DROP INDEX IF EXISTS idx_expenses_cash_advance_id;

ALTER TABLE expenses
    DROP CONSTRAINT IF EXISTS fk_expenses_cash_advance;

ALTER TABLE expenses
    DROP COLUMN IF EXISTS cash_advance_id;

DROP INDEX IF EXISTS idx_purchase_orders_cash_advance_id;

ALTER TABLE purchase_orders
    DROP CONSTRAINT IF EXISTS fk_purchase_orders_cash_advance;

ALTER TABLE purchase_orders
    DROP COLUMN IF EXISTS cash_advance_id;
