Login | Register
My pages Projects Community openCollabNet

Discussions > commits > svn commit: r307 - trunk/www: . img/reveng mysql

argouml-sql
Discussion topic

Back to topic list

svn commit: r307 - trunk/www: . img/reveng mysql

Author elbedd
Full name Laurent BRAUD
Date 2013-05-29 17:13:33 PDT
Message Author: elbedd
Date: 2013-05-28 14:14:44-0700
New Revision: 307

Added:
   trunk/www/ParsingDDLScript.html
   trunk/www/ParsingDDL​Script_mysql.html
   trunk/www/img/reveng/
   trunk/www/img/reveng​/ImportSource1.png (contents, props changed)
   trunk/www/img/reveng​/ImportSource2.png (contents, props changed)
   trunk/www/img/reveng​/ImportedC.png (contents, props changed)
   trunk/www/img/reveng​/ImportedP.png (contents, props changed)
   trunk/www/mysql/
   trunk/www/mysql/saki​la-schema_min.sql

Log:
First pages to explain the Parsing DDL Script feature

Not finish, so no link at "plan.html".
Commit for view if it works (first SVN commit).


Added: trunk/www/ParsingDDLScript.html
Url: http://argouml-sql.t​igris.org/source/bro​wse/argouml-sql/trun​k/www/ParsingDDLScri​pt.html?view=markup​&pathrev=307
====================​====================​====================​==================
--- (empty file)
+++ trunk/www/ParsingDDLScript.html 2013-05-28 14:14:44-0700
@@ -0,0 +1,98 @@
+<html>
+<head>
+<title>Parsing DDL Script</title>
+</head>
+
+<body>
+ <div class="h2">
+ <h2>Plans</h2>
+ <p>Parsing DDL Script with this module is in progress (0.35.1 ?). With this
+ release you can import some script from :
+ </p>
+ <ul>
+ <li><a href="ParsingDDLScri​pt_mysql.html">My​SQL / MariaDB</a></li>
+ <li>SQL Server</li>
+ </ul>
+ 2 kind of model can be imported :
+ <ul>
+ <li>Physical (Other words : Logique ? Relationnal ?)</li>
+ <li>Conception</li>
+ </ul>
+
+ </div>
+
+ <h2>Example</h2>
+ <p>
+ Here is a example, extract of <a href="https://code.google.​com/p/sakila-sample-​database-ports">Sakila</a>
+ <textarea rows="12" cols="100" readonly>
+CREATE TABLE film (
+ film_id bigint NOT NULL,
+ title varchar(255) NOT NULL,
+ description text,
+ release_year year(4) DEFAULT NULL,
+ language_id tinyint(3) unsigned NOT NULL,
+ original_language_id tinyint(3) unsigned DEFAULT NULL,
+ last_update timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
+ PRIMARY KEY (film_id),
+ CONSTRAINT fk_film_language FOREIGN KEY (language_id) REFERENCES language (language_id) ON UPDATE CASCADE,
+ CONSTRAINT fk_film_language_original FOREIGN KEY (original_language_id) REFERENCES language (language_id) ON UPDATE CASCADE
+);
+
+
+CREATE TABLE language (
+ language_id tinyint(3) unsigned NOT NULL AUTO_INCREMENT,
+ name char(20) NOT NULL,
+ last_update timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
+ PRIMARY KEY (language_id)
+);
+ </textarea>
+ </p>
+ <p>
+ Choose File / Import Sources...
+
+ <img alt="importSetting" src="img/reveng/Impo​rtSource1.PNG" />
+ </p>
+ <p>
+ Note that you might have to choose "UTF-8" as encoding.<br/>
+
+ <img alt="SqlSetting" src="img/reveng/Impo​rtSource2.PNG" />
+ </p>
+ <p>
+ You have to choose the database : Mysql/MariaDB or Sql Server.<br/>
+ For this example, choose Mysql/MariaDB.
+ </p>
+
+ <p>
+ Result with Physical model :
+ <img alt="Physical model" src="img/reveng/ImportedP.png" />
+ </p>
+ <p>
+ A FK become an association and each attribute of FK is in the table.
+ Stereotype &lt;&lt;Tabl​e&gt;&gt;, &lt;&lt;PK​&gt;&gt; and &lt;&lt;FK​&gt;&gt; are created in the project.
+
+ </p>
+
+ <p>
+ Result with Conception model :
+ <img alt="Physical model" src="img/reveng/ImportedC.png" />
+ A FK can become :
+ <ul>
+ <li>An association</li>
+ <li>A generalization</li>
+ </ul>
+
+ </p>
+
+ <h2>About FK</h2>
+ <p>
+ The name of the association end is :
+ <ul>
+ <li>The name of the column in the base if there only one</li>
+ <li>Otherwise, the name of the FK</li>
+ </ul>
+ </p>
+
+
+ This page was last modified by $Author: elbedd $ on $Date: 2013-05-28 23:00:00 +0100 (tue., 28 may 2013) $.
+</body>
+</html>

Added: trunk/www/ParsingDDL​Script_mysql.html
Url: http://argouml-sql.t​igris.org/source/bro​wse/argouml-sql/trun​k/www/ParsingDDLScri​pt_mysql.html?view=m​arkup&pathrev=30​7
====================​====================​====================​==================
--- (empty file)
+++ trunk/www/ParsingDDL​Script_mysql.html 2013-05-28 14:14:44-0700
@@ -0,0 +1,38 @@
+<html>
+<head>
+<title>Parsing Mysql DDL Script</title>
+</head>
+<body>
+ <div class="h2">
+ <h2>Get a DDL script from Mysql / MariaDB</h2>
+ <p>
+ Use the following command to get the script DDL:<br/>
+ mysqldump --no-data -u user -p > file.sql<br/>
+ </p>
+
+ <p>Script test with Version</p>
+ <ul>
+ <li>5.5</li>
+ </ul>
+ </div>
+
+ <div class="h2">
+ <h2>Example sakila</h2>
+
+ <p>
+ A Complete database can be found here :
+ <a href="https://code.google.​com/p/sakila-sample-​database-ports/sourc​e/browse/">sakila-sample from code google</a>
+ Some changes are needed, like removing the views, datatype enum/set (<a href="mysql/sakila-s​chema_min.sql">Du​mp file here</a>)
+
+ </p>
+
+
+ </div>
+
+
+
+
+ This page was last modified by $Author: elbedd $ on $Date: 2013-05-27
+ 22:21:38 +0100 (mon., 27 may 2013) $.
+</body>
+</html>

Added: trunk/www/img/reveng​/ImportSource1.png
Url: http://argouml-sql.t​igris.org/source/bro​wse/argouml-sql/trun​k/www/img/reveng/Imp​ortSource1.png?view=​markup&pathrev=3​07
====================​====================​====================​==================
Binary file. No diff available.

Added: trunk/www/img/reveng​/ImportSource2.png
Url: http://argouml-sql.t​igris.org/source/bro​wse/argouml-sql/trun​k/www/img/reveng/Imp​ortSource2.png?view=​markup&pathrev=3​07
====================​====================​====================​==================
Binary file. No diff available.

Added: trunk/www/img/reveng​/ImportedC.png
Url: http://argouml-sql.t​igris.org/source/bro​wse/argouml-sql/trun​k/www/img/reveng/Imp​ortedC.png?view=mark​up&pathrev=307
====================​====================​====================​==================
Binary file. No diff available.

Added: trunk/www/img/reveng​/ImportedP.png
Url: http://argouml-sql.t​igris.org/source/bro​wse/argouml-sql/trun​k/www/img/reveng/Imp​ortedP.png?view=mark​up&pathrev=307
====================​====================​====================​==================
Binary file. No diff available.

Added: trunk/www/mysql/saki​la-schema_min.sql
Url: http://argouml-sql.t​igris.org/source/bro​wse/argouml-sql/trun​k/www/mysql/sakila-s​chema_min.sql?view=m​arkup&pathrev=30​7
====================​====================​====================​==================
--- (empty file)
+++ trunk/www/mysql/saki​la-schema_min.sql 2013-05-28 14:14:44-0700
@@ -0,0 +1,360 @@
+-- MySQL dump 10.14 Distrib 5.5.30-MariaDB, for Win32 (x86)
+--
+-- Host: localhost Database: sakila
+-- --------------------​--------------------​--------------
+-- Server version 5.5.30-MariaDB
+
+/*!40101 SET @OLD_CHARACTER_SET_C​LIENT=@@CHARACTER_SE​T_CLIENT */;
+/*!40101 SET @OLD_CHARACTER_SET_R​ESULTS=@@CHARACTER_S​ET_RESULTS */;
+/*!40101 SET @OLD_COLLATION_CONNE​CTION=@@COLLATION_CO​NNECTION */;
+/*!40101 SET NAMES utf8 */;
+/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
+/*!40103 SET TIME_ZONE='+00:00' */;
+/*!40014 SET @OLD_UNIQUE_CHECKS=@​@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
+/*!40014 SET @OLD_FOREIGN_KEY_CHE​CKS=@@FOREIGN_KEY_CH​ECKS, FOREIGN_KEY_CHECKS=0 */;
+/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VA​LUE_ON_ZERO' */;
+/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
+
+--
+-- Table structure for table `actor`
+--
+
+DROP TABLE IF EXISTS `actor`;
+/*!40101 SET @saved_cs_client = @@character_set_client */;
+/*!40101 SET character_set_client = utf8 */;
+CREATE TABLE `actor` (
+ `actor_id` smallint(5) unsigned NOT NULL AUTO_INCREMENT,
+ `first_name` varchar(45) NOT NULL,
+ `last_name` varchar(45) NOT NULL,
+ `last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
+ PRIMARY KEY (`actor_id`),
+ KEY `idx_actor_last_name` (`last_name`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+/*!40101 SET character_set_client = @saved_cs_client */;
+
+
+
+--
+-- Table structure for table `address`
+--
+
+DROP TABLE IF EXISTS `address`;
+/*!40101 SET @saved_cs_client = @@character_set_client */;
+/*!40101 SET character_set_client = utf8 */;
+CREATE TABLE `address` (
+ `address_id` smallint(5) unsigned NOT NULL AUTO_INCREMENT,
+ `address` varchar(50) NOT NULL,
+ `address2` varchar(50) DEFAULT NULL,
+ `district` varchar(20) NOT NULL,
+ `city_id` smallint(5) unsigned NOT NULL,
+ `postal_code` varchar(10) DEFAULT NULL,
+ `phone` varchar(20) NOT NULL,
+ `last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
+ PRIMARY KEY (`address_id`),
+ KEY `idx_fk_city_id` (`city_id`),
+ CONSTRAINT `fk_address_city` FOREIGN KEY (`city_id`) REFERENCES `city` (`city_id`) ON UPDATE CASCADE
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+/*!40101 SET character_set_client = @saved_cs_client */;
+
+--
+-- Table structure for table `category`
+--
+
+DROP TABLE IF EXISTS `category`;
+/*!40101 SET @saved_cs_client = @@character_set_client */;
+/*!40101 SET character_set_client = utf8 */;
+CREATE TABLE `category` (
+ `category_id` tinyint(3) unsigned NOT NULL AUTO_INCREMENT,
+ `name` varchar(25) NOT NULL,
+ `last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
+ PRIMARY KEY (`category_id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+/*!40101 SET character_set_client = @saved_cs_client */;
+
+--
+-- Table structure for table `city`
+--
+
+DROP TABLE IF EXISTS `city`;
+/*!40101 SET @saved_cs_client = @@character_set_client */;
+/*!40101 SET character_set_client = utf8 */;
+CREATE TABLE `city` (
+ `city_id` smallint(5) unsigned NOT NULL AUTO_INCREMENT,
+ `city` varchar(50) NOT NULL,
+ `country_id` smallint(5) unsigned NOT NULL,
+ `last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
+ PRIMARY KEY (`city_id`),
+ KEY `idx_fk_country_id` (`country_id`),
+ CONSTRAINT `fk_city_country` FOREIGN KEY (`country_id`) REFERENCES `country` (`country_id`) ON UPDATE CASCADE
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+/*!40101 SET character_set_client = @saved_cs_client */;
+
+--
+-- Table structure for table `country`
+--
+
+DROP TABLE IF EXISTS `country`;
+/*!40101 SET @saved_cs_client = @@character_set_client */;
+/*!40101 SET character_set_client = utf8 */;
+CREATE TABLE `country` (
+ `country_id` smallint(5) unsigned NOT NULL AUTO_INCREMENT,
+ `country` varchar(50) NOT NULL,
+ `last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
+ PRIMARY KEY (`country_id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+/*!40101 SET character_set_client = @saved_cs_client */;
+
+--
+-- Table structure for table `customer`
+--
+
+DROP TABLE IF EXISTS `customer`;
+/*!40101 SET @saved_cs_client = @@character_set_client */;
+/*!40101 SET character_set_client = utf8 */;
+CREATE TABLE `customer` (
+ `customer_id` smallint(5) unsigned NOT NULL AUTO_INCREMENT,
+ `store_id` tinyint(3) unsigned NOT NULL,
+ `first_name` varchar(45) NOT NULL,
+ `last_name` varchar(45) NOT NULL,
+ `email` varchar(50) DEFAULT NULL,
+ `address_id` smallint(5) unsigned NOT NULL,
+ `active` tinyint(1) NOT NULL DEFAULT '1',
+ `create_date` datetime NOT NULL,
+ `last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
+ PRIMARY KEY (`customer_id`),
+ KEY `idx_fk_store_id` (`store_id`),
+ KEY `idx_fk_address_id` (`address_id`),
+ KEY `idx_last_name` (`last_name`),
+ CONSTRAINT `fk_customer_address` FOREIGN KEY (`address_id`) REFERENCES `address` (`address_id`) ON UPDATE CASCADE,
+ CONSTRAINT `fk_customer_store` FOREIGN KEY (`store_id`) REFERENCES `store` (`store_id`) ON UPDATE CASCADE
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+/*!40101 SET character_set_client = @saved_cs_client */;
+--
+-- Table structure for table `film`
+--
+
+DROP TABLE IF EXISTS `film`;
+/*!40101 SET @saved_cs_client = @@character_set_client */;
+/*!40101 SET character_set_client = utf8 */;
+CREATE TABLE `film` (
+ `film_id` smallint(5) unsigned NOT NULL AUTO_INCREMENT,
+ `title` varchar(255) NOT NULL,
+ `description` text,
+ `release_year` year(4) DEFAULT NULL,
+ `language_id` tinyint(3) unsigned NOT NULL,
+ `original_language_id` tinyint(3) unsigned DEFAULT NULL,
+ `rental_duration` tinyint(3) unsigned NOT NULL DEFAULT '3',
+ `rental_rate` decimal(4,2) NOT NULL DEFAULT '4.99',
+ `length` smallint(5) unsigned DEFAULT NULL,
+ `replacement_cost` decimal(5,2) NOT NULL DEFAULT '19.99',
+ PRIMARY KEY (`film_id`),
+ KEY `idx_title` (`title`),
+ KEY `idx_fk_language_id` (`language_id`),
+ KEY `idx_fk_original_language_id` (`original_language_id`),
+ CONSTRAINT `fk_film_language` FOREIGN KEY (`language_id`) REFERENCES `language` (`language_id`) ON UPDATE CASCADE,
+ CONSTRAINT `fk_film_language_original` FOREIGN KEY (`original_language_id`) REFERENCES `language` (`language_id`) ON UPDATE CASCADE
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+
+--
+-- Table structure for table `film_actor`
+--
+
+DROP TABLE IF EXISTS `film_actor`;
+/*!40101 SET @saved_cs_client = @@character_set_client */;
+/*!40101 SET character_set_client = utf8 */;
+CREATE TABLE `film_actor` (
+ `actor_id` smallint(5) unsigned NOT NULL,
+ `film_id` smallint(5) unsigned NOT NULL,
+ `last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
+ PRIMARY KEY (`actor_id`,`film_id`),
+ KEY `idx_fk_film_id` (`film_id`),
+ CONSTRAINT `fk_film_actor_actor` FOREIGN KEY (`actor_id`) REFERENCES `actor` (`actor_id`) ON UPDATE CASCADE,
+ CONSTRAINT `fk_film_actor_film` FOREIGN KEY (`film_id`) REFERENCES `film` (`film_id`) ON UPDATE CASCADE
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+/*!40101 SET character_set_client = @saved_cs_client */;
+
+--
+-- Table structure for table `film_category`
+--
+
+DROP TABLE IF EXISTS `film_category`;
+/*!40101 SET @saved_cs_client = @@character_set_client */;
+/*!40101 SET character_set_client = utf8 */;
+CREATE TABLE `film_category` (
+ `film_id` smallint(5) unsigned NOT NULL,
+ `category_id` tinyint(3) unsigned NOT NULL,
+ `last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
+ PRIMARY KEY (`film_id`,`category_id`),
+ KEY `fk_film_category_category` (`category_id`),
+ CONSTRAINT `fk_film_category_film` FOREIGN KEY (`film_id`) REFERENCES `film` (`film_id`) ON UPDATE CASCADE,
+ CONSTRAINT `fk_film_category_category` FOREIGN KEY (`category_id`) REFERENCES `category` (`category_id`) ON UPDATE CASCADE
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+/*!40101 SET character_set_client = @saved_cs_client */;
+
+
+--
+-- Table structure for table `film_text`
+--
+
+DROP TABLE IF EXISTS `film_text`;
+/*!40101 SET @saved_cs_client = @@character_set_client */;
+/*!40101 SET character_set_client = utf8 */;
+CREATE TABLE `film_text` (
+ `film_id` smallint(6) NOT NULL,
+ `title` varchar(255) NOT NULL,
+ `description` text,
+ PRIMARY KEY (`film_id`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8;
+/*!40101 SET character_set_client = @saved_cs_client */;
+
+--
+-- Table structure for table `inventory`
+--
+
+DROP TABLE IF EXISTS `inventory`;
+/*!40101 SET @saved_cs_client = @@character_set_client */;
+/*!40101 SET character_set_client = utf8 */;
+CREATE TABLE `inventory` (
+ `inventory_id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
+ `film_id` smallint(5) unsigned NOT NULL,
+ `store_id` tinyint(3) unsigned NOT NULL,
+ `last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
+ PRIMARY KEY (`inventory_id`),
+ KEY `idx_fk_film_id` (`film_id`),
+ KEY `idx_store_id_film_id` (`store_id`,`film_id`),
+ CONSTRAINT `fk_inventory_store` FOREIGN KEY (`store_id`) REFERENCES `store` (`store_id`) ON UPDATE CASCADE,
+ CONSTRAINT `fk_inventory_film` FOREIGN KEY (`film_id`) REFERENCES `film` (`film_id`) ON UPDATE CASCADE
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+/*!40101 SET character_set_client = @saved_cs_client */;
+
+--
+-- Table structure for table `language`
+--
+
+DROP TABLE IF EXISTS `language`;
+/*!40101 SET @saved_cs_client = @@character_set_client */;
+/*!40101 SET character_set_client = utf8 */;
+CREATE TABLE `language` (
+ `language_id` tinyint(3) unsigned NOT NULL AUTO_INCREMENT,
+ `name` char(20) NOT NULL,
+ `last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
+ PRIMARY KEY (`language_id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+/*!40101 SET character_set_client = @saved_cs_client */;
+
+
+
+--
+-- Table structure for table `payment`
+--
+
+DROP TABLE IF EXISTS `payment`;
+/*!40101 SET @saved_cs_client = @@character_set_client */;
+/*!40101 SET character_set_client = utf8 */;
+CREATE TABLE `payment` (
+ `payment_id` smallint(5) unsigned NOT NULL AUTO_INCREMENT,
+ `customer_id` smallint(5) unsigned NOT NULL,
+ `staff_id` tinyint(3) unsigned NOT NULL,
+ `rental_id` int(11) DEFAULT NULL,
+ `amount` decimal(5,2) NOT NULL,
+ `payment_date` datetime NOT NULL,
+ `last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
+ PRIMARY KEY (`payment_id`),
+ KEY `idx_fk_staff_id` (`staff_id`),
+ KEY `idx_fk_customer_id` (`customer_id`),
+ KEY `fk_payment_rental` (`rental_id`),
+ CONSTRAINT `fk_payment_rental` FOREIGN KEY (`rental_id`) REFERENCES `rental` (`rental_id`) ON DELETE SET NULL ,
+ CONSTRAINT `fk_payment_customer` FOREIGN KEY (`customer_id`) REFERENCES `customer` (`customer_id`) ON UPDATE CASCADE,
+ CONSTRAINT `fk_payment_staff` FOREIGN KEY (`staff_id`) REFERENCES `staff` (`staff_id`) ON UPDATE CASCADE
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+/*!40101 SET character_set_client = @saved_cs_client */;
+
+--
+-- Table structure for table `rental`
+--
+
+DROP TABLE IF EXISTS `rental`;
+/*!40101 SET @saved_cs_client = @@character_set_client */;
+/*!40101 SET character_set_client = utf8 */;
+CREATE TABLE `rental` (
+ `rental_id` int(11) NOT NULL AUTO_INCREMENT,
+ `rental_date` datetime NOT NULL,
+ `inventory_id` mediumint(8) unsigned NOT NULL,
+ `customer_id` smallint(5) unsigned NOT NULL,
+ `return_date` datetime DEFAULT NULL,
+ `staff_id` tinyint(3) unsigned NOT NULL,
+ `last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
+ PRIMARY KEY (`rental_id`),
+ UNIQUE KEY `rental_date` (`rental_date`,`inve​ntory_id`,`customer_​id`),
+ KEY `idx_fk_inventory_id` (`inventory_id`),
+ KEY `idx_fk_customer_id` (`customer_id`),
+ KEY `idx_fk_staff_id` (`staff_id`),
+ CONSTRAINT `fk_rental_staff` FOREIGN KEY (`staff_id`) REFERENCES `staff` (`staff_id`) ON UPDATE CASCADE,
+ CONSTRAINT `fk_rental_inventory` FOREIGN KEY (`inventory_id`) REFERENCES `inventory` (`inventory_id`) ON UPDATE CASCADE,
+ CONSTRAINT `fk_rental_customer` FOREIGN KEY (`customer_id`) REFERENCES `customer` (`customer_id`) ON UPDATE CASCADE
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+/*!40101 SET character_set_client = @saved_cs_client */;
+
+
+
+
+
+--
+-- Table structure for table `staff`
+--
+
+DROP TABLE IF EXISTS `staff`;
+/*!40101 SET @saved_cs_client = @@character_set_client */;
+/*!40101 SET character_set_client = utf8 */;
+CREATE TABLE `staff` (
+ `staff_id` tinyint(3) unsigned NOT NULL AUTO_INCREMENT,
+ `first_name` varchar(45) NOT NULL,
+ `last_name` varchar(45) NOT NULL,
+ `address_id` smallint(5) unsigned NOT NULL,
+ `picture` blob,
+ `email` varchar(50) DEFAULT NULL,
+ `store_id` tinyint(3) unsigned NOT NULL,
+ `active` tinyint(1) NOT NULL DEFAULT '1',
+ `username` varchar(16) NOT NULL,
+ `password` varchar(40) DEFAULT NULL,
+ `last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
+ PRIMARY KEY (`staff_id`),
+ KEY `idx_fk_store_id` (`store_id`),
+ KEY `idx_fk_address_id` (`address_id`),
+ CONSTRAINT `fk_staff_store` FOREIGN KEY (`store_id`) REFERENCES `store` (`store_id`) ON UPDATE CASCADE,
+ CONSTRAINT `fk_staff_address` FOREIGN KEY (`address_id`) REFERENCES `address` (`address_id`) ON UPDATE CASCADE
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+/*!40101 SET character_set_client = @saved_cs_client */;
+
+
+
+--
+-- Table structure for table `store`
+--
+
+DROP TABLE IF EXISTS `store`;
+/*!40101 SET @saved_cs_client = @@character_set_client */;
+/*!40101 SET character_set_client = utf8 */;
+CREATE TABLE `store` (
+ `store_id` tinyint(3) unsigned NOT NULL AUTO_INCREMENT,
+ `manager_staff_id` tinyint(3) unsigned NOT NULL,
+ `address_id` smallint(5) unsigned NOT NULL,
+ `last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
+ PRIMARY KEY (`store_id`),
+ UNIQUE KEY `idx_unique_manager` (`manager_staff_id`),
+ KEY `idx_fk_address_id` (`address_id`),
+ CONSTRAINT `fk_store_staff` FOREIGN KEY (`manager_staff_id`) REFERENCES `staff` (`staff_id`) ON UPDATE CASCADE,
+ CONSTRAINT `fk_store_address` FOREIGN KEY (`address_id`) REFERENCES `address` (`address_id`) ON UPDATE CASCADE
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+/*!40101 SET character_set_client = @saved_cs_client */;
+
+
+/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
+/*!40014 SET FOREIGN_KEY_CHECKS=@​OLD_FOREIGN_KEY_CHEC​KS */;
+/*!40014 SET UNIQUE_CHECKS=@OLD_U​NIQUE_CHECKS */;
+/*!40101 SET CHARACTER_SET_CLIENT​=@OLD_CHARACTER_SET_​CLIENT */;
+/*!40101 SET CHARACTER_SET_RESULT​S=@OLD_CHARACTER_SET​_RESULTS */;
+/*!40101 SET COLLATION_CONNECTION​=@OLD_COLLATION_CONN​ECTION */;
+/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
+
+-- Dump completed on 2013-05-28 20:25:24

« Previous message in topic | 1 of 1 | Next message in topic »

Messages

Show all messages in topic

svn commit: r307 - trunk/www: . img/reveng mysql elbedd Laurent BRAUD 2013-05-29 17:13:33 PDT
Messages per page: