Skip to content

Commit

Permalink
db array
Browse files Browse the repository at this point in the history
  • Loading branch information
fengzeroz committed Nov 7, 2024
1 parent b5784a9 commit 98983ae
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 2 deletions.
25 changes: 25 additions & 0 deletions persistence/0100_2.10.0_tag_type.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
BEGIN TRANSACTION;

ALTER TABLE tags RENAME TO temp_tags;

CREATE TABLE
IF NOT EXISTS tags (
driver_name TEXT NOT NULL,
group_name TEXT NOT NULL,
name TEXT NULL check (length (name) <= 128),
address TEXT NULL check (length (address) <= 128),
attribute INTEGER NOT NULL check (attribute BETWEEN 0 AND 15),
precision INTEGER NOT NULL check (precision BETWEEN 0 AND 17),
decimal REAL NOT NULL,
type INTEGER NOT NULL check (type BETWEEN 0 AND 40),
description TEXT NULL check (length (description) <= 512),
value TEXT,
UNIQUE (driver_name, group_name, name),
FOREIGN KEY (driver_name, group_name) REFERENCES groups (driver_name, name) ON UPDATE CASCADE ON DELETE CASCADE
);

INSERT INTO tags SELECT * FROM temp_tags;

DROP TABLE temp_tags;

COMMIT;
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ CREATE TABLE
precision INTEGER NOT NULL check (precision BETWEEN 0 AND 17),
decimal REAL NOT NULL,
bias REAL NOT NULL check (bias BETWEEN -1000 AND 1000),
type INTEGER NOT NULL check (type BETWEEN 0 AND 22),
type INTEGER NOT NULL check (type BETWEEN 0 AND 40),
description TEXT NULL check (length (description) <= 512),
value TEXT,
UNIQUE (driver_name, group_name, name),
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ CREATE TABLE
precision INTEGER NOT NULL check (precision BETWEEN 0 AND 17),
decimal REAL NOT NULL,
bias REAL NOT NULL check (bias BETWEEN -1000 AND 1000),
type INTEGER NOT NULL check (type BETWEEN 0 AND 22),
type INTEGER NOT NULL check (type BETWEEN 0 AND 40),
description TEXT NULL check (length (description) <= 512),
value TEXT,
UNIQUE (driver_name, group_name, name),
Expand Down

0 comments on commit 98983ae

Please sign in to comment.