1.0.4 • Published 18 days ago

simple-mysql-migrate v1.0.4

Weekly downloads
-
License
ISC
Repository
-
Last release
18 days ago

Simple-Mysql-Migrate

Dead simple database migration for SQL only

The principle is similar to Flyway and all similar tools, except it's VERY basic and runs in a few lines of code for NodeJS. MySQL only.

import DbMigrate from 'simple-mysql-migrate';

// These are the default settings if none are used
const migration = new DbMigrate ({
    "host": "127.0.0.1",
    "port": 3306,
    "username": "my_user",
    "password": "my_password",
    "database": "my_database_name"
});

migration.setMigrationPath("/path/to/my/migration/files/");
await migration.migrate();

It is dead simple: it will scan through the .sql files and run them in order.

A schema_version table will be created to keep track of what has already been ran.

The filenames should be called v[any version]__[any string].sql, for example: v1.2.5__new_user_table.sql

1.0.4

18 days ago

1.0.3

28 days ago

1.0.2

4 months ago

1.0.1

2 years ago

1.0.0

2 years ago