Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
C
caosdb-mysqlbackend
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
caosdb
Software
caosdb-mysqlbackend
Commits
086b5aae
Commit
086b5aae
authored
Jul 9, 2022
by
Henrik tom Wörden
Browse files
Options
Downloads
Patches
Plain Diff
ENH: add real_property_id column
parent
26292eb6
No related branches found
No related tags found
No related merge requests found
Pipeline
#25480
failed
Jul 9, 2022
Stage: test
Stage: deploy
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
procedures/insertEntityProperty.sql
+21
-19
21 additions, 19 deletions
procedures/insertEntityProperty.sql
with
21 additions
and
19 deletions
procedures/insertEntityProperty.sql
+
21
−
19
View file @
086b5aae
...
@@ -37,7 +37,9 @@ CREATE PROCEDURE db_5_0.insertEntityProperty(
...
@@ -37,7 +37,9 @@ CREATE PROCEDURE db_5_0.insertEntityProperty(
in
DescOverride
TEXT
,
in
DescOverride
TEXT
,
in
DatatypeOverride
INT
UNSIGNED
,
in
DatatypeOverride
INT
UNSIGNED
,
in
Collection
VARCHAR
(
255
),
in
Collection
VARCHAR
(
255
),
in
PropertyIndex
INT
UNSIGNED
)
in
PropertyIndex
INT
UNSIGNED
,
in
RealPropertyID
INT
UNSIGNED
,
)
BEGIN
BEGIN
DECLARE
ReferenceValueIVersion
INT
UNSIGNED
DEFAULT
NULL
;
DECLARE
ReferenceValueIVersion
INT
UNSIGNED
DEFAULT
NULL
;
DECLARE
ReferenceValue
INT
UNSIGNED
DEFAULT
NULL
;
DECLARE
ReferenceValue
INT
UNSIGNED
DEFAULT
NULL
;
...
@@ -46,19 +48,19 @@ BEGIN
...
@@ -46,19 +48,19 @@ BEGIN
CASE
Datatable
CASE
Datatable
WHEN
'double_data'
THEN
WHEN
'double_data'
THEN
INSERT
INTO
double_data
INSERT
INTO
double_data
(
domain_id
,
entity_id
,
property_id
,
value
,
unit_sig
,
status
,
pidx
)
(
domain_id
,
entity_id
,
property_id
,
value
,
unit_sig
,
status
,
pidx
,
real_property_id
)
VALUES
VALUES
(
DomainID
,
EntityID
,
PropertyID
,
PropertyValue
,
PropertyUnitSig
,
PropertyStatus
,
PropertyIndex
);
(
DomainID
,
EntityID
,
PropertyID
,
PropertyValue
,
PropertyUnitSig
,
PropertyStatus
,
PropertyIndex
,
RealPropertyID
);
WHEN
'integer_data'
THEN
WHEN
'integer_data'
THEN
INSERT
INTO
integer_data
INSERT
INTO
integer_data
(
domain_id
,
entity_id
,
property_id
,
value
,
unit_sig
,
status
,
pidx
)
(
domain_id
,
entity_id
,
property_id
,
value
,
unit_sig
,
status
,
pidx
,
real_property_id
)
VALUES
VALUES
(
DomainID
,
EntityID
,
PropertyID
,
PropertyValue
,
PropertyUnitSig
,
PropertyStatus
,
PropertyIndex
);
(
DomainID
,
EntityID
,
PropertyID
,
PropertyValue
,
PropertyUnitSig
,
PropertyStatus
,
PropertyIndex
,
RealPropertyID
);
WHEN
'datetime_data'
THEN
WHEN
'datetime_data'
THEN
INSERT
INTO
datetime_data
INSERT
INTO
datetime_data
(
domain_id
,
entity_id
,
property_id
,
value
,
value_ns
,
status
,
pidx
)
(
domain_id
,
entity_id
,
property_id
,
value
,
value_ns
,
status
,
pidx
,
real_property_id
)
VALUES
VALUES
(
DomainID
,
EntityID
,
PropertyID
,
SUBSTRING_INDEX
(
PropertyValue
,
'UTC'
,
1
),
IF
(
SUBSTRING_INDEX
(
PropertyValue
,
'UTC'
,
-
1
)
=
''
,
NULL
,
SUBSTRING_INDEX
(
PropertyValue
,
'UTC'
,
-
1
)),
PropertyStatus
,
PropertyIndex
);
(
DomainID
,
EntityID
,
PropertyID
,
SUBSTRING_INDEX
(
PropertyValue
,
'UTC'
,
1
),
IF
(
SUBSTRING_INDEX
(
PropertyValue
,
'UTC'
,
-
1
)
=
''
,
NULL
,
SUBSTRING_INDEX
(
PropertyValue
,
'UTC'
,
-
1
)),
PropertyStatus
,
PropertyIndex
,
RealPropertyID
);
WHEN
'reference_data'
THEN
WHEN
'reference_data'
THEN
-- special handling if versioning enabled and specific version of referenced entity is given.
-- special handling if versioning enabled and specific version of referenced entity is given.
...
@@ -78,35 +80,35 @@ BEGIN
...
@@ -78,35 +80,35 @@ BEGIN
INSERT
INTO
reference_data
INSERT
INTO
reference_data
(
domain_id
,
entity_id
,
property_id
,
value
,
value_iversion
,
status
,
(
domain_id
,
entity_id
,
property_id
,
value
,
value_iversion
,
status
,
pidx
)
pidx
,
real_property_id
)
VALUES
VALUES
(
DomainID
,
EntityID
,
PropertyID
,
ReferenceValue
,
(
DomainID
,
EntityID
,
PropertyID
,
ReferenceValue
,
ReferenceValueIVersion
,
PropertyStatus
,
PropertyIndex
);
ReferenceValueIVersion
,
PropertyStatus
,
PropertyIndex
,
RealPropertyID
);
WHEN
'enum_data'
THEN
WHEN
'enum_data'
THEN
INSERT
INTO
enum_data
INSERT
INTO
enum_data
(
domain_id
,
entity_id
,
property_id
,
value
,
status
,
pidx
)
(
domain_id
,
entity_id
,
property_id
,
value
,
status
,
pidx
,
real_property_id
)
VALUES
VALUES
(
DomainID
,
EntityID
,
PropertyID
,
PropertyValue
,
PropertyStatus
,
PropertyIndex
);
(
DomainID
,
EntityID
,
PropertyID
,
PropertyValue
,
PropertyStatus
,
PropertyIndex
,
RealPropertyID
);
WHEN
'date_data'
THEN
WHEN
'date_data'
THEN
INSERT
INTO
date_data
INSERT
INTO
date_data
(
domain_id
,
entity_id
,
property_id
,
value
,
status
,
pidx
)
(
domain_id
,
entity_id
,
property_id
,
value
,
status
,
pidx
,
real_property_id
)
VALUES
VALUES
(
DomainID
,
EntityID
,
PropertyID
,
SUBSTRING_INDEX
(
PropertyValue
,
'.'
,
1
),
PropertyStatus
,
PropertyIndex
);
(
DomainID
,
EntityID
,
PropertyID
,
SUBSTRING_INDEX
(
PropertyValue
,
'.'
,
1
),
PropertyStatus
,
PropertyIndex
,
RealPropertyID
);
WHEN
'text_data'
THEN
WHEN
'text_data'
THEN
INSERT
INTO
text_data
INSERT
INTO
text_data
(
domain_id
,
entity_id
,
property_id
,
value
,
status
,
pidx
)
(
domain_id
,
entity_id
,
property_id
,
value
,
status
,
pidx
,
real_property_id
)
VALUES
VALUES
(
DomainID
,
EntityID
,
PropertyID
,
PropertyValue
,
PropertyStatus
,
PropertyIndex
);
(
DomainID
,
EntityID
,
PropertyID
,
PropertyValue
,
PropertyStatus
,
PropertyIndex
,
RealPropertyID
);
WHEN
'null_data'
THEN
WHEN
'null_data'
THEN
INSERT
INTO
null_data
INSERT
INTO
null_data
(
domain_id
,
entity_id
,
property_id
,
status
,
pidx
)
(
domain_id
,
entity_id
,
property_id
,
status
,
pidx
,
real_property_id
)
VALUES
VALUES
(
DomainID
,
EntityID
,
PropertyID
,
PropertyStatus
,
PropertyIndex
);
(
DomainID
,
EntityID
,
PropertyID
,
PropertyStatus
,
PropertyIndex
,
RealPropertyID
);
WHEN
'name_data'
THEN
WHEN
'name_data'
THEN
INSERT
INTO
name_data
INSERT
INTO
name_data
(
domain_id
,
entity_id
,
property_id
,
value
,
status
,
pidx
)
(
domain_id
,
entity_id
,
property_id
,
value
,
status
,
pidx
,
real_property_id
)
VALUES
VALUES
(
DomainID
,
EntityID
,
PropertyID
,
PropertyValue
,
PropertyStatus
,
PropertyIndex
);
(
DomainID
,
EntityID
,
PropertyID
,
PropertyValue
,
PropertyStatus
,
PropertyIndex
,
RealPropertyID
);
ELSE
ELSE
SELECT
*
FROM
table_does_not_exist
;
SELECT
*
FROM
table_does_not_exist
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment