From 1ba23ad45057893a6612a62e1844025c0b353657 Mon Sep 17 00:00:00 2001 From: ivanm Date: Wed, 18 Dec 2024 13:27:43 +0100 Subject: [PATCH 1/3] feat: refs #8073 #refs 8073 create vn.productionCountryVolume --- db/versions/11387-whiteDendro/00-firstScript.sql | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 db/versions/11387-whiteDendro/00-firstScript.sql diff --git a/db/versions/11387-whiteDendro/00-firstScript.sql b/db/versions/11387-whiteDendro/00-firstScript.sql new file mode 100644 index 000000000..4461b945d --- /dev/null +++ b/db/versions/11387-whiteDendro/00-firstScript.sql @@ -0,0 +1,9 @@ +CREATE TABLE IF NOT EXISTS vn.productionCountryVolume( + id INT(11) UNSIGNED NOT NULL AUTO_INCREMENT, + countryFk MEDIUMINT(8) UNSIGNED NOT NULL, + estimate DECIMAL(6, 2), + PRIMARY KEY (id), + CONSTRAINT productionCountryVolume_countryFK + FOREIGN KEY (countryFk) REFERENCES vn.country (id) + ON DELETE RESTRICT ON UPDATE CASCADE +) COMMENT = 'Estimación del crecimiento por país' \ No newline at end of file From 148ab57b1a1cf0bc4d42f999a039951ace7c41a8 Mon Sep 17 00:00:00 2001 From: ivanm Date: Wed, 18 Dec 2024 15:06:49 +0100 Subject: [PATCH 2/3] feat: refs #8073 change names and primary key --- db/versions/11387-whiteDendro/00-firstScript.sql | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/db/versions/11387-whiteDendro/00-firstScript.sql b/db/versions/11387-whiteDendro/00-firstScript.sql index 4461b945d..3226dfc42 100644 --- a/db/versions/11387-whiteDendro/00-firstScript.sql +++ b/db/versions/11387-whiteDendro/00-firstScript.sql @@ -1,8 +1,7 @@ -CREATE TABLE IF NOT EXISTS vn.productionCountryVolume( - id INT(11) UNSIGNED NOT NULL AUTO_INCREMENT, +CREATE TABLE IF NOT EXISTS vn.productionCountry( countryFk MEDIUMINT(8) UNSIGNED NOT NULL, - estimate DECIMAL(6, 2), - PRIMARY KEY (id), + volumeGrowthEstimatePercent DECIMAL(6, 2), + PRIMARY KEY (countryFk), CONSTRAINT productionCountryVolume_countryFK FOREIGN KEY (countryFk) REFERENCES vn.country (id) ON DELETE RESTRICT ON UPDATE CASCADE From c59cae9f74fbe65d14badde2fc40e82660573a1c Mon Sep 17 00:00:00 2001 From: ivanm Date: Thu, 19 Dec 2024 14:38:28 +0100 Subject: [PATCH 3/3] feat: refs #8073 new comment message --- db/versions/11387-whiteDendro/00-firstScript.sql | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/db/versions/11387-whiteDendro/00-firstScript.sql b/db/versions/11387-whiteDendro/00-firstScript.sql index 3226dfc42..4e9f1d217 100644 --- a/db/versions/11387-whiteDendro/00-firstScript.sql +++ b/db/versions/11387-whiteDendro/00-firstScript.sql @@ -1,8 +1,8 @@ CREATE TABLE IF NOT EXISTS vn.productionCountry( countryFk MEDIUMINT(8) UNSIGNED NOT NULL, - volumeGrowthEstimatePercent DECIMAL(6, 2), + volumeGrowthEstimatePercent DECIMAL(6, 2) COMMENT 'Porcentaje estimado de crecimiento del volumen', PRIMARY KEY (countryFk), CONSTRAINT productionCountryVolume_countryFK FOREIGN KEY (countryFk) REFERENCES vn.country (id) ON DELETE RESTRICT ON UPDATE CASCADE -) COMMENT = 'Estimación del crecimiento por país' \ No newline at end of file +) COMMENT = 'Datos de producción por país' \ No newline at end of file