You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
piq9117 2316affdbe removed functional dependencies (#38) 1 year ago
app firsties 2 years ago
nix Drop hasql-migration (#37) 1 year ago
src removed functional dependencies (#38) 1 year ago
test removed functional dependencies (#38) 1 year ago
.gitignore Drop hasql-migration (#37) 1 year ago
.stylish-haskell.yaml Drop hasql-migration (#37) 1 year ago
CHANGELOG.md firsties 2 years ago
LICENSE license and readme 2 years ago
Makefile Drop hasql-migration (#37) 1 year ago
README.md readme (#20) 2 years ago
Setup.hs firsties 2 years ago
default.nix Drop hasql-migration (#37) 1 year ago
package.yaml Drop hasql-migration (#37) 1 year ago
release.nix hasql-migration override removed (#30) 2 years ago
shell.nix Drop hasql-migration (#37) 1 year ago

README.md

migratum

Generic badge

Migratum is a PostgreSQL migration utility.

Migratum: PostgreSQL Migration Tool

Usage: migratum COMMAND
  Migratum is a database tool that manages migrations

Available options:
  -h,--help                Show this help text

Available commands:
  new                      Generate necessary files for migration
  init                     Initialize database for migration
  migrate                  Perform Migration

Initial Setup

Database Connection

$ migratum new

This comment will generate the migrations directory which will contain

migrations
|-migratum.yaml
|-sql

migratum.yaml will contain the field below, which you can fill in with your database information.

config:
  postgres_password:
  postgres_db:
  postgres_user:
  postgres_host:
  postgres_port:

Once these fields have been filled in, perform this command

$ migratum init

This will create a table called schema_migrations. This table will store the information about the migrations that have been executed in the database

Migration

Write your migration file in the sql directory with this convention.

V<version number>__<name of migration>.sql

For example:

V1__uuid_extension.sql

After you are done writing your migration script, perform this command

$ migratum migrate

You should see this response in your terminal

[Info]: MigrationPerformed V1__uuid_extension.sql