mikaeljorhult / hydrofon

Equipment booking system.
MIT License
23 stars 11 forks source link

Flags Error on fresh install #132

Closed ari1127 closed 1 year ago

ari1127 commented 1 year ago

First, this release is awesome! It looks beautiful and has many of the features I'm looking for in an equipment booking system. So thank you for releasing it!

After a fresh install, I was perusing the capabilities and clicking on the Resources tab resulted in a error: could not find driver SELECT "name", "abbr" FROM "flags"

from line 48 of the Resources controller: $filterFlags = Flag::pluck('name', 'abbr');

After looking at the Flags model, I don't see a protected $fillable declaration, just the rows array. So this could be a lead. I did try to add the $fillable list and migrate but that didn't solve the issue.

Any help would be appreciated!

mikaeljorhult commented 1 year ago

Hydrofon is using the Sushi package for flagging resources which relies on an SQLite database. Laravel not being able to find the driver when loading flags might be caused by the SQLite extension not being loaded.

If running PHP on Windows you might have to manually enable the extension.

ari1127 commented 1 year ago

Ah ha... I'm running postgres on ubuntu. Is a separate SQLite db established for Sushi? I can try enabling the php extension

ari1127 commented 1 year ago

Unfortunately I'm experiencing a similar error:

SQLSTATE[HY000]: General error: 1 no such table: flags SELECT "name", "abbr" FROM "flags"

I did add the $fillable declaration to the model and migrate the changes. So a flags table does exist in the postgres database...

mikaeljorhult commented 1 year ago

The model don't have to be fillable as they are never stored, just used in relationships with resources. Can you share which versions you are running of PHP, preferably your phpinfo()?

ari1127 commented 1 year ago

I rolled back my migration and removed the fillable, and I'm back in action. Thanks for the help with SQLite driver!

mikaeljorhult commented 1 year ago

Happy to help! Let me know if you have any more questions.