Readded some guild data code. fixed some weird cases with macro command. removed restrict command. changed db to be 'as it was'. removed execution limiters since commands are quite heavily ratelimited anyway

This commit is contained in:
2021-10-30 20:57:33 +01:00
parent db7cca6296
commit 72228911f2
12 changed files with 150 additions and 368 deletions

View File

@ -56,8 +56,7 @@ CREATE TABLE reminders_new (
-- , CONSTRAINT interval_enabled_mutin CHECK (`enabled` = 1 OR `interval` IS NULL)
# disallow an expiry time if interval is unspecified
-- , CONSTRAINT interval_expires_mutin CHECK (`expires` IS NULL OR `interval` IS NOT NULL)
)
COLLATE utf8mb4_unicode_ci;
);
# import data from other tables
INSERT INTO reminders_new (

View File

@ -1,33 +1,13 @@
USE reminders;
CREATE TABLE macro (
id INT UNSIGNED AUTO_INCREMENT,
guild_id BIGINT UNSIGNED NOT NULL,
guild_id INT UNSIGNED NOT NULL,
name VARCHAR(100) NOT NULL,
description VARCHAR(100),
commands TEXT NOT NULL,
FOREIGN KEY (guild_id) REFERENCES guilds(guild) ON DELETE CASCADE,
FOREIGN KEY (guild_id) REFERENCES guilds(id) ON DELETE CASCADE,
PRIMARY KEY (id)
);
DROP TABLE IF EXISTS events;
CREATE TABLE reminders.todos_new (
id INT UNSIGNED AUTO_INCREMENT UNIQUE NOT NULL,
user_id BIGINT UNSIGNED,
guild_id BIGINT UNSIGNED,
channel_id BIGINT UNSIGNED,
value VARCHAR(2000) NOT NULL,
PRIMARY KEY (id),
INDEX (user_id),
INDEX (guild_id),
INDEX (channel_id)
);
INSERT INTO reminders.todos_new (user_id, guild_id, channel_id, value)
SELECT users.user, guilds.guild, channels.channel, todos.value
FROM todos
INNER JOIN users ON users.id = todos.user_id
INNER JOIN guilds ON guilds.id = todos.guild_id
INNER JOIN channels ON channels.id = todos.channel_id;