I generated a migration from db table that had created field
defined.
Generated migration looks like this:
UP:
create_table:
users:
- modified
no_dates:
...
When I tried to run that migration it failed with SQL error. The
SQL query was:
CREATE TABLE ... (..., default VARCHAR(255) DEFAULT 'modified', ...);
I looked in the code and I understand that no_dates option
indicates that the script shouldn't try to add created and modified
fields automatically if any of these fields was not present in the
table the migration is generated from.
However it should include those fields in migration if they were
present in the table, right?
So there must be something wrong in either building the yaml
file or translating it to fields definitions.
The line that causes the SQL error is the line no 775 of
migrate.php:
if (isset($fields[0])) $fields = array_merge($fields, $this->_getProperties($fields[0]));
However I am not sure if that's the only piece of code that
should be modified to fix the issue. I bet not.
If you need some help with fixing this, please contact. As for
now, I didn't have the time too look in the code closely enough to
understand the whole philosophy behind treating created and
modified fields differently than other fields, so I was not able to
work on appropriate patch.