-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make ContainerQueue.containerId not nullable (#227)
- Loading branch information
Showing
1 changed file
with
15 additions
and
0 deletions.
There are no files selected for viewing
15 changes: 15 additions & 0 deletions
15
schemas/ispyb/updates/2024_03_19_ContainerQueue_containerId_not_null.sql
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,15 @@ | ||
INSERT IGNORE INTO SchemaStatus (scriptName, schemaStatus) VALUES ('2024_03_19_ContainerQueue_containerId_not_null.sql', 'ONGOING'); | ||
|
||
ALTER TABLE ContainerQueue | ||
DROP CONSTRAINT IF EXISTS ContainerQueue_ibfk1, | ||
DROP INDEX IF EXISTS ContainerQueue_idx1, | ||
MODIFY containerId int(10) unsigned NOT NULL; | ||
|
||
ALTER TABLE ContainerQueue | ||
ADD INDEX ContainerQueue_idx1 (containerId, completedTimeStamp), | ||
ADD CONSTRAINT `ContainerQueue_ibfk1` | ||
FOREIGN KEY ContainerQueue_idx1 (`containerId`) | ||
REFERENCES `Container` (`containerId`) | ||
ON DELETE CASCADE ON UPDATE CASCADE; | ||
|
||
UPDATE SchemaStatus SET schemaStatus = 'DONE' WHERE scriptName = '2024_03_19_ContainerQueue_containerId_not_null.sql'; |