1.0.6 • Published 10 months ago

@holykuche/db-migrations-executor v1.0.6

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

Installation

via npm

npm install @holykuche/db-migrations-executor

via yarn

yarn add @holykuche/db-migrations-executor

Usage

import { DatabaseClient, MigrationsExecutorImpl } from '@holykuche/db-migrations-executor';

// Implement DatabaseClient. You can use any database management system in theory.
// But the API implies relational databases usage.
const dbClient: DatabaseClient = {
  // your implementation
};

// Keep your migration scripts in a distributive directory fresh.
// For example, you might copy migration scripts into a distributive
// directory each time while building process.
// Set this constant to relative path to migrations.
const MIGRATION_SCRIPTS_DIR = 'migration-scripts';

new MigrationsExecutorImpl(dbClient)
    .execute('migrations', resolve(__dirname, MIGRATION_SCRIPTS_DIR))
    .then(() => console.log('Migrations completed successfully'))
    .catch(error => console.error(error));

Also, you can find a usage example here (see poker and telegram modules).

1.0.6

10 months ago

1.0.5

10 months ago

1.0.4

11 months ago

1.0.3

11 months ago

1.0.2

11 months ago

1.0.1

11 months ago

1.0.0

11 months ago