diff --git a/src/_canary/workspace.py b/src/_canary/workspace.py index b26ba1d9..4b57e844 100644 --- a/src/_canary/workspace.py +++ b/src/_canary/workspace.py @@ -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, @@ -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) @@ -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 @@ -1114,7 +1114,7 @@ def put_selection( self.connection.execute( """ INSERT INTO selections ( - spec_id, + selection_id, tag, gen_signature, created_on,