From ad46b979c631a33fd5da19db970381b8d52b7b47 Mon Sep 17 00:00:00 2001
From: Ludovic Pouzenc <ludovic@pouzenc.fr>
Date: Sun, 13 Mar 2016 22:10:16 +0100
Subject: Interesses : add status column

---
 schema/schema-mysql.sql | 28 ++++++++++++++++++++++------
 1 file changed, 22 insertions(+), 6 deletions(-)

(limited to 'schema/schema-mysql.sql')

diff --git a/schema/schema-mysql.sql b/schema/schema-mysql.sql
index 06ec3e4..0f14b79 100644
--- a/schema/schema-mysql.sql
+++ b/schema/schema-mysql.sql
@@ -61,9 +61,7 @@ DROP TABLE IF EXISTS `adherent_statuts`;
 /*!40101 SET character_set_client = utf8 */;
 CREATE TABLE `adherent_statuts` (
   `id` int(11) NOT NULL AUTO_INCREMENT,
-  `title` varchar(32) COLLATE utf8_unicode_ci NOT NULL,
-  PRIMARY KEY (`id`),
-  UNIQUE KEY `title` (`title`)
+  PRIMARY KEY (`id`)
 ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
 /*!40101 SET character_set_client = @saved_cs_client */;
 
@@ -149,8 +147,8 @@ CREATE TABLE `equipement_modeles` (
   `id` int(11) NOT NULL AUTO_INCREMENT,
   `constructeur` varchar(32) COLLATE utf8_unicode_ci NOT NULL,
   `modele` varchar(32) COLLATE utf8_unicode_ci NOT NULL,
-  `profile` varchar(16) COLLATE utf8_unicode_ci NOT NULL,
-  `revision` varchar(8) COLLATE utf8_unicode_ci NOT NULL,
+  `profile` varchar(16) COLLATE utf8_unicode_ci DEFAULT NULL,
+  `revision` varchar(8) COLLATE utf8_unicode_ci DEFAULT NULL,
   PRIMARY KEY (`id`)
 ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='Modèles d''équipements';
 /*!40101 SET character_set_client = @saved_cs_client */;
@@ -206,6 +204,21 @@ CREATE TABLE `equipements` (
 /*!40101 SET character_set_client = @saved_cs_client */;
 
 --
+-- Table structure for table `interesse_statuts`
+--
+
+DROP TABLE IF EXISTS `interesse_statuts`;
+/*!40101 SET @saved_cs_client     = @@character_set_client */;
+/*!40101 SET character_set_client = utf8 */;
+CREATE TABLE `interesse_statuts` (
+  `id` int(11) NOT NULL AUTO_INCREMENT,
+  `title` varchar(32) COLLATE utf8_unicode_ci NOT NULL,
+  PRIMARY KEY (`id`),
+  UNIQUE KEY `title` (`title`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
+/*!40101 SET character_set_client = @saved_cs_client */;
+
+--
 -- Table structure for table `interesses`
 --
 
@@ -215,6 +228,7 @@ DROP TABLE IF EXISTS `interesses`;
 CREATE TABLE `interesses` (
   `id` int(11) NOT NULL AUTO_INCREMENT,
   `date_demande` date NOT NULL,
+  `interesse_statut_id` int(11) NOT NULL,
   `civilite_id` int(11) NOT NULL,
   `nom` varchar(32) COLLATE utf8_unicode_ci NOT NULL,
   `prenom` varchar(32) COLLATE utf8_unicode_ci NOT NULL,
@@ -229,6 +243,8 @@ CREATE TABLE `interesses` (
   UNIQUE KEY `id` (`id`),
   KEY `civilite_id` (`civilite_id`),
   KEY `ville_id` (`ville_id`),
+  KEY `interesse_statut_id` (`interesse_statut_id`),
+  CONSTRAINT `interesses_ibfk_3` FOREIGN KEY (`interesse_statut_id`) REFERENCES `interesse_statuts` (`id`) ON UPDATE CASCADE,
   CONSTRAINT `interesses_ibfk_1` FOREIGN KEY (`civilite_id`) REFERENCES `civilites` (`id`) ON UPDATE CASCADE,
   CONSTRAINT `interesses_ibfk_2` FOREIGN KEY (`ville_id`) REFERENCES `villes` (`id`) ON UPDATE CASCADE
 ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
@@ -738,4 +754,4 @@ CREATE TABLE `villes` (
 /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
 /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
 
--- Dump completed on 2016-03-12  0:30:48
+-- Dump completed on 2016-03-13 22:06:30
-- 
cgit v1.1

