DEV: Change uploads.filesize column to bigint (#14334)

DEV: Change uploads.filesize column to bigint (#14334)

This is necessary to allow for large file uploads via the direct S3 upload mechanism, as we convert the external file to an Upload record via ExternalUploadManager once it is complete.

This will allow for files larger than 2,147,483,647 bytes (2.14GB) to be referenced in the uploads table.

This is a table locking migration, but since it is not as highly trafficked as posts, topics, or users, the disruption should be minimal.

diff --git a/app/models/upload.rb b/app/models/upload.rb
index 5b4b4be..f038837 100644
--- a/app/models/upload.rb
+++ b/app/models/upload.rb
@@ -513,7 +513,7 @@ end
 #  id                           :integer          not null, primary key
 #  user_id                      :integer          not null
 #  original_filename            :string           not null
-#  filesize                     :integer          not null
+#  filesize                     :bigint           not null
 #  width                        :integer
 #  height                       :integer
 #  url                          :string           not null
diff --git a/db/migrate/20210914011037_change_uploads_filesize_to_bigint.rb b/db/migrate/20210914011037_change_uploads_filesize_to_bigint.rb
new file mode 100644
index 0000000..5810bd7
--- /dev/null
+++ b/db/migrate/20210914011037_change_uploads_filesize_to_bigint.rb
@@ -0,0 +1,7 @@
+# frozen_string_literal: true
+class ChangeUploadsFilesizeToBigint < ActiveRecord::Migration[6.1]
+  def change
+    change_column :uploads, :filesize, :bigint
+  end

GitHub sha: 581482003a5f7a5dfee3d60fa9e2850a02922293

This commit appears in #14334 which was approved by tgxworld. It was merged by martin.