Add Snapshots and Snapshot_Events Tables. Add HomeView to Users.

This commit is contained in:
Isaac Connor 2021-03-12 09:26:13 -05:00
parent 786adc5511
commit 620806a1bf
1 changed files with 21 additions and 0 deletions

View File

@ -677,6 +677,7 @@ CREATE TABLE `Users` (
`MonitorIds` text,
`TokenMinExpiry` BIGINT UNSIGNED NOT NULL DEFAULT 0,
`APIEnabled` tinyint(3) UNSIGNED NOT NULL default 1,
`HomeView` varchar(64) NOT NULL DEFAULT '',
PRIMARY KEY (`Id`),
UNIQUE KEY `UC_Username` (`Username`)
) ENGINE=@ZM_MYSQL_ENGINE@;
@ -1046,6 +1047,26 @@ CREATE TABLE Sessions (
PRIMARY KEY(id)
) ENGINE=InnoDB;
CREATE TABLE Snapshots (
`Id` int(10) unsigned NOT NULL auto_increment,
`Name` VARCHAR(64),
`Description` TEXT,
`CreatedBy` int(10),
`CreatedOn` datetime default NULL,
PRIMARY KEY(Id)
) ENGINE=InnoDB;
CREATE TABLE Snapshot_Events (
`Id` int(10) unsigned NOT NULL auto_increment,
`SnapshotId` int(10) unsigned NOT NULL,
FOREIGN KEY (`SnapshotId`) REFERENCES `Snapshots` (`Id`) ON DELETE CASCADE,
`EventId` bigint unsigned NOT NULL,
FOREIGN KEY (`EventId`) REFERENCES `Events` (`Id`) ON DELETE CASCADE,
KEY `Snapshot_Events_SnapshotId_idx` (`SnapshotId`),
PRIMARY KEY(Id)
) ENGINE=InnoDB;
-- 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
--