diff --git a/back/src/org/kar/karideo/WebLauncher.java b/back/src/org/kar/karideo/WebLauncher.java index c7f44e5..4b14431 100755 --- a/back/src/org/kar/karideo/WebLauncher.java +++ b/back/src/org/kar/karideo/WebLauncher.java @@ -59,7 +59,7 @@ public class WebLauncher { migrationEngine.add(new Migration20230810()); migrationEngine.add(new Migration20231015()); WebLauncher.LOGGER.info("Migrate the DB [START]"); - migrationEngine.migrate(GlobalConfiguration.dbConfig); + migrationEngine.migrateWaitAdmin(GlobalConfiguration.dbConfig); WebLauncher.LOGGER.info("Migrate the DB [STOP]"); } diff --git a/back/src/org/kar/karideo/migration/Initialization.java b/back/src/org/kar/karideo/migration/Initialization.java index 456a6bd..d178a8f 100644 --- a/back/src/org/kar/karideo/migration/Initialization.java +++ b/back/src/org/kar/karideo/migration/Initialization.java @@ -17,8 +17,13 @@ public class Initialization extends MigrationSqlStep { public String getName() { return "Initialization"; } - - public Initialization() throws Exception { + + public Initialization() { + + } + + @Override + public void generateStep() throws Exception { addClass(Data.class); addClass(Media.class); addClass(Type.class); diff --git a/back/src/org/kar/karideo/migration/Migration20230810.java b/back/src/org/kar/karideo/migration/Migration20230810.java index d67cd7c..8ae79c6 100644 --- a/back/src/org/kar/karideo/migration/Migration20230810.java +++ b/back/src/org/kar/karideo/migration/Migration20230810.java @@ -4,20 +4,25 @@ import org.kar.archidata.migration.MigrationSqlStep; import org.kar.karideo.model.UserMediaAdvancement; public class Migration20230810 extends MigrationSqlStep { - - public static final int KARSO_INITIALISATION_ID = 1; + + public static final int KARSO_INITIALISATION_ID = 1; @Override public String getName() { return "migration-2023-08-10"; } - public Migration20230810() throws Exception { + public Migration20230810() { + + } + + @Override + public void generateStep() throws Exception { addClass(UserMediaAdvancement.class); - + addAction(""" ALTER TABLE `userMediaAdvancement` AUTO_INCREMENT = 1000; """); } - + } diff --git a/back/src/org/kar/karideo/migration/Migration20231015.java b/back/src/org/kar/karideo/migration/Migration20231015.java index 8b7cd98..e43b617 100644 --- a/back/src/org/kar/karideo/migration/Migration20231015.java +++ b/back/src/org/kar/karideo/migration/Migration20231015.java @@ -13,7 +13,12 @@ public class Migration20231015 extends MigrationSqlStep { return "refactor creation and update time"; } - public Migration20231015() throws Exception { + public Migration20231015() { + + } + + @Override + public void generateStep() throws Exception { for (String elem : List.of("data", "media", "media_link_cover", "season", "season_link_cover", "series", "series_link_cover", "type", "type_link_cover", "user", "userMediaAdvancement")) { addAction(""" ALTER TABLE `""" + elem + """