neoq/backends/postgres
2024-01-28 07:13:45 -07:00
..
migrations fix: neoq_jobs.id is an integer and should be bigint 2023-10-05 10:40:08 -06:00
postgres_backend.go Fix support for sslmode too 2024-01-28 07:13:45 -07:00
postgres_backend_test.go Fix lints 2024-01-26 09:21:05 -07:00
README.md Support postgres backend schema migrations 2023-08-28 08:59:40 +02:00

Migrations

Migrations are implemented with https://github.com/golang-migrate/migrate

Install the CLI

To add new migrations, install the CLI. The version of the CLI is not particularly important.

go install -tags 'postgres' github.com/golang-migrate/migrate/v4/cmd/migrate@v4.16.2

Adding migrations

Adding new migrations is done with the migrate create command

migrate create -dir backends/postgres/migrations -ext sql <descriptive_migration_name>

Running migrations

Migrations are run every time neoq initializes the postgres backend. There is no need to run migrations explicitly.