himbot/migrations/000003_create_himbucks_table.up.sql

11 lines
316 B
MySQL
Raw Normal View History

2024-11-05 00:19:36 -06:00
CREATE TABLE IF NOT EXISTS himbucks (
id INTEGER PRIMARY KEY AUTOINCREMENT,
user_id INTEGER NOT NULL,
guild_id TEXT NOT NULL,
balance INTEGER DEFAULT 0,
message_count INTEGER DEFAULT 0,
last_earned_at DATETIME,
FOREIGN KEY (user_id) REFERENCES users(id),
UNIQUE(user_id, guild_id)
);