migrate applies outstanding migrations.
rollback reverses the latest migration batch.
refresh rolls back migrations and runs them again.
fresh drops all tables and runs all migrations again.
These commands have very different safety implications.
Scenario:
During local development, fresh can be useful when rebuilding disposable data. Production environments require much more caution because destructive schema operations can cause data loss.
Interview tip:
Always explain commands in the context of environment safety rather than treating them as interchangeable.
0 comments:
Post a Comment
Thanks