debian-mirror-gitlab/lib/gitlab/database/schema_validation/schema_objects/column.rb
2023-06-20 00:43:36 +05:30

23 lines
473 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, to: :adapter
def statement
[name, adapter.data_type, adapter.default, adapter.nullable].compact.join(' ')
end
end
end
end
end
end