--liquibase formatted sql

--changeset cyril:update currency

ALTER TABLE `currency`
    CHANGE COLUMN `description` `description` VARCHAR (100) NOT NULL;

ALTER TABLE `purchase_order`
    ADD COLUMN `currencyId` INT NULL AFTER `supplierId`,
    ADD CONSTRAINT `FK_PURCHASE_ORDER_ON_CURRENCYID` FOREIGN KEY (`currencyId`) REFERENCES `currency` (`id`);
;

ALTER TABLE `purchase_order_line`
DROP
FOREIGN KEY `FK_PURCHASE_ORDER_LINE_ON_CURRENCYID`;

ALTER TABLE `purchase_order_line`
DROP
COLUMN `currencyId`,
DROP INDEX `FK_PURCHASE_ORDER_LINE_ON_CURRENCYID`;
;