Skip to content

Commit

Permalink
Merge pull request #1679 from eeff/eeff/dev
Browse files Browse the repository at this point in the history
fix: node cache SQL schema fk constraint
  • Loading branch information
fengzeroz authored Nov 20, 2023
2 parents ad67826 + 23523a0 commit a99a147
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion persistence/0002_2.3.0_node_cache.sql
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,17 @@
--- fix primary key ---
BEGIN;

DROP TABLE IF EXISTS old_node_cache;
ALTER TABLE node_cache RENAME TO old_node_cache;

CREATE TABLE IF NOT EXISTS node_cache (
node_name TEXT PRIMARY KEY,
CACHE TEXT NOT NULL
CACHE TEXT NOT NULL,
FOREIGN KEY (node_name) REFERENCES nodes (name) ON UPDATE CASCADE ON DELETE CASCADE
);

INSERT OR REPLACE INTO node_cache SELECT * FROM old_node_cache;

DROP TABLE old_node_cache;

COMMIT;

0 comments on commit a99a147

Please sign in to comment.