Commit 9f2a3189 authored by Luke Duncalfe's avatar Luke Duncalfe Committed by Tiger Watson

Validate text limit on designs.filename

This adds a validation to the text limit constraint that was added in
https://gitlab.com/gitlab-org/gitlab/-/merge_requests/33565.

Our database migration guidelines
https://docs.gitlab.com/ee/development/database/strings_and_the_text_data_type.html#add-a-text-limit-constraint-to-an-existing-column
recommend that we only validate the constraint one release after the
constraint was added.

https://gitlab.com/gitlab-org/gitlab/-/issues/220420
parent 4b7e5399
---
title: Add migration to validate design_management_designs.filename text limit constraint
merge_request: 43952
author:
type: other
# frozen_string_literal: true
class ValidateDesignsFilenameTextLimit < ActiveRecord::Migration[6.0]
include Gitlab::Database::MigrationHelpers
DOWNTIME = false
disable_ddl_transaction!
def up
validate_text_limit :design_management_designs, :filename
end
def down
# no-op
end
end
a581071767c5484e8286951854b0effe04d4b8951f208f10ceb4812940363959
\ No newline at end of file
......@@ -11412,7 +11412,8 @@ CREATE TABLE design_management_designs (
project_id integer NOT NULL,
issue_id integer,
filename character varying NOT NULL,
relative_position integer
relative_position integer,
CONSTRAINT check_07155e2715 CHECK ((char_length((filename)::text) <= 255))
);
CREATE SEQUENCE design_management_designs_id_seq
......@@ -18147,9 +18148,6 @@ ALTER TABLE ONLY chat_names
ALTER TABLE ONLY chat_teams
ADD CONSTRAINT chat_teams_pkey PRIMARY KEY (id);
ALTER TABLE design_management_designs
ADD CONSTRAINT check_07155e2715 CHECK ((char_length((filename)::text) <= 255)) NOT VALID;
ALTER TABLE vulnerability_scanners
ADD CONSTRAINT check_37608c9db5 CHECK ((char_length(vendor) <= 255)) NOT VALID;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment