Skip to content

Commit 4b17d15

Browse files
authored
Merge pull request #2 from DrMyroslav/HCK-1255-enforce-unique-primary-key
enforce PK
2 parents 9184647 + af11328 commit 4b17d15

File tree

4 files changed

+1193
-155
lines changed

4 files changed

+1193
-155
lines changed

adapter/0.1.20.json

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
/**
2+
* Copyright © 2016-2018 by IntegrIT S.A. dba Hackolade. All rights reserved.
3+
*
4+
* The copyright to the computer software herein is the property of IntegrIT S.A.
5+
* The software may be used and/or copied only with the written permission of
6+
* IntegrIT S.A. or in accordance with the terms and conditions stipulated in
7+
* the agreement/contract under which the software has been supplied.
8+
*
9+
* {
10+
* "add": {
11+
* "entity": [<names of new property>],
12+
* "container": [<names of new property>],
13+
* "model": [<names of new property>],
14+
* "view": [<names of new property>],
15+
* "field": {
16+
* "<type>": [<names of new property>]
17+
* }
18+
* },
19+
* "delete": {
20+
* "entity": [<names of new property>],
21+
* "container": [<names of new property>],
22+
* "model": [<names of new property>],
23+
* "view": [<names of new property>],
24+
* "field": {
25+
* "<type>": [<names of new property>]
26+
* }
27+
* },
28+
* "modify": {
29+
* "entity": [
30+
* {
31+
* "from": { <properties that identify record> },
32+
* "to": { <properties that need to be changed> }
33+
* }
34+
* ],
35+
* "container": [],
36+
* "model": [],
37+
* "view": [],
38+
* "field": []
39+
* },
40+
* }
41+
*/
42+
{
43+
"modify": {
44+
"entity": [
45+
[
46+
"setRdbmEntityCompositeKeys",
47+
"primaryKey",
48+
"compositePrimaryKey",
49+
"primaryKey",
50+
[
51+
"unique",
52+
"compositePrimaryKey",
53+
"compositeUniqueKey"
54+
]
55+
]
56+
]
57+
}
58+
}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"versionDate": "2022-05-13",
55
"author": "hackolade",
66
"engines": {
7-
"hackolade": "6.0.8",
7+
"hackolade": "6.1.2",
88
"hackoladePlugin": "1.2.0"
99
},
1010
"contributes": {

properties_pane/entity_level/entityLevelConfig.json

Lines changed: 72 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -638,7 +638,38 @@ making sure that you maintain a proper JSON format.
638638
"propertyType": "group",
639639
"groupItemLimit": 1,
640640
"propertyKeyword": "primaryKey",
641-
"propertyTooltip": "",
641+
"propertyTooltip": {
642+
"disabled": [
643+
{
644+
"tooltip": "Remove the existing single column primary key definition prior to unlock the possibility to create a composite primary key definition for this table",
645+
"dependency": {
646+
"type": "and",
647+
"values": [
648+
{
649+
"level": "children",
650+
"key": "primaryKey",
651+
"value": true
652+
},
653+
{
654+
"type": "not",
655+
"values": {
656+
"level": "children",
657+
"key": "compositePrimaryKey",
658+
"value": true
659+
}
660+
}
661+
]
662+
}
663+
},
664+
{
665+
"tooltip": "Remove or update the existing composite primary key definition prior to unlock the possibility to create a new composite primary key definition for this table",
666+
"dependency": {
667+
"key": "primaryKey",
668+
"minLength": 1
669+
}
670+
}
671+
]
672+
},
642673
"structure": [
643674
{
644675
"propertyName": "Constraint name",
@@ -681,6 +712,46 @@ making sure that you maintain a proper JSON format.
681712
"propertyType": "details",
682713
"template": "textarea"
683714
}
715+
],
716+
"disabledOnCondition": [
717+
{
718+
"level": "children",
719+
"value": {
720+
"type": "and",
721+
"values": [
722+
{
723+
"key": "primaryKey",
724+
"value": true
725+
},
726+
{
727+
"type": "or",
728+
"values": [
729+
{
730+
"key": "compositePrimaryKey",
731+
"value": false
732+
},
733+
{
734+
"key": "compositePrimaryKey",
735+
"exist": false
736+
}
737+
]
738+
},
739+
{
740+
"type": "or",
741+
"values": [
742+
{
743+
"key": "compositeUniqueKey",
744+
"value": false
745+
},
746+
{
747+
"key": "compositeUniqueKey",
748+
"exist": false
749+
}
750+
]
751+
}
752+
]
753+
}
754+
}
684755
]
685756
},
686757
{

0 commit comments

Comments
 (0)