-- AlterTable: add parentId for hierarchical accounting codes (3-level: TopCategory > SubCategory > Item) ALTER TABLE "Account" ADD COLUMN "parentId" TEXT; ALTER TABLE "Account" ADD CONSTRAINT "Account_parentId_fkey" FOREIGN KEY ("parentId") REFERENCES "Account"("id") ON DELETE SET NULL ON UPDATE CASCADE;