1.0.0 • Published 6 years ago

@astrocoders/migrathor v1.0.0

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

Usage

Create a migrathorconfig.js file in the root directory of your project. For example:

require('dotenv').config()

module.exports = {
  host: process.env.PG_HOST,
  port: Number(process.env.PG_PORT),
  user: process.env.PG_USER,
  database: process.env.PG_DATABASE,
  password: process.env.PG_PASSWORD,
  databaseConfigFolder: 'pgSql',
}

So you can use yarn migrathor <cmd>

Commands

migration - create a new migration file in ${databaseConfigFolder}/migrations

migrate - run the latest migration

rollback - undoes the last migration