debian-mirror-gitlab/lib/gitlab/database/schema_validation/schema_objects/column.rb
2023-07-09 08:55:56 +05:30

23 lines
490 B
Ruby

# frozen_string_literal: true
module Gitlab
module Database
module SchemaValidation
module SchemaObjects
class Column
def initialize(adapter)
@adapter = adapter
end
attr_reader :adapter
delegate :name, :table_name, :partition_key?, to: :adapter
def statement
[name, adapter.data_type, adapter.default, adapter.nullable].compact.join(' ')
end
end
end
end
end
end