diff --git a/crates/moments-api/src/main.rs b/crates/moments-api/src/main.rs index 4ce2685..6f27ec8 100644 --- a/crates/moments-api/src/main.rs +++ b/crates/moments-api/src/main.rs @@ -36,8 +36,12 @@ async fn main() -> anyhow::Result<()> { init_tracing(); let args = Args::parse(); + // The api connects as moments_ro and never writes — migrations are owned + // by moments-worker, which is the database owner (moments_rw). Running + // migrations from here would fail with `permission denied for schema + // public`. The worker must have run at least once before the api accepts + // traffic; in deploy this is ordered via systemd dependencies (§3). let store = PgStore::connect(&args.database_url).await?; - store.migrate().await?; let state = AppState { store: Arc::new(store), };