From 581482003a5f7a5dfee3d60fa9e2850a02922293 Mon Sep 17 00:00:00 2001 From: Martin Brennan Date: Tue, 14 Sep 2021 12:20:56 +1000 Subject: [PATCH] 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. --- app/models/upload.rb | 2 +- .../20210914011037_change_uploads_filesize_to_bigint.rb | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) create mode 100644 db/migrate/20210914011037_change_uploads_filesize_to_bigint.rb diff --git a/app/models/upload.rb b/app/models/upload.rb index 5b4b4be312a..f03883783cb 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 00000000000..5810bd72f9d --- /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 +end