Skip to content

Remove description html text limit

Serena Fang requested to merge remove-description-html-check-constraint into master

What does this MR do and why?

The description_html text limit was causing problems with forking projects: (internal slack link) https://gitlab.slack.com/archives/CETG54GQ0/p1659983265439899, so we should remove the limit

Closes Unable to fork www-gitlab-com (#370174 - closed)

Migration output

$ bin/rails db:migrate:up:main VERSION=20220808194857
WARNING: This version of GitLab depends on gitlab-shell 14.10.0, but you're running 13.22.0. Please update gitlab-shell.
main: == 20220808194857 RemoveDescriptionHtmlLimit: migrating =======================
main: -- transaction_open?()
main:    -> 0.0000s
main: -- transaction_open?()
main:    -> 0.0000s
main: -- execute("ALTER TABLE namespace_details\nDROP CONSTRAINT IF EXISTS check_2df620eaf6\n")
main:    -> 0.0010s
main: -- transaction_open?()
main:    -> 0.0000s
main: -- transaction_open?()
main:    -> 0.0000s
main: -- execute("ALTER TABLE namespace_details\nDROP CONSTRAINT IF EXISTS check_2f563eec0f\n")
main:    -> 0.0005s
main: == 20220808194857 RemoveDescriptionHtmlLimit: migrated (0.0113s) ==============


main: == 20220808194857 RemoveDescriptionHtmlLimit: migrated (0.0120s) ==============

$ bin/rails db:migrate:down:main VERSION=20220808194857
WARNING: This version of GitLab depends on gitlab-shell 14.10.0, but you're running 13.22.0. Please update gitlab-shell.
main: == 20220808194857 RemoveDescriptionHtmlLimit: reverting =======================
main: -- transaction_open?()
main:    -> 0.0000s
main: -- current_schema()
main:    -> 0.0008s
main: -- transaction_open?()
main:    -> 0.0000s
main: -- execute("ALTER TABLE namespace_details\nADD CONSTRAINT check_2df620eaf6\nCHECK ( char_length(description_html) <= 255 )\nNOT VALID;\n")
main:    -> 0.0008s
main: -- current_schema()
main:    -> 0.0003s
main: -- execute("SET statement_timeout TO 0")
main:    -> 0.0003s
main: -- execute("ALTER TABLE namespace_details VALIDATE CONSTRAINT check_2df620eaf6;")
main:    -> 0.0004s
main: -- execute("RESET statement_timeout")
main:    -> 0.0003s
main: -- transaction_open?()
main:    -> 0.0000s
main: -- current_schema()
main:    -> 0.0002s
main: -- transaction_open?()
main:    -> 0.0000s
main: -- execute("ALTER TABLE namespace_details\nADD CONSTRAINT check_2f563eec0f\nCHECK ( char_length(description) <= 255 )\nNOT VALID;\n")
main:    -> 0.0005s
main: -- current_schema()
main:    -> 0.0002s
main: -- execute("ALTER TABLE namespace_details VALIDATE CONSTRAINT check_2f563eec0f;")
main:    -> 0.0005s
main: == 20220808194857 RemoveDescriptionHtmlLimit: reverted (0.0194s) ==============

How to set up and validate locally

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 Sean Carroll

Merge request reports