-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #334 from OPUS4/issue206
Beliebige Identifier-Typen in Datenbank erlauben
- Loading branch information
Showing
4 changed files
with
40 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
START TRANSACTION; | ||
|
||
-- Replace identifier type ENUM with VARCHAR to allow any type | ||
|
||
ALTER TABLE `document_identifiers` | ||
ADD COLUMN `typestr` VARCHAR(10) NULL COMMENT 'Type of identifier'; | ||
|
||
UPDATE `document_identifiers` | ||
SET `typestr` = CAST(`type` as CHAR); | ||
|
||
ALTER TABLE `document_identifiers` | ||
DROP INDEX `fk_document_identifiers_documents_type`; | ||
|
||
ALTER TABLE `document_identifiers` | ||
DROP COLUMN `type`; | ||
|
||
ALTER TABLE `document_identifiers` | ||
RENAME COLUMN `typestr` TO `type`; | ||
|
||
ALTER TABLE `document_identifiers` | ||
ADD INDEX `fk_document_identifiers_documents_type` (`document_id` ASC, `type` ASC); | ||
|
||
-- Update database version | ||
|
||
TRUNCATE TABLE `schema_version`; | ||
INSERT INTO `schema_version` (`version`) VALUES (21); | ||
|
||
COMMIT; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters