DROP TABLE IF EXISTS stock.inboundPick;

CREATE TABLE stock.buyPick (
	id INT UNSIGNED auto_increment NOT NULL,
	lotFk INT(11) NOT NULL
		COMMENT 'Buy id',
	outFk INT(11) NOT NULL
		COMMENT 'Out id',
	quantity INT UNSIGNED NOT NULL
		COMMENT 'Picked quantity',
	PRIMARY KEY (id),
	CONSTRAINT buyPick_unique UNIQUE KEY (lotFk, outFk)
)
ENGINE=InnoDB
DEFAULT CHARSET=utf8mb3
COLLATE=utf8mb3_unicode_ci;
