-- phpMyAdmin SQL Dump
-- version 4.7.4
-- https://www.phpmyadmin.net/
--
-- Host: localhost
-- Generation Time: Feb 27, 2019 at 03:08 PM
-- Server version: 5.7.25-0ubuntu0.16.04.2
-- PHP Version: 7.0.33-0ubuntu0.16.04.1

SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";


/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;

--
-- Database: `promo_standards`
--

-- --------------------------------------------------------

--
-- Table structure for table `charges_information`
--

CREATE TABLE `charges_information` (
  `id` int(11) NOT NULL,
  `product_sku` varchar(64) NOT NULL,
  `charge_information` mediumtext NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

-- --------------------------------------------------------

--
-- Table structure for table `media_collection`
--

CREATE TABLE `media_collection` (
  `id` int(11) NOT NULL,
  `product_sku` varchar(64) NOT NULL,
  `part_id` varchar(64) NOT NULL,
  `media_url` text NOT NULL,
  `media_type` varchar(255) NOT NULL,
  `file_size` double NOT NULL,
  `width` int(11) NOT NULL,
  `height` int(11) NOT NULL,
  `dot_per_inch` int(11) NOT NULL,
  `color` varchar(255) NOT NULL,
  `description` text NOT NULL,
  `change_time_stamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `decoration_id` int(11) NOT NULL,
  `decoration_name` varchar(64) NOT NULL,
  `location_id` int(11) NOT NULL,
  `location_name` varchar(64) NOT NULL,
  `class_type` text NOT NULL,
  `single_part` tinyint(1) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

-- --------------------------------------------------------

--
-- Table structure for table `products`
--

CREATE TABLE `products` (
  `id` int(32) NOT NULL,
  `name` varchar(64) DEFAULT NULL,
  `sku` varchar(64) NOT NULL,
  `description` text NOT NULL,
  `brand` varchar(64) NOT NULL,
  `created_date` date NOT NULL,
  `last_change_date` date NOT NULL,
  `is_caution` tinyint(1) NOT NULL,
  `export` tinyint(1) NOT NULL,
  `is_closeout` tinyint(1) NOT NULL,
  `product_marketing` text NOT NULL,
  `product_keyword` text NOT NULL,
  `product_category` text NOT NULL,
  `related_product` text NOT NULL,
  `product_part_id` varchar(64) NOT NULL,
  `end_date` date NOT NULL,
  `effective_date` date NOT NULL,
  `caution_comment` text,
  `line_name` varchar(64) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

-- --------------------------------------------------------

--
-- Table structure for table `product_category`
--

CREATE TABLE `product_category` (
  `category_id` int(11) NOT NULL,
  `product_sku` varchar(64) NOT NULL,
  `category_name` varchar(64) NOT NULL,
  `subcategory_name` varchar(64) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

-- --------------------------------------------------------

--
-- Table structure for table `product_config_n_pricing`
--

CREATE TABLE `product_config_n_pricing` (
  `id` int(11) NOT NULL,
  `product_sku` varchar(64) NOT NULL,
  `part` text NOT NULL,
  `location` int(11) NOT NULL,
  `currency` varchar(64) NOT NULL,
  `fob_details` text NOT NULL,
  `fob_postal_code` varchar(255) NOT NULL,
  `pricetype` varchar(64) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

-- --------------------------------------------------------

--
-- Table structure for table `product_fob`
--

CREATE TABLE `product_fob` (
  `id` int(11) NOT NULL,
  `fob_id` varchar(64) NOT NULL,
  `fob_city` varchar(64) NOT NULL,
  `fob_postal_code` varchar(64) NOT NULL,
  `fob_state` varchar(64) NOT NULL,
  `fob_country` varchar(64) NOT NULL,
  `currency` text NOT NULL,
  `product_sku` varchar(64) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

-- --------------------------------------------------------

--
-- Table structure for table `product_location`
--

CREATE TABLE `product_location` (
  `id` int(11) NOT NULL,
  `product_sku` varchar(255) NOT NULL,
  `location_id` int(11) NOT NULL,
  `location_name` text NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

-- --------------------------------------------------------

--
-- Table structure for table `product_parts`
--

CREATE TABLE `product_parts` (
  `id` int(11) NOT NULL,
  `part_id` varchar(64) NOT NULL,
  `product_sku` varchar(64) NOT NULL,
  `description` text NOT NULL,
  `country_of_origin` varchar(2) NOT NULL,
  `primary_material` varchar(64) NOT NULL,
  `shape` varchar(64) NOT NULL,
  `color` text NOT NULL,
  `specification` text NOT NULL,
  `apparel_size` text NOT NULL,
  `dimension` text NOT NULL,
  `lead_time` int(11) DEFAULT NULL,
  `unspsc` varchar(8) DEFAULT NULL,
  `gtin` varchar(14) DEFAULT NULL,
  `is_rush_service` tinyint(1) NOT NULL,
  `product_packaging` text NOT NULL,
  `shipping_package` text NOT NULL,
  `end_date` date NOT NULL,
  `effective_date` date NOT NULL,
  `is_closeout` tinyint(1) NOT NULL,
  `is_caution` tinyint(1) NOT NULL,
  `caution_comment` text,
  `nmfc_code` decimal(10,0) DEFAULT NULL,
  `nmfc_description` text,
  `nmfc_number` varchar(64) DEFAULT NULL,
  `is_on_demand` tinyint(1) NOT NULL,
  `is_hazmat` tinyint(1) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

-- --------------------------------------------------------

--
-- Table structure for table `related_products`
--

CREATE TABLE `related_products` (
  `id` int(11) NOT NULL,
  `product_sku` varchar(64) NOT NULL,
  `relation_type` varchar(64) NOT NULL,
  `part_id` varchar(64) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

-- --------------------------------------------------------

--
-- Table structure for table `shopify_products_data`
--

CREATE TABLE `shopify_products_data` (
  `id` int(11) NOT NULL,
  `product_id` bigint(20) NOT NULL,
  `product_sku` varchar(64) NOT NULL,
  `inventory_item_id` bigint(20) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Indexes for dumped tables
--

--
-- Indexes for table `charges_information`
--
ALTER TABLE `charges_information`
  ADD PRIMARY KEY (`id`),
  ADD KEY `charges_fk_product_sku` (`product_sku`);

--
-- Indexes for table `media_collection`
--
ALTER TABLE `media_collection`
  ADD PRIMARY KEY (`id`),
  ADD KEY `media_fk_product_sku` (`product_sku`);

--
-- Indexes for table `products`
--
ALTER TABLE `products`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `product_sku` (`sku`);

--
-- Indexes for table `product_category`
--
ALTER TABLE `product_category`
  ADD PRIMARY KEY (`category_id`),
  ADD UNIQUE KEY `category_product` (`product_sku`);

--
-- Indexes for table `product_config_n_pricing`
--
ALTER TABLE `product_config_n_pricing`
  ADD PRIMARY KEY (`id`),
  ADD KEY `product_config_fk_product_sku` (`product_sku`);

--
-- Indexes for table `product_fob`
--
ALTER TABLE `product_fob`
  ADD PRIMARY KEY (`id`),
  ADD KEY `product_fob_fk_product_sku` (`product_sku`);

--
-- Indexes for table `product_location`
--
ALTER TABLE `product_location`
  ADD PRIMARY KEY (`id`,`location_id`),
  ADD KEY `product_location_fk_product_sku` (`product_sku`);

--
-- Indexes for table `product_parts`
--
ALTER TABLE `product_parts`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `product_part_id` (`part_id`),
  ADD KEY `parts_product_fk_id` (`product_sku`);

--
-- Indexes for table `related_products`
--
ALTER TABLE `related_products`
  ADD PRIMARY KEY (`id`),
  ADD KEY `related_product_fk_product_sku` (`product_sku`);

--
-- Indexes for table `shopify_products_data`
--
ALTER TABLE `shopify_products_data`
  ADD PRIMARY KEY (`id`);

--
-- AUTO_INCREMENT for dumped tables
--

--
-- AUTO_INCREMENT for table `charges_information`
--
ALTER TABLE `charges_information`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `media_collection`
--
ALTER TABLE `media_collection`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `products`
--
ALTER TABLE `products`
  MODIFY `id` int(32) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=1;

--
-- AUTO_INCREMENT for table `product_category`
--
ALTER TABLE `product_category`
  MODIFY `category_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=1;

--
-- AUTO_INCREMENT for table `product_config_n_pricing`
--
ALTER TABLE `product_config_n_pricing`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `product_fob`
--
ALTER TABLE `product_fob`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `product_location`
--
ALTER TABLE `product_location`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `product_parts`
--
ALTER TABLE `product_parts`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=1;

--
-- AUTO_INCREMENT for table `related_products`
--
ALTER TABLE `related_products`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=1;

--
-- AUTO_INCREMENT for table `shopify_products_data`
--
ALTER TABLE `shopify_products_data`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=1;

--
-- Constraints for dumped tables
--

--
-- Constraints for table `charges_information`
--
ALTER TABLE `charges_information`
  ADD CONSTRAINT `charges_fk_product_sku` FOREIGN KEY (`product_sku`) REFERENCES `products` (`sku`);

--
-- Constraints for table `media_collection`
--
ALTER TABLE `media_collection`
  ADD CONSTRAINT `media_fk_product_sku` FOREIGN KEY (`product_sku`) REFERENCES `products` (`sku`);

--
-- Constraints for table `product_category`
--
ALTER TABLE `product_category`
  ADD CONSTRAINT `category_product_fk_productsku` FOREIGN KEY (`product_sku`) REFERENCES `products` (`sku`);

--
-- Constraints for table `product_config_n_pricing`
--
ALTER TABLE `product_config_n_pricing`
  ADD CONSTRAINT `product_config_fk_product_sku` FOREIGN KEY (`product_sku`) REFERENCES `products` (`sku`);

--
-- Constraints for table `product_fob`
--
ALTER TABLE `product_fob`
  ADD CONSTRAINT `product_fob_fk_product_sku` FOREIGN KEY (`product_sku`) REFERENCES `products` (`sku`);

--
-- Constraints for table `product_location`
--
ALTER TABLE `product_location`
  ADD CONSTRAINT `product_location_fk_product_sku` FOREIGN KEY (`product_sku`) REFERENCES `products` (`sku`);

--
-- Constraints for table `product_parts`
--
ALTER TABLE `product_parts`
  ADD CONSTRAINT `parts_product_fk_id` FOREIGN KEY (`product_sku`) REFERENCES `products` (`sku`);

--
-- Constraints for table `related_products`
--
ALTER TABLE `related_products`
  ADD CONSTRAINT `related_product_fk_product_sku` FOREIGN KEY (`product_sku`) REFERENCES `products` (`sku`);
COMMIT;

/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
