1.0.6 • Published 4 years ago

@ventinc/migrator v1.0.6

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

@ventinc/migrator

A simple postgresql migrator that work with raw query

Intallation

NPM: npm i -S @ventinc/migrator

YARN: yarn add -D @ventinc/migrator

Configuration

Configuration is mandatory to make CLI and migrator work. This library use node postgres so connection just need to be a pool configuration: you can see it here

By default the name of configuration file is: migrations.config.js. Create this file next to your project package.json

module.exports = {
  connection: {
    user: "root",
    host: "localhost",
    database: "databasename",
    password: "password",
    port: 5432,
  },
  types: [
    {
      name: "migrations",
      folder: __dirname + "/migrations",
    },
  ],
};

You can create multiple types to make differents migrations like seeds to populate your database.

How work CLI

Add this in package.json

{
  ...
  "scripts": {
    "migrator": "migrator"
  }
  ...
}

and run yarn migrator or npm run migrator in your terminal

1.0.6

4 years ago

1.0.5

4 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago