phinx: --dry-run is not fully working
Running phinx migrate --dry-run will execute queries if they’re written via queryBuilder.
For example here’s code from docs:
<?php
$builder = $this->getQueryBuilder();
$builder
->update('users')
->set('fname', 'Snow')
->where(['fname' => 'Jon'])
->execute()
So phinx migrate --dry-run will not work with that code.
About this issue
- Original URL
- State: open
- Created 6 years ago
- Reactions: 1
- Comments: 19 (8 by maintainers)
Kludge-solutions Inc.
+1 For this. Query Builder has to be able to output raw SQL that interprets and sends to server. We’ve had a major problem where something got interpreted in an unintended way and entire database of suppliers got updated instead of a few intended records. Showing what was the interpreted SQL to be sent to server would have helped at code review stage. The issue we had was someone writing
->where(['id >', 1])instead of->where(['id >' => 1])- that quietly passed forWHERE idSQL dropping the second bit, no error, and entire table updated. We need to see whats been run against the server.