You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

mysql-migrate-cli

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mysql-migrate-cli - npm Package Compare versions

Comparing version

to
0.1.1

4

lib/down.js

@@ -11,5 +11,3 @@ const path = require('path');

const appliedMigrations = (await connection.query(`SELECT file FROM ${options.table};`))
.map(row => row.file)
.reverse();
const appliedMigrations = (await connection.query(`SELECT file FROM ${options.table} ORDER BY 1 DESC`)).map(row => row.file);

@@ -16,0 +14,0 @@ if (appliedMigrations.length === 0) {

{
"name": "mysql-migrate-cli",
"version": "0.1.0",
"version": "0.1.1",
"description": "Migrations tool for MYSQL db",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -50,7 +50,9 @@ # mysql-migrate-cli

module.exports = {
up: '',
down: ''
up: 'ALTER TABLE my_cool_table ADD COLUMN super_column TEXT;',
down: 'ALTER TABLE my_cool_table DROP COLUMN super_column;'
}
```
where `up` and `down` is plain SQL
where `up` and `down` is plain SQL:
- `up` section applies migration
- `down` section revert migration

@@ -57,0 +59,0 @@ ### In your `package.json`