node_modules ignore

This commit is contained in:
2025-05-08 23:43:47 +02:00
parent e19d52f172
commit 4574544c9f
65041 changed files with 10593536 additions and 0 deletions

17
server/node_modules/umzug/lib/storage/contract.d.ts generated vendored Normal file
View File

@@ -0,0 +1,17 @@
import type { MigrationParams } from '../types';
export type UmzugStorage<Ctx = unknown> = {
/**
* Logs migration to be considered as executed.
*/
logMigration: (params: MigrationParams<Ctx>) => Promise<void>;
/**
* Unlogs migration (makes it to be considered as pending).
*/
unlogMigration: (params: MigrationParams<Ctx>) => Promise<void>;
/**
* Gets list of executed migrations.
*/
executed: (meta: Pick<MigrationParams<Ctx>, 'context'>) => Promise<string[]>;
};
export declare function isUmzugStorage(arg: Partial<UmzugStorage>): arg is UmzugStorage;
export declare const verifyUmzugStorage: (arg: Partial<UmzugStorage>) => UmzugStorage;

18
server/node_modules/umzug/lib/storage/contract.js generated vendored Normal file
View File

@@ -0,0 +1,18 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.verifyUmzugStorage = exports.isUmzugStorage = void 0;
function isUmzugStorage(arg) {
return (arg &&
typeof arg.logMigration === 'function' &&
typeof arg.unlogMigration === 'function' &&
typeof arg.executed === 'function');
}
exports.isUmzugStorage = isUmzugStorage;
const verifyUmzugStorage = (arg) => {
if (!isUmzugStorage(arg)) {
throw new Error(`Invalid umzug storage`);
}
return arg;
};
exports.verifyUmzugStorage = verifyUmzugStorage;
//# sourceMappingURL=contract.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"contract.js","sourceRoot":"","sources":["../../src/storage/contract.ts"],"names":[],"mappings":";;;AAmBA,SAAgB,cAAc,CAAC,GAA0B;IACvD,OAAO,CACL,GAAG;QACH,OAAO,GAAG,CAAC,YAAY,KAAK,UAAU;QACtC,OAAO,GAAG,CAAC,cAAc,KAAK,UAAU;QACxC,OAAO,GAAG,CAAC,QAAQ,KAAK,UAAU,CACnC,CAAA;AACH,CAAC;AAPD,wCAOC;AAEM,MAAM,kBAAkB,GAAG,CAAC,GAA0B,EAAgB,EAAE;IAC7E,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,EAAE;QACxB,MAAM,IAAI,KAAK,CAAC,uBAAuB,CAAC,CAAA;KACzC;IAED,OAAO,GAAG,CAAA;AACZ,CAAC,CAAA;AANY,QAAA,kBAAkB,sBAM9B"}

5
server/node_modules/umzug/lib/storage/index.d.ts generated vendored Normal file
View File

@@ -0,0 +1,5 @@
export * from './contract';
export * from './json';
export * from './memory';
export * from './mongodb';
export * from './sequelize';

24
server/node_modules/umzug/lib/storage/index.js generated vendored Normal file
View File

@@ -0,0 +1,24 @@
"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __exportStar = (this && this.__exportStar) || function(m, exports) {
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
};
Object.defineProperty(exports, "__esModule", { value: true });
// codegen:start {preset: barrel}
__exportStar(require("./contract"), exports);
__exportStar(require("./json"), exports);
__exportStar(require("./memory"), exports);
__exportStar(require("./mongodb"), exports);
__exportStar(require("./sequelize"), exports);
// codegen:end
//# sourceMappingURL=index.js.map

1
server/node_modules/umzug/lib/storage/index.js.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/storage/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,iCAAiC;AACjC,6CAA0B;AAC1B,yCAAsB;AACtB,2CAAwB;AACxB,4CAAyB;AACzB,8CAA2B;AAC3B,cAAc"}

20
server/node_modules/umzug/lib/storage/json.d.ts generated vendored Normal file
View File

@@ -0,0 +1,20 @@
import type { UmzugStorage } from './contract';
export type JSONStorageConstructorOptions = {
/**
Path to JSON file where the log is stored.
@default './umzug.json'
*/
readonly path?: string;
};
export declare class JSONStorage implements UmzugStorage {
readonly path: string;
constructor(options?: JSONStorageConstructorOptions);
logMigration({ name: migrationName }: {
name: string;
}): Promise<void>;
unlogMigration({ name: migrationName }: {
name: string;
}): Promise<void>;
executed(): Promise<string[]>;
}

61
server/node_modules/umzug/lib/storage/json.js generated vendored Normal file
View File

@@ -0,0 +1,61 @@
"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
__setModuleDefault(result, mod);
return result;
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.JSONStorage = void 0;
const fs_1 = require("fs");
const path = __importStar(require("path"));
const filesystem = {
/** reads a file as a string or returns null if file doesn't exist */
async readAsync(filepath) {
return fs_1.promises.readFile(filepath).then(c => c.toString(), () => null);
},
/** writes a string as file contents, creating its parent directory if necessary */
async writeAsync(filepath, content) {
await fs_1.promises.mkdir(path.dirname(filepath), { recursive: true });
await fs_1.promises.writeFile(filepath, content);
},
};
class JSONStorage {
constructor(options) {
var _a;
this.path = (_a = options === null || options === void 0 ? void 0 : options.path) !== null && _a !== void 0 ? _a : path.join(process.cwd(), 'umzug.json');
}
async logMigration({ name: migrationName }) {
const loggedMigrations = await this.executed();
loggedMigrations.push(migrationName);
await filesystem.writeAsync(this.path, JSON.stringify(loggedMigrations, null, 2));
}
async unlogMigration({ name: migrationName }) {
const loggedMigrations = await this.executed();
const updatedMigrations = loggedMigrations.filter(name => name !== migrationName);
await filesystem.writeAsync(this.path, JSON.stringify(updatedMigrations, null, 2));
}
async executed() {
const content = await filesystem.readAsync(this.path);
return content ? JSON.parse(content) : [];
}
}
exports.JSONStorage = JSONStorage;
//# sourceMappingURL=json.js.map

1
server/node_modules/umzug/lib/storage/json.js.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"json.js","sourceRoot":"","sources":["../../src/storage/json.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,2BAAiC;AACjC,2CAA4B;AAG5B,MAAM,UAAU,GAAG;IACjB,qEAAqE;IACrE,KAAK,CAAC,SAAS,CAAC,QAAgB;QAC9B,OAAO,aAAE,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC,IAAI,CAC/B,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,QAAQ,EAAE,EACjB,GAAG,EAAE,CAAC,IAAI,CACX,CAAA;IACH,CAAC;IACD,mFAAmF;IACnF,KAAK,CAAC,UAAU,CAAC,QAAgB,EAAE,OAAe;QAChD,MAAM,aAAE,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,EAAC,SAAS,EAAE,IAAI,EAAC,CAAC,CAAA;QACzD,MAAM,aAAE,CAAC,SAAS,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAA;IACvC,CAAC;CACF,CAAA;AAWD,MAAa,WAAW;IAGtB,YAAY,OAAuC;;QACjD,IAAI,CAAC,IAAI,GAAG,MAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,IAAI,mCAAI,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,YAAY,CAAC,CAAA;IACrE,CAAC;IAED,KAAK,CAAC,YAAY,CAAC,EAAC,IAAI,EAAE,aAAa,EAAiB;QACtD,MAAM,gBAAgB,GAAG,MAAM,IAAI,CAAC,QAAQ,EAAE,CAAA;QAC9C,gBAAgB,CAAC,IAAI,CAAC,aAAa,CAAC,CAAA;QAEpC,MAAM,UAAU,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,gBAAgB,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAA;IACnF,CAAC;IAED,KAAK,CAAC,cAAc,CAAC,EAAC,IAAI,EAAE,aAAa,EAAiB;QACxD,MAAM,gBAAgB,GAAG,MAAM,IAAI,CAAC,QAAQ,EAAE,CAAA;QAC9C,MAAM,iBAAiB,GAAG,gBAAgB,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,KAAK,aAAa,CAAC,CAAA;QAEjF,MAAM,UAAU,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,iBAAiB,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAA;IACpF,CAAC;IAED,KAAK,CAAC,QAAQ;QACZ,MAAM,OAAO,GAAG,MAAM,UAAU,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;QACrD,OAAO,OAAO,CAAC,CAAC,CAAE,IAAI,CAAC,KAAK,CAAC,OAAO,CAAc,CAAC,CAAC,CAAC,EAAE,CAAA;IACzD,CAAC;CACF;AAzBD,kCAyBC"}

2
server/node_modules/umzug/lib/storage/memory.d.ts generated vendored Normal file
View File

@@ -0,0 +1,2 @@
import type { UmzugStorage } from './contract';
export declare const memoryStorage: () => UmzugStorage;

17
server/node_modules/umzug/lib/storage/memory.js generated vendored Normal file
View File

@@ -0,0 +1,17 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.memoryStorage = void 0;
const memoryStorage = () => {
let executed = [];
return {
async logMigration({ name }) {
executed.push(name);
},
async unlogMigration({ name }) {
executed = executed.filter(n => n !== name);
},
executed: async () => [...executed],
};
};
exports.memoryStorage = memoryStorage;
//# sourceMappingURL=memory.js.map

1
server/node_modules/umzug/lib/storage/memory.js.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"memory.js","sourceRoot":"","sources":["../../src/storage/memory.ts"],"names":[],"mappings":";;;AAEO,MAAM,aAAa,GAAG,GAAiB,EAAE;IAC9C,IAAI,QAAQ,GAAa,EAAE,CAAA;IAC3B,OAAO;QACL,KAAK,CAAC,YAAY,CAAC,EAAC,IAAI,EAAC;YACvB,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;QACrB,CAAC;QACD,KAAK,CAAC,cAAc,CAAC,EAAC,IAAI,EAAC;YACzB,QAAQ,GAAG,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,KAAK,IAAI,CAAC,CAAA;QAC7C,CAAC;QACD,QAAQ,EAAE,KAAK,IAAI,EAAE,CAAC,CAAC,GAAG,QAAQ,CAAC;KACpC,CAAA;AACH,CAAC,CAAA;AAXY,QAAA,aAAa,iBAWzB"}

35
server/node_modules/umzug/lib/storage/mongodb.d.ts generated vendored Normal file
View File

@@ -0,0 +1,35 @@
import type { UmzugStorage } from './contract';
type AnyObject = Record<string, any>;
export type MongoDBConnectionOptions = {
/**
A connection to target database established with MongoDB Driver
*/
readonly connection: AnyObject;
/**
The name of the migration collection in MongoDB
@default 'migrations'
*/
readonly collectionName?: string;
};
export type MongoDBCollectionOptions = {
/**
A reference to a MongoDB Driver collection
*/
readonly collection: AnyObject;
};
export type MongoDBStorageConstructorOptions = MongoDBConnectionOptions | MongoDBCollectionOptions;
export declare class MongoDBStorage implements UmzugStorage {
readonly collection: AnyObject;
readonly connection: any;
readonly collectionName: string;
constructor(options: MongoDBStorageConstructorOptions);
logMigration({ name: migrationName }: {
name: string;
}): Promise<void>;
unlogMigration({ name: migrationName }: {
name: string;
}): Promise<void>;
executed(): Promise<string[]>;
}
export {};

31
server/node_modules/umzug/lib/storage/mongodb.js generated vendored Normal file
View File

@@ -0,0 +1,31 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.MongoDBStorage = void 0;
function isMongoDBCollectionOptions(arg) {
return Boolean(arg.collection);
}
class MongoDBStorage {
constructor(options) {
var _a, _b;
if (!options || (!options.collection && !options.connection)) {
throw new Error('MongoDB Connection or Collection required');
}
this.collection = isMongoDBCollectionOptions(options)
? options.collection
: options.connection.collection((_a = options.collectionName) !== null && _a !== void 0 ? _a : 'migrations');
this.connection = options.connection; // TODO remove this
this.collectionName = (_b = options.collectionName) !== null && _b !== void 0 ? _b : 'migrations'; // TODO remove this
}
async logMigration({ name: migrationName }) {
await this.collection.insertOne({ migrationName });
}
async unlogMigration({ name: migrationName }) {
await this.collection.deleteOne({ migrationName });
}
async executed() {
const records = await this.collection.find({}).sort({ migrationName: 1 }).toArray();
return records.map(r => r.migrationName);
}
}
exports.MongoDBStorage = MongoDBStorage;
//# sourceMappingURL=mongodb.js.map

1
server/node_modules/umzug/lib/storage/mongodb.js.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"mongodb.js","sourceRoot":"","sources":["../../src/storage/mongodb.ts"],"names":[],"mappings":";;;AA6BA,SAAS,0BAA0B,CAAC,GAAQ;IAC1C,OAAO,OAAO,CAAC,GAAG,CAAC,UAAU,CAAC,CAAA;AAChC,CAAC;AAED,MAAa,cAAc;IAKzB,YAAY,OAAyC;;QACnD,IAAI,CAAC,OAAO,IAAI,CAAC,CAAE,OAAe,CAAC,UAAU,IAAI,CAAE,OAAe,CAAC,UAAU,CAAC,EAAE;YAC9E,MAAM,IAAI,KAAK,CAAC,2CAA2C,CAAC,CAAA;SAC7D;QAED,IAAI,CAAC,UAAU,GAAG,0BAA0B,CAAC,OAAO,CAAC;YACnD,CAAC,CAAC,OAAO,CAAC,UAAU;YACpB,CAAC,CAAC,OAAO,CAAC,UAAU,CAAC,UAAU,CAAC,MAAA,OAAO,CAAC,cAAc,mCAAI,YAAY,CAAC,CAAA;QAEzE,IAAI,CAAC,UAAU,GAAI,OAAe,CAAC,UAAU,CAAA,CAAC,mBAAmB;QACjE,IAAI,CAAC,cAAc,GAAG,MAAC,OAAe,CAAC,cAAc,mCAAI,YAAY,CAAA,CAAC,mBAAmB;IAC3F,CAAC;IAED,KAAK,CAAC,YAAY,CAAC,EAAC,IAAI,EAAE,aAAa,EAAiB;QACtD,MAAM,IAAI,CAAC,UAAU,CAAC,SAAS,CAAC,EAAC,aAAa,EAAC,CAAC,CAAA;IAClD,CAAC;IAED,KAAK,CAAC,cAAc,CAAC,EAAC,IAAI,EAAE,aAAa,EAAiB;QACxD,MAAM,IAAI,CAAC,UAAU,CAAC,SAAS,CAAC,EAAC,aAAa,EAAC,CAAC,CAAA;IAClD,CAAC;IAED,KAAK,CAAC,QAAQ;QAEZ,MAAM,OAAO,GAAa,MAAM,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,EAAC,aAAa,EAAE,CAAC,EAAC,CAAC,CAAC,OAAO,EAAE,CAAA;QAC3F,OAAO,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,aAAa,CAAC,CAAA;IAC1C,CAAC;CACF;AA/BD,wCA+BC"}

106
server/node_modules/umzug/lib/storage/sequelize.d.ts generated vendored Normal file
View File

@@ -0,0 +1,106 @@
import type { SetRequired } from 'type-fest';
import type { UmzugStorage } from './contract';
type ModelTempInterface = {} & ModelClass & Record<string, any>;
/**
* Minimal structure of a sequelize model, defined here to avoid a hard dependency.
* The type expected is `import { Model } from 'sequelize'`
*/
export type ModelClass = {
tableName: string;
sequelize?: SequelizeType;
getTableName(): string;
sync(): Promise<void>;
findAll(options?: {}): Promise<any[]>;
create(options: {}): Promise<void>;
destroy(options: {}): Promise<void>;
};
/**
* Minimal structure of a sequelize model, defined here to avoid a hard dependency.
* The type expected is `import { Sequelize } from 'sequelize'`
*/
export type SequelizeType = {
getQueryInterface(): any;
isDefined(modelName: string): boolean;
model(modelName: string): any;
define(modelName: string, columns: {}, options: {}): {};
dialect?: {
name?: string;
};
};
type ModelClassType = ModelClass & (new (values?: object, options?: any) => ModelTempInterface);
type _SequelizeStorageConstructorOptions = {
/**
The configured instance of Sequelize. If omitted, it is inferred from the `model` option.
*/
readonly sequelize?: SequelizeType;
/**
The model representing the SequelizeMeta table. Must have a column that matches the `columnName` option. If omitted, it is created automatically.
*/
readonly model?: any;
/**
The name of the model.
@default 'SequelizeMeta'
*/
readonly modelName?: string;
/**
The name of the table. If omitted, defaults to the model name.
*/
readonly tableName?: string;
/**
Name of the schema under which the table is to be created.
@default undefined
*/
readonly schema?: any;
/**
Name of the table column holding the executed migration names.
@default 'name'
*/
readonly columnName?: string;
/**
The type of the column holding the executed migration names.
For `utf8mb4` charsets under InnoDB, you may need to set this to less than 190
@default Sequelize.DataTypes.STRING
*/
readonly columnType?: any;
/**
Option to add timestamps to the table
@default false
*/
readonly timestamps?: boolean;
};
export type SequelizeStorageConstructorOptions = SetRequired<_SequelizeStorageConstructorOptions, 'sequelize'> | SetRequired<_SequelizeStorageConstructorOptions, 'model'>;
export declare class SequelizeStorage implements UmzugStorage {
readonly sequelize: SequelizeType;
readonly columnType: string;
readonly columnName: string;
readonly timestamps: boolean;
readonly modelName: string;
readonly tableName?: string;
readonly schema: any;
readonly model: ModelClassType;
/**
Constructs Sequelize based storage. Migrations will be stored in a SequelizeMeta table using the given instance of Sequelize.
If a model is given, it will be used directly as the model for the SequelizeMeta table. Otherwise, it will be created automatically according to the given options.
If the table does not exist it will be created automatically upon the logging of the first migration.
*/
constructor(options: SequelizeStorageConstructorOptions);
getModel(): ModelClassType;
protected syncModel(): Promise<void>;
logMigration({ name: migrationName }: {
name: string;
}): Promise<void>;
unlogMigration({ name: migrationName }: {
name: string;
}): Promise<void>;
executed(): Promise<string[]>;
_model(): ModelClassType;
}
export {};

85
server/node_modules/umzug/lib/storage/sequelize.js generated vendored Normal file
View File

@@ -0,0 +1,85 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.SequelizeStorage = void 0;
const DIALECTS_WITH_CHARSET_AND_COLLATE = new Set(['mysql', 'mariadb']);
class SequelizeStorage {
/**
Constructs Sequelize based storage. Migrations will be stored in a SequelizeMeta table using the given instance of Sequelize.
If a model is given, it will be used directly as the model for the SequelizeMeta table. Otherwise, it will be created automatically according to the given options.
If the table does not exist it will be created automatically upon the logging of the first migration.
*/
constructor(options) {
var _a, _b, _c, _d, _e, _f;
if (!options || (!options.model && !options.sequelize)) {
throw new Error('One of "sequelize" or "model" storage option is required');
}
this.sequelize = (_a = options.sequelize) !== null && _a !== void 0 ? _a : options.model.sequelize;
this.columnType = (_b = options.columnType) !== null && _b !== void 0 ? _b : this.sequelize.constructor.DataTypes.STRING;
this.columnName = (_c = options.columnName) !== null && _c !== void 0 ? _c : 'name';
this.timestamps = (_d = options.timestamps) !== null && _d !== void 0 ? _d : false;
this.modelName = (_e = options.modelName) !== null && _e !== void 0 ? _e : 'SequelizeMeta';
this.tableName = options.tableName;
this.schema = options.schema;
this.model = (_f = options.model) !== null && _f !== void 0 ? _f : this.getModel();
}
getModel() {
var _a;
if (this.sequelize.isDefined(this.modelName)) {
// eslint-disable-next-line @typescript-eslint/no-unsafe-return
return this.sequelize.model(this.modelName);
}
const dialectName = (_a = this.sequelize.dialect) === null || _a === void 0 ? void 0 : _a.name;
const hasCharsetAndCollate = dialectName && DIALECTS_WITH_CHARSET_AND_COLLATE.has(dialectName);
return this.sequelize.define(this.modelName, {
[this.columnName]: {
type: this.columnType,
allowNull: false,
unique: true,
primaryKey: true,
autoIncrement: false,
},
}, {
tableName: this.tableName,
schema: this.schema,
timestamps: this.timestamps,
charset: hasCharsetAndCollate ? 'utf8' : undefined,
collate: hasCharsetAndCollate ? 'utf8_unicode_ci' : undefined,
});
}
async syncModel() {
await this.model.sync();
}
async logMigration({ name: migrationName }) {
await this.syncModel();
await this.model.create({
[this.columnName]: migrationName,
});
}
async unlogMigration({ name: migrationName }) {
await this.syncModel();
await this.model.destroy({
where: {
[this.columnName]: migrationName,
},
});
}
async executed() {
await this.syncModel();
const migrations = await this.model.findAll({ order: [[this.columnName, 'ASC']] });
return migrations.map(migration => {
const name = migration[this.columnName];
if (typeof name !== 'string') {
throw new TypeError(`Unexpected migration name type: expected string, got ${typeof name}`);
}
return name;
});
}
// TODO remove this
_model() {
return this.model;
}
}
exports.SequelizeStorage = SequelizeStorage;
//# sourceMappingURL=sequelize.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"sequelize.js","sourceRoot":"","sources":["../../src/storage/sequelize.ts"],"names":[],"mappings":";;;AAmCA,MAAM,iCAAiC,GAAG,IAAI,GAAG,CAAC,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC,CAAA;AA8DvE,MAAa,gBAAgB;IAU3B;;;;;;QAMC;IACD,YAAY,OAA2C;;QACrD,IAAI,CAAC,OAAO,IAAI,CAAC,CAAC,OAAO,CAAC,KAAK,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,EAAE;YACtD,MAAM,IAAI,KAAK,CAAC,0DAA0D,CAAC,CAAA;SAC5E;QAED,IAAI,CAAC,SAAS,GAAG,MAAA,OAAO,CAAC,SAAS,mCAAI,OAAO,CAAC,KAAK,CAAC,SAAS,CAAA;QAC7D,IAAI,CAAC,UAAU,GAAG,MAAA,OAAO,CAAC,UAAU,mCAAK,IAAI,CAAC,SAAS,CAAC,WAAmB,CAAC,SAAS,CAAC,MAAM,CAAA;QAC5F,IAAI,CAAC,UAAU,GAAG,MAAA,OAAO,CAAC,UAAU,mCAAI,MAAM,CAAA;QAC9C,IAAI,CAAC,UAAU,GAAG,MAAA,OAAO,CAAC,UAAU,mCAAI,KAAK,CAAA;QAC7C,IAAI,CAAC,SAAS,GAAG,MAAA,OAAO,CAAC,SAAS,mCAAI,eAAe,CAAA;QACrD,IAAI,CA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