-
-
Notifications
You must be signed in to change notification settings - Fork 834
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MySQL Cluster support - Need primary keys on all tables #2769
Comments
We had the same issue at @blomstra using Percona and are migrating that manually for now. But this is a great addition to flarum/issue-archive#121. |
Agree we should implement this. Other than migrations, which tables are affected? |
@askvortsov1 All other tables except Can you guide me to the correct place in code so that I could maybe patch this and finish installation at my end? I tried to look for the code that is creating |
Interesting, looks like it's hardcoded outside of migrations in https://github.com/flarum/core/blob/94d69fe15fbcc459c84fcad5a0d5b274d9d7fe48/src/Database/DatabaseMigrationRepository.php#L91-L104. We should adjust that to include a proper primary key on new installs, but how do we want to handle old installs? Could do a migration and include that by default on new installs... |
Thank you @askvortsov1
There was another error related to posts table being MyISAM. Change it to InnoDB from the beginning (I think it is later altered to InnoDB later in setup). Now that initial setup is done, we can test it further. |
@luceos @tankerkiller125 let's just add an incrementing ID in a migration + in the |
I'm for making the migration name the primary key. Notably since it's basically impossible to have duplicate names there anyway. |
Tested locally, and immediately ran into a duplicate migration name 😞 |
Bug Report
Current Behavior
Installation on Percona MySQL Cluster fails with error - Something went wrong: SQLSTATE[HY000]: General error: 1105 Percona-XtraDB-Cluster prohibits use of DML command on a table (xxx.fl_migrations) without an explicit primary key with pxc_strict_mode = ENFORCING or MASTER (SQL: insert into
xx_migrations
(migration
,extension
) values (2015_02_24_000000_create_access_tokens_table, ?))Steps to Reproduce
Expected Behaviour
Installation should work.
Possible Solution
All tables should have primary keys
Additional Context
https://www.percona.com/doc/percona-xtradb-cluster/LATEST/features/pxc-strict-mode.html#tables-without-primary-keys
The text was updated successfully, but these errors were encountered: