Skip to content

Commit 367b289

Browse files
committed
refactor: Use single table for colorscheme variants
1 parent 307ea61 commit 367b289

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed
Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,9 @@
1-
CREATE TABLE colorschemes (
2-
name TEXT NOT NULL,
3-
repository_id INTEGER NOT NULL REFERENCES repositories(id) ON DELETE CASCADE,
4-
5-
PRIMARY KEY (name, repository_id)
6-
);
7-
8-
CREATE TABLE colorscheme_color_data (
1+
CREATE TABLE colorscheme_variants (
92
colorscheme_name TEXT NOT NULL,
103
repository_id INTEGER NOT NULL REFERENCES repositories(id) ON DELETE CASCADE,
114
background TEXT NOT NULL CHECK (background IN ('light', 'dark')),
125
color_data JSON NOT NULL,
136

147
PRIMARY KEY (colorscheme_name, repository_id, background)
8+
FOREIGN KEY (colorscheme_name, repository_id) REFERENCES colorschemes(name, repository_id) ON DELETE CASCADE
159
)

0 commit comments

Comments
 (0)