feat(db): add naming_instructions to user_settings
AA
2h ago+17307+17307+01234567890123456789012345678901234567890123456789-1-1-0123456789
What & why
First of three PRs for #9197 (account-wide naming instructions). This one only adds a nullable naming_instructions text column to user_settings. It ships alone because of the rule that a schema migration goes in its own PR (packages/trpc/AGENTS.md rule 10).
- Next: the API field in
userSettings.get/update(PR 2), then host-service and desktop (PR 3). loadUserSettingsselects columns explicitly, so the API output stays the same in this PR.
How I tested it
drizzle-kit generatewrote0190_user_settings_naming_instructions.sql, which is one statement:ALTER TABLE "user_settings" ADD COLUMN "naming_instructions" text;- Applied all migrations to this workspace's own local Postgres 18 DB. The column exists afterwards.
Migration safety checklist:
- Nullable column with no default, so Postgres changes only metadata: no table rewrite, and the ACCESS EXCLUSIVE lock is held for a moment only.
user_settingsis small (one row per person who has changed a setting) and is not one of the hot tables in rule 4.- No foreign keys change, so lock order doesn't matter.
- No tRPC input or output change in this PR.
- Not rehearsed under load, and I didn't check production table sizes, since I have no production access. A metadata-only
ADD COLUMNon a small table should not need it, but a maintainer may want to confirm theuser_settingssize.
Checklist
- PR title follows conventional commits (
type(scope): subject) -
bun run lintandbun run typecheckpass (CI fails on lint warnings too) - "Allow edits from maintainers" is checked on fork PRs
- I have signed the CLA (the bot asks on your first PR)
Summary by cubic
Adds a nullable naming_instructions text column to user_settings as the first step toward account-wide naming instructions (#9197). This PR ships only the schema migration; the API field and host-service changes come in follow-up PRs.
- The migration is a single
ALTER TABLEadding a nullable column, so it's metadata-only with no table rewrite. loadUserSettingsselects columns explicitly, so the API output is unchanged in this PR.
Summary by CodeRabbit
- New Features
- User settings can now include optional naming instructions, which can be saved as text. Existing settings remain compatible when no instructions are provided.