When installing the module with mysql 5.7 the following error occurs:

exception 'PDOException' with message '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, [error]
use UNIQUE instead' in /Users/msti/Sites/amberroad2/includes/database/database.inc:2171
Stack trace:
#0 /Users/msti/Sites/amberroad2/includes/database/database.inc(2171): PDOStatement->execute(Array)
#1 /Users/msti/Sites/amberroad2/includes/database/database.inc(683): DatabaseStatementBase->execute(Array, Array)
#2 /Users/msti/Sites/amberroad2/includes/database/schema.inc(661): DatabaseConnection->query('CREATE TABLE {p...')
#3 /Users/msti/Sites/amberroad2/includes/database/database.inc(2720): DatabaseSchema->createTable('panelizer_entit...', Array)
#4 /Users/msti/Sites/amberroad2/includes/common.inc(7011): db_create_table('panelizer_entit...', Array)

This error is caused by the enhancements of mysql 5.7 that also bring some compatibility problems.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

msti created an issue. See original summary.

msti’s picture

This patch add a 'not null' => TRUE, to the 'view_mode' field at mysql

DamienMcKenna’s picture

That should already be added in panelizer_schema_4()..

I really don't like how these schema things are done. Does this also fix the problem?

DamienMcKenna’s picture

dgtlmoon’s picture

Patch from #3 resolved the issue for me

lotyrin’s picture

Status: Needs review » Reviewed & tested by the community

Reading the refactor in #3 looks right. Confirmed resolves this issue.

dgtlmoon’s picture

Reroll for latest 3.x

DamienMcKenna’s picture

A few minor tweaks.

DamienMcKenna’s picture

Status: Needs review » Fixed

Committed. Thanks for bringing this up, msti, we needed to clean up the schema as it was getting difficult to maintain.

  • DamienMcKenna committed 971dc45 on 7.x-3.x
    Issue #2659820 by msti, DamienMcKenna, dgtlmoon, lotyrin: Refactored...

Status: Fixed » Closed (fixed)

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