Class: Gitlab::Database::GitlabSchemaInfo
- Inherits:
-
Struct
- Object
- Struct
- Gitlab::Database::GitlabSchemaInfo
- Defined in:
- lib/gitlab/database/gitlab_schema_info.rb
Instance Attribute Summary collapse
-
#allow_cross_foreign_keys ⇒ Object
Returns the value of attribute allow_cross_foreign_keys.
-
#allow_cross_joins ⇒ Object
Returns the value of attribute allow_cross_joins.
-
#allow_cross_transactions ⇒ Object
Returns the value of attribute allow_cross_transactions.
-
#description ⇒ Object
Returns the value of attribute description.
-
#disallow_sequences ⇒ Object
Returns the value of attribute disallow_sequences.
-
#file_path ⇒ Object
Returns the value of attribute file_path.
-
#name ⇒ Object
Returns the value of attribute name.
-
#require_sharding_key ⇒ Object
Returns the value of attribute require_sharding_key.
-
#sharding_root_tables ⇒ Object
Returns the value of attribute sharding_root_tables.
Class Method Summary collapse
Instance Method Summary collapse
- #allow_cross_foreign_keys?(table_schemas, all_tables) ⇒ Boolean
- #allow_cross_joins?(table_schemas, all_tables) ⇒ Boolean
- #allow_cross_transactions?(table_schemas, all_tables) ⇒ Boolean
-
#initialize ⇒ GitlabSchemaInfo
constructor
A new instance of GitlabSchemaInfo.
Constructor Details
#initialize ⇒ GitlabSchemaInfo
Returns a new instance of GitlabSchemaInfo.
17 18 19 20 21 22 23 24 25 26 |
# File 'lib/gitlab/database/gitlab_schema_info.rb', line 17 def initialize(*) super self.name = name.to_sym self.allow_cross_joins = add_table_specific_allows( :joins, convert_array_to_hash(allow_cross_joins)) self.allow_cross_transactions = add_table_specific_allows( :transactions, convert_array_to_hash(allow_cross_transactions)) self.allow_cross_foreign_keys = add_table_specific_allows( :foreign_keys, convert_array_to_hash(allow_cross_foreign_keys)) end |
Instance Attribute Details
#allow_cross_foreign_keys ⇒ Object
Returns the value of attribute 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_joins ⇒ Object
Returns the value of attribute 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_transactions ⇒ Object
Returns the value of attribute allow_cross_transactions
5 6 7 |
# File 'lib/gitlab/database/gitlab_schema_info.rb', line 5 def allow_cross_transactions @allow_cross_transactions end |
#description ⇒ Object
Returns the value of attribute description
5 6 7 |
# File 'lib/gitlab/database/gitlab_schema_info.rb', line 5 def description @description end |
#disallow_sequences ⇒ Object
Returns the value of attribute disallow_sequences
5 6 7 |
# File 'lib/gitlab/database/gitlab_schema_info.rb', line 5 def disallow_sequences @disallow_sequences end |
#file_path ⇒ Object
Returns the value of attribute file_path
5 6 7 |
# File 'lib/gitlab/database/gitlab_schema_info.rb', line 5 def file_path @file_path end |
#name ⇒ Object
Returns the value of attribute name
5 6 7 |
# File 'lib/gitlab/database/gitlab_schema_info.rb', line 5 def name @name end |
#require_sharding_key ⇒ Object
Returns the value of attribute require_sharding_key
5 6 7 |
# File 'lib/gitlab/database/gitlab_schema_info.rb', line 5 def require_sharding_key @require_sharding_key end |
#sharding_root_tables ⇒ Object
Returns the value of attribute sharding_root_tables
5 6 7 |
# File 'lib/gitlab/database/gitlab_schema_info.rb', line 5 def sharding_root_tables @sharding_root_tables end |
Class Method Details
.load_file(yaml_file) ⇒ Object
28 29 30 31 |
# File 'lib/gitlab/database/gitlab_schema_info.rb', line 28 def self.load_file(yaml_file) content = YAML.load_file(yaml_file) new(**content.deep_symbolize_keys.merge(file_path: yaml_file)) end |
Instance Method Details
#allow_cross_foreign_keys?(table_schemas, all_tables) ⇒ Boolean
41 42 43 |
# File 'lib/gitlab/database/gitlab_schema_info.rb', line 41 def allow_cross_foreign_keys?(table_schemas, all_tables) allowed_for?(allow_cross_foreign_keys, table_schemas, all_tables) end |
#allow_cross_joins?(table_schemas, all_tables) ⇒ Boolean
33 34 35 |
# File 'lib/gitlab/database/gitlab_schema_info.rb', line 33 def allow_cross_joins?(table_schemas, all_tables) allowed_for?(allow_cross_joins, table_schemas, all_tables) end |
#allow_cross_transactions?(table_schemas, all_tables) ⇒ Boolean
37 38 39 |
# File 'lib/gitlab/database/gitlab_schema_info.rb', line 37 def allow_cross_transactions?(table_schemas, all_tables) allowed_for?(allow_cross_transactions, table_schemas, all_tables) end |