Steuerkram/migrations/042_invoice_storno_of_id.sql

6 lines
262 B
SQL

ALTER TABLE invoices
ADD COLUMN storno_of_id INT UNSIGNED NULL DEFAULT NULL
COMMENT 'FK zur stornierten Originalrechnung'
AFTER beleg_id,
ADD CONSTRAINT fk_invoices_storno_of
FOREIGN KEY (storno_of_id) REFERENCES invoices(id) ON DELETE SET NULL;