From c8ab5d434496dc14d53210546fd96e11d20f8796 Mon Sep 17 00:00:00 2001 From: jorgep Date: Thu, 14 Nov 2024 11:16:45 +0100 Subject: [PATCH 1/4] fix: refs #6818 add defaultChannel --- back/models/say-simple-config.json | 3 +++ db/dump/fixtures.before.sql | 9 +++++---- db/versions/11347-redErica/00-firstScript.sql | 7 +++++++ 3 files changed, 15 insertions(+), 4 deletions(-) create mode 100644 db/versions/11347-redErica/00-firstScript.sql diff --git a/back/models/say-simple-config.json b/back/models/say-simple-config.json index edc4caa43..d5d4f8a6f 100644 --- a/back/models/say-simple-config.json +++ b/back/models/say-simple-config.json @@ -13,6 +13,9 @@ }, "url": { "type": "string" + }, + "defaultChannel": { + "type": "number" } }, "acls": [ diff --git a/db/dump/fixtures.before.sql b/db/dump/fixtures.before.sql index 68d8be097..2af9e3c23 100644 --- a/db/dump/fixtures.before.sql +++ b/db/dump/fixtures.before.sql @@ -4024,8 +4024,9 @@ INSERT INTO srt.buffer (id, x, y, `size`, `length`, stateFk, typeFk, isActive, c INSERT IGNORE INTO vn.saySimpleCountry (countryFk, channel) VALUES (19, 1169), - (8, 1183), - (NULL, 1320); + (8, 1183); -INSERT IGNORE INTO vn.saySimpleConfig (url) - VALUES ('saysimle-url-mock'); \ No newline at end of file +ALTER TABLE vn.saySimpleConfig ADD COLUMN defaultChannel TINYINT(4); + +INSERT IGNORE INTO vn.saySimpleConfig (url, defaultChannel) + VALUES ('saysimle-url-mock', 1320); \ No newline at end of file diff --git a/db/versions/11347-redErica/00-firstScript.sql b/db/versions/11347-redErica/00-firstScript.sql new file mode 100644 index 000000000..dcd4c9248 --- /dev/null +++ b/db/versions/11347-redErica/00-firstScript.sql @@ -0,0 +1,7 @@ +DROP TABLE IF EXISTS vn.saySimpleConfig; + +CREATE TABLE vn.saySimpleConfig( + id INT AUTO_INCREMENT PRIMARY KEY, + url VARCHAR(255) NOT NULL, + defaultChannel INT(4) +); \ No newline at end of file From a37332f7be6c7d2ab4b8aecfa61b7c91c14ff536 Mon Sep 17 00:00:00 2001 From: jorgep Date: Thu, 14 Nov 2024 11:18:38 +0100 Subject: [PATCH 2/4] fix: refs #6818 add defaultChannel --- db/dump/fixtures.before.sql | 2 -- 1 file changed, 2 deletions(-) diff --git a/db/dump/fixtures.before.sql b/db/dump/fixtures.before.sql index 2af9e3c23..eafd8c721 100644 --- a/db/dump/fixtures.before.sql +++ b/db/dump/fixtures.before.sql @@ -4026,7 +4026,5 @@ INSERT IGNORE INTO vn.saySimpleCountry (countryFk, channel) VALUES (19, 1169), (8, 1183); -ALTER TABLE vn.saySimpleConfig ADD COLUMN defaultChannel TINYINT(4); - INSERT IGNORE INTO vn.saySimpleConfig (url, defaultChannel) VALUES ('saysimle-url-mock', 1320); \ No newline at end of file From f96b9146494749f4e44ad6a3ce9d1844ecefdded Mon Sep 17 00:00:00 2001 From: jorgep Date: Thu, 14 Nov 2024 16:39:26 +0100 Subject: [PATCH 3/4] fix: refs #6818 use right col type --- db/dump/fixtures.before.sql | 4 ++-- db/versions/11347-redErica/00-firstScript.sql | 6 ++++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/db/dump/fixtures.before.sql b/db/dump/fixtures.before.sql index eafd8c721..c99f523b5 100644 --- a/db/dump/fixtures.before.sql +++ b/db/dump/fixtures.before.sql @@ -4023,8 +4023,8 @@ INSERT INTO srt.buffer (id, x, y, `size`, `length`, stateFk, typeFk, isActive, c INSERT IGNORE INTO vn.saySimpleCountry (countryFk, channel) - VALUES (19, 1169), - (8, 1183); + VALUES (19, `1169`), + (8, `1183`); INSERT IGNORE INTO vn.saySimpleConfig (url, defaultChannel) VALUES ('saysimle-url-mock', 1320); \ No newline at end of file diff --git a/db/versions/11347-redErica/00-firstScript.sql b/db/versions/11347-redErica/00-firstScript.sql index dcd4c9248..5da1d6096 100644 --- a/db/versions/11347-redErica/00-firstScript.sql +++ b/db/versions/11347-redErica/00-firstScript.sql @@ -3,5 +3,7 @@ DROP TABLE IF EXISTS vn.saySimpleConfig; CREATE TABLE vn.saySimpleConfig( id INT AUTO_INCREMENT PRIMARY KEY, url VARCHAR(255) NOT NULL, - defaultChannel INT(4) -); \ No newline at end of file + defaultChannel VARCHAR(128) +); + +ALTER TABLE vn.saySimpleCountry MODIFY COLUMN channel VARCHAR(128); \ No newline at end of file From 4b659c0b4822ac9db5ff0ac9652da72b57976c7f Mon Sep 17 00:00:00 2001 From: jorgep Date: Thu, 14 Nov 2024 16:39:35 +0100 Subject: [PATCH 4/4] fix: refs #6818 use right col type --- db/dump/fixtures.before.sql | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/db/dump/fixtures.before.sql b/db/dump/fixtures.before.sql index c99f523b5..cc258e2e3 100644 --- a/db/dump/fixtures.before.sql +++ b/db/dump/fixtures.before.sql @@ -4023,8 +4023,8 @@ INSERT INTO srt.buffer (id, x, y, `size`, `length`, stateFk, typeFk, isActive, c INSERT IGNORE INTO vn.saySimpleCountry (countryFk, channel) - VALUES (19, `1169`), - (8, `1183`); + VALUES (19, '1169'), + (8, '1183'); INSERT IGNORE INTO vn.saySimpleConfig (url, defaultChannel) VALUES ('saysimle-url-mock', 1320); \ No newline at end of file