From 068f47deff9bad1220e244f54f6989dc6b8ed214 Mon Sep 17 00:00:00 2001 From: Diana Bishop Date: Wed, 30 Oct 2024 08:26:47 -0400 Subject: [PATCH] backend: clean up SQL --- sql/create_event_table.sql | 4 +--- sql/create_rsvp_table.sql | 1 - sql/remove_host_foreign_key_in_events.sql | 2 -- 3 files changed, 1 insertion(+), 6 deletions(-) delete mode 100644 sql/remove_host_foreign_key_in_events.sql diff --git a/sql/create_event_table.sql b/sql/create_event_table.sql index ba57d84..673066c 100644 --- a/sql/create_event_table.sql +++ b/sql/create_event_table.sql @@ -14,8 +14,6 @@ CREATE TABLE IF NOT EXISTS `event` ( `max_attendees` int NOT NULL, `event_type` text NOT NULL, `host_id` int NOT NULL, - `created_at` timestamp NOT NULL default CURRENT_TIMESTAMP, - CONSTRAINT `fk_event_host` - FOREIGN KEY (`host_id`) REFERENCES `host` (`host_id`) + `created_at` timestamp NOT NULL default CURRENT_TIMESTAMP ) DEFAULT CHARSET=utf8; diff --git a/sql/create_rsvp_table.sql b/sql/create_rsvp_table.sql index dae4c89..432e4a3 100644 --- a/sql/create_rsvp_table.sql +++ b/sql/create_rsvp_table.sql @@ -6,6 +6,5 @@ CREATE TABLE IF NOT EXISTS `rsvp` ( `last_name` text NOT NULL, `phone_number` text NOT NULL, `email` text NOT NULL, - FOREIGN KEY (`event_id`) REFERENCES `event`(`event_id`), `rsvp_response` text NOT NULL ) DEFAULT CHARSET=utf8; \ No newline at end of file diff --git a/sql/remove_host_foreign_key_in_events.sql b/sql/remove_host_foreign_key_in_events.sql deleted file mode 100644 index ff23c24..0000000 --- a/sql/remove_host_foreign_key_in_events.sql +++ /dev/null @@ -1,2 +0,0 @@ -ALTER TABLE event DROP COLUMN host_id; -ALTER TABLE event add column host_id int NOT NULL;