diff --git a/backend/init/migration/migrate.go b/backend/init/migration/migrate.go index 365094f71..582c433f2 100644 --- a/backend/init/migration/migrate.go +++ b/backend/init/migration/migrate.go @@ -42,6 +42,7 @@ func Init() { migrations.AddDatabases, migrations.UpdateDatabase, migrations.UpdateAppInstallResource, + migrations.DropDatabaseLocal, }) if err := m.Migrate(); err != nil { global.LOG.Error(err) diff --git a/backend/init/migration/migrations/init.go b/backend/init/migration/migrations/init.go index 9b5fdbd62..a7fb74a2b 100644 --- a/backend/init/migration/migrations/init.go +++ b/backend/init/migration/migrations/init.go @@ -759,3 +759,11 @@ var UpdateAppInstallResource = &gormigrate.Migration{ return nil }, } + +var DropDatabaseLocal = &gormigrate.Migration{ + ID: "20230914-drop-database-local", + Migrate: func(tx *gorm.DB) error { + _ = tx.Where("name = ? AND address = ?", "local", "127.0.0.1").Delete(&model.Database{}).Error + return nil + }, +}