mirror of
https://github.com/dreamhunter2333/cloudflare_temp_email.git
synced 2026-09-13 03:16:31 +08:00
16 lines
540 B
SQL
16 lines
540 B
SQL
CREATE TABLE IF NOT EXISTS redeem_codes (
|
|
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
|
code TEXT UNIQUE NOT NULL,
|
|
redeem_type TEXT NOT NULL,
|
|
value TEXT NOT NULL,
|
|
result TEXT,
|
|
enabled INTEGER NOT NULL DEFAULT 1,
|
|
redeemed INTEGER NOT NULL DEFAULT 0 CHECK (redeemed IN (0, 1)),
|
|
expires_at DATETIME NOT NULL,
|
|
redeemed_at DATETIME,
|
|
created_at DATETIME DEFAULT CURRENT_TIMESTAMP,
|
|
updated_at DATETIME DEFAULT CURRENT_TIMESTAMP
|
|
);
|
|
|
|
CREATE INDEX IF NOT EXISTS idx_redeem_codes_type ON redeem_codes(redeem_type);
|