schema/mysql: Add user and user_preference tables

This commit is contained in:
Eric Lippmann 2014-10-20 16:32:31 +02:00
parent 1bb3a58e8f
commit c2a3770869
1 changed files with 21 additions and 1 deletions

View File

@ -11,5 +11,25 @@ CREATE TABLE `icingaweb_group_membership`(
`username` varchar(64) COLLATE utf8_unicode_ci NOT NULL,
`ctime` timestamp NULL DEFAULT NULL,
`mtime` timestamp NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`group_name`,`username`)
PRIMARY KEY (`group_name`,`username`),
CONSTRAINT `fk_icingaweb_group_membership_icingaweb_group` FOREIGN KEY (`group_name`)
REFERENCES `icingaweb_group` (`name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `icingaweb_user`(
`name` varchar(64) COLLATE utf8_unicode_ci NOT NULL,
`active` tinyint(1) NOT NULL,
`password_hash` varbinary(255) NOT NULL,
`ctime` timestamp NULL DEFAULT NULL,
`mtime` timestamp NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `icingaweb_user_preference`(
`username` varchar(64) COLLATE utf8_unicode_ci NOT NULL,
`name` varchar(64) COLLATE utf8_unicode_ci NOT NULL,
`value` varchar(255) NOT NULL,
`ctime` timestamp NULL DEFAULT NULL,
`mtime` timestamp NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`username`,`name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;