Database seeding fails for wave project on perconadb replication cluster

nicu-plai

Jan 15th, 2019 08:52 AM

Hello, I'm trying to install wave using a Percona DB cluster as database. php artisan migrate runs ok but php artisan db:seed fails on the password_resets table.

The error is:

SQLSTATE[HY000]: General error: 1105 Percona-XtraDB-Cluster prohibits use of DML command on a table (saastuts_wave.password_resets) without an explicit primary key with pxc_strict_mode= ENFORCING or MASTER (SQL: delete from password_resets)

I'm guessing this happens because of Percona requirements of primary key for each table. Could you recommend an elegant solution to this problem? Maybe editing the database seed scripts to also include primary key for the table, but I don't know what file to modify.

bobbyiliev

Mar 26th, 2023 08:04 AM

Hi there,

You're correct that the error is due to the Percona cluster requiring a primary key for each table. This should already be fixed here.

But in general, to fix this, you can modify the migration file for the password_resets table or any other table to include a primary key in there.