How to make DigitalOcean managed MySQL database work with Laravel

The managed mysql database in DigitalOcean requires every table to have a primary key. Laravel by default ships with password_resets table which dont have any primary key.

If you ever come across this issue, you can patch DigitalOcean managed mysql database by making some quick curl requests.

Make a GET request to retrieve database ID. Endpoint: https://api.digitalocean.com/v2/databases

  
curl --location --request GET 'https://api.digitalocean.com/v2/databases' \
--header 'Authorization: Bearer {{BEARER_TOKEN}}'
  

Use the database ID from earlier response and make a PATCH request. Endpoint: https://api.digitalocean.com/v2/databases/{{DATABASE_ID}}/config

  
curl --location --request PATCH 'https://api.digitalocean.com/v2/databases/{{DATABASE_ID}}/config' \
--header 'Authorization: Bearer {{BEARER_TOKEN}}' \
--header 'Content-Type: application/json' \
--data-raw '{"config": { "sql_require_primary_key": false }}'
  

Web Application

Web application development based on your requirements.

CMS

Open Source CMS customisation based on your requirements.

Integration

Integration with various 3rd party applications and services.

Newsletters

The best way to keep in touch and be informed of special offers.