Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add TableName cop #574

Merged
merged 1 commit into from Mar 7, 2022
Merged

Conversation

MaximeDucheneS
Copy link
Contributor

@MaximeDucheneS MaximeDucheneS commented Oct 7, 2021

Adds a cop that will check for uses of self.table_name=.

See https://rails.rubystyle.guide/#keep-ar-defaults for more details.


Before submitting the PR make sure the following are checked:

  • Wrote good commit messages.
  • Commit message starts with [Fix #issue-number] (if the related issue exists).
  • Feature branch is up-to-date with master (if not - rebase it).
  • Squashed related commits together.
  • Added tests.
  • Added an entry (file) to the changelog folder named {change_type}_{change_description}.md if the new code introduces user-observable changes. See changelog entry format for details.
  • The PR relates to only one subject with a clear title
    and description in grammatically correct, complete sentences.
  • Run bundle exec rake default. It executes all tests and RuboCop for itself, and generates the documentation.
  • If this is a new cop, consider making a corresponding update to the Rails Style Guide.

config/default.yml Outdated Show resolved Hide resolved
@koic
Copy link
Member

koic commented Oct 7, 2021

Rails/TableName cop may be abstract. What about a name like Rails/SetTableName cop or Rails/TableNameAssignment cop?

@MaximeDucheneS
Copy link
Contributor Author

@koic I do like Rails/TableNameAssignment, thanks!

@pirj
Copy link
Member

pirj commented Oct 7, 2021

Here's a digest of self.table_name = usages from https://github.com/eliotsykes/real-world-rails
Leaving it up to you to categorize. I hope this helps make an informed decision.

apps/discourse/app/models/stylesheet_cache.rb
4:  self.table_name = 'stylesheet_cache'

apps/discourse/app/models/topic_view_item.rb
7:  self.table_name = 'topic_views'

apps/claim-for-crown-court-defence/app/models/interim_claim_info.rb
4:  self.table_name = 'interim_claim_info'

apps/claim-for-crown-court-defence/app/models/stats/mi_data.rb
3:    self.table_name = 'mi_data'

apps/claim-for-crown-court-defence/app/models/stats/statistic.rb
15:    self.table_name = 'statistics'

apps/claim-for-crown-court-defence/app/models/claim/base_claim.rb
11:    self.table_name = 'claims'

apps/claim-for-crown-court-defence/app/models/assessment.rb
26:  self.table_name = 'determinations'

apps/claim-for-crown-court-defence/app/models/fee/base_fee_type.rb
35:    self.table_name = 'fee_types'

apps/claim-for-crown-court-defence/app/models/fee/base_fee.rb
33:    self.table_name = 'fees'

apps/claim-for-crown-court-defence/app/models/redetermination.rb
18:  self.table_name = 'determinations'

apps/spree/api/app/models/spree/oauth_access_grant.rb
5:    self.table_name = 'spree_oauth_access_grants'

apps/spree/api/app/models/spree/oauth_access_token.rb
5:    self.table_name = 'spree_oauth_access_tokens'

apps/spree/api/app/models/spree/oauth_application.rb
5:    self.table_name = 'spree_oauth_applications'

apps/spree/core/spec/lib/spree/core/number_generator_spec.rb
10:      self.table_name = 'spree_orders'
143:        self.table_name = 'spree_orders'

apps/spree/core/spec/models/spree/base_spec.rb
5:    self.table_name = 'test_parents'
9:    self.table_name = 'test_children'

apps/spree/core/spec/models/spree/reimbursement_type/credit_spec.rb
16:      self.table_name = 'spree_payments' # Your creditable class should not use this table

apps/spree/core/spec/models/spree/product_spec.rb
6:    self.table_name = 'spree_products'

apps/spree/core/app/models/spree/classification.rb
3:    self.table_name = 'spree_products_taxons'

apps/spree/core/app/models/spree/store_product.rb
3:    self.table_name = 'spree_products_stores'

apps/spree/core/app/models/spree/store_promotion.rb
3:    self.table_name = 'spree_promotions_stores'

apps/spree/core/app/models/spree/store_payment_method.rb
3:    self.table_name = 'spree_payment_methods_stores'

apps/spree/core/app/models/spree/legacy_user.rb
8:    self.table_name = 'spree_users'

apps/openproject/modules/webhooks/app/models/webhooks.rb
2:  def self.table_name_prefix

apps/openproject/modules/two_factor_authentication/app/models/two_factor_authentication.rb
2:  def self.table_name_prefix

apps/openproject/modules/ldap_groups/app/models/ldap_groups.rb
2:  def self.table_name_prefix

apps/openproject/modules/overviews/db/migrate/20190826083604_my_project_page_to_grid.rb
3:    self.table_name = 'my_projects_overviews'

apps/openproject/modules/documents/app/models/journal/document_journal.rb
32:  self.table_name = "document_journals"

apps/openproject/modules/bim/app/models/bim/bcf/comment.rb
31:    self.table_name = :bcf_comments

apps/openproject/modules/bim/app/models/bim/bcf/issue.rb
3:    self.table_name = :bcf_issues

apps/openproject/modules/bim/app/models/bim/bcf/viewpoint.rb
3:    self.table_name = :bcf_viewpoints

apps/openproject/modules/budgets/app/models/journal/budget_journal.rb
30:  self.table_name = 'budget_journals'

apps/openproject/modules/recaptcha/app/models/recaptcha/entry.rb
3:    self.table_name_prefix = 'recaptcha_'

apps/openproject/modules/meeting/app/models/journal/meeting_journal.rb
32:  self.table_name = 'meeting_journals'

apps/openproject/modules/meeting/app/models/meeting.rb
32:  self.table_name = 'meetings'

apps/openproject/modules/meeting/app/models/journal/meeting_content_journal.rb
32:  self.table_name = 'meeting_content_journals'

apps/openproject/modules/grids/app/models/grids/grid.rb
33:    self.table_name = :grids

apps/openproject/modules/grids/app/models/grids/widget.rb
33:    self.table_name = :grid_widgets

apps/openproject/modules/job_status/app/models/job_status/status.rb
3:    self.table_name = 'delayed_job_statuses'

apps/openproject/modules/reporting/lib/report/chainable.rb
324:    def self.table_name(value = nil)

apps/openproject/modules/costs/app/models/journal/time_entry_journal.rb
32:  self.table_name = 'time_entry_journals'

apps/openproject/db/migrate/20171106074835_move_hashed_token_to_core.rb
3:    self.table_name = :plaintext_tokens

apps/openproject/db/migrate/20200115090742_fix_parent_id_for_wiki_pages.rb
3:    self.table_name = "wiki_pages"

apps/openproject/db/migrate/20190722082648_add_derived_estimated_hours_to_work_packages.rb
3:    self.table_name = "work_packages"

apps/openproject/db/migrate/20170829095701_generate_wp_closure.rb
226:    self.table_name = 'work_packages'

apps/openproject/db/migrate/tables/base.rb
38:  def self.table_name

apps/openproject/db/migrate/20191216135213_join_table_for_active_activities.rb
3:    self.table_name = :time_entry_activities_projects
7:    self.table_name = :enumerations

apps/openproject/db/migrate/20210825183540_make_user_preferences_json.rb
7:    self.table_name = 'user_preferences'

apps/openproject/lib/open_project/text_formatting/formats/markdown/textile_converter.rb
516:        self.table_name = 'boards'

apps/openproject/lib/tasks/attachment_migrations.rake
43:      self.table_name = "wiki_pages"
49:      self.table_name = "wiki_contents"

apps/openproject/app/models/principal.rb
43:  self.table_name = "#{table_name_prefix}users#{table_name_suffix}"

apps/openproject/app/models/journal.rb
32:  self.table_name = 'journals'

apps/openproject/app/models/color.rb
32:  self.table_name = 'colors'

apps/openproject/app/models/sessions/user_session.rb
36:    self.table_name = 'sessions'

apps/openproject/app/models/projects/status.rb
34:  self.table_name = 'project_statuses'

apps/openproject/app/models/journal/message_journal.rb
32:  self.table_name = 'message_journals'

apps/openproject/app/models/journal/attachment_journal.rb
32:  self.table_name = 'attachment_journals'

apps/openproject/app/models/journal/customizable_journal.rb
32:  self.table_name = 'customizable_journals'

apps/openproject/app/models/journal/news_journal.rb
32:  self.table_name = 'news_journals'

apps/openproject/app/models/journal/wiki_content_journal.rb
32:  self.table_name = 'wiki_content_journals'

apps/openproject/app/models/journal/attachable_journal.rb
32:  self.table_name = 'attachable_journals'

apps/openproject/app/models/journal/work_package_journal.rb
32:  self.table_name = 'work_package_journals'

apps/openproject/app/models/journal/changeset_journal.rb
32:  self.table_name = 'changeset_journals'

apps/openproject/app/models/token/base.rb
21:    self.table_name = 'tokens'

apps/zammad/app/models/store/provider/db.rb
6:      self.table_name = 'store_provider_dbs'

apps/zammad/app/models/concerns/has_group_relation_definition.rb
8:    self.table_name   = "groups_#{group_relation_model_identifier}s"

apps/zammad/app/models/user_group.rb
6:  self.table_name = 'groups_users'

apps/zammad/app/models/report/profile.rb
4:  self.table_name = 'report_profiles'

apps/zammad/app/models/activity_stream.rb
6:  self.table_name = 'activity_streams'

apps/zammad/app/models/ticket/priority.rb
9:  self.table_name = 'ticket_priorities'

apps/zammad/app/models/role_group.rb
6:  self.table_name = 'roles_groups'

apps/zammad/app/models/karma/user.rb
4:  self.table_name = 'karma_users'

apps/zammad/app/models/karma/activity.rb
4:  self.table_name = 'karma_activities'

apps/zammad/app/models/karma/activity_log.rb
7:  self.table_name = 'karma_activity_logs'

apps/zammad/app/models/cti/log.rb
7:    self.table_name = 'cti_logs'

apps/zammad/app/models/cti/caller_id.rb
5:    self.table_name = 'cti_caller_ids'

apps/zammad/app/models/object_manager/attribute.rb
29:  self.table_name = 'object_manager_attributes'

apps/zammad/app/models/history.rb
7:  self.table_name = 'histories'

apps/foreman/db/migrate/20140710132249_extract_nic_attributes.rb
2:  self.table_name = 'nics'

apps/foreman/db/migrate/20120624094034_add_os_family_to_ptable.rb
3:    self.table_name = 'ptables'

apps/foreman/db/migrate/20160818091420_add_override_flag_to_filter.rb
3:    self.table_name = 'filters'

apps/foreman/db/migrate/20160317070258_add_view_params_to_filters_with_edit.rb
3:    self.table_name = 'filterings'
7:    self.table_name = 'filters'

apps/foreman/db/migrate/20150605073820_fix_template_snippet_flag.rb
3:    self.table_name = 'templates'

apps/foreman/db/migrate/20150714140850_remove_new_from_compute_attributes.rb
2:  self.table_name = 'compute_attributes'

apps/foreman/db/migrate/20180705164601_remove_legacy_puppet_hostname_setting.rb
3:    self.table_name = 'settings'

apps/foreman/db/migrate/20140630114339_add_boot_mode_to_subnet.rb
3:    self.table_name = 'subnets'

apps/foreman/db/migrate/20150312144232_migrate_websockets_setting.rb
2:  self.table_name = 'settings'

apps/foreman/db/migrate/20140908082450_remove_signo_setting.rb
3:    self.table_name = 'settings'

apps/foreman/db/migrate/20130908100439_delete_orphaned_records.rb
3:    self.table_name = 'config_templates'
7:    self.table_name = 'ptables'

apps/foreman/db/migrate/20140908192300_change_nil_admin_users_to_false.rb
2:  self.table_name = 'users'

apps/foreman/db/migrate/20161006070258_migrate_common_parameter_permissions.rb
3:    self.table_name = 'filters'

apps/foreman/db/migrate/20160527093031_limit_os_description.rb
3:    self.table_name = 'operatingsystems'

apps/foreman/db/migrate/20140902102858_convert_ipam_to_string.rb
3:    self.table_name = 'subnets'

apps/foreman/db/migrate/20141203082104_make_templates_default.rb
3:    self.table_name = 'config_templates'

apps/foreman/db/migrate/20150514114044_migrate_ptables_to_templates.rb
3:    self.table_name = 'ptables'
11:    self.table_name = 'templates'

apps/foreman/db/migrate/20190801143210_convert_dns_conflict_timeout_setting.rb
2:  self.table_name = 'settings'

apps/foreman/db/migrate/20140219183343_migrate_permissions.rb
8:  self.table_name = 'permissions'
12:  self.table_name = 'filters'
34:  self.table_name = 'user_roles'
40:  self.table_name = 'roles'
46:  self.table_name = 'filterings'
52:  self.table_name = 'users'

apps/foreman/db/migrate/20180831115634_add_uniqueness_to_puppetclass_name.rb
3:    self.table_name = 'puppetclasses'

apps/foreman/db/migrate/20141015164522_remove_failed_report_setting.rb
3:    self.table_name = 'settings'

apps/foreman/db/migrate/20180119205740_change_user_timezone_empty_to_nil.rb
3:    self.table_name = 'users'

apps/foreman/db/migrate/20131127112625_rename_seeded_templates.rb
39:    self.table_name = 'config_templates'
43:    self.table_name = 'ptables'

apps/foreman/db/migrate/20150612105614_rename_taxonomy_ignored_type_to_provisioning_templates.rb
3:    self.table_name = 'taxonomies'

apps/foreman/db/migrate/20140910153654_move_host_nics_to_interfaces.rb
2:  self.table_name = 'nics'
10:  self.table_name = 'hosts'

apps/foreman/db/migrate/20180403144853_convert_vm_attrs_to_hash.rb
36:    self.table_name = 'nics'
41:    self.table_name = 'compute_attributes'
45:    self.table_name = 'compute_resources'
50:    self.table_name = 'lookup_values'
54:    self.table_name = 'lookup_keys'

apps/foreman/db/migrate/20130329195742_remove_duplicate_snippets.rb
3:    self.table_name = 'config_templates'

apps/foreman/db/migrate/20190305150816_drop_elements_from_vm_attrs_hash.rb
56:    self.table_name = 'nics'
63:    self.table_name = 'compute_attributes'
68:    self.table_name = 'compute_resources'
74:    self.table_name = 'lookup_values'
79:    self.table_name = 'lookup_keys'

apps/foreman/db/migrate/20150508124600_copy_unmanaged_hosts_to_interfaces.rb
2:  self.table_name = 'nics'
10:  self.table_name = 'hosts'

apps/foreman/lib/tasks/puppet.rake
69:        self.table_name = 'environments'

apps/foreman/test/controllers/api/base_controller_subclass_test.rb
48:  self.table_name = 'filters'
52:  self.table_name = 'roles'

apps/foreman/test/controllers/application_controller_subclass_test.rb
21:  def self.table_name
41:    def self.table_name

apps/foreman/test/models/concerns/taxonomix_test.rb
4:  self.table_name = 'domains'
17:  self.table_name = 'domains'

apps/foreman/test/unit/dirty_associations_test.rb
4:  self.table_name = 'dummy_dirty_association'
15:  self.table_name = 'second_mock'
20:  self.table_name = 'third_mock'
25:  self.table_name = 'first_mock'

apps/foreman/app/services/foreman/render_templates_from_folder.rb
4:      self.table_name = 'templates'

apps/foreman/app/models/provisioning_template.rb
19:  self.table_name = 'templates'

apps/foreman/app/models/report_template.rb
16:  self.table_name = 'templates'

apps/foreman/app/models/host_status/status.rb
5:    self.table_name = 'host_status'

apps/foreman/app/models/host_facets.rb
2:  def self.table_name_prefix

apps/foreman/app/models/nic/base.rb
10:    self.table_name = 'nics'

apps/foreman/app/models/host/base.rb
14:    self.table_name = :hosts

apps/foreman/app/models/ptable.rb
24:  self.table_name = 'templates'

apps/openstreetmap-website/db/migrate/039_add_more_controls_to_gpx_files.rb
3:    self.table_name = "gpx_files"

apps/openstreetmap-website/db/migrate/20120808231205_add_counter_caches.rb
6:    self.table_name = "gpx_files"

apps/openstreetmap-website/db/migrate/006_tile_nodes.rb
3:    self.table_name = "current_nodes"
7:    self.table_name = "nodes"

apps/openstreetmap-website/db/migrate/005_tile_tracepoints.rb
3:    self.table_name = "gps_points"

apps/openstreetmap-website/app/models/trace.rb
31:  self.table_name = "gpx_files"

apps/openstreetmap-website/app/models/relation.rb
26:  self.table_name = "current_relations"

apps/openstreetmap-website/app/models/way_tag.rb
15:  self.table_name = "current_way_tags"

apps/openstreetmap-website/app/models/friendship.rb
21:  self.table_name = "friends"

apps/openstreetmap-website/app/models/tracepoint.rb
26:  self.table_name = "gps_points"

apps/openstreetmap-website/app/models/tracetag.rb
20:  self.table_name = "gpx_file_tags"

apps/openstreetmap-website/app/models/old_node_tag.rb
16:  self.table_name = "node_tags"

apps/openstreetmap-website/app/models/old_way.rb
26:  self.table_name = "ways"

apps/openstreetmap-website/app/models/old_relation_member.rb
22:  self.table_name = "relation_members"

apps/openstreetmap-website/app/models/old_way_node.rb
20:  self.table_name = "way_nodes"

apps/openstreetmap-website/app/models/way_node.rb
20:  self.table_name = "current_way_nodes"

apps/openstreetmap-website/app/models/node_tag.rb
15:  self.table_name = "current_node_tags"

apps/openstreetmap-website/app/models/old_way_tag.rb
16:  self.table_name = "way_tags"

apps/openstreetmap-website/app/models/relation_member.rb
21:  self.table_name = "current_relation_members"

apps/openstreetmap-website/app/models/old_relation_tag.rb
16:  self.table_name = "relation_tags"

apps/openstreetmap-website/app/models/relation_tag.rb
15:  self.table_name = "current_relation_tags"

apps/openstreetmap-website/app/models/node.rb
31:  self.table_name = "current_nodes"

apps/openstreetmap-website/app/models/old_relation.rb
26:  self.table_name = "relations"

apps/openstreetmap-website/app/models/way.rb
26:  self.table_name = "current_ways"

apps/openstreetmap-website/app/models/old_node.rb
31:  self.table_name = "nodes"

apps/openfoodnetwork/db/migrate/20200514174526_reset_negative_nonbackorderable_count_on_hand_in_stock_items.rb
6:      self.table_name = "spree_stock_items"

apps/openfoodnetwork/app/models/distributor_shipping_method.rb
4:  self.table_name = "distributors_shipping_methods"

apps/openfoodnetwork/app/models/spree/classification.rb
5:    self.table_name = 'spree_products_taxons'

apps/loomio/app/models/identities/base.rb
3:  self.table_name = :omniauth_identities

apps/loomio/app/models/search_vector.rb
26:  self.table_name = 'discussion_search_vectors'

apps/ruby-china/db/migrate/20160126061903_create_settings.rb
2:  self.table_name = "site_configs"

apps/chatwoot/app/models/kbase.rb
2:  def self.table_name_prefix

apps/chatwoot/app/models/channel/facebook_page.rb
24:  self.table_name = 'channel_facebook_pages'

apps/chatwoot/app/models/channel/twitter_profile.rb
21:  self.table_name = 'channel_twitter_profiles'

apps/chatwoot/app/models/channel/whatsapp.rb
21:  self.table_name = 'channel_whatsapp'

apps/chatwoot/app/models/channel/line.rb
21:  self.table_name = 'channel_line'

apps/chatwoot/app/models/channel/web_widget.rb
31:  self.table_name = 'channel_web_widgets'

apps/chatwoot/app/models/channel/api.rb
23:  self.table_name = 'channel_api'

apps/chatwoot/app/models/channel/twilio_sms.rb
22:  self.table_name = 'channel_twilio_sms'

apps/chatwoot/app/models/channel/email.rb
21:  self.table_name = 'channel_email'

apps/chatwoot/app/models/channel/telegram.rb
20:  self.table_name = 'channel_telegram'

apps/chatwoot/app/models/integrations.rb
2:  def self.table_name_prefix

apps/gitlabhq/doc/development/work_items.md
64:  self.table_name = 'issues'

apps/gitlabhq/doc/development/single_table_inheritance.md
36:    self.table_name = 'services'

apps/gitlabhq/doc/development/migration_style_guide.md
1016:    self.table_name = 'projects'
1115:    self.table_name = 'users'

apps/gitlabhq/doc/development/background_migrations.md
209:    self.table_name = 'services'

apps/gitlabhq/doc/development/database/not_null_constraints.md
157:    self.table_name = 'epics'

apps/gitlabhq/doc/development/database/strings_and_the_text_data_type.md
212:    self.table_name = 'issues'

apps/gitlabhq/doc/development/database/rename_database_tables.md
92:renaming the model directly or setting the `self.table_name` variable.

apps/gitlabhq/doc/development/avoiding_downtime_in_migrations.md
244:    self.table_name = 'issues'
286:    self.table_name = 'issues'

apps/gitlabhq/lib/gitlab/background_migration/populate_latest_pipeline_ids.rb
10:        self.table_name = 'project_settings'

apps/gitlabhq/lib/gitlab/background_migration/backfill_namespace_traversal_ids_children.rb
12:        self.table_name = 'namespaces'

apps/gitlabhq/lib/gitlab/background_migration/set_null_external_diff_store_to_local_value.rb
16:        self.table_name = 'merge_request_diffs'

apps/gitlabhq/lib/gitlab/background_migration/migrate_merge_request_diff_commit_users.rb
35:        self.table_name = 'merge_request_diff_commits'
72:        self.table_name = 'merge_request_diff_commit_users'

apps/gitlabhq/lib/gitlab/background_migration/update_jira_tracker_data_deployment_type_based_on_url.rb
7:    self.table_name = "jira_tracker_data"

apps/gitlabhq/lib/gitlab/background_migration/populate_has_vulnerabilities.rb
9:        self.table_name = 'project_settings'
34:        self.table_name = 'vulnerabilities'

apps/gitlabhq/lib/gitlab/background_migration/set_merge_request_diff_files_count.rb
23:        self.table_name = 'merge_request_diffs'

apps/gitlabhq/lib/gitlab/background_migration/user_mentions/models/note.rb
13:          self.table_name = 'notes'

apps/gitlabhq/lib/gitlab/background_migration/user_mentions/models/user.rb
11:          self.table_name = 'users'

apps/gitlabhq/lib/gitlab/background_migration/user_mentions/models/epic.rb
19:          self.table_name = 'epics'

apps/gitlabhq/lib/gitlab/background_migration/user_mentions/models/design_user_mention.rb
9:          self.table_name = 'design_user_mentions'

apps/gitlabhq/lib/gitlab/background_migration/user_mentions/models/commit_user_mention.rb
9:          self.table_name = 'commit_user_mentions'

apps/gitlabhq/lib/gitlab/background_migration/user_mentions/models/merge_request_user_mention.rb
9:          self.table_name = 'merge_request_user_mentions'

apps/gitlabhq/lib/gitlab/background_migration/user_mentions/models/merge_request.rb
19:          self.table_name = 'merge_requests'

apps/gitlabhq/lib/gitlab/background_migration/user_mentions/models/design_management/design.rb
13:            self.table_name = 'design_management_designs'

apps/gitlabhq/lib/gitlab/background_migration/user_mentions/models/project.rb
12:          self.table_name = 'projects'

apps/gitlabhq/lib/gitlab/background_migration/user_mentions/models/epic_user_mention.rb
9:          self.table_name = 'epic_user_mentions'

apps/gitlabhq/lib/gitlab/background_migration/remove_duplicate_services.rb
13:        self.table_name = 'services'

apps/gitlabhq/lib/gitlab/background_migration/cleanup_orphaned_lfs_objects_projects.rb
10:        self.table_name = 'lfs_objects_projects'
20:        self.table_name = 'lfs_objects'
25:        self.table_name = 'projects'

apps/gitlabhq/lib/gitlab/background_migration/wrongfully_confirmed_email_unconfirmer.rb
10:        self.table_name = 'users'
20:        self.table_name = 'emails'

apps/gitlabhq/lib/gitlab/background_migration/fix_pages_access_level.rb
20:        self.table_name = 'namespaces'
30:        self.table_name = 'projects'
61:        self.table_name = 'project_features'

apps/gitlabhq/lib/gitlab/background_migration/backfill_draft_status_on_merge_requests.rb
13:        self.table_name = 'merge_requests'

apps/gitlabhq/lib/gitlab/background_migration/backfill_merge_request_cleanup_schedules.rb
12:        self.table_name = 'merge_requests'

apps/gitlabhq/lib/gitlab/background_migration/remove_duplicate_vulnerabilities_findings.rb
9:    self.table_name = "vulnerability_occurrences"

apps/gitlabhq/lib/gitlab/background_migration/migrate_stage_status.rb
12:        self.table_name = 'ci_builds'

apps/gitlabhq/lib/gitlab/background_migration/add_modified_to_approval_merge_request_rule.rb
9:        self.table_name = 'namespaces'
15:        self.table_name = 'approval_merge_request_rules'
25:        self.table_name = 'approval_project_rules'
34:        self.table_name = 'approval_merge_request_rule_sources'

apps/gitlabhq/lib/gitlab/background_migration/set_default_iteration_cadences.rb
8:        self.table_name = 'sprints'
12:        self.table_name = 'iterations_cadences'
18:        self.table_name = 'namespaces'

apps/gitlabhq/lib/gitlab/background_migration/cleanup_optimistic_locking_nulls.rb
27:          self.table_name = table

apps/gitlabhq/lib/gitlab/background_migration/backfill_projects_with_coverage.rb
8:        self.table_name = 'project_ci_feature_usages'

apps/gitlabhq/lib/gitlab/background_migration/backfill_artifact_expiry_date.rb
19:        self.table_name = 'ci_job_artifacts'

apps/gitlabhq/lib/gitlab/background_migration/migrate_users_bio_to_user_details.rb
8:        self.table_name = 'users'
12:        self.table_name = 'user_details'

apps/gitlabhq/lib/gitlab/background_migration/backfill_project_repositories.rb
12:        self.table_name = 'shards'
109:        self.table_name = 'namespaces'
124:        self.table_name = 'project_repositories'
131:        self.table_name = 'projects'

apps/gitlabhq/lib/gitlab/background_migration/backfill_namespace_traversal_ids_roots.rb
12:        self.table_name = 'namespaces'

apps/gitlabhq/lib/gitlab/background_migration/populate_dismissed_state_for_vulnerabilities.rb
8:        self.table_name = 'vulnerabilities'

apps/gitlabhq/lib/gitlab/background_migration/add_merge_request_diff_commits_count.rb
8:        self.table_name = 'merge_request_diffs'

apps/gitlabhq/lib/gitlab/background_migration/set_null_package_files_file_store_to_local_value.rb
17:          self.table_name = 'packages_package_files'

apps/gitlabhq/lib/gitlab/background_migration/drop_invalid_vulnerabilities.rb
7:    self.table_name = "vulnerabilities"
12:    self.table_name = "vulnerability_occurrences"

apps/gitlabhq/lib/gitlab/background_migration/populate_missing_vulnerability_dismissal_information.rb
11:        self.table_name = 'vulnerabilities'
31:        self.table_name = 'vulnerability_occurrences'
45:        self.table_name = 'vulnerability_feedback'

apps/gitlabhq/lib/gitlab/background_migration/fix_projects_without_prometheus_service.rb
48:          self.table_name = 'clusters'
64:          self.table_name = 'services'
88:          self.table_name = 'projects'

apps/gitlabhq/lib/gitlab/background_migration/extract_project_topics_into_separate_table.rb
9:        self.table_name = 'tags'
14:        self.table_name = 'taggings'
20:        self.table_name = 'topics'
25:        self.table_name = 'project_topics'
31:        self.table_name = 'projects'

apps/gitlabhq/lib/gitlab/background_migration/migrate_null_private_profile_to_false.rb
9:        self.table_name = 'users'

apps/gitlabhq/lib/gitlab/background_migration/replace_blocked_by_links.rb
8:        self.table_name = 'issue_links'

apps/gitlabhq/lib/gitlab/background_migration/migrate_fingerprint_sha256_within_keys.rb
11:        self.table_name = 'keys'

apps/gitlabhq/lib/gitlab/background_migration/disable_expiration_policies_linked_to_no_container_images.rb
14:        self.table_name = 'container_expiration_policies'

apps/gitlabhq/lib/gitlab/background_migration/fill_valid_time_for_pages_domain_certificate.rb
9:        self.table_name = 'pages_domains'

apps/gitlabhq/lib/gitlab/background_migration/link_lfs_objects_projects.rb
11:        self.table_name = 'lfs_objects_projects'
30:        self.table_name = 'fork_network_members'

apps/gitlabhq/lib/gitlab/background_migration/populate_issue_email_participants.rb
9:        self.table_name = 'issues'

apps/gitlabhq/lib/gitlab/background_migration/backfill_jira_tracker_deployment_type2.rb
11:        self.table_name = 'jira_tracker_data'
30:        self.table_name = 'services'

apps/gitlabhq/lib/gitlab/background_migration/backfill_push_rules_id_in_projects.rb
10:        self.table_name = 'project_settings'

apps/gitlabhq/lib/gitlab/background_migration/cleanup_concurrent_schema_change.rb
51:          self.table_name = table

apps/gitlabhq/lib/gitlab/background_migration/migrate_u2f_webauthn.rb
8:        self.table_name = 'u2f_registrations'
12:        self.table_name = 'webauthn_registrations'

apps/gitlabhq/lib/gitlab/background_migration/migrate_project_taggings_context_from_tags_to_topics.rb
11:        self.table_name = 'taggings'

apps/gitlabhq/lib/gitlab/background_migration/fix_promoted_epics_discussion_ids.rb
11:        self.table_name = 'notes'

apps/gitlabhq/lib/gitlab/background_migration/recalculate_vulnerabilities_occurrences_uuid.rb
7:    self.table_name = "vulnerability_identifiers"
14:    self.table_name = "vulnerability_occurrences"

apps/gitlabhq/lib/gitlab/background_migration/populate_user_highest_roles_table.rb
14:        self.table_name = 'users'

apps/gitlabhq/lib/gitlab/background_migration/migrate_issue_trackers_sensitive_data.rb
12:        self.table_name = 'issue_tracker_data'
30:        self.table_name = 'jira_tracker_data'

apps/gitlabhq/lib/gitlab/background_migration/reset_shared_runners_for_transferred_projects.rb
11:        self.table_name = 'namespaces'
16:        self.table_name = 'projects'

apps/gitlabhq/lib/gitlab/background_migration/populate_finding_uuid_for_vulnerability_feedback.rb
21:        self.table_name = 'vulnerability_feedback'
84:        self.table_name = 'vulnerability_occurrences'
105:        self.table_name = 'vulnerability_identifiers'

apps/gitlabhq/lib/gitlab/database/dynamic_model_helpers.rb
12:          self.table_name = table_name

apps/gitlabhq/lib/gitlab/database/async_indexes/postgres_async_index.rb
7:        self.table_name = 'postgres_async_indexes'

apps/gitlabhq/lib/gitlab/database/pg_class.rb
6:      self.table_name = 'pg_class'

apps/gitlabhq/lib/gitlab/database/background_migration_job.rb
8:      self.table_name = :background_migration_jobs

apps/gitlabhq/lib/gitlab/database/background_migration/batched_job.rb
10:        self.table_name = :batched_background_migration_jobs

apps/gitlabhq/lib/gitlab/database/background_migration/batched_migration.rb
10:        self.table_name = :batched_background_migrations

apps/gitlabhq/lib/gitlab/database/postgres_index.rb
8:      self.table_name = 'postgres_indexes'

apps/gitlabhq/lib/gitlab/database/rename_reserved_paths_migration/v1/migration_classes.rb
41:            self.table_name = 'namespaces'
61:            self.table_name = 'users'
65:            self.table_name = 'routes'
72:            self.table_name = 'projects'

apps/gitlabhq/lib/gitlab/database/reindexing/reindex_action.rb
7:        self.table_name = 'postgres_reindex_actions'

apps/gitlabhq/lib/gitlab/database/migration_helpers.rb
775:      #       self.table_name = 'issues'
910:          self.table_name = table

apps/gitlabhq/lib/gitlab/database/postgres_index_bloat_estimate.rb
10:      self.table_name = 'postgres_index_bloat_estimates'

apps/gitlabhq/lib/tasks/tokens.rake
32:  self.table_name = 'users'

apps/gitlabhq/db/migrate/20201005092709_remove_compliance_frameworks_group_id_fk.rb
10:    self.table_name = 'compliance_management_frameworks'

apps/gitlabhq/db/migrate/20210531071107_enable_enforce_ssh_key_expiration.rb
5:    self.table_name = 'application_settings'

apps/gitlabhq/db/migrate/20191213120427_fix_max_pages_size.rb
8:    self.table_name = 'application_settings'

apps/gitlabhq/db/migrate/20210519154058_schedule_update_users_where_two_factor_auth_required_from_group.rb
16:    self.table_name = 'users'

apps/gitlabhq/db/migrate/20191213184609_backfill_operations_feature_flags_active.rb
9:    self.table_name = 'operations_feature_flags'

apps/gitlabhq/db/migrate/20210422195929_create_elastic_reindexing_slices.rb
9:    self.table_name = 'elastic_reindexing_subtasks'
13:    self.table_name = 'elastic_reindexing_slices'

apps/gitlabhq/db/migrate/20201027002551_migrate_services_to_http_integrations.rb
14:    self.table_name = 'alert_management_http_integrations'

apps/gitlabhq/db/migrate/20201008013434_generate_ci_jwt_signing_key.rb
7:    self.table_name = 'application_settings'

apps/gitlabhq/db/migrate/20210323155010_populate_dismissal_information_for_vulnerabilities.rb
19:    self.table_name = 'vulnerabilities'

apps/gitlabhq/db/migrate/20190402150158_backport_enterprise_schema.rb
106:    self.table_name = 'application_settings'
110:    self.table_name = 'protected_branch_merge_access_levels'
114:    self.table_name = 'protected_branch_push_access_levels'
118:    self.table_name = 'projects'

apps/gitlabhq/db/migrate/20200728182311_add_o_auth_paths_to_protected_paths.rb
30:    self.table_name = 'application_settings'

apps/gitlabhq/db/migrate/20210729123101_confirm_security_bot.rb
5:    self.table_name = 'users'

apps/gitlabhq/db/migrate/20200312053852_populate_canonical_emails.rb
13:    self.table_name = 'users'

apps/gitlabhq/db/migrate/20210804150320_create_base_work_item_types.rb
8:      self.table_name = 'work_item_types'

apps/gitlabhq/db/migrate/20200509203901_reseed_repository_storages_weighted.rb
8:    self.table_name = 'application_settings'

apps/gitlabhq/db/migrate/20190104182041_cleanup_legacy_artifact_migration.rb
13:    self.table_name = 'ci_builds'

apps/gitlabhq/db/migrate/20201012073022_remove_not_null_constraint_on_framework.rb
12:    self.table_name = 'project_compliance_framework_settings'

apps/gitlabhq/db/migrate/20210428151144_update_invalid_web_hooks.rb
9:    self.table_name = 'web_hooks'

apps/gitlabhq/db/migrate/20190620105427_change_null_private_profile_to_false.rb
13:    self.table_name = 'users'

apps/gitlabhq/db/migrate/20191120115530_encrypt_plaintext_attributes_on_application_settings.rb
18:    self.table_name = 'application_settings'

apps/gitlabhq/db/migrate/20190703130053_remove_gitaly_feature_flags.rb
42:    self.table_name = 'features'

apps/gitlabhq/db/migrate/20200508203901_add_repository_storages_weighted_to_application_settings.rb
8:    self.table_name = 'application_settings'

apps/gitlabhq/db/migrate/20210831203408_upsert_base_work_item_types.rb
6:      self.table_name = 'work_item_types'

apps/gitlabhq/db/migrate/20210203092549_restore_has_external_wiki_default_value.rb
11:    self.table_name = 'projects'

apps/gitlabhq/db/migrate/20201217132603_create_elastic_reindexing_subtasks.rb
11:    self.table_name = 'elastic_reindexing_tasks'
15:    self.table_name = 'elastic_reindexing_subtasks'

apps/gitlabhq/db/post_migrate/20201112130715_schedule_recalculate_uuid_on_vulnerabilities_occurrences.rb
17:    self.table_name = "vulnerability_occurrences"

apps/gitlabhq/db/post_migrate/20200204113225_schedule_recalculate_project_authorizations_third_run.rb
17:    self.table_name = 'users'

apps/gitlabhq/db/post_migrate/20201102073808_schedule_blocked_by_links_replacement_second_try.rb
18:    self.table_name = 'issue_links'

apps/gitlabhq/db/post_migrate/20200421195234_backfill_status_page_published_incidents.rb
9:    self.table_name = 'status_page_published_incidents'
15:    self.table_name = 'issues'

apps/gitlabhq/db/post_migrate/20191030223057_backfill_version_author_and_created_at.rb
11:    self.table_name = 'projects'
16:    self.table_name = 'issues'
22:    self.table_name = 'design_management_versions'

apps/gitlabhq/db/post_migrate/20200420094444_backfill_snippet_repositories.rb
16:    self.table_name = 'snippets'

apps/gitlabhq/db/post_migrate/20190606175050_encrypt_feature_flags_clients_tokens.rb
7:    self.table_name = 'operations_feature_flags_clients'

apps/gitlabhq/db/post_migrate/20210302150310_schedule_migrate_pages_to_zip_storage.rb
20:    self.table_name = 'project_pages_metadata'

apps/gitlabhq/db/post_migrate/20210722042939_update_issuable_slas_where_issue_closed.rb
9:    self.table_name = 'issuable_slas'
15:    self.table_name = 'issues'

apps/gitlabhq/db/post_migrate/20200907124300_complete_namespace_settings_migration.rb
10:    self.table_name = 'namespaces'

apps/gitlabhq/db/post_migrate/20200526115436_dedup_mr_metrics.rb
13:    self.table_name = 'merge_request_metrics'

apps/gitlabhq/db/post_migrate/20190827102026_migrate_code_owner_approval_status_to_protected_branches_in_batches.rb
14:    self.table_name = 'projects'
23:    self.table_name = 'protected_branches'

apps/gitlabhq/db/post_migrate/20210226120851_move_container_registry_enabled_to_project_features.rb
15:    self.table_name = 'projects'

apps/gitlabhq/db/post_migrate/20201110161542_cleanup_transfered_projects_shared_runners.rb
16:    self.table_name = 'namespaces'

apps/gitlabhq/db/post_migrate/20190628191740_schedule_fixing_names_of_user_namespaces.rb
14:    self.table_name = 'namespaces'
22:    self.table_name = 'routes'

apps/gitlabhq/db/post_migrate/20200615111857_unconfirm_wrongfully_verified_emails.rb
16:    self.table_name = 'application_settings'

apps/gitlabhq/db/post_migrate/20200310215714_migrate_saml_identities_to_scim_identities.rb
7:    self.table_name = 'identities'

apps/gitlabhq/db/post_migrate/20200526000407_seed_repository_storages_weighted.rb
8:    self.table_name = 'application_settings'

apps/gitlabhq/db/post_migrate/20200723040950_migrate_incident_issues_to_incident_type.rb
16:    self.table_name = 'issues'

apps/gitlabhq/db/migrate/20210318134427_delete_security_findings_without_uuid.rb
11:    self.table_name = 'security_findings'

apps/gitlabhq/db/post_migrate/20200929114107_schedule_migrate_u2f_webauthn.rb
16:    self.table_name = 'u2f_registrations'

apps/gitlabhq/db/post_migrate/20190905091812_schedule_project_any_approval_rule_migration.rb
19:    self.table_name = 'projects'

apps/gitlabhq/db/post_migrate/20210115220610_schedule_artifact_expiry_backfill.rb
18:    self.table_name = 'ci_job_artifacts'

apps/gitlabhq/db/post_migrate/20210303064142_cleanup_gitlab_subscriptions_with_null_namespace_id.rb
7:    self.table_name = 'gitlab_subscriptions'

apps/gitlabhq/db/post_migrate/20201005094331_migrate_compliance_framework_enum_to_database_framework_record.rb
11:    self.table_name = 'compliance_management_frameworks'
44:    self.table_name = 'project_compliance_framework_settings'

apps/gitlabhq/db/post_migrate/20200130145430_reschedule_migrate_issue_trackers_data.rb
14:    self.table_name = 'services'

apps/gitlabhq/db/post_migrate/20190214112022_schedule_sync_issuables_state_id.rb
30:    self.table_name = 'issues'
36:    self.table_name = 'merge_requests'

apps/gitlabhq/db/post_migrate/20200805152108_migrate_null_external_diff_store_to_local_value.rb
14:    self.table_name = 'merge_request_diffs'

apps/gitlabhq/db/post_migrate/20200723132258_schedule_copy_of_mr_target_project_id_to_mr_metrics.rb
16:    self.table_name = 'merge_requests'

apps/gitlabhq/db/migrate/20210629031900_associate_existing_dast_builds_with_variables.rb
7:    self.table_name = 'dast_profiles'
14:    self.table_name = 'dast_profiles_pipelines'
21:    self.table_name = 'ci_builds'
28:    self.table_name = 'dast_site_profiles_builds'

apps/gitlabhq/db/migrate/20191125114345_add_admin_mode_protected_path.rb
26:    self.table_name = 'application_settings'

apps/gitlabhq/db/migrate/20210503105845_add_project_value_stream_id_to_project_stages.rb
9:    self.table_name = 'analytics_cycle_analytics_project_stages'

apps/gitlabhq/db/post_migrate/20201231133921_schedule_set_default_iteration_cadences.rb
14:    self.table_name = 'sprints'

apps/gitlabhq/db/post_migrate/20191007163736_populate_remaining_any_approver_rules_for_projects.rb
18:    self.table_name = 'projects'

apps/gitlabhq/db/post_migrate/20200909161624_cleanup_group_import_states_with_null_user_id.rb
16:    self.table_name = 'users'
20:    self.table_name = 'namespaces'
26:    self.table_name = 'members'
53:    self.table_name = 'group_import_states'

apps/gitlabhq/db/post_migrate/20200608072931_backfill_imported_snippet_repositories.rb
16:    self.table_name = 'snippets'
21:    self.table_name = 'snippet_repositories'

apps/gitlabhq/db/post_migrate/20200420162730_remove_additional_application_settings_rows.rb
5:    self.table_name = 'application_settings'

apps/gitlabhq/db/post_migrate/20191118211629_migrate_ops_feature_flags_scopes_target_user_ids.rb
12:    self.table_name = 'operations_feature_flag_scopes'

apps/gitlabhq/db/post_migrate/20200409211607_migrate_legacy_attachments.rb
15:    self.table_name = 'uploads'

apps/gitlabhq/db/post_migrate/20210215095328_migrate_delayed_project_removal_from_namespaces_to_namespace_settings.rb
7:    self.table_name = 'namespaces'

apps/gitlabhq/db/post_migrate/20200910170908_ensure_filled_external_diff_store_on_merge_request_diffs.rb
14:    self.table_name = 'merge_request_diffs'

apps/gitlabhq/db/post_migrate/20201014142521_schedule_sync_blocking_issues_count.rb
15:    self.table_name = 'issue_links'

apps/gitlabhq/db/post_migrate/20200915185707_ensure_filled_file_store_on_package_files.rb
15:      self.table_name = 'packages_package_files'

apps/gitlabhq/db/post_migrate/20200519201128_migrate_vulnerability_dismissal_feedback.rb
14:    self.table_name = 'vulnerabilities'

apps/gitlabhq/db/post_migrate/20210303165302_cleanup_cluster_tokens_with_null_name.rb
13:    self.table_name = 'cluster_agent_tokens'

apps/gitlabhq/db/post_migrate/20200623142159_remove_gitlab_issue_tracker_service_records.rb
12:    self.table_name = 'services'

apps/gitlabhq/db/post_migrate/20190506135400_schedule_sync_issuables_state_id_where_nil.rb
31:    self.table_name = 'issues'
37:    self.table_name = 'merge_requests'

apps/gitlabhq/db/post_migrate/20210219102900_reschedule_set_default_iteration_cadences.rb
14:    self.table_name = 'sprints'

apps/gitlabhq/db/post_migrate/20200518114540_schedule_fix_ruby_object_in_audit_events.rb
15:    self.table_name = 'audit_events'

apps/gitlabhq/db/post_migrate/20190905091831_schedule_merge_request_any_approval_rule_migration.rb
19:    self.table_name = 'merge_requests'

apps/gitlabhq/db/post_migrate/20210427212034_schedule_update_timelogs_project_id.rb
16:    self.table_name = 'timelogs'

apps/gitlabhq/db/post_migrate/20190613231640_migrate_managed_clusters_with_no_token_to_unmanaged.rb
16:    self.table_name = 'clusters'
30:    self.table_name = 'clusters_kubernetes_namespaces'

apps/gitlabhq/db/post_migrate/20210119122354_alter_vsa_issue_first_mentioned_in_commit_value.rb
14:    self.table_name = 'analytics_cycle_analytics_group_stages'

apps/gitlabhq/db/post_migrate/20201128210234_schedule_populate_issue_email_participants.rb
16:    self.table_name = 'issues'

apps/gitlabhq/db/post_migrate/20200511083541_cleanup_projects_with_missing_namespace.rb
30:    self.table_name = 'user_details'
36:    self.table_name = 'users'
150:    self.table_name = 'namespaces'
183:    self.table_name = 'members'
206:    self.table_name = 'projects'

apps/gitlabhq/db/post_migrate/20190711201818_encrypt_deploy_tokens_tokens.rb
7:    self.table_name = 'deploy_tokens'

apps/gitlabhq/db/post_migrate/20210823132600_remove_duplicate_dast_site_tokens.rb
7:    self.table_name = 'dast_site_tokens'

apps/gitlabhq/db/post_migrate/20200807152315_backfill_merge_request_diffs_files_counts.rb
18:    self.table_name = 'merge_request_diffs'

apps/gitlabhq/db/post_migrate/20200806173633_migrate_null_package_files_file_store_to_local_value.rb
14:    self.table_name = 'packages_package_files'

apps/gitlabhq/db/post_migrate/20200128133510_cleanup_empty_commit_user_mentions.rb
10:    self.table_name = 'commit_user_mentions'

apps/gitlabhq/db/post_migrate/20210513163904_cleanup_move_container_registry_enabled_to_project_feature.rb
27:      self.table_name = 'background_migration_jobs'

apps/gitlabhq/db/post_migrate/20200207185149_schedule_fix_orphan_promoted_issues.rb
15:    self.table_name = 'notes'

apps/gitlabhq/db/post_migrate/20210731132939_backfill_stage_event_hash.rb
39:    self.table_name = 'analytics_cycle_analytics_group_stages'
45:    self.table_name = 'analytics_cycle_analytics_project_stages'
49:    self.table_name = 'analytics_cycle_analytics_stage_event_hashes'

apps/gitlabhq/db/post_migrate/20210514063252_schedule_cleanup_orphaned_lfs_objects_projects.rb
15:    self.table_name = 'lfs_objects_projects'

apps/gitlabhq/db/post_migrate/20210826171758_initialize_throttle_unauthenticated_api_columns.rb
10:    self.table_name = :application_settings

apps/gitlabhq/db/post_migrate/20200831065705_ensure_target_project_id_is_filled.rb
13:    self.table_name = 'merge_requests'
21:    self.table_name = 'merge_request_metrics'

apps/gitlabhq/db/post_migrate/20201119092319_schedule_repopulate_historical_vulnerability_statistics.rb
17:    self.table_name = 'project_settings'

apps/gitlabhq/db/post_migrate/20201026185514_ensure_u2f_registrations_migrated.rb
15:    self.table_name = 'u2f_registrations'

apps/gitlabhq/db/post_migrate/20190812070645_migrate_private_profile_nulls.rb
13:    self.table_name = 'users'

apps/gitlabhq/db/post_migrate/20200416111111_migrate_vulnerability_dismissals.rb
15:    self.table_name = 'vulnerabilities'

apps/gitlabhq/db/post_migrate/20201203123201_remove_orphan_service_hooks.rb
11:    self.table_name = 'web_hooks'
19:    self.table_name = 'services'

apps/gitlabhq/db/post_migrate/20201015073808_schedule_blocked_by_links_replacement.rb
18:    self.table_name = 'issue_links'

apps/gitlabhq/db/post_migrate/20201130103926_schedule_populate_dismissed_state_for_vulnerabilities.rb
27:    self.table_name = 'vulnerabilities'

apps/gitlabhq/db/post_migrate/20190924152703_migrate_issue_trackers_data.rb
14:    self.table_name = 'services'

apps/gitlabhq/db/post_migrate/20191002031332_schedule_pages_metadata_migration.rb
16:    self.table_name = 'projects'

apps/gitlabhq/db/post_migrate/20210226141517_dedup_issue_metrics.rb
15:    self.table_name = 'issue_metrics'

apps/gitlabhq/db/post_migrate/20200831224343_populate_vulnerability_historical_statistics_for_year.rb
14:    self.table_name = 'vulnerabilities'

apps/gitlabhq/db/migrate/20201215132151_change_unique_index_on_security_findings.rb
15:    self.table_name = 'security_findings'

apps/gitlabhq/db/migrate/20201028204306_migrate_default_diff_max_patch_bytes_to_minimum_200kb.rb
8:    self.table_name = 'application_settings'

apps/gitlabhq/db/post_migrate/20200217225719_schedule_migrate_security_scans.rb
16:    self.table_name = 'ci_job_artifacts'

apps/gitlabhq/db/post_migrate/20210615234935_fix_batched_migrations_old_format_job_arguments.rb
5:    self.table_name = 'batched_background_migrations'

apps/gitlabhq/db/migrate/20190725012225_change_outbound_local_requests_whitelist_default.rb
10:    self.table_name = 'application_settings'

apps/gitlabhq/db/post_migrate/20200716234259_remove_duplicate_labels_from_group.rb
14:    self.table_name = 'backup_labels'
18:    self.table_name = 'labels'
24:    self.table_name = 'namespaces'

apps/gitlabhq/db/post_migrate/20200713071042_confirm_project_bot_users.rb
9:    self.table_name = 'users'

apps/gitlabhq/db/post_migrate/20200506154421_migrate_scim_identities_to_saml_for_new_users.rb
7:    self.table_name = 'scim_identities'
15:    self.table_name = 'identities'

apps/gitlabhq/db/post_migrate/20210610141711_disable_expiration_policies_linked_to_no_container_images.rb
10:    self.table_name = 'container_expiration_policies'

apps/gitlabhq/db/post_migrate/20190606163724_migrate_legacy_managed_clusters_to_unmanaged.rb
16:    self.table_name = 'clusters'
30:    self.table_name = 'clusters_kubernetes_namespaces'

apps/gitlabhq/db/post_migrate/20200608205813_set_lock_version_to_not_null.rb
15:      self.table_name = table

apps/gitlabhq/db/post_migrate/20191008143850_fix_any_approver_rule_for_projects.rb
18:    self.table_name = 'approval_project_rules'

apps/gitlabhq/db/post_migrate/20200406102120_backfill_deployment_clusters_from_deployments.rb
22:    self.table_name = 'deployments'

apps/gitlabhq/db/post_migrate/20201208175117_schedule_backfilling_artifact_expiry_migration.rb
16:    self.table_name = 'ci_job_artifacts'

apps/gitlabhq/db/post_migrate/20190926180443_schedule_epic_issues_after_epics_move.rb
17:    self.table_name = 'epics'

apps/gitlabhq/db/post_migrate/20210415155043_move_container_registry_enabled_to_project_features3.rb
32:      self.table_name = table_name

apps/gitlabhq/db/post_migrate/20200703125016_backfill_namespace_settings.rb
17:    self.table_name = 'namespaces'

apps/gitlabhq/db/post_migrate/20200204113223_schedule_recalculate_project_authorizations.rb
17:    self.table_name = 'namespaces'
23:    self.table_name = 'project_authorizations'

apps/gitlabhq/db/post_migrate/20200809221641_migrate_license_management_artifacts_to_license_scanning.rb
13:    self.table_name = 'ci_job_artifacts'

apps/gitlabhq/db/post_migrate/20201104124300_ensure_namespace_settings_creation.rb
16:    self.table_name = 'namespaces'

apps/gitlabhq/db/post_migrate/20210708130419_reschedule_merge_request_diff_users_background_migration.rb
23:    self.table_name = 'merge_request_diffs'

apps/gitlabhq/db/post_migrate/20200305082754_remove_duplicate_labels_from_project.rb
14:    self.table_name = 'backup_labels'
18:    self.table_name = 'labels'
24:    self.table_name = 'projects'

apps/gitlabhq/db/post_migrate/20190703185326_fix_wrong_pages_access_level.rb
17:    self.table_name = 'project_features'

apps/gitlabhq/db/post_migrate/20200703064117_generate_missing_routes_for_bots.rb
9:    self.table_name = 'users'
28:    self.table_name = 'routes'
35:    self.table_name = 'namespaces'

apps/gitlabhq/db/post_migrate/20210420103955_remove_hipchat_service_records.rb
9:    self.table_name = 'services'

apps/gitlabhq/db/post_migrate/20200128210353_cleanup_optimistic_locking_nulls.rb
20:      self.table_name = table

apps/gitlabhq/db/post_migrate/20191115115043_migrate_epic_mentions_to_db.rb
18:    self.table_name = 'epics'

apps/gitlabhq/db/post_migrate/20200323080714_trigger_background_migration_for_users_bio.rb
14:    self.table_name = 'users'

apps/gitlabhq/db/post_migrate/20210601073400_fix_total_stage_in_vsa.rb
13:    self.table_name = 'analytics_cycle_analytics_group_stages'

apps/gitlabhq/db/post_migrate/20200513171959_enable_hashed_storage.rb
7:    self.table_name = 'application_settings'

apps/gitlabhq/db/migrate/20190801060809_delete_kubernetes_services.rb
7:    self.table_name = 'services'

apps/gitlabhq/db/migrate/20200212014653_rename_security_dashboard_feature_flag_to_instance_security_dashboard.rb
7:    self.table_name = 'feature_gates'

apps/gitlabhq/db/post_migrate/20201112130710_schedule_remove_duplicate_vulnerabilities_findings.rb
18:    self.table_name = "vulnerability_occurrences"

apps/gitlabhq/db/post_migrate/20191021101942_remove_empty_github_service_templates.rb
9:    self.table_name = 'services'

apps/gitlabhq/db/post_migrate/20200106071113_update_fingerprint_sha256_within_keys.rb
9:    self.table_name = 'keys'

apps/gitlabhq/db/post_migrate/20210210093901_backfill_updated_at_after_repository_storage_move.rb
16:    self.table_name = 'project_repository_storage_moves'

apps/gitlabhq/db/post_migrate/20200901170135_backfill_modified_column_for_approval_merge_request_rules.rb
11:    self.table_name = 'approval_merge_request_rules'

apps/gitlabhq/db/post_migrate/20201028182809_backfill_jira_tracker_deployment_type2.rb
17:    self.table_name = 'jira_tracker_data'

apps/gitlabhq/db/post_migrate/20191022113635_nullify_feature_flag_plaintext_tokens.rb
9:    self.table_name = 'operations_feature_flags_clients'

apps/gitlabhq/db/post_migrate/20210426225417_schedule_recalculate_uuid_on_vulnerabilities_occurrences2.rb
16:    self.table_name = "vulnerability_occurrences"

apps/gitlabhq/db/post_migrate/20190715193142_migrate_discussion_id_on_promoted_epics.rb
19:    self.table_name = 'system_note_metadata'
28:    self.table_name = 'notes'

apps/gitlabhq/db/post_migrate/20190517153211_migrate_k8s_service_integration.rb
9:    self.table_name = 'clusters'
32:    self.table_name = 'cluster_platforms_kubernetes'
45:    self.table_name = 'services'

apps/gitlabhq/db/post_migrate/20210818185845_backfill_projects_with_coverage.rb
16:    self.table_name = 'ci_daily_build_group_report_results'

apps/gitlabhq/db/post_migrate/20190418132125_populate_project_statistics_packages_size.rb
11:    self.table_name = 'project_statistics'

apps/gitlabhq/db/post_migrate/20210107194543_remove_alerts_service_records.rb
9:    self.table_name = 'services'

apps/gitlabhq/db/post_migrate/20200122123016_backfill_project_settings.rb
17:    self.table_name = 'projects'

apps/gitlabhq/db/post_migrate/20200602143020_update_routes_for_lost_and_found_group_and_orphaned_projects.rb
13:    self.table_name = 'users'
68:    self.table_name = 'namespaces'
105:    self.table_name = 'routes'
115:    self.table_name = 'projects'

apps/gitlabhq/db/post_migrate/20200727100631_remove_again_gitlab_issue_tracker_service_records.rb
12:    self.table_name = 'services'

apps/gitlabhq/db/post_migrate/20201030121314_schedule_update_existing_users_that_require_two_factor_auth.rb
19:    self.table_name = 'users'

apps/gitlabhq/db/post_migrate/20210105030125_cleanup_projects_with_bad_has_external_wiki_data.rb
16:    self.table_name = 'services'
23:    self.table_name = 'projects'

apps/gitlabhq/db/post_migrate/20210210221006_cleanup_projects_with_bad_has_external_issue_tracker_data.rb
16:    self.table_name = 'services'
23:    self.table_name = 'projects'

apps/gitlabhq/db/post_migrate/20210304133508_schedule_remove_duplicate_vulnerabilities_findings2.rb
16:    self.table_name = "vulnerability_occurrences"

apps/gitlabhq/db/post_migrate/20210816183304_schedule_copy_ci_builds_columns_to_security_scans2.rb
15:    self.table_name = 'security_scans'

apps/gitlabhq/db/post_migrate/20210330091751_remove_records_without_group_from_webhooks_table.rb
11:    self.table_name = 'web_hooks'
16:    self.table_name = 'namespaces'

apps/gitlabhq/db/post_migrate/20210730104800_schedule_extract_project_topics_into_separate_table.rb
18:    self.table_name = 'taggings'

apps/gitlabhq/db/post_migrate/20190102152410_delete_inconsistent_internal_id_records2.rb
23:    self.table_name = 'internal_ids'

apps/gitlabhq/db/post_migrate/20210205214003_remove_alerts_service_records_again.rb
9:    self.table_name = 'services'

apps/gitlabhq/db/post_migrate/20210511095658_schedule_migrate_project_taggings_context_from_tags_to_topics.rb
16:    self.table_name = 'taggings'

apps/gitlabhq/db/post_migrate/20200325162730_schedule_backfill_push_rules_id_in_projects.rb
14:    self.table_name = 'push_rules'

apps/gitlabhq/db/post_migrate/20200211155000_cleanup_empty_merge_request_mentions.rb
10:    self.table_name = 'merge_request_user_mentions'

apps/gitlabhq/db/post_migrate/20191108202723_add_unique_constraint_to_software_licenses.rb
59:    Class.new(ActiveRecord::Base) { self.table_name = name }

apps/gitlabhq/db/post_migrate/20200710102418_delete_user_callout_alerts_moved.rb
11:    self.table_name = 'user_callouts'

apps/gitlabhq/db/post_migrate/20200214034836_remove_security_dashboard_feature_flag.rb
7:    self.table_name = 'feature_gates'

apps/gitlabhq/db/post_migrate/20210513155546_backfill_nuget_temporary_packages_to_processing_status.rb
11:    self.table_name = 'packages_packages'

apps/gitlabhq/db/post_migrate/20210401131948_move_container_registry_enabled_to_project_features2.rb
15:    self.table_name = 'projects'

apps/gitlabhq/db/post_migrate/20210224150506_reschedule_artifact_expiry_backfill.rb
16:    self.table_name = 'ci_job_artifacts'

apps/gitlabhq/db/post_migrate/20210825193652_backfill_cadence_id_for_boards_scoped_to_iteration.rb
13:    self.table_name = 'boards'

apps/gitlabhq/db/post_migrate/20210413132500_reschedule_artifact_expiry_backfill_again.rb
16:    self.table_name = 'ci_job_artifacts'

apps/gitlabhq/db/post_migrate/20210805192450_update_trial_plans_ci_daily_pipeline_schedule_triggers.rb
11:    self.table_name = 'plans'
18:    self.table_name = 'plan_limits'

apps/gitlabhq/db/post_migrate/20210811122206_update_external_project_bots.rb
7:    self.table_name = 'users'

apps/gitlabhq/db/post_migrate/20201030203854_backfill_design_iids.rb
13:    self.table_name = 'design_management_designs'

apps/gitlabhq/db/post_migrate/20191007163701_populate_remaining_any_approver_rules_for_merge_requests.rb
18:    self.table_name = 'merge_requests'

apps/gitlabhq/db/post_migrate/20200128134110_migrate_commit_notes_mentions_to_db.rb
19:    self.table_name = 'notes'

apps/gitlabhq/db/post_migrate/20190524073827_schedule_fill_valid_time_for_pages_domain_certificates.rb
21:    self.table_name = 'pages_domains'

apps/gitlabhq/db/post_migrate/20200821224343_schedule_populate_vulnerability_historical_statistics.rb
14:    self.table_name = 'vulnerabilities'

apps/gitlabhq/db/post_migrate/20210303121224_update_gitlab_subscriptions_start_at_post_eoa.rb
9:    self.table_name = 'plans'
16:    self.table_name = 'gitlab_subscriptions'

apps/gitlabhq/db/post_migrate/20200427064130_cleanup_optimistic_locking_nulls_pt2_fixed.rb
17:      self.table_name = table

apps/gitlabhq/db/post_migrate/20200211155539_migrate_merge_request_mentions_to_db.rb
19:    self.table_name = 'merge_requests'

apps/gitlabhq/db/post_migrate/20200811130433_create_missing_vulnerabilities_issue_links.rb
6:    self.table_name = 'vulnerability_feedback'
10:    self.table_name = 'vulnerability_issue_links'

apps/gitlabhq/db/migrate/20210630224625_generate_customers_dot_jwt_signing_key.rb
7:    self.table_name = 'application_settings'

apps/gitlabhq/db/post_migrate/20210908132335_disable_job_token_scope_when_unused.rb
9:    self.table_name = 'project_ci_cd_settings'
15:        self.table_name = 'ci_job_token_project_scope_links'

apps/gitlabhq/db/post_migrate/20200701070435_add_default_value_stream_to_groups_with_group_stages.rb
18:    self.table_name = 'namespaces'
24:    self.table_name = 'analytics_cycle_analytics_group_value_streams'
30:    self.table_name = 'analytics_cycle_analytics_group_stages'

apps/gitlabhq/db/post_migrate/20200124110831_migrate_design_notes_mentions_to_db.rb
22:    self.table_name = 'design_user_mentions'
28:    self.table_name = 'notes'

apps/gitlabhq/db/post_migrate/20200204113224_schedule_recalculate_project_authorizations_second_run.rb
17:    self.table_name = 'users'

apps/gitlabhq/db/post_migrate/20191115115522_migrate_epic_notes_mentions_to_db.rb
22:    self.table_name = 'notes'

apps/gitlabhq/db/post_migrate/20190527194900_schedule_calculate_wiki_sizes.rb
12:    self.table_name = 'project_statistics'

apps/gitlabhq/spec/initializers/attr_encrypted_no_db_connection_spec.rb
10:        self.table_name = 'projects'

apps/gitlabhq/spec/initializers/00_rails_disable_joins_spec.rb
8:      self.table_name = '_test_primary_records'
18:      self.table_name = '_test_bridge_records'
28:      self.table_name = '_test_secondary_records'

apps/gitlabhq/spec/initializers/attr_encrypted_thread_safe_spec.rb
9:        self.table_name = 'projects'

apps/gitlabhq/spec/support_specs/helpers/active_record/query_recorder_spec.rb
10:      self.table_name = 'schema_migrations'

apps/gitlabhq/spec/support_specs/matchers/exceed_query_limit_helpers_spec.rb
11:      self.table_name = 'schema_migrations'

apps/gitlabhq/spec/validators/any_field_validator_spec.rb
9:        self.table_name = 'vulnerabilities'
34:        self.table_name = 'vulnerabilities'

apps/gitlabhq/spec/lib/gitlab/graphql/pagination/connections_spec.rb
25:      self.table_name = 'testing_pagination_nodes'

apps/gitlabhq/spec/lib/gitlab/graphql/pagination/keyset/connection_generic_keyset_spec.rb
323:            self.table_name  = 'no_primary_key'

apps/gitlabhq/spec/lib/gitlab/graphql/pagination/keyset/connection_spec.rb
375:          self.table_name  = 'no_primary_key'

apps/gitlabhq/spec/lib/gitlab/markdown_cache/active_record/extension_spec.rb
7:      self.table_name = 'issues'
185:        self.table_name = 'notes'

apps/gitlabhq/spec/lib/gitlab/background_migration/update_jira_tracker_data_deployment_type_based_on_url_spec.rb
12:      self.table_name = 'jira_tracker_data'

apps/gitlabhq/spec/lib/gitlab/background_migration/migrate_issue_trackers_sensitive_data_spec.rb
10:      self.table_name = 'issue_tracker_data'
27:      self.table_name = 'jira_tracker_data'

apps/gitlabhq/spec/lib/gitlab/database/load_balancing_spec.rb
247:        self.table_name = "load_balancing_test"

apps/gitlabhq/spec/lib/gitlab/database/partitioning/partition_manager_spec.rb
62:        self.table_name = 'my_model_example_table'
143:        self.table_name = 'my_model_example_table'
224:        self.table_name = 'my_model_example_table'

apps/gitlabhq/spec/lib/gitlab/database/partitioning/monthly_strategy_spec.rb
44:        self.table_name = 'partitioned_test'
184:        self.table_name = 'partitioned_test'

apps/gitlabhq/spec/lib/gitlab/database/migration_helpers_spec.rb
1707:        self.table_name = 'issues'
2052:          self.table_name = :_test_backfill_table
2265:        self.table_name = 'plans'
2269:        self.table_name = 'plan_limits'
2364:        self.table_name = 'issues'

apps/gitlabhq/spec/lib/gitlab/database/obsolete_ignored_columns_spec.rb
26:        self.table_name = 'projects'
34:        self.table_name = 'issues'
46:        self.table_name = 'users'

apps/gitlabhq/spec/lib/gitlab/database/schema_cache_with_renamed_table_spec.rb
8:      self.table_name = 'projects'
14:      self.table_name = 'projects_new'

apps/gitlabhq/spec/lib/gitlab/database/migration_helpers/loose_foreign_key_helpers_spec.rb
12:      self.table_name = 'loose_fk_test_table'

apps/gitlabhq/spec/lib/gitlab/database/load_balancing/connection_proxy_spec.rb
102:        self.table_name = "connection_proxy_bulk_insert"

apps/gitlabhq/spec/support/shared_examples/models/concerns/from_set_operator_shared_examples.rb
11:        self.table_name = 'users'

apps/gitlabhq/spec/support/helpers/migrations_helpers.rb
10:      self.table_name = name
23:      self.table_name = name

apps/gitlabhq/spec/models/concerns/optionally_search_spec.rb
21:        self.table_name = 'users'

apps/gitlabhq/spec/models/concerns/bulk_insert_safe_spec.rb
42:    self.table_name = :bulk_insert_parent_items
56:      self.table_name = 'bulk_insert_items'
242:          self.table_name = 'bulk_insert_items_with_composite_pk'

apps/gitlabhq/spec/models/concerns/featurable_spec.rb
36:        self.table_name = 'project_features'

apps/gitlabhq/spec/models/concerns/nullify_if_blank_spec.rb
12:      self.table_name = 'users'

apps/gitlabhq/spec/models/concerns/each_batch_spec.rb
11:        self.table_name = 'users'

apps/gitlabhq/spec/models/concerns/atomic_internal_id_spec.rb
117:          self.table_name = :milestones
185:        self.table_name = :milestones

apps/gitlabhq/spec/models/concerns/case_sensitivity_spec.rb
11:        self.table_name = 'namespaces'

apps/gitlabhq/spec/models/concerns/where_composite_spec.rb
12:        self.table_name = tbl_name

apps/gitlabhq/spec/models/concerns/batch_destroy_dependent_associations_spec.rb
7:    self.table_name = 'projects'

apps/gitlabhq/spec/models/concerns/schedulable_spec.rb
66:        self.table_name = 'users'

apps/gitlabhq/spec/models/concerns/loose_foreign_key_spec.rb
10:      self.table_name = 'projects'
40:          self.table_name = 'projects'
58:          self.table_name = 'projects'

apps/gitlabhq/spec/models/concerns/cache_markdown_field_spec.rb
8:      self.table_name = 'issues'

apps/gitlabhq/spec/models/application_record_spec.rb
260:          self.table_name = 'tests'
271:          self.table_name = 'tests'

apps/gitlabhq/spec/migrations/generate_ci_jwt_signing_key_spec.rb
10:      self.table_name = 'application_settings'

apps/gitlabhq/spec/migrations/20210421163509_schedule_update_jira_tracker_data_deployment_type_based_on_url_spec.rb
13:      self.table_name = 'jira_tracker_data'

apps/gitlabhq/spec/migrations/generate_customers_dot_jwt_signing_key_spec.rb
10:      self.table_name = 'application_settings'

apps/gitlabhq/app/models/bulk_imports/configuration.rb
6:  self.table_name = 'bulk_import_configurations'

apps/gitlabhq/app/models/bulk_imports/export_upload.rb
8:    self.table_name = 'bulk_import_export_uploads'

apps/gitlabhq/app/models/bulk_imports/failure.rb
4:  self.table_name = 'bulk_import_failures'

apps/gitlabhq/app/models/bulk_imports/export.rb
11:    self.table_name = 'bulk_import_exports'

apps/gitlabhq/app/models/bulk_imports/tracker.rb
4:  self.table_name = 'bulk_import_trackers'

apps/gitlabhq/app/models/bulk_imports/entity.rb
21:  self.table_name = 'bulk_import_entities'

apps/gitlabhq/app/models/analytics/cycle_analytics.rb
5:    def self.table_name_prefix

apps/gitlabhq/app/models/analytics/usage_trends/measurement.rb
6:      self.table_name = 'analytics_usage_trends_measurements'

apps/gitlabhq/app/models/project_import_state.rb
7:  self.table_name = "project_mirror_data"

apps/gitlabhq/app/models/concerns/integrations/base_data_fields.rb
10:      belongs_to :integration, inverse_of: self.table_name.to_sym, foreign_key: :service_id

apps/gitlabhq/app/models/iteration.rb
5:  self.table_name = 'sprints'

apps/gitlabhq/app/models/loose_foreign_keys.rb
4:  def self.table_name_prefix

apps/gitlabhq/app/models/issues/csv_import.rb
4:  self.table_name = 'csv_issue_imports'

apps/gitlabhq/app/models/dev_ops_report/metric.rb
7:    self.table_name = 'conversational_development_index_metrics'

apps/gitlabhq/app/models/terraform.rb
4:  def self.table_name_prefix

apps/gitlabhq/app/models/group_deploy_key.rb
4:  self.table_name = 'group_deploy_keys'

apps/gitlabhq/app/models/aws/role.rb
5:    self.table_name = 'aws_roles'

apps/gitlabhq/app/models/ci_platform_metric.rb
6:  self.table_name = 'ci_platform_metrics'

apps/gitlabhq/app/models/product_analytics_event.rb
4:  self.table_name = 'product_analytics_events_experimental'

apps/gitlabhq/app/models/dependency_proxy.rb
6:  def self.table_name_prefix

apps/gitlabhq/app/models/packages/conan.rb
4:    def self.table_name_prefix

apps/gitlabhq/app/models/packages/debian.rb
11:    def self.table_name_prefix

apps/gitlabhq/app/models/packages/nuget.rb
7:    def self.table_name_prefix

apps/gitlabhq/app/models/packages/rubygems.rb
6:    def self.table_name_prefix

apps/gitlabhq/app/models/packages/composer/cache_file.rb
8:      self.table_name = 'packages_composer_cache_files'

apps/gitlabhq/app/models/packages/composer/metadatum.rb
6:      self.table_name = 'packages_composer_metadata'

apps/gitlabhq/app/models/packages/maven.rb
4:    def self.table_name_prefix

apps/gitlabhq/app/models/packages/pypi.rb
4:    def self.table_name_prefix

apps/gitlabhq/app/models/packages/helm.rb
7:    def self.table_name_prefix

apps/gitlabhq/app/models/alert_management.rb
4:  def self.table_name_prefix

apps/gitlabhq/app/models/users/credit_card_validation.rb
7:    self.table_name = 'user_credit_card_validations'

apps/gitlabhq/app/models/users/group_callout.rb
7:    self.table_name = 'user_group_callouts'

apps/gitlabhq/app/models/design_management/action.rb
9:    self.table_name = "#{DesignManagement.table_name_prefix}designs_versions"

apps/gitlabhq/app/models/atlassian/identity.rb
5:    self.table_name = 'atlassian_identities'

apps/gitlabhq/app/models/error_tracking.rb
4:  def self.table_name_prefix

apps/gitlabhq/app/models/commit_status.rb
12:  self.table_name = 'ci_builds'

apps/gitlabhq/app/models/jira_import_state.rb
8:  self.table_name = 'jira_imports'

apps/gitlabhq/app/models/packages.rb
5:  def self.table_name_prefix

apps/gitlabhq/app/models/operations/feature_flags_client.rb
7:    self.table_name = 'operations_feature_flags_clients'

apps/gitlabhq/app/models/operations/feature_flag.rb
11:    self.table_name = 'operations_feature_flags'

apps/gitlabhq/app/models/operations/feature_flags/user_list.rb
10:      self.table_name = 'operations_user_lists'

apps/gitlabhq/app/models/operations/feature_flags/strategy_user_list.rb
6:      self.table_name = 'operations_strategies_user_lists'

apps/gitlabhq/app/models/operations/feature_flags/strategy.rb
21:      self.table_name = 'operations_strategies'

apps/gitlabhq/app/models/operations/feature_flags/scope.rb
8:      self.table_name = 'operations_scopes'

apps/gitlabhq/app/models/namespace/package_setting.rb
5:  self.table_name = 'namespace_package_settings'

apps/gitlabhq/app/models/incident_management/issuable_escalation_status.rb
7:    self.table_name = 'incident_management_issuable_escalation_statuses'

apps/gitlabhq/app/models/customer_relations/organization.rb
6:  self.table_name = "customer_relations_organizations"

apps/gitlabhq/app/models/customer_relations/contact.rb
6:  self.table_name = "customer_relations_contacts"

apps/gitlabhq/app/models/clusters/group.rb
5:    self.table_name = 'cluster_groups'

apps/gitlabhq/app/models/clusters/kubernetes_namespace.rb
7:    self.table_name = 'clusters_kubernetes_namespaces'

apps/gitlabhq/app/models/clusters/applications/runner.rb
8:      self.table_name = 'clusters_applications_runners'

apps/gitlabhq/app/models/clusters/applications/cilium.rb
6:      self.table_name = 'clusters_applications_cilium'

apps/gitlabhq/app/models/clusters/applications/ingress.rb
11:      self.table_name = 'clusters_applications_ingress'

apps/gitlabhq/app/models/clusters/applications/elastic_stack.rb
10:      self.table_name = 'clusters_applications_elastic_stacks'

apps/gitlabhq/app/models/clusters/applications/crossplane.rb
10:      self.table_name = 'clusters_applications_crossplane'

apps/gitlabhq/app/models/clusters/applications/prometheus.rb
10:      self.table_name = 'clusters_applications_prometheus'

apps/gitlabhq/app/models/clusters/applications/cert_manager.rb
11:      self.table_name = 'clusters_applications_cert_managers'

apps/gitlabhq/app/models/clusters/applications/helm.rb
10:      self.table_name = 'clusters_applications_helm'

apps/gitlabhq/app/models/clusters/integrations/elastic_stack.rb
9:      self.table_name = 'clusters_integration_elasticstack'

apps/gitlabhq/app/models/clusters/applications/jupyter.rb
12:      self.table_name = 'clusters_applications_jupyter'

apps/gitlabhq/app/models/clusters/integrations/prometheus.rb
9:      self.table_name = 'clusters_integration_prometheus'

apps/gitlabhq/app/models/clusters/applications/knative.rb
14:      self.table_name = 'clusters_applications_knative'

apps/gitlabhq/app/models/clusters/providers/aws.rb
9:      self.table_name = 'cluster_providers_aws'

apps/gitlabhq/app/models/clusters/cluster.rb
12:    self.table_name = 'clusters'

apps/gitlabhq/app/models/clusters/agent_token.rb
11:    self.table_name = 'cluster_agent_tokens'

apps/gitlabhq/app/models/clusters/agents/group_authorization.rb
6:      self.table_name = 'agent_group_authorizations'

apps/gitlabhq/app/models/clusters/providers/gcp.rb
8:      self.table_name = 'cluster_providers_gcp'

apps/gitlabhq/app/models/clusters/agents/project_authorization.rb
6:      self.table_name = 'agent_project_authorizations'

apps/gitlabhq/app/models/clusters/agent.rb
5:    self.table_name = 'cluster_agents'

apps/gitlabhq/app/models/clusters/project.rb
5:    self.table_name = 'cluster_projects'

apps/gitlabhq/app/models/clusters/platforms/kubernetes.rb
14:      self.table_name = 'cluster_platforms_kubernetes'

apps/gitlabhq/app/models/design_management.rb
10:  def self.table_name_prefix

apps/gitlabhq/app/models/projects/repository_storage_move.rb
11:    self.table_name = 'project_repository_storage_moves'

apps/gitlabhq/app/models/projects/ci_feature_usage.rb
5:    self.table_name = 'project_ci_feature_usages'

apps/gitlabhq/app/models/serverless/domain_cluster.rb
5:    self.table_name = 'serverless_domain_cluster'

apps/gitlabhq/app/models/ci/pipeline_chat_data.rb
7:    self.table_name = 'ci_pipeline_chat_data'

apps/gitlabhq/app/models/ci/job_token/project_scope_link.rb
9:      self.table_name = 'ci_job_token_project_scope_links'

apps/gitlabhq/app/models/ci/build_metadata.rb
14:    self.table_name = 'ci_builds_metadata'

apps/gitlabhq/app/models/ci/application_record.rb
8:    def self.table_name_prefix

apps/gitlabhq/app/models/ci/sources/pipeline.rb
11:      self.table_name = "ci_sources_pipelines"

apps/gitlabhq/app/models/ci/build_trace_metadata.rb
6:    self.table_name = 'ci_build_trace_metadata'

apps/gitlabhq/app/models/ci/pipeline_config.rb
5:    self.table_name = 'ci_pipelines_config'

apps/gitlabhq/app/models/ci/build_runner_session.rb
13:    self.table_name = 'ci_builds_runner_session'

apps/gitlabhq/app/models/work_item/type.rb
8:  self.table_name = 'work_item_types'

apps/gitlabhq/app/models/error_tracking/project_error_tracking_setting.rb
27:    self.table_name = 'project_error_tracking_settings'

apps/gitlabhq/app/models/releases/link.rb
5:    self.table_name = 'release_links'

apps/gitlabhq/app/models/postgresql/replication_slot.rb
5:    self.table_name = 'pg_replication_slots'

apps/gitlabhq/app/models/snippets/repository_storage_move.rb
11:    self.table_name = 'snippet_repository_storage_moves'

apps/gitlabhq/app/models/metrics/users_starred_dashboard.rb
5:    self.table_name = 'metrics_users_starred_dashboards'

apps/gitlabhq/app/models/metrics/dashboard/annotation.rb
8:      self.table_name = 'metrics_dashboard_annotations'

apps/gitlabhq/app/models/wiki_page/meta.rb
7:    self.table_name = 'wiki_page_meta'

apps/gitlabhq/app/models/wiki_page/slug.rb
11:    self.table_name = 'wiki_page_slugs'

config/default.yml Outdated Show resolved Hide resolved
@andyw8
Copy link
Contributor

andyw8 commented Oct 7, 2021

I wonder if it's also worth mentioning that in some cases a better approach would be to configure an inflection.

@andyw8
Copy link
Contributor

andyw8 commented Oct 7, 2021

Looking at the list @pirj shared, I think db/migrate should be excluded.

@pirj
Copy link
Member

pirj commented Oct 7, 2021

db/migrate should be excluded

And specs, too.

@pirj
Copy link
Member

pirj commented Oct 8, 2021

apps/foreman/app/models/nic/base.rb
10:    self.table_name = 'nics'

apps/openproject/app/models/token/base.rb
21:    self.table_name = 'tokens'

Apparently, table name convention doesn't work that well with STI base classes:

@pirj
Copy link
Member

pirj commented Nov 14, 2021

@MaximeDucheneS ping

@pirj
Copy link
Member

pirj commented Dec 25, 2021

@MaximeDucheneS Ping.

@MaximeDucheneS
Copy link
Contributor Author

apps/foreman/app/models/nic/base.rb
10:    self.table_name = 'nics'

apps/openproject/app/models/token/base.rb
21:    self.table_name = 'tokens'

Apparently, table name convention doesn't work that well with STI base classes:

@pirj I don't have much experience with these. I'm wondering if naming those classes Base is standard or perhaps even mandatory? If so, maybe the cop could return if the class is named Base? Do you think that could be an acceptable solution?

@pirj
Copy link
Member

pirj commented Jan 1, 2022

the cop could return if the class is named Base?

That would definitely reduce the number of false positives.

CHANGELOG.md Outdated Show resolved Hide resolved
config/default.yml Outdated Show resolved Hide resolved
config/default.yml Outdated Show resolved Hide resolved
Copy link
Member

@pirj pirj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Considering that this is Enabled: false, I'm totally fine with this cop.

@pirj
Copy link
Member

pirj commented Jan 4, 2022

Thank you for the contribution!

config/default.yml Outdated Show resolved Hide resolved
lib/rubocop/cop/rails/table_name_assignment.rb Outdated Show resolved Hide resolved
@koic
Copy link
Member

koic commented Mar 4, 2022

@MaximeDucheneS This looks good to me. Can you squash your commits into one?

@MaximeDucheneS
Copy link
Contributor Author

@koic Done!

@koic koic merged commit 3331b65 into rubocop:master Mar 7, 2022
@koic
Copy link
Member

koic commented Mar 7, 2022

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants