Advertisement
Guest User

Untitled

a guest
Mar 20th, 2019
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MySQL 2.24 KB | None | 0 0
  1. DROP TABLE IF EXISTS `delivery_config_new`;
  2. CREATE TABLE `delivery_config_new` (
  3.     `delivery_config_id` INT(10) NOT NULL AUTO_INCREMENT,
  4.     `delivery_types_id` INT(10) NOT NULL COMMENT 'Ссылка на способ доставки',
  5.     `fias_id` INT(11) NOT NULL DEFAULT 0,
  6.     `price_default` INT(11) NOT NULL COMMENT 'Цена по умолчанию (для отчетов)',
  7.     `zone` VARCHAR(50) NOT NULL DEFAULT '0' COMMENT 'Зона для расчета трукоста',
  8.     `data` VARCHAR(50) NULL DEFAULT NULL,
  9.     `date_start` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
  10.     `date_end` TIMESTAMP NOT NULL DEFAULT '2038-01-01 00:00:00',
  11.     `is_active` TINYINT(1) NOT NULL DEFAULT '0',
  12.     PRIMARY KEY (`delivery_config_id`),
  13.     INDEX `delivery_types_id_fias_id_idx` (`delivery_types_id`, `fias_id`)
  14. )
  15. COMMENT='Настройки доставки ТК'
  16. COLLATE='utf8_general_ci'
  17. ENGINE=InnoDB
  18. ;
  19.  
  20. DROP TABLE IF EXISTS `delivery_config_extra`;
  21. CREATE TABLE `delivery_config_extra` (
  22.     `delivery_types_id` INT(10) NOT NULL COMMENT 'Ссылка на способ доставки',
  23.     `fias_id` INT(11) NOT NULL DEFAULT 0,
  24.     `tc_city_code` VARCHAR(255) NOT NULL DEFAULT '' COMMENT 'Код города в системе ТК',
  25.     PRIMARY KEY (`delivery_types_id`, `fias_id`),
  26.     INDEX `tc_city_code_idx` (`tc_city_code`)
  27. )
  28. COMMENT='Связь фиаса и города в системе ТК'
  29. COLLATE='utf8_general_ci'
  30. ENGINE=InnoDB
  31. ;
  32.  
  33. DROP TABLE IF EXISTS `delivery_ranges`;
  34. CREATE TABLE `delivery_ranges` (
  35.     `delivery_ranges_id` INT(10) NOT NULL AUTO_INCREMENT,
  36.     `delivery_types_id` INT(10) NOT NULL COMMENT 'Ссылка на способ доставки',
  37.     `object_id` INT(11) NOT NULL DEFAULT '0',
  38.     `entities_id` INT(11) NOT NULL DEFAULT '0',
  39.     `subtotal_from` DECIMAL(15,2) NOT NULL DEFAULT 0 COMMENT 'Стоимость товаров от',
  40.     `subtotal_to` DECIMAL(15,2) NOT NULL DEFAULT 0 COMMENT 'Стоимость товаров до',
  41.     `price` INT(11) NOT NULL DEFAULT '0',
  42.     INDEX `delivery_types_id_idx` (`delivery_types_id`),
  43.     INDEX `object_id_idx` (`object_id`),
  44.     INDEX `entities_id_idx` (`entities_id`),
  45.     PRIMARY KEY (`delivery_ranges_id`)
  46. )
  47. COMMENT='Диапазоны стоимостей доставки'
  48. COLLATE='utf8_general_ci'
  49. ENGINE=InnoDB
  50. ;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement