Add Tiers and Game Prize

This commit is contained in:
Aditya Siregar
2025-09-17 19:30:17 +07:00
parent 12ee54390f
commit 201e24041b
66 changed files with 6365 additions and 2 deletions
@@ -0,0 +1,17 @@
CREATE TABLE games (
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
name VARCHAR(255) NOT NULL,
type VARCHAR(50) NOT NULL,
is_active BOOLEAN DEFAULT TRUE,
metadata JSONB DEFAULT '{}',
created_at TIMESTAMP WITH TIME ZONE DEFAULT NOW(),
updated_at TIMESTAMP WITH TIME ZONE DEFAULT NOW(),
CONSTRAINT chk_games_type_valid
CHECK (type IN ('SPIN', 'RAFFLE', 'MINIGAME'))
);
-- Create indexes
CREATE INDEX idx_games_type ON games(type);
CREATE INDEX idx_games_is_active ON games(is_active);
CREATE INDEX idx_games_created_at ON games(created_at);