Commit a17a9551 authored by Hicham Brahimi's avatar Hicham Brahimi

Update backup.sql

parent 32df1735
--
-- Table structure for table `capteur`
-- Table structure for table `user`
--
DROP TABLE IF EXISTS `capteur`;
DROP TABLE IF EXISTS `user`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `capteur` (
CREATE TABLE `user` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`type` enum('num','map') NOT NULL DEFAULT 'num',
`topic` varchar(100) NOT NULL,
`nom` varchar(50) NOT NULL,
`unite` varchar(10) DEFAULT 'Val',
`visible` tinyint(1) NOT NULL DEFAULT '1',
`idGroupe` int(11) DEFAULT NULL,
`idUser` int(11) DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `idGroupe` (`idGroupe`),
KEY `idUser` (`idUser`),
CONSTRAINT `capteur_ibfk_1` FOREIGN KEY (`idUser`) REFERENCES `user` (`id`),
CONSTRAINT `idGroupe` FOREIGN KEY (`idGroupe`) REFERENCES `groupe` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=168 DEFAULT CHARSET=latin1;
`username` varchar(30) NOT NULL,
`password` varchar(100) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=latin1;
--
......@@ -39,6 +30,29 @@ CREATE TABLE `groupe` (
) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=latin1;
--
-- Table structure for table `capteur`
--
DROP TABLE IF EXISTS `capteur`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `capteur` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`type` enum('num','map') NOT NULL DEFAULT 'num',
`topic` varchar(100) NOT NULL,
`nom` varchar(50) NOT NULL,
`unite` varchar(10) DEFAULT 'Val',
`visible` tinyint(1) NOT NULL DEFAULT '1',
`idGroupe` int(11) DEFAULT NULL,
`idUser` int(11) DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `idGroupe` (`idGroupe`),
KEY `idUser` (`idUser`),
CONSTRAINT `capteur_ibfk_1` FOREIGN KEY (`idUser`) REFERENCES `user` (`id`),
CONSTRAINT `idGroupe` FOREIGN KEY (`idGroupe`) REFERENCES `groupe` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=168 DEFAULT CHARSET=latin1;
--
-- Table structure for table `notification`
......@@ -84,7 +98,6 @@ CREATE TABLE `seuil` (
) ENGINE=InnoDB AUTO_INCREMENT=36 DEFAULT CHARSET=latin1;
--
-- Table structure for table `tag`
--
......@@ -102,23 +115,6 @@ CREATE TABLE `tag` (
) ENGINE=InnoDB AUTO_INCREMENT=132 DEFAULT CHARSET=latin1;
--
-- Table structure for table `user`
--
DROP TABLE IF EXISTS `user`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `user` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`username` varchar(30) NOT NULL,
`password` varchar(100) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=latin1;
--
-- Table structure for table `valeur`
--
......@@ -136,4 +132,8 @@ CREATE TABLE `valeur` (
CONSTRAINT `idCapteur` FOREIGN KEY (`idCapteur`) REFERENCES `capteur` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=488970 DEFAULT CHARSET=latin1;
--
-- Ajout d'un index pour augmenter la vitesse de ORDER BY DESC
--
CREATE INDEX `index_valeurtemps` ON `valeur`(`temps`);
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment