mirror of
https://codeberg.org/timelimit/timelimit-server.git
synced 2026-08-31 19:03:45 +02:00
Update umzug
This commit is contained in:
Generated
+506
-3689
File diff suppressed because it is too large
Load Diff
+2
-4
@@ -38,12 +38,11 @@
|
|||||||
"@types/lodash": "^4.14.166",
|
"@types/lodash": "^4.14.166",
|
||||||
"@types/node": "^16.11.59",
|
"@types/node": "^16.11.59",
|
||||||
"@types/nodemailer": "^6.4.4",
|
"@types/nodemailer": "^6.4.4",
|
||||||
"@types/umzug": "^2.3.0",
|
|
||||||
"@typescript-eslint/eslint-plugin": "^5.10.0",
|
"@typescript-eslint/eslint-plugin": "^5.10.0",
|
||||||
"@typescript-eslint/parser": "^5.10.0",
|
"@typescript-eslint/parser": "^5.10.0",
|
||||||
"eslint": "^8.7.0",
|
"eslint": "^8.7.0",
|
||||||
"rimraf": "^3.0.2",
|
"rimraf": "^3.0.2",
|
||||||
"typescript": "^4.4.4",
|
"typescript": "^5.5.4",
|
||||||
"typescript-json-schema": "^0.52.0"
|
"typescript-json-schema": "^0.52.0"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
@@ -63,8 +62,7 @@
|
|||||||
"rate-limiter-flexible": "^2.1.15",
|
"rate-limiter-flexible": "^2.1.15",
|
||||||
"sequelize": "^6.25.5",
|
"sequelize": "^6.25.5",
|
||||||
"socket.io": "^4.0.1",
|
"socket.io": "^4.0.1",
|
||||||
"sqlite3": "^4.0.0",
|
"umzug": "^3.8.1"
|
||||||
"umzug": "^2.3.0"
|
|
||||||
},
|
},
|
||||||
"optionalDependencies": {
|
"optionalDependencies": {
|
||||||
"sqlite3": "^5.0.0"
|
"sqlite3": "^5.0.0"
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* server component for the TimeLimit App
|
* server component for the TimeLimit App
|
||||||
* Copyright (C) 2019 Jonas Lochmann
|
* Copyright (C) 2019 - 2024 Jonas Lochmann
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU Affero General Public License as
|
* it under the terms of the GNU Affero General Public License as
|
||||||
@@ -17,18 +17,23 @@
|
|||||||
|
|
||||||
import { resolve } from 'path'
|
import { resolve } from 'path'
|
||||||
import { Sequelize } from 'sequelize'
|
import { Sequelize } from 'sequelize'
|
||||||
import * as Umzug from 'umzug'
|
import { Umzug, SequelizeStorage } from 'umzug'
|
||||||
|
|
||||||
export const createUmzug = (sequelize: Sequelize) => (
|
export const createUmzug = (sequelize: Sequelize) => (
|
||||||
new Umzug({
|
new Umzug({
|
||||||
storage: 'sequelize',
|
storage: new SequelizeStorage({ sequelize }),
|
||||||
storageOptions: {
|
|
||||||
sequelize
|
|
||||||
},
|
|
||||||
migrations: {
|
migrations: {
|
||||||
params: [sequelize.getQueryInterface(), sequelize],
|
glob: resolve(__dirname, '../../../build/database/migration/migrations/*.js'),
|
||||||
path: resolve(__dirname, '../../../build/database/migration/migrations'),
|
resolve: ({ name, path }) => {
|
||||||
pattern: /^\d+[\w-]+\.js$/
|
const migration = require(path!!)
|
||||||
}
|
|
||||||
|
return {
|
||||||
|
name,
|
||||||
|
up: async () => migration.up(sequelize.getQueryInterface(), sequelize),
|
||||||
|
down: async () => migration.down(sequelize.getQueryInterface(), sequelize),
|
||||||
|
}
|
||||||
|
},
|
||||||
|
},
|
||||||
|
logger: console
|
||||||
})
|
})
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user