Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/_canary/workspace.py
Original file line number Diff line number Diff line change
Expand Up @@ -743,7 +743,7 @@ def create(cls, path: Path) -> "WorkspaceDatabase":
self.connection.execute(query)

query = """CREATE TABLE IF NOT EXISTS selections (
spec_id TEXT PRIMARY KEY,
selection_id TEXT PRIMARY KEY,
tag TEXT UNIQUE,
gen_signature TEXT,
created_on TEXT,
Expand All @@ -764,7 +764,7 @@ def create(cls, path: Path) -> "WorkspaceDatabase":
spec_id TEXT,
position INTEGER,
PRIMARY KEY (selection_id, spec_id),
FOREIGN KEY (selection_id) REFERENCES selections(spec_id) ON DELETE CASCADE
FOREIGN KEY (selection_id) REFERENCES selections(selection_id) ON DELETE CASCADE
)"""
self.connection.execute(query)

Expand Down Expand Up @@ -908,7 +908,7 @@ def get_specs_by_tagname(self, tag: str) -> list["ResolvedSpec"]:
"""
SELECT sp.data
FROM selection_specs ssp
JOIN selections sel ON ssp.selection_id = sel.spec_id
JOIN selections sel ON ssp.selection_id = sel.selection_id
JOIN specs sp ON sp.spec_id = ssp.spec_id AND sp.signature = sel.gen_signature
WHERE sel.tag = ?
ORDER BY ssp.position ASC
Expand Down Expand Up @@ -1114,7 +1114,7 @@ def put_selection(
self.connection.execute(
"""
INSERT INTO selections (
spec_id,
selection_id,
tag,
gen_signature,
created_on,
Expand Down
Loading