asxpio/db/migrations
Sergei Poljanski 4e68a74ef5
db: issuer_profiles + clients migration
issuer_profiles is one row per user with all the legal-entity fields
that previously lived in the ISSUER constant — legal name, tax id,
reg number, bank details — plus per-user defaults (invoice prefix,
currency, due days, notes). On invoice creation these get snapshotted
onto the invoice row so historical PDFs render unchanged when the
user later edits their profile.

clients is per-user, case-insensitive unique on (owner_id, email).
Partial index on active clients for the dropdown. Soft-archive only;
ON DELETE RESTRICT to honor the indefinite-retention rule.
2026-05-26 19:08:55 +03:00
..
001_invoices.rb db: connection helper and invoices migration 2026-05-26 17:43:18 +03:00
002_users_and_password_tokens.rb db: users + password_tokens migration 2026-05-26 19:07:55 +03:00
003_issuer_profiles_and_clients.rb db: issuer_profiles + clients migration 2026-05-26 19:08:55 +03:00