Skip to content
Snippets Groups Projects
install.mysql.sql 3.16 KiB
Newer Older
pyg77's avatar
pyg77 committed
-- Base de données: `opensondage`
--
Simon Leblanc's avatar
Simon Leblanc committed

pyg77's avatar
pyg77 committed
-- --------------------------------------------------------
Simon Leblanc's avatar
Simon Leblanc committed

--
pyg77's avatar
pyg77 committed
-- Structure de la table `comments`
Simon Leblanc's avatar
Simon Leblanc committed
--

pyg77's avatar
pyg77 committed
CREATE TABLE IF NOT EXISTS `comments` (
  `id_comment` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `id_sondage` char(16) NOT NULL,
  `comment` text NOT NULL,
  `usercomment` text,
  PRIMARY KEY (`id_comment`),
  KEY `id_sondage` (`id_sondage`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8;
Simon Leblanc's avatar
Simon Leblanc committed

pyg77's avatar
pyg77 committed
-- --------------------------------------------------------
Simon Leblanc's avatar
Simon Leblanc committed

--
pyg77's avatar
pyg77 committed
-- Structure de la table `sondage`
Simon Leblanc's avatar
Simon Leblanc committed
--

pyg77's avatar
pyg77 committed
CREATE TABLE IF NOT EXISTS `sondage` (
Olivier PEREZ's avatar
Olivier PEREZ committed
  `poll_id` char(16) NOT NULL,
  `admin_poll_id` char(24) DEFAULT NULL,
  `title` text NOT NULL,
  `comment` text,
  `admin_name` varchar(64) DEFAULT NULL,
  `admin_mail` varchar(128) DEFAULT NULL,
  `creation_date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `end_date` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
  `format` varchar(1) DEFAULT NULL,
  `editable` tinyint(1) DEFAULT '0',
  `receiveNewVotes` tinyint(1) DEFAULT '0',
Olivier PEREZ's avatar
Olivier PEREZ committed
  `active` tinyint(1) DEFAULT '1',
pyg77's avatar
pyg77 committed
  `statut` int(11) NOT NULL DEFAULT '1' COMMENT '1 = actif ; 0 = inactif ; ',
Olivier PEREZ's avatar
Olivier PEREZ committed
  UNIQUE KEY `poll_id` (`poll_id`)
Simon Leblanc's avatar
Simon Leblanc committed
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

pyg77's avatar
pyg77 committed
-- --------------------------------------------------------
Simon Leblanc's avatar
Simon Leblanc committed

--
pyg77's avatar
pyg77 committed
-- Structure de la table `sujet_studs`
Simon Leblanc's avatar
Simon Leblanc committed
--

pyg77's avatar
pyg77 committed
CREATE TABLE IF NOT EXISTS `sujet_studs` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
pyg77's avatar
pyg77 committed
  `id_sondage` char(16) NOT NULL,
  `sujet` text,
  KEY `id_sondage` (`id_sondage`)
Simon Leblanc's avatar
Simon Leblanc committed
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

pyg77's avatar
pyg77 committed
-- --------------------------------------------------------
Simon Leblanc's avatar
Simon Leblanc committed

--
pyg77's avatar
pyg77 committed
-- Structure de la table `user_studs`
Simon Leblanc's avatar
Simon Leblanc committed
--

pyg77's avatar
pyg77 committed
CREATE TABLE IF NOT EXISTS `user_studs` (
  `id_users` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `nom` varchar(64) NOT NULL,
  `id_sondage` char(16) NOT NULL,
  `reponses` text NOT NULL,
  PRIMARY KEY (`id_users`),
  KEY `id_sondage` (`id_sondage`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 AUTO_INCREMENT=160284 ;



Simon Leblanc's avatar
Simon Leblanc committed
INSERT INTO `sondage`
(`id_sondage`, `commentaires`, `mail_admin`, `nom_admin`,
	     `titre`, `id_sondage_admin`,
	     `date_fin`, `format`)
VALUES
pyg77's avatar
pyg77 committed
('aqg259dth55iuhwm','Repas de Noel du service','Stephanie@retaillard.com','Stephanie',
Simon Leblanc's avatar
Simon Leblanc committed
			   'Repas de Noel','aqg259dth55iuhwmy9d8jlwk',
			   FROM_UNIXTIME('1627100361'),'D+');

--
-- Data for Name: sujet_studs; Type: TABLE DATA;
--

INSERT INTO `sujet_studs` (`id_sondage`, `sujet`) VALUES
('aqg259dth55iuhwm','1225839600@12h,1225839600@19h,1226012400@12h,1226012400@19h,1226876400@12h,1226876400@19h,1227049200@12h,1227049200@19h,1227826800@12h,1227826800@19h');

--
-- Data for Name: user_studs; Type: TABLE DATA;
--

INSERT INTO `user_studs` (`nom`, `id_sondage`, `reponses`, `id_users`) VALUES
('marcel','aqg259dth55iuhwm','0110111101','933'),
('paul','aqg259dth55iuhwm','1011010111','935'),
('sophie','aqg259dth55iuhwm','1110110000','945'),
('barack','aqg259dth55iuhwm','0110000','948'),
('takashi','aqg259dth55iuhwm','0000110100','951'),
('albert','aqg259dth55iuhwm','1010110','975'),
('alfred','aqg259dth55iuhwm','0110010','1135'),
('marcs','aqg259dth55iuhwm','0100001010','1143'),
('laure','aqg259dth55iuhwm','0011000','1347'),
('benda','aqg259dth55iuhwm','1101101100','1667'),
('Albert','aqg259dth55iuhwm','1111110011','1668');