Skip to content
Snippets Groups Projects
Commit 086b5aae authored by Henrik tom Wörden's avatar Henrik tom Wörden
Browse files

ENH: add real_property_id column

parent 26292eb6
No related branches found
No related tags found
No related merge requests found
Pipeline #25480 failed
...@@ -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;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment