Skip to content

Dynamic Analysis: Create & link model classes for tables that are missing them

Please see #442736 (closed) for details.

For dynamic analysis, we have identified 2 tables that are missing a Rails model and can benefit from it:

  • dast_scanner_profiles_tags
  • dast_site_profiles_pipelines

These tables need to have a Rails model backing them because:

  • once we have that, we can set a desired_sharding_key on these models. Setting of desired sharding keys requires a Rails model to be present for a table because we need to validate that the belongs_to association used to backfill this column actually exists and is valid.

Implementation plan:

  • Create a Rails model for this table.
  • Set up the belongs_to associations on this model based on the current state of columns on this table.
  • Link the class to the table using the table's db/docs/table_name.yml file, with the classes key. Example.

Once class has been added in the yml, grouptenant scale can run automations to set desired sharding keys for these tables.

PS: If the table is no longer used or is not needed, you needn't add a model, rather you can work on dropping the table altogether.