Yes the docs are not as clear as it should be.

From my own work on this what I’ve figured out is that your ‘change’ method has to be able to work in an ‘up’ scenario regardless of the circumstances. Phinx determines the ‘down’ from there. In a sense the ‘up’ changes have to be idempotent.

For example I had a migration that required inserting rows in some tables.
I ended up doing it like this:

[code]
if ($this->hasTable(‘log_type’)) {
$this->execute(‘DELETE FROM log_type WHERE id IN (1,2,3,4)’);
$rows = [
[1, ‘Notice’, ‘notice’],
[2, ‘Warning’, ‘warning’],
[3, ‘Error’, ‘error’],
[4, ‘Success’, ‘success’]
];
$this->tables[‘log_type’]
->insert([‘id’, ‘name_’, ‘slug’], $rows)
->saveData();
}
[/code]

My apologies if that’s not easily readable.