phpList / phplist3

Fully functional Open Source email marketing manager for creating, sending, integrating, and analysing email campaigns and newsletters.
https://www.phplist.org
GNU Affero General Public License v3.0
746 stars 269 forks source link

Primary keys and MySQL cluster #955

Open matejzero opened 1 year ago

matejzero commented 1 year ago

We are migrating to MySQL cluster and one of the requirements is that every table has a primary key so deletes work across the cluster.

I noticed a few tables don't have primary keys:

My SQL knowledge is poor to honest, but here is my go at the issue:

Is there any chance primary keys could be added so that phplist is compatible with cluster version.

michield commented 1 year ago

Interesting. If you're interested in the DB structure, it's outlined here:

https://github.com/phpList/phplist3/blob/main/public_html/lists/admin/structure.php

I guess adding an ID with auto_increment may work. If you do so, it would be interesting to report your findings so that more people are aware of this.

matejzero commented 4 months ago

We moved our phplist to a cluster mysql instance.

We added primary key to phplist_i18n and phplist_linktrack_userclick. phplist_user_blacklist and phplist_user_blacklist_data tables didn't need any change.

So far it's been running OK in prod for the last 10 days, but we have low traffic phplist install.