2024-09-24 06:50:34 +00:00
|
|
|
-- vn.priceDelta definition
|
2024-09-23 11:12:53 +00:00
|
|
|
|
2024-09-24 06:50:34 +00:00
|
|
|
CREATE OR REPLACE TABLE vn.priceDelta (
|
2024-09-23 11:12:53 +00:00
|
|
|
`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',
|
2024-09-24 06:50:34 +00:00
|
|
|
`warehouseFk` smallint(6) unsigned DEFAULT NULL,
|
2024-09-23 11:12:53 +00:00
|
|
|
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
|
2024-09-24 06:50:34 +00:00
|
|
|
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci COMMENT='Defines the increasing o decreasing for ranges of items';
|