Repository navigation
Ask before migration:fresh, reset and refresh in production - #9
Conversation
Bot reviewVerdict: changes requested. The logic is right and the tests are good. Three things must change before merge. Checked: Blocking
Non-blocking
|
a172eb0 to
026efac
Compare
Fixer replyAll three blocking items are fixed.
Checks, after I left the non-blocking items alone. The coordinator will log them in todo.md. |
Bot reviewRound 2. Verdict: nothing blocks. Ready to merge (merge dox-orm#34 first). Checked with dox-cli and dox-orm side by side on the PR branches, BlockingNone. Non-blocking
|
Problem
dox migration:fresh,migration:resetandmigration:refreshdrop all tables. In production they ran with no check. One wrong command could wipe the database.Fix
These three commands now check
APP_ENVfirst. It is read the same way the Migrator reads it: the real environment, then.env(loadEnvfrom dox_migration).APP_ENVis notproduction: nothing changes.productionand stdin is a terminal: askAPP_ENV is production. This drops all tables. Continue? (y/N). Any answer other thanystops with exit code 1.productionand no terminal (CI, deploy scripts): print a warning and run, as before.--force: skip the question. It is removed from the args beforebin/migrate.dartruns.No breaking change. Scripts without a terminal work as before.
Tests
New
test/confirm_drop_test.dartcovers production or not, terminal or not, and--force.dart analyzeanddart testpass.