ALTER TABLE vn.ticket DROP FOREIGN KEY IF EXISTS ticket_invoiceOut_FK;

ALTER TABLE vn.invoiceOut MODIFY COLUMN `ref` varchar(25) CHARACTER
	SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL;

ALTER TABLE vn.ticket MODIFY COLUMN refFk varchar(25) CHARACTER
	SET utf8mb3 COLLATE utf8mb3_unicode_ci DEFAULT NULL NULL;

ALTER TABLE vn.ticket ADD CONSTRAINT ticket_invoiceOut_FK
	FOREIGN KEY (`refFk`) REFERENCES vn.invoiceOut(`ref`) ON UPDATE CASCADE;

ALTER TABLE vn.XDiario MODIFY COLUMN SERIE varchar(2) CHARACTER
	SET utf8mb3 COLLATE utf8mb3_unicode_ci DEFAULT NULL NULL;

ALTER TABLE vn.XDiario MODIFY COLUMN FACTURA varchar(25) CHARACTER
	SET utf8mb3 COLLATE utf8mb3_unicode_ci DEFAULT '0' NULL;
