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..16a8bdce7 --- /dev/null +++ b/persistence/0100_2.10.0_tag_type.sql @@ -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; \ No newline at end of file diff --git a/persistence/0090_2.11.0_tag_type.sql b/persistence/0110_2.11.0_tag_type.sql similarity index 97% rename from persistence/0090_2.11.0_tag_type.sql rename to persistence/0110_2.11.0_tag_type.sql index 63ec2e051..083e94e9d 100644 --- a/persistence/0090_2.11.0_tag_type.sql +++ b/persistence/0110_2.11.0_tag_type.sql @@ -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), diff --git a/persistence/0091_2.11.0_group.sql b/persistence/0111_2.11.0_group.sql similarity index 100% rename from persistence/0091_2.11.0_group.sql rename to persistence/0111_2.11.0_group.sql diff --git a/persistence/0092_2.11.0_tag.sql b/persistence/0112_2.11.0_tag.sql similarity index 97% rename from persistence/0092_2.11.0_tag.sql rename to persistence/0112_2.11.0_tag.sql index 937995d6f..3dd97cfaa 100644 --- a/persistence/0092_2.11.0_tag.sql +++ b/persistence/0112_2.11.0_tag.sql @@ -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),