From 761645775114291f4743ebaac15af24037c111f5 Mon Sep 17 00:00:00 2001 From: s3inlc Date: Tue, 2 Jun 2026 09:51:59 +0200 Subject: [PATCH] adding migration to fix mysql silently altering table entries on auto increment --- .../20260602074349_mysql-autoincrement-fix.sql | 13 +++++++++++++ .../20260602074349_mysql-autoincrement-fix.sql | 1 + 2 files changed, 14 insertions(+) create mode 100644 src/migrations/mysql/20260602074349_mysql-autoincrement-fix.sql create mode 100644 src/migrations/postgres/20260602074349_mysql-autoincrement-fix.sql diff --git a/src/migrations/mysql/20260602074349_mysql-autoincrement-fix.sql b/src/migrations/mysql/20260602074349_mysql-autoincrement-fix.sql new file mode 100644 index 000000000..a57a75f38 --- /dev/null +++ b/src/migrations/mysql/20260602074349_mysql-autoincrement-fix.sql @@ -0,0 +1,13 @@ +-- The previous migration could affect the HashType 0 to be changed due to mysql silently on autoincrement application. +UPDATE HashType +SET hashTypeId = 0 +WHERE hashTypeId = 100000 + AND description = 'MD5' + AND NOT EXISTS ( + SELECT 1 + FROM ( + SELECT 1 + FROM HashType + WHERE hashTypeId = 0 + ) AS temp_check +); \ No newline at end of file diff --git a/src/migrations/postgres/20260602074349_mysql-autoincrement-fix.sql b/src/migrations/postgres/20260602074349_mysql-autoincrement-fix.sql new file mode 100644 index 000000000..5c12d9e57 --- /dev/null +++ b/src/migrations/postgres/20260602074349_mysql-autoincrement-fix.sql @@ -0,0 +1 @@ +-- This migration is only a placeholder to keep migrations parallel