-- phpMyAdmin SQL Dump
-- version 4.7.4
-- https://www.phpmyadmin.net/
--
-- Host: localhost
-- Generation Time:  6 окт 2017 в 15:05
-- Версия на сървъра: 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`
--

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

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

CREATE TABLE `promotions` (
  `id` int(11) NOT NULL,
  `title` varchar(50) NOT NULL,
  `description` text NOT NULL,
  `active` tinyint(4) DEFAULT '0',
  `promotion_visibility` varchar(255) DEFAULT NULL,
  `promotion_validity` tinyint(4) NOT NULL,
  `date_from` datetime DEFAULT NULL,
  `date_to` datetime DEFAULT NULL,
  `promo_number` int(11) DEFAULT NULL,
  `repeatability` tinyint(4) DEFAULT '0',
  `repeatability_from` time DEFAULT NULL,
  `repeatability_to` time DEFAULT NULL,
  `weekdays` varchar(255) DEFAULT NULL,
  `promotion_type` tinyint(4) NOT NULL,
  `max_count` int(11) DEFAULT NULL,
  `condition_type` tinyint(4) DEFAULT NULL,
  `condition_package` tinyint(4) DEFAULT NULL,
  `condition_products` json DEFAULT NULL,
  `bonus_type` tinyint(4) DEFAULT NULL,
  `bonus_package` tinyint(4) DEFAULT NULL,
  `bonus_products` json DEFAULT NULL,
  `bonus_discount` float UNSIGNED DEFAULT NULL,
  `category` int(10) UNSIGNED NOT NULL DEFAULT '0',
  `producer` int(10) UNSIGNED NOT NULL DEFAULT '0',
  `mark` int(10) UNSIGNED NOT NULL DEFAULT '0',
  `material` int(10) UNSIGNED NOT NULL DEFAULT '0',
  `price_product` int(10) UNSIGNED NOT NULL DEFAULT '0',
  `batch` varchar(50) DEFAULT NULL,
  `price` int(11) UNSIGNED NOT NULL DEFAULT '0',
  `discount` float UNSIGNED DEFAULT NULL,
  `fixed_price` float UNSIGNED DEFAULT NULL,
  `condition` float UNSIGNED DEFAULT NULL,
  `cond_period` int(10) UNSIGNED DEFAULT NULL,
  `cond_discount` float UNSIGNED DEFAULT NULL,
  `cond_fixed_price` float UNSIGNED 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 `promotions`
--
ALTER TABLE `promotions`
  ADD PRIMARY KEY (`id`);

--
-- AUTO_INCREMENT for dumped tables
--

--
-- AUTO_INCREMENT for table `promotions`
--
ALTER TABLE `promotions`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
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 */;
