Class: Gitlab::Database::GitlabSchemaInfo

Inherits:
Struct
  • Object
show all
Defined in:
lib/gitlab/database/gitlab_schema_info.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeGitlabSchemaInfo

Returns a new instance of GitlabSchemaInfo.



14
15
16
17
18
19
20
# File 'lib/gitlab/database/gitlab_schema_info.rb', line 14

def initialize(*)
  super
  self.name = name.to_sym
  self.allow_cross_joins = allow_cross_joins&.map(&:to_sym)&.freeze
  self.allow_cross_transactions = allow_cross_transactions&.map(&:to_sym)&.freeze
  self.allow_cross_foreign_keys = allow_cross_foreign_keys&.map(&:to_sym)&.freeze
end

Instance Attribute Details

#allow_cross_foreign_keysObject

Returns the value of attribute allow_cross_foreign_keys

Returns:

  • (Object)

    the current value of allow_cross_foreign_keys



5
6
7
# File 'lib/gitlab/database/gitlab_schema_info.rb', line 5

def allow_cross_foreign_keys
  @allow_cross_foreign_keys
end

#allow_cross_joinsObject

Returns the value of attribute allow_cross_joins

Returns:

  • (Object)

    the current value of allow_cross_joins



5
6
7
# File 'lib/gitlab/database/gitlab_schema_info.rb', line 5

def allow_cross_joins
  @allow_cross_joins
end

#allow_cross_transactionsObject

Returns the value of attribute allow_cross_transactions

Returns:

  • (Object)

    the current value of allow_cross_transactions



5
6
7
# File 'lib/gitlab/database/gitlab_schema_info.rb', line 5

def allow_cross_transactions
  @allow_cross_transactions
end

#descriptionObject

Returns the value of attribute description

Returns:

  • (Object)

    the current value of description



5
6
7
# File 'lib/gitlab/database/gitlab_schema_info.rb', line 5

def description
  @description
end

#file_pathObject

Returns the value of attribute file_path

Returns:

  • (Object)

    the current value of file_path



5
6
7
# File 'lib/gitlab/database/gitlab_schema_info.rb', line 5

def file_path
  @file_path
end

#nameObject

Returns the value of attribute name

Returns:

  • (Object)

    the current value of name



5
6
7
# File 'lib/gitlab/database/gitlab_schema_info.rb', line 5

def name
  @name
end

Class Method Details

.load_file(yaml_file) ⇒ Object



22
23
24
25
# File 'lib/gitlab/database/gitlab_schema_info.rb', line 22

def self.load_file(yaml_file)
  content = YAML.load_file(yaml_file)
  new(**content.deep_symbolize_keys.merge(file_path: yaml_file))
end