sendportal
sendportal copied to clipboard
Not compatible with Digital Ocean managed MySQL
I use a Digital Ocean managed MySQL cluster.
Problem 1: The cluster requires SSL (mysqli_ssl_set = REQUIRED). You don't presently support that, so I have to manually add it in the config/database.php file.
'options' => extension_loaded('pdo_mysql') ? array_filter([
'mysqli_ssl_set' => 'REQUIRED',
PDO::MYSQL_ATTR_SSL_CA => env('MYSQL_ATTR_SSL_CA'),
]) : [],
Problem 2:
The cluster requires tables have primary keys in order to prevent replication errors. After resolving the above issue, I ran into this one.
SQLSTATE[HY000]: General error: 3750 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. (SQL: create table `password_resets` (`email` varchar(255) not null, `token` varchar(255) not null, `created_at` timestamp null) default character set utf8mb4 collate 'utf8mb4_unicode_ci')
Problem 1: noted, thanks. We may need to expose an .env var for this
Problem 2: there are a few options here:
- use postgres instead of mysql on DO managed DB
- amend the migrations manually and add
$table->id()to thepassword_resetsandworkspace_usersmigration files