Advertisement
Guest User

Untitled

a guest
Dec 31st, 2012
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
SQL 5.46 KB | None | 0 0
  1. /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
  2. /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
  3. /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
  4. /*!40101 SET NAMES utf8 */;
  5. /*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
  6. /*!40103 SET TIME_ZONE='+00:00' */;
  7. /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
  8. /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
  9. /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
  10. /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
  11.  
  12. --
  13. -- Table structure for table `customers`
  14. --
  15.  
  16. DROP TABLE IF EXISTS `customers`;
  17. /*!40101 SET @saved_cs_client     = @@character_set_client */;
  18. /*!40101 SET character_set_client = utf8 */;
  19. CREATE TABLE `customers` (
  20.   `id` INT(11) NOT NULL AUTO_INCREMENT,
  21.   PRIMARY KEY (`id`)
  22. ) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=latin1;
  23. /*!40101 SET character_set_client = @saved_cs_client */;
  24.  
  25. --
  26. -- Dumping data for table `customers`
  27. --
  28.  
  29. LOCK TABLES `customers` WRITE;
  30. /*!40000 ALTER TABLE `customers` DISABLE KEYS */;
  31. INSERT INTO `customers` VALUES (1),(2);
  32. /*!40000 ALTER TABLE `customers` ENABLE KEYS */;
  33. UNLOCK TABLES;
  34.  
  35. --
  36. -- Table structure for table `delivery_zone_weeks`
  37. --
  38.  
  39. DROP TABLE IF EXISTS `delivery_zone_weeks`;
  40. /*!40101 SET @saved_cs_client     = @@character_set_client */;
  41. /*!40101 SET character_set_client = utf8 */;
  42. CREATE TABLE `delivery_zone_weeks` (
  43.   `id` INT(11) NOT NULL AUTO_INCREMENT,
  44.   `delivery_zone_id` INT(11) DEFAULT NULL,
  45.   PRIMARY KEY (`id`),
  46.   KEY `delivery_zone_id` (`delivery_zone_id`),
  47.   CONSTRAINT `delivery_zone_weeks_ibfk_1` FOREIGN KEY (`delivery_zone_id`) REFERENCES `delivery_zones` (`id`)
  48. ) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=latin1;
  49. /*!40101 SET character_set_client = @saved_cs_client */;
  50.  
  51. --
  52. -- Dumping data for table `delivery_zone_weeks`
  53. --
  54.  
  55. LOCK TABLES `delivery_zone_weeks` WRITE;
  56. /*!40000 ALTER TABLE `delivery_zone_weeks` DISABLE KEYS */;
  57. INSERT INTO `delivery_zone_weeks` VALUES (1,1),(2,2);
  58. /*!40000 ALTER TABLE `delivery_zone_weeks` ENABLE KEYS */;
  59. UNLOCK TABLES;
  60.  
  61. --
  62. -- Table structure for table `delivery_zones`
  63. --
  64.  
  65. DROP TABLE IF EXISTS `delivery_zones`;
  66. /*!40101 SET @saved_cs_client     = @@character_set_client */;
  67. /*!40101 SET character_set_client = utf8 */;
  68. CREATE TABLE `delivery_zones` (
  69.   `id` INT(11) NOT NULL AUTO_INCREMENT,
  70.   PRIMARY KEY (`id`)
  71. ) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=latin1;
  72. /*!40101 SET character_set_client = @saved_cs_client */;
  73.  
  74. --
  75. -- Dumping data for table `delivery_zones`
  76. --
  77.  
  78. LOCK TABLES `delivery_zones` WRITE;
  79. /*!40000 ALTER TABLE `delivery_zones` DISABLE KEYS */;
  80. INSERT INTO `delivery_zones` VALUES (1),(2);
  81. /*!40000 ALTER TABLE `delivery_zones` ENABLE KEYS */;
  82. UNLOCK TABLES;
  83.  
  84. --
  85. -- Table structure for table `shipping_addresses`
  86. --
  87.  
  88. DROP TABLE IF EXISTS `shipping_addresses`;
  89. /*!40101 SET @saved_cs_client     = @@character_set_client */;
  90. /*!40101 SET character_set_client = utf8 */;
  91. CREATE TABLE `shipping_addresses` (
  92.   `id` INT(11) NOT NULL AUTO_INCREMENT,
  93.   `customer_id` INT(11) DEFAULT NULL,
  94.   `delivery_zone_id` INT(11) DEFAULT NULL,
  95.   PRIMARY KEY (`id`),
  96.   KEY `customer_id` (`customer_id`),
  97.   KEY `delivery_zone_id` (`delivery_zone_id`),
  98.   CONSTRAINT `shipping_addresses_ibfk_1` FOREIGN KEY (`delivery_zone_id`) REFERENCES `delivery_zones` (`id`),
  99.   CONSTRAINT `shipping_addresses_ibfk_2` FOREIGN KEY (`customer_id`) REFERENCES `customers` (`id`)
  100. ) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=latin1;
  101. /*!40101 SET character_set_client = @saved_cs_client */;
  102.  
  103. --
  104. -- Dumping data for table `shipping_addresses`
  105. --
  106.  
  107. LOCK TABLES `shipping_addresses` WRITE;
  108. /*!40000 ALTER TABLE `shipping_addresses` DISABLE KEYS */;
  109. INSERT INTO `shipping_addresses` VALUES (1,1,1),(2,2,1),(3,2,2);
  110. /*!40000 ALTER TABLE `shipping_addresses` ENABLE KEYS */;
  111. UNLOCK TABLES;
  112.  
  113. --
  114. -- Table structure for table `weekly_orders`
  115. --
  116.  
  117. DROP TABLE IF EXISTS `weekly_orders`;
  118. /*!40101 SET @saved_cs_client     = @@character_set_client */;
  119. /*!40101 SET character_set_client = utf8 */;
  120. CREATE TABLE `weekly_orders` (
  121.   `id` INT(11) NOT NULL AUTO_INCREMENT,
  122.   `shipping_address_id` INT(11) DEFAULT NULL,
  123.   `delivery_zone_week_id` INT(11) DEFAULT NULL,
  124.   PRIMARY KEY (`id`),
  125.   KEY `shipping_address_id` (`shipping_address_id`),
  126.   KEY `delivery_zone_week_id` (`delivery_zone_week_id`),
  127.   CONSTRAINT `weekly_orders_ibfk_1` FOREIGN KEY (`shipping_address_id`) REFERENCES `shipping_addresses` (`id`),
  128.   CONSTRAINT `weekly_orders_ibfk_2` FOREIGN KEY (`delivery_zone_week_id`) REFERENCES `delivery_zone_weeks` (`id`)
  129. ) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=latin1;
  130. /*!40101 SET character_set_client = @saved_cs_client */;
  131.  
  132. --
  133. -- Dumping data for table `weekly_orders`
  134. --
  135.  
  136. LOCK TABLES `weekly_orders` WRITE;
  137. /*!40000 ALTER TABLE `weekly_orders` DISABLE KEYS */;
  138. INSERT INTO `weekly_orders` VALUES (1,1,1),(2,3,2);
  139. /*!40000 ALTER TABLE `weekly_orders` ENABLE KEYS */;
  140. UNLOCK TABLES;
  141. /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
  142.  
  143. /*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
  144. /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
  145. /*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
  146. /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
  147. /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
  148. /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
  149. /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
  150.  
  151. -- Dump completed on 2012-12-31 21:23:25
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement