0.7.1 • Published 10 months ago

@tomkcey/pg-migrate v0.7.1

Weekly downloads
-
License
UNLICENSED
Repository
github
Last release
10 months ago

GitHub Actions Workflow Status

How to use

Creating a migration file

For creating migration files you can use the CLI.

npx @tomkcey/pg-migrate create <migration_filename>

While database access is not required at this step, kkowing where to store those migrations is. In any case, here's all the environment variables you will need to use this program through the CLI.

PGUSER=<username>
PGPASSWORD=<password>
PGHOST=localhost
PGPORT=5432
PGDATABASE=<database>
PGSSL=<true/false>
MIGRATION_PATH=<absolute-path-to-migrations-dir>
MIGRATION_TABLE=<tablename>

Only MIGRATION_PATH is required if only using migration file creation through the CLI.

Running migrations up

import { Migrator, MigratorOptions } from "@tomkcey/pg-migrate";

const options: MigratorOptions = { ... }

const migrator = new Migrator(options, someLogger);

await migrator.up();

or npx @tomkcey/pg-migrate up

Running migrations down

import { Migrator, MigratorOptions } from "@tomkcey/pg-migrate";

const options: MigratorOptions = { ... }

const migrator = new Migrator(options, someLogger);

await migrator.down();

or npx @tomkcey/pg-migrate down


Roadmap

  • Create custom errors
0.7.1

10 months ago

0.7.0

10 months ago

0.6.0

12 months ago

0.5.3

12 months ago

0.5.2

12 months ago

0.5.1

12 months ago

0.5.0

12 months ago

0.4.2

12 months ago

0.4.1

12 months ago

0.4.0

12 months ago

0.3.0

12 months ago

0.2.0

1 year ago

0.1.0

1 year ago

0.0.4

1 year ago

0.0.3

1 year ago

0.0.2

1 year ago

0.0.1

1 year ago