Describe a Database Change in Plain English and Let Claude Write the Migration
Database migrations have fiddly syntax that nobody remembers perfectly. Skip the documentation lookup — describe what you want in plain English and Claude writes the migration in whatever framework you're using.
> add a tags column to the posts table — it should be a JSON column
> that defaults to an empty array, and add an index on it
Claude reads your existing migrations to match the conventions you already use, then creates the migration file with the correct column type, default value, index, and a proper down() method that reverses the change cleanly.
This works for any complexity:
> create a comments table — belongs to users and posts, has a body
> text field, supports soft deletes, and needs timestamps
> add two-factor auth columns to the users table — a nullable secret,
> recovery codes as JSON, and a confirmed_at timestamp
> create a polymorphic taggable relationship so tags can be applied
> to both posts and videos
Claude understands your framework's migration API. In Laravel it uses Schema::create with the right column methods. In Rails it uses create_table with the right types. In Django it generates the model changes and lets makemigrations handle the rest.
Where this gets especially useful is complex changes:
> split the address fields out of the users table into a separate
> addresses table — users can have multiple addresses with a type
> (billing, shipping) — migrate the existing data too
Claude creates the new table, writes the data migration to move existing addresses over, and drops the old columns — all in the right order with proper foreign keys and indexes.
After generating the migration, ask Claude to update the model and any related files:
> now update the User model to add the addresses relationship
> and update the registration form to use the new table
Describe the schema, get the migration — Claude handles the syntax while you focus on the design.
via Claude Code
Log in to leave a comment.
Set up Claude Code as an automated reviewer in your CI pipeline — on every pull request, it reads the diff, checks for bugs, security issues, missing tests, and convention violations, then posts its findings as a PR comment. Your human reviewers get a head start because the obvious issues are already flagged before they look.
Before deploying, tell Claude to read your project — migrations, environment variables, queue workers, scheduled tasks, caching, third-party integrations — and generate a deployment checklist that's specific to your app. Not a generic "did you run migrations?" list, but one that knows YOUR infrastructure and catches the things YOUR deploy can break.
Instead of writing a README from memory or copying a template, tell Claude to read your project and generate one that's actually accurate — real setup instructions from your config, real architecture from your directory structure, real API examples from your routes, and real prerequisites from your dependency files.