ALTER TABLE accounting_invoices ADD COLUMN deleted_at TEXT;
ALTER TABLE accounting_invoices ADD COLUMN deleted_by INTEGER REFERENCES users(id) ON DELETE SET NULL;
CREATE INDEX idx_accounting_invoices_deleted ON accounting_invoices(deleted_at,invoice_date);
