mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-19 17:38:19 +08:00
bump version
This commit is contained in:
12 files changed
+94
-24
No files matched your search
@@ -14,16 +14,19 @@ declare module '../context' {
|
||||
|
||||
export default class MigrationService extends Service {
|
||||
private channels: Record<string, MigrationScript[]> = {};
|
||||
private called = false;
|
||||
|
||||
constructor(ctx: Context) {
|
||||
super(ctx, 'migration', true);
|
||||
}
|
||||
|
||||
async registerChannel(name: string, s: MigrationScript[]) {
|
||||
if (this.called) logger.warn('MigrationService.registerChannel: called after doUpgrade');
|
||||
this.channels[name] = s;
|
||||
}
|
||||
|
||||
async doUpgrade() {
|
||||
this.called = true;
|
||||
for (const channel in this.channels) {
|
||||
const name = `db.ver${channel === 'hydrooj' ? '' : `-${channel}`}`;
|
||||
let dbVer = system.get(name) ?? 0;
|
||||
|
||||
Reference in new issue
Block a user