@astrocoders/migrathor

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

Usage no npm install needed!

<script type="module">
  import astrocodersMigrathor from 'https://cdn.skypack.dev/@astrocoders/migrathor';
</script>

README

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