Closed paulmakarov closed 2 years ago
That's because the migration is missing "id" as primary key which is the default primary key that Eloquent Models expect. So your solution is valid for this, but also i'm thinking of adding "id" column to the table.
I've added a change migration for adding the "id" column to the table
When using Postgres 11+, after migration POST: https://my-example-domain.com/api/exponent/devices/subscribe
{ "status": "failed", "error": { "message": "SQLSTATE[42703]: Undefined column: 7 ERROR: column \"id\" does not exist\nLINE 1: ...n_interests\" (\"key\", \"value\") values ($1, $2) returning \"id\"\n ^ (SQL: insert into \"exponent_push_notification_interests\" (\"key\", \"value\") values (App.User.1, ExponentPushToken[<assume valid token>]) returning \"id\")" } }
I believe this is because we must explicitly set:
protected $primaryKey = null; public $incrementing = false;
in src/Models/Interest.phpLet me know. Thanks for the package!