Welcome to mirror list, hosted at ThFree Co, Russian Federation.

column.rb « schema_objects « validation « schema « gitlab « lib « gitlab-schema-validation « gems - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 0b3687fdb985d21629bc88ee5618d860e27c1c07 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# frozen_string_literal: true

module Gitlab
  module Schema
    module Validation
      module SchemaObjects
        class Column
          def initialize(adapter)
            @adapter = adapter
          end

          attr_reader :adapter

          def name
            adapter.name
          end

          def table_name
            adapter.table_name
          end

          def partition_key?
            adapter.partition_key?
          end

          def statement
            [adapter.name, adapter.data_type, adapter.default, adapter.nullable].compact.join(' ')
          end
        end
      end
    end
  end
end