-- Place your SQL code here
-- Place your SQL code here

CREATE TABLE `priceDelta` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `itemTypeFk` smallint(5) unsigned NOT NULL,
  `minSize` int(10) unsigned DEFAULT NULL COMMENT 'Minimum item.size',
  `maxSize` int(10) unsigned DEFAULT NULL COMMENT 'Maximum item.size',
  `inkFk` varchar(3) DEFAULT NULL,
  `originFk` tinyint(2) unsigned DEFAULT NULL,
  `producerFk` mediumint(3) unsigned DEFAULT NULL,
  `fromDated` date DEFAULT NULL,
  `toDated` date DEFAULT NULL,
  `absIncreasing` decimal(10,3) DEFAULT NULL COMMENT 'Absolute increasing of final price',
  `ratIncreasing` int(11) DEFAULT NULL COMMENT 'Increasing ratio for the cost price',
  PRIMARY KEY (`id`),
  KEY `priceDelta_itemType_FK` (`itemTypeFk`),
  KEY `priceDelta_ink_FK` (`inkFk`),
  KEY `priceDelta_producer_FK` (`producerFk`),
  CONSTRAINT `priceDelta_ink_FK` FOREIGN KEY (`inkFk`) REFERENCES `ink` (`id`) ON UPDATE CASCADE,
  CONSTRAINT `priceDelta_itemType_FK` FOREIGN KEY (`itemTypeFk`) REFERENCES `itemType` (`id`) ON UPDATE CASCADE,
  CONSTRAINT `priceDelta_producer_FK` FOREIGN KEY (`producerFk`) REFERENCES `producer` (`id`) ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci COMMENT='Defines the increasing o decreasing for ranges of items';