PDOException: SQLSTATE[HY000]: General error: 1 table "rules_trigger" has more than one primary key: CREATE TABLE {rules_trigger} ( id INTEGER PRIMARY KEY AUTOINCREMENT, event VARCHAR(127) NOT NULL DEFAULT '', PRIMARY KEY (event) ); ; Array ( ) in db_create_table() (line 2541 of /Users/Stingna/htdocs/drupal-dev/includes/database/database.inc).

CommentFileSizeAuthor
#7 rules_install.patch425 bytesfago

Comments

klausi’s picture

Component: Rules Core » Rules Engine
Status: Active » Postponed (maintainer needs more info)

I'm not able to reproduce that. Did you use the latest code? What database, MySQL?

yaoweizhen’s picture

I used Drupal7-alpha6 with sqlite and latest dev version.

yaoweizhen’s picture

I also tested with Mysql. On the modules page, it went to blank page when submit module installation.

fago’s picture

Title: Install error » Install error on sqlite
Status: Postponed (maintainer needs more info) » Active

The blank page might be a memory issue. Sounds like sqlite compatibility issue, try to look for relevant issues in the drupal core queue.

yaoweizhen’s picture

Tried Mysql again. PHP is set 128M memory limit, still WSOD.

x-lette’s picture

I can confirm installation error with sqlite.

In ./rules/rules.install I changed line #97 from
'primary key' => array('id', 'event'),
to
'primary key' => array('id'), /* , 'event'), */
and installation worked fine. Looks like sqlite can't handle PKs with multiple columns or the sqlite code from drupal core generates wrong statement. But as 'id' is a foreign key to another table where 'id' already is primary key it should be sufficient for consistency having 'id' solely as primary key.

fago’s picture

StatusFileSize
new425 bytes

The wrong thing is that id is specified as serial, what is auto-incrementing. No good idea for a foreign key ;)

Patch attached, please try whether it fixes the problem for you.

fago’s picture

Status: Active » Fixed

committed that, please test.

Status: Fixed » Closed (fixed)

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