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.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

yareckon created an issue. See original summary.

yareckon’s picture

miechiel’s picture

We had the same issue. This patch fixed it.

Status: Needs review » Needs work

The last submitted patch, migrate-7-x-mysql-5-7-fixnulls.patch, failed testing. View results

pifagor’s picture

  • pifagor committed 0d9582a on 7.x-2.x
    Issue #2850753 by yareckon, miechiel, pifagor: d7 mysql 5.7...
pifagor’s picture

Status: Needs work » Fixed

I recreated the patch and push.
@yareckon Thank you.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.