server/db/fic2014.sql

152 lines
4.7 KiB
MySQL
Raw Normal View History

2013-10-09 13:40:23 +00:00
-- phpMyAdmin SQL Dump
2013-10-23 19:36:06 +00:00
-- version 4.0.5
2013-10-09 13:40:23 +00:00
-- http://www.phpmyadmin.net
--
2013-10-23 19:36:06 +00:00
-- Host: localhost
-- Generation Time: Oct 23, 2013 at 07:34 PM
-- Server version: 5.1.70-log
-- PHP Version: 5.5.4-pl0-gentoo
2013-10-09 13:40:23 +00:00
2013-10-23 19:36:06 +00:00
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
2013-10-09 13:40:23 +00:00
SET time_zone = "+00:00";
--
2013-10-23 19:36:06 +00:00
-- Database: `fic2014`
2013-10-09 13:40:23 +00:00
--
-- --------------------------------------------------------
--
2013-10-23 19:36:06 +00:00
-- Table structure for table `exercices`
2013-10-09 13:40:23 +00:00
--
CREATE TABLE IF NOT EXISTS `exercices` (
2013-10-23 19:36:06 +00:00
`id` varchar(100) COLLATE utf8_unicode_ci NOT NULL,
2013-10-09 13:40:23 +00:00
`id_theme` int(10) unsigned NOT NULL,
`require` varchar(100) COLLATE utf8_unicode_ci NULL,
2013-10-09 23:15:24 +00:00
`level` tinyint(4) NOT NULL,
2013-10-09 13:40:23 +00:00
`points` smallint(6) NOT NULL,
2013-10-23 19:36:06 +00:00
`statement` text COLLATE utf8_unicode_ci NOT NULL,
2013-10-09 13:40:23 +00:00
PRIMARY KEY (`id`)
2013-10-23 19:36:06 +00:00
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
2013-10-09 13:40:23 +00:00
-- --------------------------------------------------------
--
2013-10-23 19:36:06 +00:00
-- Table structure for table `exercice_files`
2013-10-09 13:40:23 +00:00
--
2013-10-09 23:15:24 +00:00
CREATE TABLE IF NOT EXISTS `exercice_files` (
2013-10-09 13:40:23 +00:00
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
2013-10-10 02:45:24 +00:00
`id_exercice` varchar(100) COLLATE utf8_unicode_ci NOT NULL,
2013-10-09 23:15:24 +00:00
`path` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`name` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
2013-11-08 14:47:55 +00:00
`sha1` binary(20) NOT NULL,
2013-10-09 13:40:23 +00:00
PRIMARY KEY (`id`)
2013-10-09 23:15:24 +00:00
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1 ;
2014-01-14 16:09:29 +00:00
-- --------------------------------------------------------
--
-- Table structure for table `exercice_tries`
--
CREATE TABLE IF NOT EXISTS `exercice_tries` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`id_exercice` varchar(100) COLLATE utf8_unicode_ci NOT NULL,
`id_team` smallint(5) unsigned NOT NULL,
`time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1 ;
2013-10-09 23:15:24 +00:00
-- --------------------------------------------------------
--
2013-10-23 19:36:06 +00:00
-- Table structure for table `exercice_keys`
2013-10-09 23:15:24 +00:00
--
CREATE TABLE IF NOT EXISTS `exercice_keys` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
2013-10-10 02:45:24 +00:00
`id_exercice` varchar(100) COLLATE utf8_unicode_ci NOT NULL,
2014-01-14 17:49:38 +00:00
`format` enum('raw','md5','sha1','sha256','sha512') COLLATE utf8_unicode_ci NOT NULL,
`value` varbinary(150) NOT NULL,
2013-10-09 23:15:24 +00:00
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1 ;
2013-10-09 13:40:23 +00:00
-- --------------------------------------------------------
--
2013-10-23 19:36:06 +00:00
-- Table structure for table `sessions`
2013-10-09 13:40:23 +00:00
--
CREATE TABLE IF NOT EXISTS `sessions` (
`session` binary(32) NOT NULL,
`uid` binary(16) NOT NULL,
`time` int(11) NOT NULL,
`ip` varbinary(16) NOT NULL,
2013-10-09 23:15:24 +00:00
`var` varchar(9999) COLLATE utf8_unicode_ci NOT NULL,
2013-10-09 13:40:23 +00:00
`level` tinyint(2) NOT NULL,
2013-10-09 23:15:24 +00:00
`active` enum('1','0') COLLATE utf8_unicode_ci NOT NULL,
2013-10-09 13:40:23 +00:00
PRIMARY KEY (`session`)
2013-10-09 23:15:24 +00:00
) ENGINE=MEMORY DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
2013-10-09 13:40:23 +00:00
-- --------------------------------------------------------
--
2013-10-23 19:36:06 +00:00
-- Table structure for table `solved`
2013-10-09 13:40:23 +00:00
--
CREATE TABLE IF NOT EXISTS `solved` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`id_team` int(10) unsigned NOT NULL,
`id_exercice` varchar(100) COLLATE utf8_unicode_ci NOT NULL,
2013-10-09 13:40:23 +00:00
`time` datetime NOT NULL,
PRIMARY KEY (`id`),
UNIQUE (id_team, id_exercice)
2013-10-23 19:36:06 +00:00
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1 ;
2013-10-09 13:40:23 +00:00
-- --------------------------------------------------------
--
2013-10-23 19:36:06 +00:00
-- Table structure for table `teams`
2013-10-09 13:40:23 +00:00
--
2013-10-23 19:36:06 +00:00
CREATE TABLE IF NOT EXISTS `teams` (
`id` smallint(5) unsigned NOT NULL AUTO_INCREMENT,
`team_name` varchar(255) COLLATE utf8_unicode_ci NOT NULL UNIQUE,
2013-10-23 19:36:06 +00:00
`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,
`revoked` boolean NOT NULL,
2013-10-09 13:40:23 +00:00
PRIMARY KEY (`id`)
2013-10-23 19:36:06 +00:00
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1 ;
2013-10-09 13:40:23 +00:00
-- --------------------------------------------------------
--
2013-10-23 19:36:06 +00:00
-- Table structure for table `team_members`
2013-10-09 13:40:23 +00:00
--
2013-10-23 19:36:06 +00:00
CREATE TABLE IF NOT EXISTS `team_members` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`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 UNIQUE,
`company` varchar(32) COLLATE utf8_unicode_ci NOT NULL,
PRIMARY KEY (`id`),
UNIQUE (firstname, lastname)
2013-10-23 19:36:06 +00:00
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1 ;
2013-10-09 23:15:24 +00:00
2013-10-23 19:36:06 +00:00
-- --------------------------------------------------------
--
-- Table structure for table `themes`
--
2013-10-09 23:15:24 +00:00
2013-10-23 19:36:06 +00:00
CREATE TABLE IF NOT EXISTS `themes` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`name` varchar(32) COLLATE utf8_unicode_ci NOT NULL UNIQUE,
2013-10-23 19:36:06 +00:00
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1 ;