From 3c3fce0a5acd7fe3503c906f4151e70031e8d85d Mon Sep 17 00:00:00 2001 From: whyour Date: Tue, 15 Nov 2022 11:32:42 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=88=9D=E5=A7=8B=E5=8C=96?= =?UTF-8?q?=E8=A1=A8=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- back/loaders/db.ts | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/back/loaders/db.ts b/back/loaders/db.ts index ced837c2..1fb7b3e7 100644 --- a/back/loaders/db.ts +++ b/back/loaders/db.ts @@ -10,6 +10,7 @@ import { fileExist } from '../config/util'; import { SubscriptionModel } from '../data/subscription'; import { CrontabViewModel } from '../data/cronView'; import config from '../config'; +import { sequelize } from '../data' export default async () => { try { @@ -18,15 +19,13 @@ export default async () => { await AppModel.sync(); await AuthModel.sync(); await EnvModel.sync(); - await SubscriptionModel.sync({ alter: true }); - await CrontabViewModel.sync({ alter: true }); + await SubscriptionModel.sync(); + await CrontabViewModel.sync(); - // try { - // const queryInterface = sequelize.getQueryInterface(); - // await queryInterface.addIndex('Crontabs', ['command'], { unique: true }); - // await queryInterface.addIndex('Envs', ['name', 'value'], { unique: true }); - // await queryInterface.addIndex('Apps', ['name'], { unique: true }); - // } catch (error) { } + try { + await sequelize.query('alter table Subscriptions add column proxy VARCHAR(255)') + await sequelize.query('alter table CrontabViews add column filterRelation VARCHAR(255)') + } catch (error) {} // 2.10-2.11 升级 const cronDbFile = path.join(config.rootPath, 'db/crontab.db');