Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/models/data_type.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class DataType < ApplicationRecord
has_translation :display_messages, purpose: :display_message
has_translation :aliases, purpose: :alias

validates :type, presence: true, length: { maximum: 8192 }
validates :type, presence: true, length: { maximum: 65_536 }
validates :definition_source, length: { maximum: 50 }

validate :validate_version
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# frozen_string_literal: true

class IncreaseTypeLimitsForDataTypesTo64kb < Code0::ZeroTrack::Database::Migration[1.0]
def change
remove_check_constraint :data_types, 'char_length(type) <= 8192', name: 'check_01ca31b7b9'

add_check_constraint :data_types, 'char_length(type) <= 65536', name: 'check_01ca31b7b9'
end
end
1 change: 1 addition & 0 deletions db/schema_migrations/20260706201844
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
d889cbac3eeeb24a71a3983e09e0e4e88506f86288dfbbffca2108339fe03e80
2 changes: 1 addition & 1 deletion db/structure.sql
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ CREATE TABLE data_types (
type text NOT NULL,
definition_source text,
runtime_module_id bigint NOT NULL,
CONSTRAINT check_01ca31b7b9 CHECK ((char_length(type) <= 8192)),
CONSTRAINT check_01ca31b7b9 CHECK ((char_length(type) <= 65536)),
CONSTRAINT check_3a7198812e CHECK ((char_length(identifier) <= 50)),
CONSTRAINT check_a133157a46 CHECK ((char_length(definition_source) <= 50))
);
Expand Down
2 changes: 1 addition & 1 deletion spec/models/data_type_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

describe 'validations' do
it { is_expected.to validate_presence_of(:type) }
it { is_expected.to validate_length_of(:type).is_at_most(8192) }
it { is_expected.to validate_length_of(:type).is_at_most(65_536) }
it { is_expected.to validate_length_of(:definition_source).is_at_most(50) }

describe '#validate_version' do
Expand Down
2 changes: 1 addition & 1 deletion spec/requests/grpc/sagittarius/module_service_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,7 @@
definition_data_types: [
{
identifier: 'A_TYPE',
type: 'A' * 9000,
type: 'A' * 66_000,
linked_data_type_identifiers: [],
version: '1.0.0',
definition_source: 'module-a',
Expand Down