1๋จ๊ณ: supabase.com ์์ ๋ฌด๋ฃ ๊ณ์ ์์ฑ
2๋จ๊ณ: New Project ์์ฑ ํ SQL Editor์์ ์๋ ์คํ:
-- ์ธ์
ํ
์ด๋ธ
CREATE TABLE trading_sessions (
id uuid DEFAULT gen_random_uuid() PRIMARY KEY,
created_at timestamptz DEFAULT now(),
status text DEFAULT 'active',
total_pnl numeric DEFAULT 0,
trade_count int DEFAULT 0,
session_hour int DEFAULT 0
);
-- ๊ฑฐ๋ ๊ธฐ๋ก ํ
์ด๋ธ
CREATE TABLE trades (
id uuid DEFAULT gen_random_uuid() PRIMARY KEY,
created_at timestamptz DEFAULT now(),
session_id uuid REFERENCES trading_sessions(id),
hour int NOT NULL,
coin text NOT NULL,
direction text NOT NULL,
action text NOT NULL,
entry_price numeric NOT NULL,
current_price numeric NOT NULL,
quantity numeric DEFAULT 1,
leverage int DEFAULT 10,
pnl numeric DEFAULT 0,
pnl_pct numeric DEFAULT 0,
strategy text,
status text DEFAULT 'open'
);
-- RLS ๋นํ์ฑํ (๊ฐ์ธ ์ฌ์ฉ)
ALTER TABLE trading_sessions DISABLE ROW LEVEL SECURITY;
ALTER TABLE trades DISABLE ROW LEVEL SECURITY;
3๋จ๊ณ: Project Settings โ API ์์ URL๊ณผ anon key ๋ณต์ฌ
4๋จ๊ณ: ์ ์
๋ ฅ๋์ ๋ถ์ฌ๋ฃ๊ธฐ ํ ์ ์ฅ!