· 6 years ago · Mar 25, 2019, 03:36 PM
1-- MySQL dump 10.13 Distrib 8.0.15, for osx10.14 (x86_64)
2--
3-- Host: localhost Database: cleanup
4-- ------------------------------------------------------
5-- Server version 8.0.15
6
7/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
8/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
9/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
10 SET NAMES utf8mb4 ;
11/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
12/*!40103 SET TIME_ZONE='+00:00' */;
13/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
14/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
15/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
16/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
17
18--
19-- Table structure for table `derivation_codes`
20--
21
22DROP TABLE IF EXISTS `derivation_codes`;
23/*!40101 SET @saved_cs_client = @@character_set_client */;
24 SET character_set_client = utf8mb4 ;
25CREATE TABLE `derivation_codes` (
26 `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
27 `derivation_code` varchar(255) NOT NULL,
28 `derivation_code_description` varchar(255) DEFAULT NULL,
29 `inserted_at` datetime NOT NULL,
30 `updated_at` datetime NOT NULL,
31 PRIMARY KEY (`id`),
32 UNIQUE KEY `derivation_codes_derivation_code_index` (`derivation_code`)
33) ENGINE=InnoDB AUTO_INCREMENT=11 DEFAULT CHARSET=utf8;
34/*!40101 SET character_set_client = @saved_cs_client */;
35
36--
37-- Table structure for table `nutrients`
38--
39
40DROP TABLE IF EXISTS `nutrients`;
41/*!40101 SET @saved_cs_client = @@character_set_client */;
42 SET character_set_client = utf8mb4 ;
43CREATE TABLE `nutrients` (
44 `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
45 `nutrient_code` varchar(255) DEFAULT NULL,
46 `nutrient_name` varchar(255) DEFAULT NULL,
47 `output_value` decimal(10,0) DEFAULT NULL,
48 `output_uom` varchar(255) DEFAULT NULL,
49 `ndb_no` varchar(255) DEFAULT NULL,
50 `derivation_code` varchar(255) DEFAULT NULL,
51 `inserted_at` datetime NOT NULL,
52 `updated_at` datetime NOT NULL,
53 PRIMARY KEY (`id`),
54 KEY `nutrients_ndb_no_index` (`ndb_no`),
55 KEY `nutrients_derivation_code_index` (`derivation_code`),
56 CONSTRAINT `nutrients_derivation_code_fkey` FOREIGN KEY (`derivation_code`) REFERENCES `derivation_codes` (`derivation_code`),
57 CONSTRAINT `nutrients_ndb_no_fkey` FOREIGN KEY (`ndb_no`) REFERENCES `products` (`ndb_no`)
58) ENGINE=InnoDB AUTO_INCREMENT=3231489 DEFAULT CHARSET=utf8;
59/*!40101 SET character_set_client = @saved_cs_client */;
60
61--
62-- Table structure for table `products`
63--
64
65DROP TABLE IF EXISTS `products`;
66/*!40101 SET @saved_cs_client = @@character_set_client */;
67 SET character_set_client = utf8mb4 ;
68CREATE TABLE `products` (
69 `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
70 `ndb_no` varchar(255) NOT NULL,
71 `long_name` varchar(255) DEFAULT NULL,
72 `ingredients` varchar(4000) DEFAULT NULL,
73 `data_source` varchar(255) DEFAULT NULL,
74 `gtin_upc` varchar(255) DEFAULT NULL,
75 `manufacturer` varchar(255) DEFAULT NULL,
76 `date_modified` datetime DEFAULT NULL,
77 `date_available` datetime DEFAULT NULL,
78 `inserted_at` datetime NOT NULL,
79 `updated_at` datetime NOT NULL,
80 PRIMARY KEY (`id`),
81 UNIQUE KEY `products_ndb_no_index` (`ndb_no`)
82) ENGINE=InnoDB AUTO_INCREMENT=239091 DEFAULT CHARSET=utf8;
83/*!40101 SET character_set_client = @saved_cs_client */;
84
85--
86-- Table structure for table `servings`
87--
88
89DROP TABLE IF EXISTS `servings`;
90/*!40101 SET @saved_cs_client = @@character_set_client */;
91 SET character_set_client = utf8mb4 ;
92CREATE TABLE `servings` (
93 `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
94 `serving_size` decimal(10,0) DEFAULT NULL,
95 `serving_size_uom` varchar(255) DEFAULT NULL,
96 `household_serving_size` decimal(10,0) DEFAULT NULL,
97 `household_serving_size_uom` varchar(255) DEFAULT NULL,
98 `ndb_no` varchar(255) DEFAULT NULL,
99 `inserted_at` datetime NOT NULL,
100 `updated_at` datetime NOT NULL,
101 PRIMARY KEY (`id`),
102 KEY `servings_ndb_no_index` (`ndb_no`),
103 CONSTRAINT `servings_ndb_no_fkey` FOREIGN KEY (`ndb_no`) REFERENCES `products` (`ndb_no`)
104) ENGINE=InnoDB AUTO_INCREMENT=475821 DEFAULT CHARSET=utf8;
105/*!40101 SET character_set_client = @saved_cs_client */;
106/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
107
108/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
109/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
110/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
111/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
112/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
113/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
114/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
115
116-- Dump completed on 2019-03-25 18:33:15