debian-mirror-gitlab/lib/gitlab/database/schema_validation/schema_objects/column.rb

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

24 lines
473 B
Ruby
Raw Normal View History

2023-06-20 00:43:36 +05:30
# 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