🔥 Drop the legacy file_object_thumbnail table

`file_object_thumbnail` was replaced by `file_tagged_object_thumbnail`
and nothing refers to it anymore: no query in the backend touches it,
no table has a foreign key pointing at it, no view depends on it, and
it is empty in production. It also lacked `deleted_at`, which is why
restoring files had to leave it out. Only legacy naming survives in two
helpers (`get-file-object-thumbnails` and
`delete-file-object-thumbnails!`, which operate on
`file_tagged_object_thumbnail`).

The storage bucket named "file-object-thumbnail", the one that
`file_tagged_object_thumbnail` uses, is a different thing and stays.

AI-assisted-by: deepseek-v4.1-flash
This commit is contained in:
Andrey Antukh 2026-10-12 13:17:42 +00:00
parent 575b68d2c9
commit c3c65318b4
2 changed files with 11 additions and 1 deletions

View File

@ -502,7 +502,10 @@
:fn (mg/resource "app/migrations/sql/0152-rename-version-and-add-indexes-to-server-error-report.sql")}
{:name "0153-del-orphan-profile-rels-after-team-leave"
:fn (mg/resource "app/migrations/sql/0153-del-orphan-profile-rels-after-team-leave.sql")}])
:fn (mg/resource "app/migrations/sql/0153-del-orphan-profile-rels-after-team-leave.sql")}
{:name "0154-del-legacy-file-object-thumbnail-table"
:fn (mg/resource "app/migrations/sql/0154-del-legacy-file-object-thumbnail-table.sql")}])
(defn apply-migrations!
[pool name migrations]

View File

@ -0,0 +1,7 @@
--- The `file_object_thumbnail` table was replaced by
--- `file_tagged_object_thumbnail` and nothing references it anymore: no query
--- in the codebase touches it and it is empty in production.
---
--- NOTE: the storage bucket named "file-object-thumbnail" (the one used by
--- `file_tagged_object_thumbnail`) has nothing to do with this table and stays.
DROP TABLE IF EXISTS file_object_thumbnail;