UNPKG

@jsgurucompany/jsg-nestjs-common

Version:

Initial README.md

19 lines 1 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.migratorFactory = void 0; const umzug_1 = require("umzug"); const migrator_1 = require("../migrator"); const migratorFactory = async (sequelize, options) => { var _a, _b, _c, _d; return new migrator_1.Migrator({ migrationsGlob: (_b = (_a = options === null || options === void 0 ? void 0 : options.migrator) === null || _a === void 0 ? void 0 : _a.glob) !== null && _b !== void 0 ? _b : '**/{migrations,migration}/*.migration.ts', migrationsPath: (_d = (_c = options === null || options === void 0 ? void 0 : options.migrator) === null || _c === void 0 ? void 0 : _c.path) !== null && _d !== void 0 ? _d : `${__dirname}/../../../migration/`, context: sequelize.getQueryInterface(), storage: new umzug_1.SequelizeStorage({ sequelize, }), logger: console, }); }; exports.migratorFactory = migratorFactory; //# sourceMappingURL=migrator.factory.js.map