A schema edit needs a migration, a rollback story, and data safety. Never let an agent freestyle production tables.
14 min · Reviewed 2026
Database Migrations Are Not Suggestions
A schema edit needs a migration, a rollback story, and data safety. Never let an agent freestyle production tables.
Name the job before naming the tool.
Write the smallest useful scope the agent can finish.
Run the result as a user, not as a fan of the tool.
Inspect the diff, data access, and failure path before sharing.
Add a nullable column profiles.timezone with a migration. Do not rewrite existing rows. Add app fallback to 'America/New_York' when timezone is null.Use this as the working prompt or checklist for the lesson.
What should the user be able to do when this is finished?
What data should the app or agent never expose?
What test proves the change works?
What rollback path exists if the output is wrong?
End-of-lesson check
15 questions · take it digitally for instant feedback at tendril.neural-forge.io/learn/quiz/end-coder-database-migrations-creators
What is the primary purpose of a database migration?
To speed up query performance
To automatically generate test data
To delete all existing data from the database
To create an explicit, reversible record of schema changes
Before an AI agent modifies a database schema, what should be defined first?
The exact model of GPU running the agent
The color scheme of the application
The specific SQL syntax the agent should use
The rollback procedure if something goes wrong
Why does the lesson advise running code 'as a user, not as a fan of the tool'?
To verify the change actually works for end users, not just in theory
To avoid triggering rate limits
To impress the AI agent with your skills
To save computational resources
What does the lesson mean by 'vibe-coded apps break most painfully at the database layer'?
Database changes made without proper planning cause the most difficult failures to recover from
AI-generated code works perfectly in databases but fails elsewhere
Database servers are physically more fragile than other components
Visual design errors are most noticeable in databases
Which approach best follows the lesson's advice on scoping agent tasks?
Give the agent full access to modify anything in the codebase
Break the task into the smallest useful piece the agent can complete successfully
Ask the agent to refactor the entire codebase in one prompt
Have the agent generate code without any specific requirements
What three things should be inspected before sharing an AI-generated schema change?
The server location, electricity cost, and cooling requirements
The diff, data access patterns, and failure path
The marketing copy, user interface colors, and font choices
The code comments, variable names, and indentation
What information should be documented about what the user can do when a database change is finished?
The user's favorite color
The specific workflows and capabilities the user gains
The AI model's temperature setting
The internal database table names
According to safe database practices, what should an application never expose?
Technical documentation
User interface buttons
Error messages
Sensitive data such as passwords, API keys, or personal information
What is a 'rollback path' in the context of database migrations?
The visual route users take through a UI
The network route between the app server and database
The path the AI agent takes to generate code
A documented procedure to reverse the database change if it causes problems
The lesson mentions that AI can make a working demo quickly. What distinguishes a real coder from just demo generation?
Choosing fancier variable names
Making the demo observable, reversible, and safe for production use
Using more expensive AI models
Writing longer code comments
What does 'name the job before naming the tool' mean in this lesson?
Choose a cool project name before coding begins
Pick a database name first, then create tables
Decide on a username before creating an account
Define what needs to be accomplished before selecting how to accomplish it
Why should an AI agent never 'freestyle production tables'?
Because unscripted schema changes can cause data loss or corruption without recovery options
Because AI cannot write SQL syntax
Because it uses too much electricity
Because production databases don't exist
What type of test proves that a database schema change works correctly?
A test that verifies the actual functionality and data integrity the change was meant to enable
A test that counts the number of code comments
A test that measures how fast the AI generates code
A test that checks the screen resolution of the display
What is a schema in the context of databases?
The visual layout of a website
The structure defining tables, columns, relationships, and constraints
The physical location of the database server
The programming language used to write the application
What makes a schema change 'explicit and reviewable' as the lesson recommends?
Hiding the change in compiled binary code
Making the change as vague as possible
Using cryptic variable names to make it hard to understand
Creating a documented migration that can be examined before application