This commit is contained in:
Mateusz Gruszczyński
2026-03-13 11:03:13 +01:00
commit 35571df778
132 changed files with 11197 additions and 0 deletions

View File

@@ -0,0 +1,9 @@
-- SQLite migration for split payment support
-- Run once on an existing database.
ALTER TABLE product ADD COLUMN split_payment_default INTEGER NOT NULL DEFAULT 0;
ALTER TABLE invoice ADD COLUMN split_payment INTEGER NOT NULL DEFAULT 0;
-- Optional backfill examples:
-- UPDATE product SET split_payment_default = 1 WHERE name IN ('Usługa A', 'Usługa B');
-- UPDATE invoice SET split_payment = 1 WHERE gross_amount >= 15000;

View File

@@ -0,0 +1,9 @@
ALTER TABLE company ADD COLUMN bank_account VARCHAR(64) DEFAULT '';
ALTER TABLE invoice ADD COLUMN seller_bank_account VARCHAR(64) DEFAULT '';
-- Optional backfill from current company data for already issued invoices:
-- UPDATE invoice
-- SET seller_bank_account = (
-- SELECT company.bank_account FROM company WHERE company.id = invoice.company_id
-- )
-- WHERE COALESCE(seller_bank_account, '') = '';