Skip to content

valitydev/dominant-v2

dominant_v2

Migrations

Database migrations live in the migrations/ directory and are applied automatically on service startup by epg_migrator. Pending migrations are applied in lexicographical order, each run is guarded by a Postgres advisory lock, and applied migrations are recorded in the schema_migrations table.

To add a migration, create a new file named <unix timestamp>-<short_description>.sql containing plain SQL:

touch "migrations/$(date +%s)-add_some_table.sql"

Migrations are forward-only: to undo a change that has already been applied somewhere, add a new compensating migration instead of editing or deleting an existing one.

Databases migrated by the legacy psql-migration tool (the __migrations table) are picked up automatically: the recorded history is carried over into schema_migrations on the first startup after the switchover, so already applied migrations are not rerun.

About

No description, website, or topics provided.

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages