Skip to content

Draft: Increase Remote Import URL character limit from 512 to 2048

What does this MR do and why?

Currently the character limit for the Import/Export URL used by the Import a file from a remote object storage feature is set to 512. If pre-signed URLs are used then it can easily exceed this limit.

This MR aims to increase the remote_import_url under import_export_uploads table from 512 to 2048.

This was raised from this issue.

Migration Output

> bundle exec rails db:migrate:down VERSION=20220217014305
== 20220217014305 AlterContraintOfRemoteImportUrl: reverting ==================
-- transaction_open?()
   -> 0.0000s
-- transaction_open?()
   -> 0.0000s
-- execute("ALTER TABLE import_export_uploads\nDROP CONSTRAINT IF EXISTS check_58f0d37481\n")
   -> 0.0012s
-- transaction_open?()
   -> 0.0000s
-- current_schema()
   -> 0.0003s
-- transaction_open?()
   -> 0.0000s
-- execute("ALTER TABLE import_export_uploads\nADD CONSTRAINT check_58f0d37481\nCHECK ( char_length(remote_import_url) <= 512 )\nNOT VALID;\n")
   -> 0.0011s
-- current_schema()
   -> 0.0002s
-- execute("SET statement_timeout TO 0")
   -> 0.0005s
-- execute("ALTER TABLE import_export_uploads VALIDATE CONSTRAINT check_58f0d37481;")
   -> 0.0010s
-- execute("RESET statement_timeout")
   -> 0.0004s
== 20220217014305 AlterContraintOfRemoteImportUrl: reverted (0.0176s) =========

> bundle exec rails db:migrate:up VERSION=20220217014305
== 20220217014305 AlterContraintOfRemoteImportUrl: migrating ==================
-- transaction_open?()
   -> 0.0000s
-- transaction_open?()
   -> 0.0000s
-- execute("ALTER TABLE import_export_uploads\nDROP CONSTRAINT IF EXISTS check_58f0d37481\n")
   -> 0.0012s
-- transaction_open?()
   -> 0.0000s
-- current_schema()
   -> 0.0002s
-- transaction_open?()
   -> 0.0000s
-- execute("ALTER TABLE import_export_uploads\nADD CONSTRAINT check_58f0d37481\nCHECK ( char_length(remote_import_url) <= 2048 )\nNOT VALID;\n")
   -> 0.0008s
-- current_schema()
   -> 0.0002s
-- execute("SET statement_timeout TO 0")
   -> 0.0003s
-- execute("ALTER TABLE import_export_uploads VALIDATE CONSTRAINT check_58f0d37481;")
   -> 0.0009s
-- execute("RESET statement_timeout")
   -> 0.0004s
== 20220217014305 AlterContraintOfRemoteImportUrl: migrated (0.0160s) =========

Screenshots or screen recordings

N/A

How to set up and validate locally

  1. The migrations can be run locally via bundle exec rails db:migrate:up and bundle exec rails db:migrate:down.

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Kent Japhet Ballon

Merge request reports