Skip to content

Commit

Permalink
Adjusted constraints
Browse files Browse the repository at this point in the history
  • Loading branch information
Simbiat committed Apr 26, 2021
1 parent e180ea3 commit eb0d891
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/install.sql
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ CREATE TABLE IF NOT EXISTS `%dbprefix%schedule` (
KEY `priority` (`priority`),
KEY `status` (`status`),
KEY `runby` (`runby`),
KEY `lastrun` (`lastrun`)
KEY `lastrun` (`lastrun`),
KEY `arguments` (`arguments`),
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=COMPRESSED;

CREATE TABLE IF NOT EXISTS `%dbprefix%settings` (
Expand Down Expand Up @@ -60,5 +61,8 @@ CREATE TABLE IF NOT EXISTS `%dbprefix%tasks` (
ALTER TABLE `%dbprefix%errors`
ADD CONSTRAINT `errors_to_tasks` FOREIGN KEY (`task`) REFERENCES `%dbprefix%tasks` (`task`) ON DELETE CASCADE ON UPDATE CASCADE;

ALTER TABLE `%dbprefix%errors`
ADD CONSTRAINT `errors_to_arguments` FOREIGN KEY (`arguments`) REFERENCES `%dbprefix%schedule`(`arguments`) ON DELETE CASCADE ON UPDATE CASCADE;

ALTER TABLE `%dbprefix%schedule`
ADD CONSTRAINT `schedule_to_task` FOREIGN KEY (`task`) REFERENCES `%dbprefix%tasks` (`task`) ON DELETE CASCADE ON UPDATE CASCADE;
ADD CONSTRAINT `schedule_to_task` FOREIGN KEY (`task`) REFERENCES `%dbprefix%tasks` (`task`) ON DELETE CASCADE ON UPDATE CASCADE;

0 comments on commit eb0d891

Please sign in to comment.