0.1.7 • Published 11 months ago

@shotero/dbmigrator v0.1.7

Weekly downloads
-
License
MIT
Repository
github
Last release
11 months ago

DB Migrator

Migrate PostgreSQL database using vanilla SQL files

Prerequisite:

  • PostgreSQL
  • Database

Install

npm install -g @shotero/dbmigrator

Usage

dbmigrator up -t [target]

dbmigrator down -t <target>

dbmigrator make <name>

Configuration

Sample configuration file:

.dbmigratorrc.js OR .dbmigratorrc.cjs

const config = {
  "creator": "testuser",
  "db": {
    "user": process.env.DB_USER,
    "host": process.env.DB_HOST,
    "port": 5432,
    "database": "db",
    "password": process.env.DB_PASSWORD
  },
  "paths": {
    "up": "./db/migrations/up",
    "down": "./db/migrations/down"
  },
  "migration": {
    "schema": "migration",
    "table": "migrations"
  }
}

module.exports = config;

Example

  • dbmigrator make hello
  • dbmigrator make world
  • dbmigrator up
  • dbmigrator down <timestamp>_world
0.1.7

11 months ago

0.1.6

2 years ago

0.1.5

2 years ago

0.1.4

2 years ago

0.1.3

2 years ago

0.1.2

2 years ago

0.1.1

2 years ago

0.1.0

2 years ago