18 lines
1.0 KiB
SQL
18 lines
1.0 KiB
SQL
CREATE TABLE `vn`.`zoneLog` (
|
|
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
|
|
`originFk` int(10) NOT NULL,
|
|
`userFk` int(10) unsigned DEFAULT NULL,
|
|
`action` set('insert','update','delete') COLLATE utf8_unicode_ci NOT NULL,
|
|
`creationDate` timestamp NULL DEFAULT current_timestamp(),
|
|
`description` text CHARACTER SET utf8 DEFAULT NULL,
|
|
`changedModel` varchar(45) COLLATE utf8_unicode_ci DEFAULT NULL,
|
|
`oldInstance` text COLLATE utf8_unicode_ci DEFAULT NULL,
|
|
`newInstance` text COLLATE utf8_unicode_ci DEFAULT NULL,
|
|
`changedModelId` int(11) DEFAULT NULL,
|
|
`changedModelValue` varchar(45) COLLATE utf8_unicode_ci DEFAULT NULL,
|
|
PRIMARY KEY (`id`),
|
|
KEY `originFk` (`originFk`),
|
|
KEY `userFk` (`userFk`),
|
|
CONSTRAINT `zoneLog_ibfk_1` FOREIGN KEY (`originFk`) REFERENCES `vn`.`zone` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
|
|
CONSTRAINT `zoneLog_ibfk_2` FOREIGN KEY (`userFk`) REFERENCES `account`.`user` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
|
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; |