Remove the user_interacted_projects table
What does this MR do and why?
Resolves #360823 (closed)
Following the documentation for:
- Dropping tables
- Migration style guide > Dropping a database table the section where "Table has foreign keys"
How to set up and validate locally
- Run
gdk psql
and inspect theuser_interacted_projects
table
➜ gitlab git:(md-remove-user-interacted-projects-table) ✗ gdk psql
psql (14.9)
Type "help" for help.
gitlabhq_development=# \d user_interacted_projects
Table "public.user_interacted_projects"
Column | Type | Collation | Nullable | Default
------------+---------+-----------+----------+---------
user_id | integer | | not null |
project_id | integer | | not null |
Indexes:
"user_interacted_projects_pkey" PRIMARY KEY, btree (project_id, user_id)
"index_user_interacted_projects_on_user_id" btree (user_id)
Foreign-key constraints:
"fk_0894651f08" FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE
"fk_722ceba4f7" FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE
- Run migrations
bundle exec rake db:migrate:up:main VERSION=20231213080625
andbundle exec rake db:migrate:up:main VERSION=20231213080710
- restart
gdk psql
and inspect table again, confirm it has been removed
➜ gitlab git:(md-remove-user-interacted-projects-table) gdk psql
psql (14.9)
Type "help" for help.
gitlabhq_development=# \d :user_interacted_projects
Did not find any relation named ":user_interacted_projects".
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.
Edited by Missy Davies