-- phpMyAdmin SQL Dump
-- version 4.7.4
-- https://www.phpmyadmin.net/
--
-- Host: localhost
-- Generation Time:  3 окт 2017 в 06:19
-- Версия на сървъра: 5.7.19-log
-- PHP Version: 7.1.7RC1

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: `sklad`
--

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

--
-- Структура на таблица `price_list_conditions`
--

CREATE TABLE `price_list_conditions` (
  `id` int(11) NOT NULL,
  `price_list_id` int(11) NOT NULL,
  `category` int(11) NOT NULL DEFAULT '0',
  `producer` int(11) NOT NULL DEFAULT '0',
  `mark` int(11) NOT NULL DEFAULT '0',
  `material` int(11) NOT NULL DEFAULT '0',
  `product` int(11) NOT NULL DEFAULT '0',
  `price` int(11) DEFAULT NULL,
  `discount` float DEFAULT NULL,
  `fixed_price` float DEFAULT NULL,
  `condition` float DEFAULT NULL,
  `cond_period` int(11) DEFAULT NULL,
  `cond_discount` float DEFAULT NULL,
  `cond_fixed_price` float DEFAULT NULL,
  `priority` int(11) DEFAULT NULL,
  `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Indexes for dumped tables
--

--
-- Indexes for table `price_list_conditions`
--
ALTER TABLE `price_list_conditions`
  ADD PRIMARY KEY (`id`),
  ADD KEY `price_list_id` (`price_list_id`);

--
-- AUTO_INCREMENT for dumped tables
--

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

--
-- Ограничения за дъмпнати таблици
--

--
-- Ограничения за таблица `price_list_conditions`
--
ALTER TABLE `price_list_conditions`
  ADD CONSTRAINT `price_list_conditions_ibfk_1` FOREIGN KEY (`price_list_id`) REFERENCES `price_lists` (`id`);
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 */;
