mirror of
https://github.com/ZoneMinder/zoneminder.git
synced 2026-05-18 11:35:15 -04:00
Add Tags and Event_Tags tables to db creation
This commit is contained in:
@@ -1219,6 +1219,26 @@ CREATE TABLE Reports (
|
||||
PRIMARY KEY(Id)
|
||||
) ENGINE=@ZM_MYSQL_ENGINE@;
|
||||
|
||||
CREATE TABLE `Tags` (
|
||||
`Id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
|
||||
`Name` varchar(64) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '',
|
||||
`CreateDate` TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
|
||||
`CreatedBy` int(10) unsigned,
|
||||
`LastAssignedDate` dateTime,
|
||||
PRIMARY KEY (`Id`),
|
||||
UNIQUE(`Name`)
|
||||
) ENGINE=@ZM_MYSQL_ENGINE@;
|
||||
|
||||
CREATE TABLE `Events_Tags` (
|
||||
`TagId` bigint(20) unsigned NOT NULL,
|
||||
`EventId` bigint(20) unsigned NOT NULL,
|
||||
`AssignedDate` TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
|
||||
`AssignedBy` int(10) unsigned,
|
||||
PRIMARY KEY (`TagId`, `EventId`),
|
||||
CONSTRAINT `Events_Tags_ibfk_1` FOREIGN KEY (`TagId`) REFERENCES `Tags` (`Id`) ON DELETE CASCADE,
|
||||
CONSTRAINT `Events_Tags_ibfk_2` FOREIGN KEY (`EventId`) REFERENCES `Events` (`Id`) ON DELETE CASCADE
|
||||
) ENGINE=@ZM_MYSQL_ENGINE@;
|
||||
|
||||
-- We generally don't alter triggers, we drop and re-create them, so let's keep them in a separate file that we can just source in update scripts.
|
||||
source @PKGDATADIR@/db/triggers.sql
|
||||
|
||||
|
||||
Reference in New Issue
Block a user