forked from science-ation/science-ation
26 lines
861 B
MySQL
26 lines
861 B
MySQL
|
CREATE TABLE `accounts` (
|
||
|
`id` INT NOT NULL ,
|
||
|
`username` VARCHAR( 64 ) NOT NULL ,
|
||
|
`password` VARCHAR( 64 ) NOT NULL ,
|
||
|
`email` VARCHAR( 256 ) NULL ,
|
||
|
PRIMARY KEY ( `id` ) ,
|
||
|
UNIQUE ( `username` )
|
||
|
) ENGINE = MYISAM CHARACTER SET utf8 COLLATE utf8_general_ci;
|
||
|
|
||
|
CREATE TABLE `roles` (
|
||
|
`id` INT NOT NULL AUTO_INCREMENT PRIMARY KEY ,
|
||
|
`role_type` VARCHAR( 256 ) NOT NULL ,
|
||
|
`role_name` VARCHAR( 256 ) NOT NULL ,
|
||
|
UNIQUE ( `role_type` )
|
||
|
) ENGINE = MYISAM CHARACTER SET utf8 COLLATE utf8_general_ci;
|
||
|
|
||
|
CREATE TABLE `user_roles` (
|
||
|
`id` INT NOT NULL AUTO_INCREMENT PRIMARY KEY ,
|
||
|
`accounts_id` INT NOT NULL ,
|
||
|
`users_id` INT NOT NULL ,
|
||
|
`conferences_id` INT NOT NULL ,
|
||
|
`roles_id` INT NOT NULL ,
|
||
|
`active` ENUM( 'no', 'yes' ) NOT NULL DEFAULT 'yes',
|
||
|
`complete` ENUM( 'no', 'yes' ) NOT NULL DEFAULT 'no'
|
||
|
) ENGINE = MYISAM CHARACTER SET utf8 COLLATE utf8_general_ci;
|