From c3c65318b4757995be633acc0282de0e06d41eb9 Mon Sep 17 00:00:00 2001 From: Andrey Antukh Date: Mon, 12 Oct 2026 13:17:42 +0000 Subject: [PATCH] :fire: 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 --- backend/src/app/migrations.clj | 5 ++++- .../sql/0154-del-legacy-file-object-thumbnail-table.sql | 7 +++++++ 2 files changed, 11 insertions(+), 1 deletion(-) create mode 100644 backend/src/app/migrations/sql/0154-del-legacy-file-object-thumbnail-table.sql diff --git a/backend/src/app/migrations.clj b/backend/src/app/migrations.clj index 13f99170fe..a3c4647a33 100644 --- a/backend/src/app/migrations.clj +++ b/backend/src/app/migrations.clj @@ -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] diff --git a/backend/src/app/migrations/sql/0154-del-legacy-file-object-thumbnail-table.sql b/backend/src/app/migrations/sql/0154-del-legacy-file-object-thumbnail-table.sql new file mode 100644 index 0000000000..b0ecd778fa --- /dev/null +++ b/backend/src/app/migrations/sql/0154-del-legacy-file-object-thumbnail-table.sql @@ -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;