abstract-migrator-mysql

1.0.3 • Public • Published

abstract-migrator-pg

This is a PostgreSQL adapter for migrations run with abstract-migrator

Installation

$ yarn global add abstract-migrator
$ yarn add abstract-migrator-pg
$ mkdir -p migrations/pg

Configuration

In migrations/, migrations/pg or the parent folder of migrations in your project, according to your preference, add conf.js and (optionally) secrets.js files that export enough information to connect to PostgreSQL. (The split between conf and secrets is so you can commit common settings in the former and .gitignore secrets.js for local credentials)

Ex.:

conf.js

module.exports = {
    'pg': {
	    'host': 'localhost',
		'user': 'myapp',
		'database': 'myapp'
	}
};

secrets.js

module.exports = {
	'pg': { 'password': 'foo' }
};

These parameter are passed directly to the pg Client constructor, so you can see your options here: https://node-postgres.com/features/connecting

The only parameter added by this module is prefix. By default, a table called migrations is created, but if you add 'prefix': 'foo' it'll be foo_migrations instead.

Usage

See the abstract-migrator docs for CLI usage.

Readme

Keywords

none

Package Sidebar

Install

npm i abstract-migrator-mysql

Weekly Downloads

1

Version

1.0.3

License

MIT

Unpacked Size

4.37 kB

Total Files

5

Last publish

Collaborators

  • snyder13