New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rework image tables to add foreign key references #4714
Comments
This will probably get a bit awkward when deleting or purging an image, because that requires the alias. So then we need to store the alias in a separate, nullable column or extract it manually from the url. Btw we could also put the data from Anyway its best if you can make these changes as part of #4704 so that we can include them in 0.19.4. Otherwise there will be unnecessary breaking changes. |
Making it harder to access an alias probably isn't great, since the alias the the identifier that pict-rs cares about. If you need to include URLs for indexing reasons that's fine, but make sure the alias is trivially available when needed |
|
We could store the url, as well as And on second thought, lets leave this for 0.19.5, not good to make major changes right before the release. |
My recommendation above is to keep the To clarify, the I'll put my current PR in draft till I can get that done. |
That's fine, but I'll need to extract the proxy fixes into its own PR. |
Requirements
Is your proposal related to a problem?
Currently there are 3 image tables:
remote_image
,local_image
, andimage_details
. None of these tables share SQL references, and each of them isolated.local_image
table stores an optionallocal_user
, the pictrs alias, and a pictrs token.remote_image
table stores a federated link only.image_details
using a link toAdditionally, the
post_view.thumbnail
column (and comment text) uses a 3rd link, either identical to a remote image link, a proxied one, or a local one built from the local_image pictrs alias.Describe the solution you'd like.
We should create an
image
table, which stores the link alone, and possibly alocal
column.The
local_image
table shouldn't use a pictrs alias, but the actual local url. It can then be foreign-key referenced to the image table.The
image_details
table can then also be foreign-key referenced to theimage_table
.I recommend to do this, we should:
remote_image
toimage
.local_image
reference rows (based on link as the primary key) to add to it.pictrs_alias
column fromlocal_image
, and make this the full link.Describe alternatives you've considered.
NA
Additional context
#4704
cc @Nutomic @dulla
The text was updated successfully, but these errors were encountered: