From 94461cff58812ea8fe38c73b40c1d7a8eff53fab Mon Sep 17 00:00:00 2001 From: ivanm Date: Fri, 23 Aug 2024 11:34:26 +0200 Subject: [PATCH] feat: refs #7758 Modify code lowerCamelCase and UNIQUE --- db/dump/fixtures.before.sql | 12 ++++++------ .../11191-chocolateBirch/00-firstScript.sql | 3 ++- .../11191-chocolateBirch/01-firstScript.sql | 3 ++- .../11191-chocolateBirch/02-firstScript.sql | 14 +++++++------- 4 files changed, 17 insertions(+), 15 deletions(-) diff --git a/db/dump/fixtures.before.sql b/db/dump/fixtures.before.sql index 7ed2b9b7c..4533b67af 100644 --- a/db/dump/fixtures.before.sql +++ b/db/dump/fixtures.before.sql @@ -3947,9 +3947,9 @@ VALUES INSERT INTO vn.accountDetailType (id, description, code) VALUES - (1, 'IBAN', 'IBAN'), - (2, 'SWIFT', 'SWIFT'), - (3, 'Referencia Remesas', 'REM'), - (4, 'Referencia Transferencias', 'TRAN'), - (5, 'Referencia Nominas', 'NOM'), - (6, 'ABA', 'ABA'); + (1, 'IBAN', 'iban'), + (2, 'SWIFT', 'swift'), + (3, 'Referencia Remesas', 'remRef'), + (4, 'Referencia Transferencias', 'trnRef'), + (5, 'Referencia Nominas', 'payRef'), + (6, 'ABA', 'aba'); diff --git a/db/versions/11191-chocolateBirch/00-firstScript.sql b/db/versions/11191-chocolateBirch/00-firstScript.sql index 929de87fe..4c9924a42 100644 --- a/db/versions/11191-chocolateBirch/00-firstScript.sql +++ b/db/versions/11191-chocolateBirch/00-firstScript.sql @@ -1,2 +1,3 @@ ALTER TABLE vn.mandateType - CHANGE name code VARCHAR(45) DEFAULT NULL; \ No newline at end of file + CHANGE name code VARCHAR(45) NOT NULL, + ADD UNIQUE (code); \ No newline at end of file diff --git a/db/versions/11191-chocolateBirch/01-firstScript.sql b/db/versions/11191-chocolateBirch/01-firstScript.sql index 168eaef84..50b27fdbd 100644 --- a/db/versions/11191-chocolateBirch/01-firstScript.sql +++ b/db/versions/11191-chocolateBirch/01-firstScript.sql @@ -1,2 +1,3 @@ ALTER TABLE vn.accountDetailType - ADD COLUMN code VARCHAR(45) DEFAULT NULL; \ No newline at end of file + ADD COLUMN code VARCHAR(45) NOT NULL, + ADD UNIQUE (code); \ No newline at end of file diff --git a/db/versions/11191-chocolateBirch/02-firstScript.sql b/db/versions/11191-chocolateBirch/02-firstScript.sql index 53b7317b6..733cffd63 100644 --- a/db/versions/11191-chocolateBirch/02-firstScript.sql +++ b/db/versions/11191-chocolateBirch/02-firstScript.sql @@ -1,9 +1,9 @@ UPDATE vn.accountDetailType - SET code = CASE id - WHEN 1 THEN 'IBAN' - WHEN 2 THEN 'SWIFT' - WHEN 3 THEN 'REM' - WHEN 4 THEN 'TRAN' - WHEN 5 THEN 'NOM' - WHEN 6 THEN 'ABA' + SET code = CASE description + WHEN 'IBAN' THEN 'iban' + WHEN 'SWIFT' THEN 'swift' + WHEN 'Referencia Remesas' THEN 'remRef' + WHEN 'Referencia Transferencias' THEN 'trnRef' + WHEN 'Referencia Nominas' THEN 'payRef' + WHEN 'ABA' THEN 'aba' END; \ No newline at end of file