From c29aaf5ef0a37e821e0c6eea2306deaad0bcd8f6 Mon Sep 17 00:00:00 2001 From: fengzero Date: Thu, 7 Nov 2024 02:58:35 +0000 Subject: [PATCH] db array --- persistence/0100_2.10.0_tag_type.sql | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 persistence/0100_2.10.0_tag_type.sql diff --git a/persistence/0100_2.10.0_tag_type.sql b/persistence/0100_2.10.0_tag_type.sql new file mode 100644 index 000000000..ff72df17b --- /dev/null +++ b/persistence/0100_2.10.0_tag_type.sql @@ -0,0 +1,25 @@ +BEGIN TRANSACTION; + +ALTER TABLE tags RENAME TO temp_tags; + +-- add bias column +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, + bias REAL NOT NULL check (bias BETWEEN -1000 AND 1000), + 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;