mirror of
https://github.com/whyour/qinglong.git
synced 2025-12-13 07:25:05 +08:00
Fix: Add ScenarioModel sync to database loader and migration for status column
- Import and sync ScenarioModel in back/loaders/db.ts - Add migration to ensure 'status' column exists in Scenarios table - Fixes SQLITE_ERROR: table Scenarios has no column named status Co-authored-by: whyour <22700758+whyour@users.noreply.github.com>
This commit is contained in:
parent
95780bd3ad
commit
e1b903b6db
|
|
@ -6,6 +6,7 @@ import { AppModel } from '../data/open';
|
||||||
import { SystemModel } from '../data/system';
|
import { SystemModel } from '../data/system';
|
||||||
import { SubscriptionModel } from '../data/subscription';
|
import { SubscriptionModel } from '../data/subscription';
|
||||||
import { CrontabViewModel } from '../data/cronView';
|
import { CrontabViewModel } from '../data/cronView';
|
||||||
|
import { ScenarioModel } from '../data/scenario';
|
||||||
import { sequelize } from '../data';
|
import { sequelize } from '../data';
|
||||||
|
|
||||||
export default async () => {
|
export default async () => {
|
||||||
|
|
@ -17,6 +18,7 @@ export default async () => {
|
||||||
await EnvModel.sync();
|
await EnvModel.sync();
|
||||||
await SubscriptionModel.sync();
|
await SubscriptionModel.sync();
|
||||||
await CrontabViewModel.sync();
|
await CrontabViewModel.sync();
|
||||||
|
await ScenarioModel.sync();
|
||||||
|
|
||||||
// 初始化新增字段
|
// 初始化新增字段
|
||||||
const migrations = [
|
const migrations = [
|
||||||
|
|
@ -40,6 +42,7 @@ export default async () => {
|
||||||
type: 'NUMBER',
|
type: 'NUMBER',
|
||||||
},
|
},
|
||||||
{ table: 'Envs', column: 'isPinned', type: 'NUMBER' },
|
{ table: 'Envs', column: 'isPinned', type: 'NUMBER' },
|
||||||
|
{ table: 'Scenarios', column: 'status', type: 'INTEGER DEFAULT 0' },
|
||||||
];
|
];
|
||||||
|
|
||||||
for (const migration of migrations) {
|
for (const migration of migrations) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user