A postgres driver for marv
migrations/
|- 001.create-table.sql
|- 002.create-another-table.sql
const marv = require('marv')
const pgDriver = require('marv-pg-driver')
const directory = path.join(process.cwd(), 'migrations' )
const driver = pgDriver({
table: 'db_migrations', // defaults to 'migrations'
connection: { // the connection sub document is passed directly to pg.Client
host: 'localhost',
port: 5432,
database: 'postgres',
user: 'postgres',
password: ''
}
})
marv.scan(directory, (err, migrations) => {
if (err) throw err
marv.migrate(migrations, driver, (err) => {
if (err) throw err
})
})
npm install # or yarn
npm run docker
npm test