feat(tfstated): implement states versioning
This commit is contained in:
parent
71702002cf
commit
3319e74279
5 changed files with 56 additions and 36 deletions
|
@ -5,7 +5,14 @@ CREATE TABLE schema_version (
|
|||
CREATE TABLE states (
|
||||
id INTEGER PRIMARY KEY,
|
||||
name TEXT NOT NULL,
|
||||
data BLOB,
|
||||
lock TEXT
|
||||
) STRICT;
|
||||
CREATE UNIQUE INDEX states_name on states(name);
|
||||
|
||||
CREATE TABLE versions (
|
||||
id INTEGER PRIMARY KEY,
|
||||
state_id INTEGER,
|
||||
data BLOB,
|
||||
created INTEGER DEFAULT (unixepoch()),
|
||||
FOREIGN KEY(state_id) REFERENCES states(id) ON DELETE CASCADE
|
||||
) STRICT;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue