1
0
mirror of https://github.com/chylex/Lightning-Tracker.git synced 2024-11-24 22:42:50 +01:00
Lightning-Tracker/res/~database/TrackerRoleTable.sql

16 lines
451 B
SQL

CREATE TABLE IF NOT EXISTS `tracker_roles` (
`id` INT NOT NULL AUTO_INCREMENT,
`tracker_id` INT NOT NULL,
`title` VARCHAR(32) NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY (`tracker_id`, `title`),
KEY (`id`, `tracker_id`),
# Needed for role-tracker pair checks.
FOREIGN KEY (`tracker_id`)
REFERENCES `trackers` (`id`)
ON UPDATE CASCADE
ON DELETE CASCADE
) ENGINE = InnoDB
DEFAULT CHARSET = utf8mb4
COLLATE utf8mb4_general_ci