1
0
Fork 0
mirror of https://github.com/uhIgnacio/EmoteManager.git synced 2024-08-15 02:23:13 +00:00
EmoteManager/schema.sql

22 lines
713 B
MySQL
Raw Normal View History

2021-04-06 03:51:54 +00:00
SET TIME ZONE 'UTC';
-- inserted for every time a command is invoked
CREATE TABLE invokes (
2021-04-06 04:20:06 +00:00
-- nullable because it may be invoked in DMs
guild_id BIGINT,
2021-04-06 03:51:54 +00:00
-- hashed for privacy
user_id_md5 BYTEA NOT NULL,
-- the qualified name of the command invoked (https://discordpy.readthedocs.io/en/stable/ext/commands/api.html?highlight=qualified_name#discord.ext.commands.Command.qualified_name)
command TEXT NOT NULL,
invoked_at TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT CURRENT_TIMESTAMP
);
CREATE INDEX invokes_invoked_at_idx ON invokes (invoked_at);
2021-04-06 04:00:17 +00:00
2021-04-06 04:19:37 +00:00
CREATE TABLE shard_info (
2021-04-06 04:00:17 +00:00
shard_id INT2 PRIMARY KEY,
-- sum(guild.member_count for guild in shard)
2021-04-06 04:19:37 +00:00
member_count INT4 NOT NULL,
guild_count INT2 NOT NULL
2021-04-06 04:00:17 +00:00
);