FriendsOfFlarum / webhooks

Flarum with outgoing webhooks
MIT License
21 stars 11 forks source link

Saving a webhook causes an error #3

Closed luceos closed 5 years ago

luceos commented 5 years ago
Next Illuminate\Database\QueryException: SQLSTATE[HY000]: General error: 1364 Field 'error' doesn't have a default value (SQL: insert into `webhooks` (`service`, `url`, `events`) values (discord, https://discordapp.com/api/webhooks/<yesthatsright>, [])) in /home/forge/forum.flagrow.io/vendor/illuminate/database/Connection.php:664

Seems you created migrations that don't have nullable() or default(), eg:

$table->string('error')->nullable();
luceos commented 5 years ago

The column throwing the error was error not events. Check your create handler and compare the properties you set versus those that cannot be null according to your migration.

Look at the trace error message please. :stuck_out_tongue_closed_eyes:

dsevillamartin commented 5 years ago

🤦‍♂️ I don't know how I decided the issue was the events. The first time I read it I understood it properly.

dsevillamartin commented 5 years ago

I can't reproduce, but it seems MySQL or Eloquent is converting null into an empty string... Made it nullable, should be ok now.