feat(invoices): add billingEntityType/Id for polymorphic billing

This commit is contained in:
Matt Ciaccio
2026-04-23 17:58:52 +02:00
parent d43298a74e
commit 117cfae52e
4 changed files with 8551 additions and 3 deletions

View File

@@ -0,0 +1,3 @@
ALTER TABLE "invoices" ADD COLUMN "billing_entity_type" text DEFAULT 'client' NOT NULL;--> statement-breakpoint
ALTER TABLE "invoices" ADD COLUMN "billing_entity_id" text DEFAULT '' NOT NULL;--> statement-breakpoint
CREATE INDEX "idx_invoices_billing_entity" ON "invoices" USING btree ("port_id","billing_entity_type","billing_entity_id");