sql

Sql code posted
created at 07 Jul 13:21, updated at 07 Jul 18:10

Edit | Back
1
2
3
4
5
6
7
8
9
10
11
12
13
CREATE TABLE `accountActivity` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `activityTypeId` int(11) NOT NULL,
  `description` varchar(255) NOT NULL,
  `username` varchar(100) NOT NULL,
  `eventTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  UNIQUE KEY `id_UNIQUE` (`id`),
  KEY `fk_accountActivity_user1` (`username`),
  KEY `fk_accountActivity_activityType1` (`activityTypeId`),
  CONSTRAINT `fk_accountActivity_activityType1` FOREIGN KEY (`activityTypeId`) REFERENCES `activityType` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `fk_accountActivity_user1` FOREIGN KEY (`username`) REFERENCES `user` (`userName`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=latin1
770 Bytes in 3 ms with coderay