From 73d9d947d86dc1b60f7e32e1947a305bf9d04477 Mon Sep 17 00:00:00 2001 From: Edouard DUPIN Date: Sat, 14 Sep 2024 08:52:28 +0200 Subject: [PATCH] [FIX] missing migration --- .../karusic/migration/Migration20240907.java | 34 +++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 back/src/org/kar/karusic/migration/Migration20240907.java diff --git a/back/src/org/kar/karusic/migration/Migration20240907.java b/back/src/org/kar/karusic/migration/Migration20240907.java new file mode 100644 index 0000000..40bc3d1 --- /dev/null +++ b/back/src/org/kar/karusic/migration/Migration20240907.java @@ -0,0 +1,34 @@ +package org.kar.karusic.migration; + +import org.kar.archidata.migration.MigrationSqlStep; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class Migration20240907 extends MigrationSqlStep { + private static final Logger LOGGER = LoggerFactory.getLogger(Migration20240907.class); + + public static final int KARSO_INITIALISATION_ID = 1; + + @Override + public String getName() { + return "migration-2024-09-07: convert data id in uuid"; + } + + public Migration20240907() { + + } + + @Override + public void generateStep() throws Exception { + addAction(""" + ALTER TABLE `data` DROP INDEX `PRIMARY`; + """); + addAction(""" + ALTER TABLE `data` CHANGE `id` `uuid` binary(16) DEFAULT (UUID_TO_BIN(UUID(), TRUE)); + """); + addAction(""" + ALTER TABLE `data` ADD PRIMARY KEY `uuid` (`uuid`); + """); + } + +}