From ce792426e6cfc2877eaa3797eb8c042f81c9810f Mon Sep 17 00:00:00 2001 From: Michael Schwarz Date: Thu, 14 Mar 2024 09:15:15 +0100 Subject: [PATCH] Disable foreign key check while updating database --- internal/repository/migrations/mysql/07_fix-tag-id.down.sql | 2 ++ internal/repository/migrations/mysql/07_fix-tag-id.up.sql | 2 ++ 2 files changed, 4 insertions(+) diff --git a/internal/repository/migrations/mysql/07_fix-tag-id.down.sql b/internal/repository/migrations/mysql/07_fix-tag-id.down.sql index 4172f4e..9f9959a 100644 --- a/internal/repository/migrations/mysql/07_fix-tag-id.down.sql +++ b/internal/repository/migrations/mysql/07_fix-tag-id.down.sql @@ -1 +1,3 @@ +SET FOREIGN_KEY_CHECKS = 0; ALTER TABLE tag MODIFY id INTEGER; +SET FOREIGN_KEY_CHECKS = 1; diff --git a/internal/repository/migrations/mysql/07_fix-tag-id.up.sql b/internal/repository/migrations/mysql/07_fix-tag-id.up.sql index f8d805f..1abc4b3 100644 --- a/internal/repository/migrations/mysql/07_fix-tag-id.up.sql +++ b/internal/repository/migrations/mysql/07_fix-tag-id.up.sql @@ -1 +1,3 @@ +SET FOREIGN_KEY_CHECKS = 0; ALTER TABLE tag MODIFY id INTEGER AUTO_INCREMENT; +SET FOREIGN_KEY_CHECKS = 1;