3417ed6698
- expense_kind enum (utilities + maintenance/repair/cleaning/insurance/tax/rent/other) - property_expenses table with optional link to a property_accounts row (preserves history via ON DELETE SET NULL) - services/expenses.ts: CRUD + 12-month monthly series aggregation + year-to-date summary by kind - /properties/[id]/expenses tab: inline SVG line chart for electricity + water last 12 months (no chart library), summary card, add/edit/delete inline with account linking when kind matches
drizzle migrations
This directory holds SQL migrations generated by drizzle-kit generate from the
TypeScript schema in src/lib/server/db/schema/.
Commands:
npm run db:generate— diff the schema vs. the latest snapshot and emit a new.sqlfilenpm run db:migrate— apply pending migrations toDATABASE_URLnpm run db:push— skip migrations and sync the schema directly (dev only)npm run db:studio— open the Drizzle Studio UI
After every generate, review the SQL for surprises — especially around:
- enum additions (non-blocking) vs. removals (require a separate data migration)
- index changes on large tables (use
CONCURRENTLYin production rollouts) - anything touching
assets.custom_fields— seeproject_buildfor_life_ops.mdmemory for the immutable-key policy.