Do not regenerate the dictionary file when a model is removed
What does this MR do and why?
Problem:
- Run
bundle exec rails db:migrate
- Observe the following diff:
$ git diff
diff --git a/db/docs/work_item_types.yml b/db/docs/work_item_types.yml
index 37d2c47de252..445ea9df371d 100644
--- a/db/docs/work_item_types.yml
+++ b/db/docs/work_item_types.yml
@@ -1,7 +1,6 @@
---
table_name: work_item_types
classes:
-- AddWidgetsForWorkItemTypes::WorkItemType
- WorkItems::Type
feature_categories:
- team_planning
diff --git a/db/docs/work_item_widget_definitions.yml b/db/docs/work_item_widget_definitions.yml
index 59cbca149089..073b0c8cc591 100644
--- a/db/docs/work_item_widget_definitions.yml
+++ b/db/docs/work_item_widget_definitions.yml
@@ -1,7 +1,6 @@
---
table_name: work_item_widget_definitions
classes:
-- AddWidgetsForWorkItemTypes::WidgetDefinition
- WorkItems::WidgetDefinition
feature_categories:
- team_planning
Why:
This happens when the class is added/removed in a separated merge request (not in the same where we have the migration).
Solution:
We should not regenerate the dictionary file if a model class is removed from our codebase. We wanna avoid having changed files after the execution of gdk update
if someone forgets to update the dictionary classes field.
If a new model class is added, we append the new class to the current classes of the dictionary.
Slack thread (internal)
Issue: gitlab-org/database-team/team-tasks#328 (closed)
Screenshots or screen recordings
Screenshots are required for UI changes, and strongly recommended for all other merge requests.
How to set up and validate locally
Numbered steps to set up and validate the change are strongly suggested.
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.