server: run DB migrations on startup
This commit is contained in:
parent
092d5781ca
commit
e36f4f97f9
@ -0,0 +1 @@
|
|||||||
|
DROP INDEX IF EXISTS post_summary_idx;
|
||||||
@ -0,0 +1 @@
|
|||||||
|
CREATE INDEX post_summary_idx ON post USING GIN (to_tsvector('english', summary));
|
||||||
@ -215,6 +215,7 @@ async fn main() -> Result<(), Box<dyn Error>> {
|
|||||||
std::fs::create_dir_all(&config.slurp_cache_path)?;
|
std::fs::create_dir_all(&config.slurp_cache_path)?;
|
||||||
}
|
}
|
||||||
let pool = PgPool::connect(&config.newsreader_database_url).await?;
|
let pool = PgPool::connect(&config.newsreader_database_url).await?;
|
||||||
|
sqlx::migrate!("./migrations").run(&pool).await?;
|
||||||
let tantivy_conn = TantivyConnection::new(&config.newsreader_tantivy_db_path)?;
|
let tantivy_conn = TantivyConnection::new(&config.newsreader_tantivy_db_path)?;
|
||||||
|
|
||||||
let schema = Schema::build(QueryRoot, Mutation, EmptySubscription)
|
let schema = Schema::build(QueryRoot, Mutation, EmptySubscription)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user