Commit ce5fcda2 authored by Vijay Hawoldar's avatar Vijay Hawoldar

Change Ci::Minutes:AdditionalPack text limit

Updates the text limit constraint from 32 to 50 for AdditionalPacks to
match the change in value coming from CustomersDot

Changelog: changed
EE: true
parent e0bf215c
# frozen_string_literal: true
class ChangeCiMinutesAdditionalPackTextLimit < Gitlab::Database::Migration[1.0]
disable_ddl_transaction!
def up
remove_text_limit :ci_minutes_additional_packs, :purchase_xid
add_text_limit :ci_minutes_additional_packs, :purchase_xid, 50
end
def down
remove_text_limit :ci_minutes_additional_packs, :purchase_xid
add_text_limit :ci_minutes_additional_packs, :purchase_xid, 32, validate: false
end
end
3885d2fca4166e71610cd957f1c5a703118cbb5ba47a8d494eb4e017fe499a7d
\ No newline at end of file
......@@ -11581,7 +11581,7 @@ CREATE TABLE ci_minutes_additional_packs (
expires_at date,
number_of_minutes integer NOT NULL,
purchase_xid text,
CONSTRAINT check_d7ef254af0 CHECK ((char_length(purchase_xid) <= 32))
CONSTRAINT check_d7ef254af0 CHECK ((char_length(purchase_xid) <= 50))
);
CREATE SEQUENCE ci_minutes_additional_packs_id_seq
......@@ -16,7 +16,7 @@ module Ci
validates :namespace, :number_of_minutes, presence: true
validates :expires_at, :purchase_xid, presence: true, if: -> { ::Gitlab.com? }
validates :purchase_xid, length: { maximum: 32 }
validates :purchase_xid, length: { maximum: 50 }
validates :purchase_xid, uniqueness: true, if: -> { ::Gitlab.com? }
end
end
......
......@@ -12,7 +12,7 @@ RSpec.describe Ci::Minutes::AdditionalPack do
it { is_expected.to validate_presence_of(:namespace) }
it { is_expected.to validate_presence_of(:number_of_minutes) }
it { is_expected.to validate_length_of(:purchase_xid).is_at_most(32) }
it { is_expected.to validate_length_of(:purchase_xid).is_at_most(50) }
context 'when GitLab.com' do
before do
......
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