From 863e2be14d13de9f42da38e3058d31d268e98366 Mon Sep 17 00:00:00 2001
From: Tristan Zur <tzur@ccwn.org>
Date: Sat, 23 Jun 2012 07:57:30 +0200
Subject: Schema aktualisiert

---
 protected/data/schema.astaf.mysql.sql | 36 +++++++++++++++++++----------------
 1 file changed, 20 insertions(+), 16 deletions(-)

diff --git a/protected/data/schema.astaf.mysql.sql b/protected/data/schema.astaf.mysql.sql
index 65788d4..3faf2d7 100644
--- a/protected/data/schema.astaf.mysql.sql
+++ b/protected/data/schema.astaf.mysql.sql
@@ -3,7 +3,7 @@
 -- http://www.phpmyadmin.net
 --
 -- Host: localhost
--- Erstellungszeit: 28. Apr 2012 um 17:36
+-- Erstellungszeit: 23. Jun 2012 um 07:37
 -- Server Version: 5.5.16
 -- PHP-Version: 5.3.8
 
@@ -28,7 +28,7 @@ CREATE TABLE IF NOT EXISTS `angebote` (
   `published` int(11) DEFAULT NULL,
   PRIMARY KEY (`id`),
   KEY `FK_Kategorie` (`kategorie_id`)
-) ENGINE=InnoDB  DEFAULT CHARSET=utf8 AUTO_INCREMENT=9 ;
+) ENGINE=InnoDB  DEFAULT CHARSET=utf8;
 
 -- --------------------------------------------------------
 
@@ -37,16 +37,18 @@ CREATE TABLE IF NOT EXISTS `angebote` (
 --
 
 CREATE TABLE IF NOT EXISTS `angebot_verein` (
+  `id` int(11) NOT NULL AUTO_INCREMENT,
   `angebot_id` int(11) NOT NULL,
   `verein_id` int(11) NOT NULL,
   `menge` double NOT NULL,
   `einheit` varchar(20) NOT NULL,
   `preis` float NOT NULL,
   `published` tinyint(1) DEFAULT NULL,
-  PRIMARY KEY (`angebot_id`,`verein_id`,`menge`,`einheit`),
+  PRIMARY KEY (`id`),
+  UNIQUE KEY `Unique_Angebot` (`angebot_id`,`verein_id`,`menge`,`einheit`),
   KEY `FK_Verein` (`verein_id`),
   KEY `FK_Angebot` (`angebot_id`)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+) ENGINE=InnoDB  DEFAULT CHARSET=utf8;
 
 -- --------------------------------------------------------
 
@@ -62,11 +64,13 @@ CREATE TABLE IF NOT EXISTS `benutzer` (
   `password` varchar(128) NOT NULL,
   `created_at` datetime DEFAULT NULL,
   `last_login` datetime DEFAULT NULL,
-  `is_active` int(11) NOT NULL DEFAULT '1',
-  `is_super_admin` int(11) NOT NULL DEFAULT '0',
+  `is_active` tinyint(1) NOT NULL DEFAULT '1',
+  `is_super_admin` tinyint(1) NOT NULL DEFAULT '0',
+  `admin_pw_reset` tinyint(1) NOT NULL DEFAULT '1',
+  `user_pw_reset` tinyint(1) NOT NULL DEFAULT '0',
   PRIMARY KEY (`id`),
   UNIQUE KEY `sf_guard_user_username_unique` (`username`)
-) ENGINE=InnoDB  DEFAULT CHARSET=utf8 AUTO_INCREMENT=3 ;
+) ENGINE=InnoDB  DEFAULT CHARSET=utf8;
 
 -- --------------------------------------------------------
 
@@ -82,7 +86,7 @@ CREATE TABLE IF NOT EXISTS `kategorien` (
   `default_einheit` varchar(20) NOT NULL,
   `published` int(11) DEFAULT NULL,
   PRIMARY KEY (`id`)
-) ENGINE=InnoDB  DEFAULT CHARSET=utf8 AUTO_INCREMENT=6 ;
+) ENGINE=InnoDB  DEFAULT CHARSET=utf8;
 
 -- --------------------------------------------------------
 
@@ -98,7 +102,7 @@ CREATE TABLE IF NOT EXISTS `standorte` (
   `pos_long` double DEFAULT NULL,
   `published` int(11) DEFAULT NULL,
   PRIMARY KEY (`id`)
-) ENGINE=InnoDB  DEFAULT CHARSET=utf8 AUTO_INCREMENT=12 ;
+) ENGINE=InnoDB  DEFAULT CHARSET=utf8;
 
 -- --------------------------------------------------------
 
@@ -122,7 +126,7 @@ CREATE TABLE IF NOT EXISTS `tbl_audit_trail` (
   KEY `idx_audit_trail_model` (`model`),
   KEY `idx_audit_trail_field` (`field`),
   KEY `idx_audit_trail_action` (`action`)
-) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=41 ;
+) ENGINE=InnoDB  DEFAULT CHARSET=latin1;
 
 -- --------------------------------------------------------
 
@@ -154,7 +158,7 @@ CREATE TABLE IF NOT EXISTS `veranstaltungen` (
   PRIMARY KEY (`id`),
   KEY `FK_Verein` (`verein_id`),
   KEY `FK_Standort` (`standort_id`)
-) ENGINE=InnoDB  DEFAULT CHARSET=utf8 AUTO_INCREMENT=4 ;
+) ENGINE=InnoDB  DEFAULT CHARSET=utf8;
 
 -- --------------------------------------------------------
 
@@ -176,7 +180,7 @@ CREATE TABLE IF NOT EXISTS `vereine` (
   PRIMARY KEY (`id`),
   UNIQUE KEY `FK_Unique_Slug` (`slug`),
   KEY `FK_Standort` (`standort_id`)
-) ENGINE=InnoDB  DEFAULT CHARSET=utf8 AUTO_INCREMENT=3 ;
+) ENGINE=InnoDB  DEFAULT CHARSET=utf8;
 
 --
 -- Constraints der exportierten Tabellen
@@ -192,8 +196,8 @@ ALTER TABLE `angebote`
 -- Constraints der Tabelle `angebot_verein`
 --
 ALTER TABLE `angebot_verein`
-  ADD CONSTRAINT `angebot_verein_ibfk_2` FOREIGN KEY (`verein_id`) REFERENCES `vereine` (`id`) ON DELETE CASCADE,
-  ADD CONSTRAINT `angebot_verein_ibfk_1` FOREIGN KEY (`angebot_id`) REFERENCES `angebote` (`id`);
+  ADD CONSTRAINT `angebot_verein_ibfk_1` FOREIGN KEY (`angebot_id`) REFERENCES `angebote` (`id`),
+  ADD CONSTRAINT `angebot_verein_ibfk_2` FOREIGN KEY (`verein_id`) REFERENCES `vereine` (`id`) ON DELETE CASCADE;
 
 --
 -- Constraints der Tabelle `veranstaltungen`
@@ -206,5 +210,5 @@ ALTER TABLE `veranstaltungen`
 -- Constraints der Tabelle `vereine`
 --
 ALTER TABLE `vereine`
-  ADD CONSTRAINT `vereine_ibfk_3` FOREIGN KEY (`standort_id`) REFERENCES `standorte` (`id`),
-  ADD CONSTRAINT `vereine_ibfk_2` FOREIGN KEY (`slug`) REFERENCES `benutzer` (`username`);
+  ADD CONSTRAINT `vereine_ibfk_2` FOREIGN KEY (`slug`) REFERENCES `benutzer` (`username`),
+  ADD CONSTRAINT `vereine_ibfk_3` FOREIGN KEY (`standort_id`) REFERENCES `standorte` (`id`);
-- 
cgit v1.0-28-g1787

