mise à jour du script MySQL

This commit is contained in:
pyg77 2013-03-01 11:19:57 +01:00
parent 05c8ba7c66
commit dc7e317efa
2 changed files with 59 additions and 48 deletions

View File

@ -1,12 +1,12 @@
authType basic
authName "ADMIN OpenSondage"
authUserFile /home/framatools/www/opensondage/admin/.htpasswd
authUserFile /home/framatools/www/opensondage_dev/admin/.htpasswd
order deny,allow
#order deny,allow
# satisfy all
# allow from all
require user studs
#require user studs

View File

@ -1,66 +1,77 @@
CREATE TABLE IF NOT EXISTS `sondage` (
`id_sondage` CHAR(16) NOT NULL,
`commentaires` text,
`mail_admin` VARCHAR(128),
`nom_admin` VARCHAR(64),
`titre` text,
`id_sondage_admin` CHAR(24),
`date_fin` TIMESTAMP,
`format` VARCHAR(2),
`mailsonde` BOOLEAN DEFAULT '0',
UNIQUE KEY (`id_sondage`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Name: sujet_studs; Type: TABLE;
-- Base de données: `opensondage`
--
CREATE TABLE IF NOT EXISTS `sujet_studs` (
`id_sondage` CHAR(16) NOT NULL,
`sujet` TEXT,
FOREIGN KEY (`id_sondage`) REFERENCES sondage(id_sondage) on delete cascade
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- --------------------------------------------------------
--
-- Name: user_studs; Type: TABLE;
--
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`),
FOREIGN KEY (`id_sondage`) REFERENCES sondage(id_sondage) on delete cascade
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Name: comments; Type: TABLE;
-- Structure de la table `comments`
--
CREATE TABLE IF NOT EXISTS `comments` (
`id_comment` INT(11) unsigned NOT NULL AUTO_INCREMENT,
`id_sondage` CHAR(16) NOT NULL,
`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`),
FOREIGN KEY (`id_sondage`) REFERENCES sondage(id_sondage) on delete cascade
KEY `id_sondage` (`id_sondage`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- --------------------------------------------------------
--
-- Data for Name: sondage; Type: TABLE DATA;
-- Structure de la table `sondage`
--
CREATE TABLE IF NOT EXISTS `sondage` (
`id_sondage` char(16) NOT NULL,
`commentaires` text,
`mail_admin` varchar(128) DEFAULT NULL,
`nom_admin` varchar(64) DEFAULT NULL,
`titre` text,
`id_sondage_admin` char(24) DEFAULT NULL,
`date_creation` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`date_fin` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
`format` varchar(2) DEFAULT NULL,
`mailsonde` tinyint(1) DEFAULT '0',
`statut` int(11) NOT NULL DEFAULT '1' COMMENT '1 = actif ; 0 = inactif ; ',
UNIQUE KEY `id_sondage` (`id_sondage`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- --------------------------------------------------------
--
-- Structure de la table `sujet_studs`
--
CREATE TABLE IF NOT EXISTS `sujet_studs` (
`id_sondage` char(16) NOT NULL,
`sujet` text,
KEY `id_sondage` (`id_sondage`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- --------------------------------------------------------
--
-- Structure de la table `user_studs`
--
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 ;
INSERT INTO `sondage`
(`id_sondage`, `commentaires`, `mail_admin`, `nom_admin`,
`titre`, `id_sondage_admin`,
`date_fin`, `format`)
VALUES
('aqg259dth55iuhwm','Repas de Noel du service','Stephanie@saillard.com','Stephanie',
('aqg259dth55iuhwm','Repas de Noel du service','Stephanie@retaillard.com','Stephanie',
'Repas de Noel','aqg259dth55iuhwmy9d8jlwk',
FROM_UNIXTIME('1627100361'),'D+');