From 2e01f9f7c7a086fdd51f9fd6861f15846c0636d6 Mon Sep 17 00:00:00 2001 From: jude Date: Wed, 14 Feb 2024 19:32:36 +0000 Subject: [PATCH] Add migration script --- .../20240210133900_macro_restructure.sql | 53 +++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 migrations/20240210133900_macro_restructure.sql diff --git a/migrations/20240210133900_macro_restructure.sql b/migrations/20240210133900_macro_restructure.sql new file mode 100644 index 0000000..dd8d5b2 --- /dev/null +++ b/migrations/20240210133900_macro_restructure.sql @@ -0,0 +1,53 @@ +-- Add migration script here +CREATE TABLE command_macro ( + id INT UNSIGNED AUTO_INCREMENT, + guild_id INT UNSIGNED NOT NULL, + + name VARCHAR(100) NOT NULL, + description VARCHAR(100), + commands JSON NOT NULL, + + FOREIGN KEY (guild_id) REFERENCES guilds(id) ON DELETE CASCADE, + PRIMARY KEY (id) +); + +# New JSON structure is {command_name: "Remind", "