ALTER TABLE public.count_invoices_rows DROP COLUMN row_total;
ALTER TABLE public.count_invoices_rows DROP COLUMN row_total_vat;

ALTER TABLE public.count_invoices_rows ALTER COLUMN quantity TYPE numeric(8, 2) USING quantity::numeric;

ALTER TABLE public.count_invoices_rows ADD COLUMN row_total numeric(12, 2) NOT NULL GENERATED ALWAYS AS ((quantity::numeric * unit_price)) STORED;
ALTER TABLE public.count_invoices_rows ADD COLUMN row_total_vat numeric(12, 2) NOT NULL GENERATED ALWAYS AS ((quantity::numeric * unit_price + quantity::numeric * unit_price / 100::numeric * row_vat)) STORED;





