mirror of
https://github.com/whyour/qinglong.git
synced 2026-06-30 20:35:09 +08:00
修改表唯一约束
This commit is contained in:
+10
-1
@@ -11,9 +11,18 @@ import { sequelize } from '../data';
|
||||
|
||||
export default async () => {
|
||||
try {
|
||||
await sequelize.sync({ alter: true });
|
||||
await sequelize.sync();
|
||||
await new Promise((resolve) => setTimeout(() => resolve(null), 5000));
|
||||
|
||||
// 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) {
|
||||
|
||||
// }
|
||||
|
||||
const crondbExist = await fileExist(config.cronDbFile);
|
||||
const dependenceDbExist = await fileExist(config.dependenceDbFile);
|
||||
const envDbExist = await fileExist(config.envDbFile);
|
||||
|
||||
Reference in New Issue
Block a user