From d2bb1d49365bd21a8ab67e364df31634f52fd0e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C5=91cze=20Bence?= Date: Sun, 28 May 2023 17:01:19 +0200 Subject: [PATCH] fix sql statement for table transactions --- database/migrations/structure/20230526_1551_events.sql | 5 ----- .../structure/20230528_1658_events_transactions.sql | 4 ++++ 2 files changed, 4 insertions(+), 5 deletions(-) create mode 100644 database/migrations/structure/20230528_1658_events_transactions.sql diff --git a/database/migrations/structure/20230526_1551_events.sql b/database/migrations/structure/20230526_1551_events.sql index aae1234..1afcb66 100644 --- a/database/migrations/structure/20230526_1551_events.sql +++ b/database/migrations/structure/20230526_1551_events.sql @@ -11,8 +11,3 @@ CREATE TABLE `events` ( UNIQUE KEY `slug` (`slug`), CONSTRAINT `events_community_id` FOREIGN KEY (`community_id`) REFERENCES `communities` (`id`) ) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4; - -ALTER TABLE `transactions` -ADD `event_id` int(10) unsigned NULL, -ADD KEY `event_id` (`event_id`) AFTER `community_id`, -ADD CONSTRAINT `transactions_event_id` FOREIGN KEY (`event_id`) REFERENCES `events` (`id`); diff --git a/database/migrations/structure/20230528_1658_events_transactions.sql b/database/migrations/structure/20230528_1658_events_transactions.sql new file mode 100644 index 0000000..6b52226 --- /dev/null +++ b/database/migrations/structure/20230528_1658_events_transactions.sql @@ -0,0 +1,4 @@ +ALTER TABLE `transactions` +ADD `event_id` int(10) unsigned NULL AFTER `community_id`, +ADD KEY `event_id` (`event_id`), +ADD CONSTRAINT `transactions_event_id` FOREIGN KEY (`event_id`) REFERENCES `events` (`id`); -- 2.45.2