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
ef41343a
Verified
Commit
ef41343a
authored
Aug 12, 2020
by
Timm Fitschen
Browse files
Options
Downloads
Patches
Plain Diff
FIX: collection_type constraint
parent
d3d5c099
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
patches/patch20200710-3.0.0-rc2/versioning.sql
+6
-6
6 additions, 6 deletions
patches/patch20200710-3.0.0-rc2/versioning.sql
tests/test_autotap.sql
+4
-4
4 additions, 4 deletions
tests/test_autotap.sql
with
10 additions
and
10 deletions
patches/patch20200710-3.0.0-rc2/versioning.sql
+
6
−
6
View file @
ef41343a
...
...
@@ -58,7 +58,7 @@ CREATE TABLE entity_version (
PRIMARY
KEY
(
`entity_id`
,
`_iversion`
),
FOREIGN
KEY
(
`entity_id`
)
REFERENCES
`entities`
(
`id`
)
ON
DELETE
CASCADE
,
FOREIGN
KEY
(
`srid`
)
REFERENCES
`transactions`
(
`srid`
),
UNIQUE
(
`entity_id`
,
`version`
)
UNIQUE
`entity_version-e-v`
(
`entity_id`
,
`version`
)
)
ENGINE
=
InnoDB
;
ALTER
TABLE
reference_data
...
...
@@ -230,7 +230,7 @@ CREATE TABLE archive_name_overrides (
property_id
INT
UNSIGNED
NOT
NULL
,
name
VARCHAR
(
255
)
NOT
NULL
,
_iversion
INT
UNSIGNED
NOT
NULL
,
UNIQUE
KEY
(
`domain_id`
,
`entity_id`
,
`property_id`
,
`_iversion`
),
UNIQUE
KEY
`archive_name_overrides-d-e-p-v`
(
`domain_id`
,
`entity_id`
,
`property_id`
,
`_iversion`
),
KEY
(
`domain_id`
,
`entity_id`
,
`_iversion`
),
KEY
(
`domain_id`
,
`_iversion`
),
FOREIGN
KEY
(
`domain_id`
)
REFERENCES
`entities`
(
`id`
)
ON
DELETE
CASCADE
,
...
...
@@ -244,7 +244,7 @@ CREATE TABLE archive_desc_overrides (
property_id
INT
UNSIGNED
NOT
NULL
,
description
TEXT
NOT
NULL
,
_iversion
INT
UNSIGNED
NOT
NULL
,
UNIQUE
KEY
(
`domain_id`
,
`entity_id`
,
`property_id`
,
`_iversion`
),
UNIQUE
KEY
`archive_desc_overrides-d-e-p-v`
(
`domain_id`
,
`entity_id`
,
`property_id`
,
`_iversion`
),
KEY
(
`domain_id`
,
`entity_id`
,
`_iversion`
),
KEY
(
`domain_id`
,
`_iversion`
),
FOREIGN
KEY
(
`domain_id`
)
REFERENCES
`entities`
(
`id`
)
ON
DELETE
CASCADE
,
...
...
@@ -258,7 +258,7 @@ CREATE TABLE archive_data_type (
property_id
INT
UNSIGNED
NOT
NULL
,
datatype
INT
UNSIGNED
NOT
NULL
,
_iversion
INT
UNSIGNED
NOT
NULL
,
UNIQUE
KEY
(
`domain_id`
,
`entity_id`
,
`property_id`
,
`_iversion`
),
UNIQUE
KEY
`archive_data_type-d-e-p-v`
(
`domain_id`
,
`entity_id`
,
`property_id`
,
`_iversion`
),
KEY
(
`domain_id`
,
`entity_id`
,
`_iversion`
),
KEY
(
`domain_id`
,
`_iversion`
),
FOREIGN
KEY
(
`domain_id`
)
REFERENCES
`entities`
(
`id`
)
ON
DELETE
CASCADE
,
...
...
@@ -273,7 +273,7 @@ CREATE TABLE archive_collection_type (
property_id
INT
UNSIGNED
NOT
NULL
,
collection
VARCHAR
(
255
)
NOT
NULL
,
_iversion
INT
UNSIGNED
NOT
NULL
,
UNIQUE
KEY
(
`domain_id`
,
`entity_id`
,
`property_id`
,
`_iversion`
),
UNIQUE
KEY
`archive_collection_type-d-e-p-v`
(
`domain_id`
,
`entity_id`
,
`property_id`
,
`_iversion`
),
KEY
(
`domain_id`
,
`entity_id`
,
`_iversion`
),
KEY
(
`domain_id`
,
`_iversion`
),
FOREIGN
KEY
(
`domain_id`
)
REFERENCES
`entities`
(
`id`
)
ON
DELETE
CASCADE
,
...
...
@@ -314,6 +314,6 @@ CREATE TABLE archive_entities (
FOREIGN
KEY
(
`acl`
)
REFERENCES
`entity_acl`
(
`id`
)
)
ENGINE
=
InnoDB
;
ALTER
IGNORE
TABLE
collection_type
ADD
UNIQUE
KEY
`collection_type-d-e-p`
(
`domain_id`
,
`entity_id`
,
`property_id`
);
INSERT
INTO
feature_config
(
_key
,
_value
)
VALUES
(
"ENTITY_VERSIONING"
,
"ENABLED"
);
This diff is collapsed.
Click to expand it.
tests/test_autotap.sql
+
4
−
4
View file @
ef41343a
...
...
@@ -102,7 +102,7 @@ SELECT tap.index_is_type('_caosdb_schema_unit_tests','collection_type','property
SELECT
tap
.
is_indexed
(
'_caosdb_schema_unit_tests'
,
'collection_type'
,
'`property_id`'
,
''
);
-- CONSTRAINTS
SELECT
tap
.
constraints_are
(
'_caosdb_schema_unit_tests'
,
'collection_type'
,
'`collection_type_domain_id_entity`,`collection_type_entity_id_entity`,`collection_type_property_id_entity`'
,
''
);
SELECT
tap
.
constraints_are
(
'_caosdb_schema_unit_tests'
,
'collection_type'
,
'`collection_type
-d-e-p`,`collection_type
_domain_id_entity`,`collection_type_entity_id_entity`,`collection_type_property_id_entity`'
,
''
);
-- CONSTRAINT collection_type.collection_type_domain_id_entity
...
...
@@ -2291,12 +2291,12 @@ SELECT tap.col_charset_is('_caosdb_schema_unit_tests','entity_version','srid',NU
SELECT
tap
.
col_collation_is
(
'_caosdb_schema_unit_tests'
,
'entity_version'
,
'srid'
,
NULL
,
''
);
-- CONSTRAINTS
SELECT
tap
.
constraints_are
(
'_caosdb_schema_unit_tests'
,
'entity_version'
,
'`entity_
id
`,`PRIMARY`,`entity_version_ibfk_1`,`entity_version_ibfk_2`'
,
''
);
SELECT
tap
.
constraints_are
(
'_caosdb_schema_unit_tests'
,
'entity_version'
,
'`entity_
version-e-v
`,`PRIMARY`,`entity_version_ibfk_1`,`entity_version_ibfk_2`'
,
''
);
-- CONSTRAINT entity_version.entity_id
SELECT
tap
.
has_constraint
(
'_caosdb_schema_unit_tests'
,
'entity_version'
,
'entity_
id
'
,
''
);
SELECT
tap
.
constraint_type_is
(
'_caosdb_schema_unit_tests'
,
'entity_version'
,
'entity_
id
'
,
'UNIQUE'
,
''
);
SELECT
tap
.
has_constraint
(
'_caosdb_schema_unit_tests'
,
'entity_version'
,
'entity_
version-e-v
'
,
''
);
SELECT
tap
.
constraint_type_is
(
'_caosdb_schema_unit_tests'
,
'entity_version'
,
'entity_
version-e-v
'
,
'UNIQUE'
,
''
);
-- CONSTRAINT entity_version.PRIMARY
...
...
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