Skip to content

Commit bc63779

Browse files
authored
add draft_code table for code editor (#369)
1 parent 8c6f7a9 commit bc63779

1 file changed

Lines changed: 21 additions & 0 deletions

File tree

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
"""
2+
draft_code_editor
3+
"""
4+
5+
from yoyo import step
6+
7+
__depends__ = {'20250822_01_UtXzl-website-submission'}
8+
9+
steps = [
10+
step("""
11+
CREATE TABLE IF NOT EXISTS leaderboard.draft_code (
12+
id SERIAL PRIMARY KEY,
13+
leaderboard_id INTEGER NOT NULL REFERENCES leaderboard.leaderboard(id) ON DELETE CASCADE,
14+
user_id TEXT NOT NULL REFERENCES leaderboard.user_info(id) ON DELETE CASCADE,
15+
type TEXT NOT NULL DEFAULT 'general',
16+
code BYTEA NOT NULL,
17+
created_at TIMESTAMPTZ NOT NULL DEFAULT NOW(),
18+
last_modified_at TIMESTAMPTZ NOT NULL DEFAULT NOW()
19+
);
20+
""")
21+
]

0 commit comments

Comments
 (0)