diff --git a/back/models/companyI18n.json b/back/models/companyI18n.json index 19fc4aa00..0c7dd98e4 100644 --- a/back/models/companyI18n.json +++ b/back/models/companyI18n.json @@ -7,6 +7,10 @@ } }, "properties": { + "id": { + "type": "number", + "id": true + }, "companyFk": { "type": "number", "id": 1 diff --git a/back/models/inkI18n.json b/back/models/inkI18n.json index f808dd9f5..f5f1ffb2b 100644 --- a/back/models/inkI18n.json +++ b/back/models/inkI18n.json @@ -7,6 +7,10 @@ } }, "properties": { + "id": { + "type": "number", + "id": true + }, "inkFk": { "type": "number", "id": 1 diff --git a/back/models/itemCategoryI18n.json b/back/models/itemCategoryI18n.json index 3226c923d..ad206b1ca 100644 --- a/back/models/itemCategoryI18n.json +++ b/back/models/itemCategoryI18n.json @@ -7,6 +7,10 @@ } }, "properties": { + "id": { + "type": "number", + "id": true + }, "categoryFk": { "type": "number", "id": 1 diff --git a/back/models/itemTypeI18n.json b/back/models/itemTypeI18n.json index a76cfb933..c3ea723f9 100644 --- a/back/models/itemTypeI18n.json +++ b/back/models/itemTypeI18n.json @@ -7,6 +7,7 @@ } }, "properties": { + "typeFk": { "type": "number", "id": 1 @@ -17,6 +18,10 @@ }, "name": { "type": "string" + }, + "id": { + "type": "number", + "id": true } } } diff --git a/back/models/originI18n.json b/back/models/originI18n.json index a0066ab49..ed5f240db 100644 --- a/back/models/originI18n.json +++ b/back/models/originI18n.json @@ -7,6 +7,10 @@ } }, "properties": { + "id": { + "type": "number", + "id": true + }, "originFk": { "type": "number", "id": 1 diff --git a/back/models/stateI18n.json b/back/models/stateI18n.json index b136dc9f3..52cb8415b 100644 --- a/back/models/stateI18n.json +++ b/back/models/stateI18n.json @@ -7,6 +7,10 @@ } }, "properties": { + "id": { + "type": "number", + "id": true + }, "stateFk": { "type": "number", "id": 1 diff --git a/back/models/tagI18n.json b/back/models/tagI18n.json index b1d62ed59..842512632 100644 --- a/back/models/tagI18n.json +++ b/back/models/tagI18n.json @@ -7,6 +7,10 @@ } }, "properties": { + "id": { + "type": "number", + "id": true + }, "tagFk": { "type": "number", "id": 1 diff --git a/db/dump/fixtures.before.sql b/db/dump/fixtures.before.sql index 9724ff75d..f03dca5b8 100644 --- a/db/dump/fixtures.before.sql +++ b/db/dump/fixtures.before.sql @@ -4056,3 +4056,101 @@ VALUES (9, 'en', 'Santa Dorotea Chrysanthemum'), (9, 'fr', 'Chrysanthème Santa Dorotea'), (9, 'pt', 'Crisântemo Santa Dorotea'); + +INSERT INTO vn.inkI18n (inkFk, lang, name) +VALUES + ('?', 'ca', 'Sense especificar'), + ('?', 'en', 'Unspecified'), + ('?', 'fr', 'Indéterminé'), + ('?', 'mn', 'тодорхойгүй'), + ('?', 'pt', 'Não especificado'), + ('2C', 'ca', '2 Colors'), + ('2C', 'en', '2 Colour'), + ('2C', 'fr', '2 Couleur'), + ('2C', 'mn', '2 Өнгө'), + ('2C', 'pt', '2 Cor'), + ('A/M', 'ca', 'Groc / Marró'), + ('A/M', 'en', 'Yellow / Brown'), + ('A/M', 'fr', 'Yellow / Brown'), + ('A/M', 'mn', 'Шар / Браун'), + ('A/M', 'pt', 'Yellow / Brown'), + ('A/N', 'ca', 'Groc / Taronja'), + ('A/N', 'en', 'Yellow orange'), + ('A/N', 'fr', 'Jaune / Orange'), + ('A/N', 'mn', 'Шар / Улбар шар'), + ('A/N', 'pt', 'Amarelo / Laranja'); + +INSERT INTO vn.itemCategoryI18n (categoryFk, lang, name) +VALUES + (1, 'ca', 'Flor'), + (1, 'en', 'Flower'), + (1, 'fr', 'Fleur'), + (1, 'mn', 'цэцэг'), + (1, 'pt', 'Flores'), + (2, 'ca', 'Planta'), + (2, 'en', 'Plant'), + (2, 'fr', 'Plante'), + (2, 'mn', 'станц'), + (2, 'pt', 'Plantas'), + (3, 'ca', 'Complements'), + (3, 'en', 'Accessories'), + (3, 'fr', 'Accessoires'), + (3, 'mn', 'Дагалдах хэрэгсэл'), + (3, 'pt', 'Acessórios'), + (4, 'ca', 'Artificial'), + (4, 'en', 'Artificial'), + (4, 'fr', 'Artificielle'), + (4, 'mn', 'Хиймэл'), + (4, 'pt', 'Artificial'), + (5, 'ca', 'Verds'), + (5, 'en', 'Green'), + (5, 'fr', 'Vert'), + (5, 'mn', 'ногоон'), + (5, 'pt', 'Verdes'); + +INSERT INTO vn.originI18n (originFk, lang, name) +VALUES + (1, 'ca', 'Chollolandia'), + (1, 'en', 'Chollolandia'), + (1, 'fr', 'Chollolandia'), + (1, 'mn', 'Chollolandia'), + (1, 'pt', 'Chollolandia'), + (2, 'ca', 'Alemanya'), + (2, 'en', 'Germany'), + (2, 'fr', 'Allemagne'), + (2, 'mn', 'Герман'), + (2, 'pt', 'Alemanha'), + (3, 'ca', 'Almeria'), + (3, 'en', 'Almeria'), + (3, 'fr', 'Almeria'), + (3, 'mn', 'Зугаа'), + (3, 'pt', 'Almeria'), + (4, 'ca', 'Austràlia'), + (4, 'en', 'Australia'), + (4, 'fr', 'Australie'), + (4, 'mn', 'Австрали'), + (4, 'pt', 'Austrália'), + (5, 'ca', 'canada'), + (5, 'en', 'Canada'), + (5, 'fr', 'Canada'), + (5, 'mn', 'Канад'), + (5, 'pt', 'Canadá'); + +INSERT INTO vn.stateI18n (stateFk, lang, name) +VALUES + (1, 'en', 'Fix'), + (1, 'es', 'Arreglar'), + (2, 'en', 'Free'), + (2, 'es', 'Libre'), + (3, 'en', 'OK'), + (3, 'es', 'OK'), + (4, 'en', 'Printed'), + (4, 'es', 'Impreso'), + (5, 'en', 'Preparation'), + (5, 'es', 'Preparación'), + (6, 'en', 'In Review'), + (6, 'es', 'En Revisión'), + (7, 'en', 'Unfinished'), + (7, 'es', 'Sin Acabar'); + + diff --git a/db/versions/11309-pinkGalax/00-firstScript.sql b/db/versions/11309-pinkGalax/00-firstScript.sql index 287449792..feb3e424b 100644 --- a/db/versions/11309-pinkGalax/00-firstScript.sql +++ b/db/versions/11309-pinkGalax/00-firstScript.sql @@ -10,4 +10,23 @@ INSERT INTO salix.ACL (model,property,accessType,permission,principalType,princi ('itemCategoryI18n','*','*','ALLOW','ROLE','employee'); +ALTER TABLE vn.companyI18n + ADD id INT AUTO_INCREMENT UNIQUE; +ALTER TABLE vn.inkI18n + ADD id INT AUTO_INCREMENT UNIQUE; + +ALTER TABLE vn.itemCategoryI18n + ADD id INT AUTO_INCREMENT UNIQUE; + +ALTER TABLE vn.itemTypeI18n + ADD id INT AUTO_INCREMENT UNIQUE; + +ALTER TABLE vn.originI18n + ADD id INT AUTO_INCREMENT UNIQUE; + +ALTER TABLE vn.stateI18n + ADD id INT AUTO_INCREMENT UNIQUE; + +ALTER TABLE vn.tagI18n + ADD id INT AUTO_INCREMENT UNIQUE; diff --git a/loopback/common/methods/application/getI18nTables.js b/loopback/common/methods/application/getI18nTables.js index cd00b09e2..2756450a7 100644 --- a/loopback/common/methods/application/getI18nTables.js +++ b/loopback/common/methods/application/getI18nTables.js @@ -20,6 +20,7 @@ module.exports = Self => { WHERE c.table_name LIKE '%i18n' AND c.COLUMN_KEY = 'PRI' + AND c.column_name <> 'id' AND c.COLUMN_NAME <> 'lang'`); const columns = await Self.rawSql(` @@ -28,6 +29,7 @@ module.exports = Self => { WHERE c.table_name LIKE '%i18n' AND c.COLUMN_KEY <> 'PRI' + AND c.column_name <> 'id' `); for (const column of columns)