flarum / issue-archive

0 stars 0 forks source link

Primary Key required on tables #49

Open katosdev opened 2 years ago

katosdev commented 2 years ago

Bug Report

Current Behavior When using a clustered SQL environment, installation fails due to missing primary keys on the database tables.

Unable to create or change a table without a primary key, when the system variable 'sql_require_primary_key' is set Add a primary key to the table or unset this variable to avoid this message. Note that tables without a primary key can cause performance problems in row-based replication, so please consult your DBA before changing this setting.

This issue seems to be present on any percona and clustered database

CC : @luceos

tankerkiller125 commented 2 years ago

Is this just a cluster default setting for MySQL that can be changed? Or is this an outright requirement that must be met for clutered MySQL installs?

askvortsov1 commented 2 years ago

Is this just a cluster default setting for MySQL that can be changed? Or is this an outright requirement that must be met for clutered MySQL installs?

Seems to be a performance thing, which would probably apply moreso in a distributed mysql setup.

That being said, if there's a way to add primary keys to all tables in bundled extensions without horrible pain, I think that might be worth looking into.

katosdev commented 2 years ago

@luceos and @imorland can likely weigh in better here with their wealth of knowledge drawn from Blomstra

luceos commented 2 years ago

For scaled environments a PK is required, percona and other clustered MySQL instances (like those managed in clouds) rely on those PK's those exist. I would say this should become a convention in our code.

That being said, if there's a way to add primary keys to all tables in bundled extensions without horrible pain, I think that might be worth looking into.

I fear the only solution would be to go over all tables and create migrations for them.