From f4d1b9c5c3f47309f3aec69662915d49a9aef537 Mon Sep 17 00:00:00 2001 From: Taras Dubyk Date: Fri, 4 Oct 2024 14:20:42 +0300 Subject: [PATCH] field single PK and UK should be mutually exclusive (#47) --- adapter/0.2.8.json | 58 ++++ .../field_level/fieldLevelConfig.json | 301 +++++++++++++++--- 2 files changed, 317 insertions(+), 42 deletions(-) create mode 100644 adapter/0.2.8.json diff --git a/adapter/0.2.8.json b/adapter/0.2.8.json new file mode 100644 index 0000000..000a685 --- /dev/null +++ b/adapter/0.2.8.json @@ -0,0 +1,58 @@ +/** + * Copyright © 2016-2018 by IntegrIT S.A. dba Hackolade. All rights reserved. + * + * The copyright to the computer software herein is the property of IntegrIT S.A. + * The software may be used and/or copied only with the written permission of + * IntegrIT S.A. or in accordance with the terms and conditions stipulated in + * the agreement/contract under which the software has been supplied. + * + * { + * "add": { + * "entity": [], + * "container": [], + * "model": [], + * "view": [], + * "field": { + * "": [] + * } + * }, + * "delete": { + * "entity": [], + * "container": [], + * "model": [], + * "view": [], + * "field": { + * "": [] + * } + * }, + * "modify": { + * "entity": [ + * { + * "from": { }, + * "to": { } + * } + * ], + * "container": [], + * "model": [], + * "view": [], + * "field": [] + * }, + * } + */ +{ + "add": {}, + "modify": { + "field": [ + { + "from": { + "primaryKey": true, + "unique": true + }, + "to": { + "unique": false + } + } + ] + }, + "delete": {} +} diff --git a/properties_pane/field_level/fieldLevelConfig.json b/properties_pane/field_level/fieldLevelConfig.json index 54a7be5..49f1861 100644 --- a/properties_pane/field_level/fieldLevelConfig.json +++ b/properties_pane/field_level/fieldLevelConfig.json @@ -349,6 +349,13 @@ making sure that you maintain a proper JSON format. ] } ] + }, + { + "type": "not", + "values": { + "key": "unique", + "value": true + } } ] } @@ -409,12 +416,21 @@ making sure that you maintain a proper JSON format. "type": "or", "values": [ { - "key": "compositePrimaryKey", - "value": false + "type": "or", + "values": [ + { + "key": "primaryKey", + "value": false + }, + { + "key": "primaryKey", + "exist": false + } + ] }, { "key": "compositePrimaryKey", - "exist": false + "value": true } ] }, @@ -808,6 +824,13 @@ making sure that you maintain a proper JSON format. ] } ] + }, + { + "type": "not", + "values": { + "key": "unique", + "value": true + } } ] } @@ -867,12 +890,21 @@ making sure that you maintain a proper JSON format. "type": "or", "values": [ { - "key": "compositePrimaryKey", - "value": false + "type": "or", + "values": [ + { + "key": "primaryKey", + "value": false + }, + { + "key": "primaryKey", + "exist": false + } + ] }, { "key": "compositePrimaryKey", - "exist": false + "value": true } ] }, @@ -1256,6 +1288,13 @@ making sure that you maintain a proper JSON format. ] } ] + }, + { + "type": "not", + "values": { + "key": "unique", + "value": true + } } ] } @@ -1315,12 +1354,21 @@ making sure that you maintain a proper JSON format. "type": "or", "values": [ { - "key": "compositePrimaryKey", - "value": false + "type": "or", + "values": [ + { + "key": "primaryKey", + "value": false + }, + { + "key": "primaryKey", + "exist": false + } + ] }, { "key": "compositePrimaryKey", - "exist": false + "value": true } ] }, @@ -1634,6 +1682,13 @@ making sure that you maintain a proper JSON format. ] } ] + }, + { + "type": "not", + "values": { + "key": "unique", + "value": true + } } ] } @@ -1706,12 +1761,21 @@ making sure that you maintain a proper JSON format. "type": "or", "values": [ { - "key": "compositePrimaryKey", - "value": false + "type": "or", + "values": [ + { + "key": "primaryKey", + "value": false + }, + { + "key": "primaryKey", + "exist": false + } + ] }, { "key": "compositePrimaryKey", - "exist": false + "value": true } ] }, @@ -2077,6 +2141,13 @@ making sure that you maintain a proper JSON format. ] } ] + }, + { + "type": "not", + "values": { + "key": "unique", + "value": true + } } ] } @@ -2149,12 +2220,21 @@ making sure that you maintain a proper JSON format. "type": "or", "values": [ { - "key": "compositePrimaryKey", - "value": false + "type": "or", + "values": [ + { + "key": "primaryKey", + "value": false + }, + { + "key": "primaryKey", + "exist": false + } + ] }, { "key": "compositePrimaryKey", - "exist": false + "value": true } ] }, @@ -2538,6 +2618,13 @@ making sure that you maintain a proper JSON format. ] } ] + }, + { + "type": "not", + "values": { + "key": "unique", + "value": true + } } ] } @@ -2611,12 +2698,21 @@ making sure that you maintain a proper JSON format. "type": "or", "values": [ { - "key": "compositePrimaryKey", - "value": false + "type": "or", + "values": [ + { + "key": "primaryKey", + "value": false + }, + { + "key": "primaryKey", + "exist": false + } + ] }, { "key": "compositePrimaryKey", - "exist": false + "value": true } ] }, @@ -2979,6 +3075,13 @@ making sure that you maintain a proper JSON format. ] } ] + }, + { + "type": "not", + "values": { + "key": "unique", + "value": true + } } ] } @@ -3038,12 +3141,21 @@ making sure that you maintain a proper JSON format. "type": "or", "values": [ { - "key": "compositePrimaryKey", - "value": false + "type": "or", + "values": [ + { + "key": "primaryKey", + "value": false + }, + { + "key": "primaryKey", + "exist": false + } + ] }, { "key": "compositePrimaryKey", - "exist": false + "value": true } ] }, @@ -3407,6 +3519,13 @@ making sure that you maintain a proper JSON format. ] } ] + }, + { + "type": "not", + "values": { + "key": "unique", + "value": true + } } ] } @@ -3466,12 +3585,21 @@ making sure that you maintain a proper JSON format. "type": "or", "values": [ { - "key": "compositePrimaryKey", - "value": false + "type": "or", + "values": [ + { + "key": "primaryKey", + "value": false + }, + { + "key": "primaryKey", + "exist": false + } + ] }, { "key": "compositePrimaryKey", - "exist": false + "value": true } ] }, @@ -3735,12 +3863,21 @@ making sure that you maintain a proper JSON format. "type": "or", "values": [ { - "key": "compositePrimaryKey", - "value": false + "type": "or", + "values": [ + { + "key": "primaryKey", + "value": false + }, + { + "key": "primaryKey", + "exist": false + } + ] }, { "key": "compositePrimaryKey", - "exist": false + "value": true } ] }, @@ -4070,6 +4207,13 @@ making sure that you maintain a proper JSON format. ] } ] + }, + { + "type": "not", + "values": { + "key": "unique", + "value": true + } } ] } @@ -4129,12 +4273,21 @@ making sure that you maintain a proper JSON format. "type": "or", "values": [ { - "key": "compositePrimaryKey", - "value": false + "type": "or", + "values": [ + { + "key": "primaryKey", + "value": false + }, + { + "key": "primaryKey", + "exist": false + } + ] }, { "key": "compositePrimaryKey", - "exist": false + "value": true } ] }, @@ -4451,6 +4604,13 @@ making sure that you maintain a proper JSON format. ] } ] + }, + { + "type": "not", + "values": { + "key": "unique", + "value": true + } } ] } @@ -4510,12 +4670,21 @@ making sure that you maintain a proper JSON format. "type": "or", "values": [ { - "key": "compositePrimaryKey", - "value": false + "type": "or", + "values": [ + { + "key": "primaryKey", + "value": false + }, + { + "key": "primaryKey", + "exist": false + } + ] }, { "key": "compositePrimaryKey", - "exist": false + "value": true } ] }, @@ -4832,6 +5001,13 @@ making sure that you maintain a proper JSON format. ] } ] + }, + { + "type": "not", + "values": { + "key": "unique", + "value": true + } } ] } @@ -4891,12 +5067,21 @@ making sure that you maintain a proper JSON format. "type": "or", "values": [ { - "key": "compositePrimaryKey", - "value": false + "type": "or", + "values": [ + { + "key": "primaryKey", + "value": false + }, + { + "key": "primaryKey", + "exist": false + } + ] }, { "key": "compositePrimaryKey", - "exist": false + "value": true } ] }, @@ -5213,6 +5398,13 @@ making sure that you maintain a proper JSON format. ] } ] + }, + { + "type": "not", + "values": { + "key": "unique", + "value": true + } } ] } @@ -5272,12 +5464,21 @@ making sure that you maintain a proper JSON format. "type": "or", "values": [ { - "key": "compositePrimaryKey", - "value": false + "type": "or", + "values": [ + { + "key": "primaryKey", + "value": false + }, + { + "key": "primaryKey", + "exist": false + } + ] }, { "key": "compositePrimaryKey", - "exist": false + "value": true } ] }, @@ -5594,6 +5795,13 @@ making sure that you maintain a proper JSON format. ] } ] + }, + { + "type": "not", + "values": { + "key": "unique", + "value": true + } } ] } @@ -5653,12 +5861,21 @@ making sure that you maintain a proper JSON format. "type": "or", "values": [ { - "key": "compositePrimaryKey", - "value": false + "type": "or", + "values": [ + { + "key": "primaryKey", + "value": false + }, + { + "key": "primaryKey", + "exist": false + } + ] }, { "key": "compositePrimaryKey", - "exist": false + "value": true } ] },