fix: skip if exists

This commit is contained in:
chenos 2023-07-29 12:30:40 +08:00
parent 021ca950ab
commit 767b81c65d
2 changed files with 6 additions and 0 deletions

View File

@ -5,6 +5,9 @@ export default class extends Migration {
async up() { async up() {
const systemSettings = this.db.getRepository('systemSettings'); const systemSettings = this.db.getRepository('systemSettings');
let instance: Model = await systemSettings.findOne(); let instance: Model = await systemSettings.findOne();
if (instance?.options?.adminSchemaUid) {
return;
}
const uiRoutes = this.db.getRepository('uiRoutes'); const uiRoutes = this.db.getRepository('uiRoutes');
const routes = await uiRoutes.find(); const routes = await uiRoutes.find();
for (const route of routes) { for (const route of routes) {

View File

@ -5,6 +5,9 @@ export default class extends Migration {
async up() { async up() {
const systemSettings = this.db.getRepository('systemSettings'); const systemSettings = this.db.getRepository('systemSettings');
let instance: Model = await systemSettings.findOne(); let instance: Model = await systemSettings.findOne();
if (instance?.options?.mobileSchemaUid) {
return;
}
const uiRoutes = this.db.getRepository('uiRoutes'); const uiRoutes = this.db.getRepository('uiRoutes');
const routes = await uiRoutes.find(); const routes = await uiRoutes.find();
for (const route of routes) { for (const route of routes) {