Replies: 1 comment 2 replies
-
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi all
I've implemented both Spatie Medialibrary and Spatie multitenancy on my application, and I've run into an issue.
I use media library to set avatars and thumbnails for my users, and capture their images in my registration requests. However, I'm currently getting the following error:
Base table or view not found: 1146 Table 'landlord.media' doesn't exist (SQL: select max(
order_column) as aggregate from
media)
For some reason, the program is looking for the media table on my landlord database (which is my default) instead of my tenant database (which my model uses). I've set the UsesTenantConnection trait on the model in question, so I would expect it to look at the tenant database for the media table?
Additionally, I'm only experiencing this issue on my prod server, not my dev server, and my prod server has many more media entries. It could not have something to do with the amount of media stored in the table right? This was a non-issue, and it seems to have "broken by itself", as many people were able to successfully upload previously.
How can I get the media library to always honour the tenant connection instead of the landlord connection?
Beta Was this translation helpful? Give feedback.
All reactions