Laravel Telescope tables without primary key #41818
Replies: 4 comments
-
Digital Ocean will send you many warning letters if you use their cloud DB solution and telescope.
Real bullshit, why not a big integer id key? |
Beta Was this translation helpful? Give feedback.
-
Also link #33238 |
Beta Was this translation helpful? Give feedback.
-
MySQL and MariaDB using HA setup, requires primary keys on any table. This is not a Digital Ocean thing, but this is a replication implementation thing in both MySQL and MariaDB. It is optional on Primary to Replicas, and mandatory on Galera Primary to Primary setup (the only setup actually). They can have this optionally configured to allow, but this will have high chances to get this tables corrupted any minute in Galera setup and will slow down a lot in time on Primary to Replica setups. Replication relies on primary keys and you can't change this without convincing Oracle and MariaDB that you think is wrong. Change the migrations yourself if necessary and add a primary key where it is missing. Not only Digital Ocean enforce primary keys because of this reasons, but also most other Public Cloud providers that offer managed databases do, this operations will increase resource usage on their side as well. Also, when you sell managed database, you don't want to have people on support crying about their data being corrupted simply because they did not want to add a primary key. |
Beta Was this translation helpful? Give feedback.
-
Definitely not a DO thing, just a +1 example. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Good day,
I'm currently facing a problem where the database that I'm supposed to deploy my Laravel app has a restriction on primary keys (every tables must have a primary key).
Refer to below error:
SQLException: Percona-XtraDB-Cluster prohibits use of DML command on a table (mydb.sample_table) without an explicit primary key with pxc_strict_mode = ENFORCING or MASTER
Referring to Laravel Telescope migration file,
https://github.com/laravel/telescope/blob/4.x/database/migrations/2018_08_08_100000_create_telescope_entries_table.php
Both
telescope_entries_tags
andtelescope_monitoring
have no primary key.My question is whether if I can add a primary key ($table->id()) to the migrations, without causing anything to break?
I have no choice but to ask it here as it is only happening on the production.
Any help is much appreciated.
Beta Was this translation helpful? Give feedback.
All reactions