-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup_db.sql
More file actions
51 lines (46 loc) · 1.46 KB
/
Copy pathsetup_db.sql
File metadata and controls
51 lines (46 loc) · 1.46 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
-- Simple database setup for Scooty bot
-- Run this in Supabase SQL Editor
-- Supprimer les tables existantes si elles existent
DROP TABLE IF EXISTS scouts CASCADE;
DROP TABLE IF EXISTS events CASCADE;
DROP TABLE IF EXISTS archetypes CASCADE;
-- Créer la table events
CREATE TABLE events (
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
name TEXT NOT NULL,
start_date TIMESTAMPTZ NOT NULL,
end_date TIMESTAMPTZ,
status TEXT DEFAULT 'active',
created_at TIMESTAMPTZ DEFAULT NOW(),
updated_at TIMESTAMPTZ DEFAULT NOW()
);
-- Créer la table scouts
CREATE TABLE scouts (
id BIGSERIAL PRIMARY KEY,
event_id UUID REFERENCES events(id) ON DELETE CASCADE,
opponent TEXT NOT NULL,
archetype TEXT NOT NULL,
scout_by TEXT NOT NULL,
comment TEXT DEFAULT '',
created_at TIMESTAMPTZ DEFAULT NOW(),
updated_at TIMESTAMPTZ DEFAULT NOW()
);
-- Créer la table archetypes
CREATE TABLE archetypes (
id BIGSERIAL PRIMARY KEY,
name TEXT UNIQUE NOT NULL,
emoji TEXT,
color TEXT,
active BOOLEAN DEFAULT true,
created_at TIMESTAMPTZ DEFAULT NOW(),
updated_at TIMESTAMPTZ DEFAULT NOW()
);
-- Insérer des archétypes par défaut
INSERT INTO archetypes (name, emoji, color) VALUES
('jeskai_control', '🔵🔴⚪', '#FFD700'),
('abzan_sorin', '⚪⚫🟢', '#228B22'),
('jund_midrange', '⚫🔴🟢', '#8B0000'),
('mono_green', '🟢', '#00FF00'),
('azorius_tempo', '⚪🔵', '#1E90FF'),
('rakdos_sac', '⚫🔴', '#DC143C'),
('other', '❓', '#808080');