Running Migrations on MYSQL 5.7 fails with SQLSTATE[42000]: Syntax error or access violation: 1171 All parts of a PRIMARY KEY must be NOT NULL; if you need NULL in a key, use UNIQUE instead.
As seen all over core and contrib, and in the D8 version of the migrate module, not null needs to now be explicitly set for any primary key fields.
see: https://www.drupal.org/node/2616282
In addition, when nulls are allowed, if they are the default, that needs to be made explicit. This is the case with dest[n] fields.
The attached patch does both in our sqlmap.inc
Setting to "Major" because migrate cant be used on Mysql 5.7 -- soon to be the majority platform -- without changes.
Comment | File | Size | Author |
---|---|---|---|
migrate-7-x-mysql-5-7-fixnulls.patch | 1.4 KB | yareckon | |
Comments
Comment #2
yareckon CreditAttribution: yareckon at wegewerk for Ärzte ohne Grenzen e.V. / Médecins Sans Frontières commentedComment #3
miechiel CreditAttribution: miechiel at Triquanta commentedWe had the same issue. This patch fixed it.
Comment #5
pifagorComment #7
pifagorI recreated the patch and push.
@yareckon Thank you.