Skip to content

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

Code of conduct

Contributing

Security policy

Stars

1 star

Watchers

2 watching

Forks

Releases

Packages

Used by

Contributors

Languages