alter table {schema}.quote_items
    add column if not exists line_kind text not null default 'item',
    add column if not exists activity_id uuid references {schema}.activities(id);

alter table {schema}.quote_items
    alter column item_id drop not null;

alter table {schema}.outgoing_invoice_items
    add column if not exists line_kind text not null default 'item',
    add column if not exists activity_id uuid references {schema}.activities(id);

alter table {schema}.outgoing_invoice_items
    alter column item_id drop not null;
