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

View File

@@ -0,0 +1,39 @@
'use strict';
const createStorage = (opts)=>{
const { db, tableName } = opts;
const hasMigrationTable = ()=>db.getSchemaConnection().hasTable(tableName);
const createMigrationTable = ()=>{
return db.getSchemaConnection().createTable(tableName, (table)=>{
table.increments('id');
table.string('name');
table.datetime('time', {
useTz: false
});
});
};
return {
async logMigration ({ name }) {
await db.getConnection().insert({
name,
time: new Date()
}).into(tableName);
},
async unlogMigration ({ name }) {
await db.getConnection(tableName).del().where({
name
});
},
async executed () {
if (!await hasMigrationTable()) {
await createMigrationTable();
return [];
}
const logs = await db.getConnection(tableName).select().from(tableName).orderBy('time');
return logs.map((log)=>log.name);
}
};
};
exports.createStorage = createStorage;
//# sourceMappingURL=storage.js.map