fic2014.sql: add some unique constraints
This commit is contained in:
parent
5de5775310
commit
a6ecd0f432
@ -87,7 +87,8 @@ CREATE TABLE IF NOT EXISTS `solved` (
|
||||
`id_team` int(10) unsigned NOT NULL,
|
||||
`id_exercice` varchar(100) COLLATE utf8_unicode_ci NOT NULL,
|
||||
`time` datetime NOT NULL,
|
||||
PRIMARY KEY (`id`)
|
||||
PRIMARY KEY (`id`),
|
||||
UNIQUE (id_team, id_exercice)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1 ;
|
||||
|
||||
-- --------------------------------------------------------
|
||||
@ -98,7 +99,7 @@ CREATE TABLE IF NOT EXISTS `solved` (
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `teams` (
|
||||
`id` smallint(5) unsigned NOT NULL AUTO_INCREMENT,
|
||||
`team_name` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
|
||||
`team_name` varchar(255) COLLATE utf8_unicode_ci NOT NULL UNIQUE,
|
||||
`key_hash` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
|
||||
`auth_level` tinyint(1) NOT NULL,
|
||||
`slogan` varchar(64) COLLATE utf8_unicode_ci NOT NULL,
|
||||
@ -116,9 +117,10 @@ CREATE TABLE IF NOT EXISTS `team_members` (
|
||||
`id_team` int(10) unsigned NOT NULL,
|
||||
`firstname` varchar(32) COLLATE utf8_unicode_ci NOT NULL,
|
||||
`lastname` varchar(32) COLLATE utf8_unicode_ci NOT NULL,
|
||||
`nickname` varchar(32) COLLATE utf8_unicode_ci NOT NULL,
|
||||
`nickname` varchar(32) COLLATE utf8_unicode_ci NOT NULL UNIQUE,
|
||||
`company` varchar(32) COLLATE utf8_unicode_ci NOT NULL,
|
||||
PRIMARY KEY (`id`)
|
||||
PRIMARY KEY (`id`),
|
||||
UNIQUE (firstname, lastname)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1 ;
|
||||
|
||||
-- --------------------------------------------------------
|
||||
@ -129,6 +131,6 @@ CREATE TABLE IF NOT EXISTS `team_members` (
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `themes` (
|
||||
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
|
||||
`name` varchar(32) COLLATE utf8_unicode_ci NOT NULL,
|
||||
`name` varchar(32) COLLATE utf8_unicode_ci NOT NULL UNIQUE,
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1 ;
|
||||
|
Loading…
Reference in New Issue
Block a user