1.3.2 • Published 4 years ago

pg-simple-migrations v1.3.2

Weekly downloads
1
License
MIT
Repository
github
Last release
4 years ago

Postgres migrations

Very simple postgresSQL migration library. Only allowed 'up' migrations, that means that is not possible to do rollback or create 'down' migration. If you need to change something about before migration you need crete new .sql file and migrate.

Install

$ npm install pg-simple-migrations

Usage

Set DATABASE_URL env variable to connect to postgres instance:

  • postgres://postgres:password@localhost:5432/postgres

The command to run the migration is: pgsm. After that command you need to specify the folder path to your migration folder: pgsm /migrations. Use in package.json as independet command or before running the app.

"scripts": {
  "start": "pgsm /migrations && node server.js",
  "migrate": "pgsm /migrations"
},

Migrations files

The .sql files inside you migration folder should be named as following:

00001-tables.sql
00002-data.sql

The migrations will aply in that order, so if you have more that one file to migrate make sure it ordered wit number prefix correctly

1.3.2

4 years ago

1.3.1

4 years ago

1.3.0

4 years ago

1.2.0

4 years ago

1.2.1

4 years ago

1.1.1

4 years ago

1.1.0

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago

0.7.1

4 years ago

0.7.0

4 years ago

0.6.1

4 years ago

0.6.0

4 years ago

0.5.0

4 years ago

0.4.2

4 years ago

0.4.1

4 years ago

0.4.0

4 years ago

0.3.7

4 years ago

0.3.6

4 years ago

0.3.5

4 years ago

0.3.4

4 years ago

0.3.3

4 years ago

0.3.2

4 years ago

0.3.1

4 years ago

0.3.0

4 years ago

0.2.0

4 years ago

0.1.0

4 years ago