NotParcel/migrations/005_generate_fileAuth_table.sql
2024-12-30 11:37:46 -07:00

8 lines
401 B
SQL

CREATE TABLE IF NOT EXISTS fileAuth (
token CHAR(64) PRIMARY KEY NOT NULL, -- Single use token to download the file
product VARCHAR(36) NOT NULL, -- Product ID (Reference to product in products table)
owner BIGINT NOT NULL, -- Owner of the token
expires BIGINT NOT NULL, -- Expiration for this token
FOREIGN KEY (owner) REFERENCES users(robloxId),
FOREIGN KEY (product) REFERENCES products(id)
)