DEV: Make site setting type uploaded_image_list use upload IDs (PR #10401)

It used to be a list of concatenated upload URLs which was prone to break.

GitHub

I might have missed it, but is there a mechanism to migrate the old format to the new format?

That’s risky to run in a migration. Any way you can avoid calling a model’s method?

What happens if either urls or sha1s is empty?

Nice :+1:

It generated an invalid query SELECT id FROM uploads WHERE url IN () OR sha1 IN (), but I fixed it.

discourse_development=# SELECT id FROM uploads WHERE url IN () OR sha1 IN ();
ERROR:  syntax error at or near ")"
LINE 1: SELECT id FROM uploads WHERE url IN () OR sha1 IN ();
                                             ^