feat: add SQL migration system using sqlx::migrate!()
Replace manual schema.sql application with sqlx's built-in migration system. Migrations are embedded at compile time and tracked in the _sqlx_migrations table. Pending migrations run automatically on startup. - Move db/schema.sql → migrations/20260307000000_initial_schema.sql - Remove apply_schema() and split_sql_statements() from db.rs - Add run_migrations() using sqlx::migrate!() macro - Remove docker-compose schema.sql mount (app handles it now) - Enable sqlx "migrate" feature in Cargo.toml Future schema changes: add a new timestamped .sql in migrations/. Closes #190 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -12,7 +12,6 @@ services:
|
||||
- oxicloud
|
||||
volumes:
|
||||
- pg_data:/var/lib/postgresql/data
|
||||
- ./db/schema.sql:/docker-entrypoint-initdb.d/10-schema.sql
|
||||
healthcheck:
|
||||
test: ["CMD-SHELL", "pg_isready -U postgres"]
|
||||
interval: 5s
|
||||
|
||||
Reference in New Issue
Block a user