Skip to content

Commit

Permalink
Make ContainerQueue.containerId not nullable (#227)
Browse files Browse the repository at this point in the history
  • Loading branch information
KarlLevik authored Mar 19, 2024
1 parent 707ec92 commit 1032009
Showing 1 changed file with 15 additions and 0 deletions.
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';

0 comments on commit 1032009

Please sign in to comment.