[DEV] clean

This commit is contained in:
Edouard DUPIN 2023-11-24 00:05:28 +01:00
parent 2e24175899
commit d624e7f691
4 changed files with 24 additions and 9 deletions

View File

@ -59,7 +59,7 @@ public class WebLauncher {
migrationEngine.add(new Migration20230810()); migrationEngine.add(new Migration20230810());
migrationEngine.add(new Migration20231015()); migrationEngine.add(new Migration20231015());
WebLauncher.LOGGER.info("Migrate the DB [START]"); WebLauncher.LOGGER.info("Migrate the DB [START]");
migrationEngine.migrate(GlobalConfiguration.dbConfig); migrationEngine.migrateWaitAdmin(GlobalConfiguration.dbConfig);
WebLauncher.LOGGER.info("Migrate the DB [STOP]"); WebLauncher.LOGGER.info("Migrate the DB [STOP]");
} }

View File

@ -17,8 +17,13 @@ public class Initialization extends MigrationSqlStep {
public String getName() { public String getName() {
return "Initialization"; return "Initialization";
} }
public Initialization() throws Exception { public Initialization() {
}
@Override
public void generateStep() throws Exception {
addClass(Data.class); addClass(Data.class);
addClass(Media.class); addClass(Media.class);
addClass(Type.class); addClass(Type.class);

View File

@ -4,20 +4,25 @@ import org.kar.archidata.migration.MigrationSqlStep;
import org.kar.karideo.model.UserMediaAdvancement; import org.kar.karideo.model.UserMediaAdvancement;
public class Migration20230810 extends MigrationSqlStep { public class Migration20230810 extends MigrationSqlStep {
public static final int KARSO_INITIALISATION_ID = 1; public static final int KARSO_INITIALISATION_ID = 1;
@Override @Override
public String getName() { public String getName() {
return "migration-2023-08-10"; return "migration-2023-08-10";
} }
public Migration20230810() throws Exception { public Migration20230810() {
}
@Override
public void generateStep() throws Exception {
addClass(UserMediaAdvancement.class); addClass(UserMediaAdvancement.class);
addAction(""" addAction("""
ALTER TABLE `userMediaAdvancement` AUTO_INCREMENT = 1000; ALTER TABLE `userMediaAdvancement` AUTO_INCREMENT = 1000;
"""); """);
} }
} }

View File

@ -13,7 +13,12 @@ public class Migration20231015 extends MigrationSqlStep {
return "refactor creation and update time"; 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")) { 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(""" addAction("""
ALTER TABLE `""" + elem + """ ALTER TABLE `""" + elem + """