-
Notifications
You must be signed in to change notification settings - Fork 175
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
Migration fails when sql_require_primary_key
is set
#108
Comments
FWIW, You can reach out to DO to get the |
Not really a great trade-off since it can break replication 🤷 |
Encountered the exact same problem. It's not exactly ideal that we have to reach out to DO to solve this issue ourselves and I personally would rather not disable |
While I agree it's not ideal, you can also make an API request to DO to change this setting; https://stackoverflow.com/questions/62418099/unable-to-create-or-change-a-table-without-a-primary-key-laravel-digitalocean |
@jessarcher @timacdonald could we get auto incrementing primary keys on the tables or was there a big reason we didn't? |
If we can't we could maybe add a note in the docs for DO instances that should contact them to request them to remove the setting. |
Is there any reason why we can't publish the migration files? As placing this at the beginning of up() solves the issue: |
Migrations should be publishable soon, #81 |
That's great. Though, despite there being a temporary solution to it, I hope this doesn't detract from the issue of needing to disable I believe the reason is that not using primary keys can significantly impact replication performance and I'm presuming that DO is enforcing it because you can't manually exclude tables from replication if using DO's read-only nodes (as far as I'm aware). Edit: Contacted DigitalOcean to confirm it. Heres what they said:
I can see this being an issue for users who use don't have a secondary DB for pulse if they have read-only nodes activated. |
Similar issue with Telescope: laravel/telescope#1407 |
This will be fixed in #142 If you have already run the migrations you will need to add this column manually. |
Big thank you for this change -- those mimic the columns I added manually, but it's fantastic that Pulse will work out-of-the-box going forward. It's a fantastic package! |
Pulse Version
1.0beta
Laravel Version
10
PHP Version
8.1
Description
When
sql_require_primary_key
is set, the Pulse migration fails:It errors on the first table, but presumably will fail on all three tables. This setting is required on Digital Ocean Managed MySQL servers so Pulse can't be installed for any application backed by that service.
pulse_values
andpulse_aggregates
tables both have aunique
index so both tables can probably be created by disablingsql_require_primary_key
while the tables are being created.But
pulse_entries
doesn't appear to have a column or index that can be used as a primary key so I don't know what to do there.Steps To Reproduce
sql_require_primary_key
to true in your MySQL configuration.The text was updated successfully, but these errors were encountered: