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
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
caosdb
Software
caosdb-mysqlbackend
Commits
f5dbeccc
Verified
Commit
f5dbeccc
authored
1 year ago
by
Timm Fitschen
Browse files
Options
Downloads
Patches
Plain Diff
WIP: String IDs
parent
a4b158c4
No related branches found
No related tags found
3 merge requests
!17
Release 6.0
,
!15
External String IDs
,
!11
DRAFT: file system cleanup
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
patches/patch20221122-6.0-SNAPSHOT/create_entity_ids_table.sql
+9
-1
9 additions, 1 deletion
...es/patch20221122-6.0-SNAPSHOT/create_entity_ids_table.sql
procedures/initAutoIncrement.sql
+0
-40
0 additions, 40 deletions
procedures/initAutoIncrement.sql
with
9 additions
and
41 deletions
patches/patch20221122-6.0-SNAPSHOT/create_entity_ids_table.sql
+
9
−
1
View file @
f5dbeccc
...
...
@@ -5,6 +5,8 @@ DROP PROCEDURE IF EXISTS retrieveGroup;
DROP
PROCEDURE
IF
EXISTS
getInfo
;
DROP
PROCEDURE
IF
EXISTS
getRole
;
DROP
PROCEDURE
IF
EXISTS
setPassword
;
DROP
PROCEDURE
IF
EXISTS
initAutoIncrement
;
DELETE
FROM
entities
WHERE
id
=
99
;
-- new entity_ids table
...
...
@@ -17,4 +19,10 @@ CREATE TABLE `entity_ids` (
)
ENGINE
=
InnoDB
;
-- fill all existing entities into the new entity_ids table.
INSERT
INTO
entity_ids
(
id
,
internal_id
)
SELECT
id
,
id
FROM
entities
WHERE
id
>
0
AND
role
!=
"DOMAIN"
;
INSERT
INTO
entity_ids
(
id
,
internal_id
)
SELECT
id
,
id
FROM
entities
WHERE
id
>
0
AND
role
!=
"DOMAIN"
AND
id
!=
50
;
ALTER
TABLE
transaction_log
MODIFY
COLUMN
`entity_id`
VARCHAR
(
255
)
NOT
NULL
;
ALTER
TABLE
user_info
DROP
CONSTRAINT
`subjects_ibfk_1`
;
ALTER
TABle
user_info
MODIFY
COLUMN
`entity`
VARCHAR
(
255
)
DEFAULT
NULL
;
ALTER
TABLE
user_info
ADD
CONSTRAINT
`subjects_ibfk_2`
FOREIGN
KEY
(
`entity`
)
REFERENCES
`entity_ids`
(
`id`
);
This diff is collapsed.
Click to expand it.
procedures/initAutoIncrement.sql
deleted
100644 → 0
+
0
−
40
View file @
a4b158c4
/*
* ** header v3.0
* This file is a part of the CaosDB Project.
*
* Copyright (C) 2018 Research Group Biomedical Physics,
* Max-Planck-Institute for Dynamics and Self-Organization Göttingen
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*
* ** end header
*/
DROP
PROCEDURE
IF
EXISTS
db_5_0
.
initAutoIncrement
;
delimiter
//
CREATE
PROCEDURE
db_5_0
.
initAutoIncrement
()
BEGIN
SELECT
@
max
:
=
MAX
(
entity_id
)
+
1
FROM
transaction_log
;
IF
@
max
IS
NOT
NULL
THEN
SET
@
stmtStr
=
CONCAT
(
'ALTER TABLE entities AUTO_INCREMENT='
,
@
max
);
PREPARE
stmt
FROM
@
stmtStr
;
EXECUTE
stmt
;
DEALLOCATE
PREPARE
stmt
;
END
IF
;
END
;
//
delimiter
;
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