Drop unused DAST tables
What does this MR do and why?
Drops the following tables:
- dast_scanner_profiles_tags
- dast_site_profiles_pipelines
Based on this discussion, these tables are no longer being used.
MR acceptance checklist
Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.
How to set up and validate locally
- Run
bundle exec rake db:migrate
on your local GDK.
Down Migration
$ scripts/db_tasks db:migrate Running: `bundle exec rake db:migrate:main` main: == [advisory_lock_connection] object_id: 114380, pg_backend_pid: 185 main: == 20240517082413 DropTableDastScannerProfilesTags: migrating ================= main: -- drop_table(:dast_scanner_profiles_tags) main: -> 0.0027s main: == 20240517082413 DropTableDastScannerProfilesTags: migrated (0.0158s) ======== main: == 20240517083248 DropTableDastSiteProfilesPipelines: migrating =============== main: -- drop_table(:dast_site_profiles_pipelines) main: -> 0.0017s main: == 20240517083248 DropTableDastSiteProfilesPipelines: migrated (0.0083s) ====== main: == [advisory_lock_connection] object_id: 114380, pg_backend_pid: 185Up Migration
$ scripts/db_tasks db:migrate:down VERSION=20240517083248 Running: `bundle exec rake db:migrate:down:main VERSION=20240517083248` main: == [advisory_lock_connection] object_id: 114540, pg_backend_pid: 124 main: == 20240517083248 DropTableDastSiteProfilesPipelines: reverting =============== main: -- create_table(:dast_site_profiles_pipelines, {:id=>false}) main: -> 0.0049s main: -- quote_table_name(:dast_site_profiles_pipelines) main: -> 0.0000s main: -- quote_table_name(:dast_site_profiles_pipelines_pkey) main: -> 0.0001s main: -- quote_table_name(:dast_site_profiles_pipelines_pkey) main: -> 0.0000s main: -- execute("ALTER TABLE \"dast_site_profiles_pipelines\" ADD CONSTRAINT \"dast_site_profiles_pipelines_pkey\" PRIMARY KEY USING INDEX \"dast_site_profiles_pipelines_pkey\"\n") main: -> 0.0009s main: -- transaction_open?(nil) main: -> 0.0000s main: -- transaction_open?(nil) main: -> 0.0000s main: -- execute("ALTER TABLE dast_site_profiles_pipelines ADD CONSTRAINT fk_cf05cf8fe1 FOREIGN KEY (dast_site_profile_id) REFERENCES dast_site_profiles (id) ON DELETE CASCADE NOT VALID;") main: -> 0.0014s main: -- execute("SET statement_timeout TO 0") main: -> 0.0007s main: -- execute("ALTER TABLE dast_site_profiles_pipelines VALIDATE CONSTRAINT fk_cf05cf8fe1;") main: -> 0.0015s main: -- execute("RESET statement_timeout") main: -> 0.0005s main: -- execute("COMMENT ON TABLE dast_site_profiles_pipelines IS '{\"owner\":\"group::dynamic analysis\",\"description\":\"Join table between DAST Site Profiles and CI Pipelines\"}';\n") main: -> 0.0702s main: == 20240517083248 DropTableDastSiteProfilesPipelines: reverted (0.1616s) ====== main: == [advisory_lock_connection] object_id: 114540, pg_backend_pid: 124 $ scripts/db_tasks db:migrate:down VERSION=20240517082413 Running: `bundle exec rake db:migrate:down:main VERSION=20240517082413` main: == [advisory_lock_connection] object_id: 114100, pg_backend_pid: 153 main: == 20240517082413 DropTableDastScannerProfilesTags: reverting ================= main: -- create_table(:dast_scanner_profiles_tags) main: -> 0.0054s main: -- transaction_open?(nil) main: -> 0.0000s main: -- transaction_open?(nil) main: -> 0.0000s main: -- execute("ALTER TABLE dast_scanner_profiles_tags ADD CONSTRAINT fk_rails_deb79b7f19 FOREIGN KEY (dast_scanner_profile_id) REFERENCES dast_scanner_profiles (id) ON DELETE CASCADE NOT VALID;") main: -> 0.0012s main: -- execute("SET statement_timeout TO 0") main: -> 0.0005s main: -- execute("ALTER TABLE dast_scanner_profiles_tags VALIDATE CONSTRAINT fk_rails_deb79b7f19;") main: -> 0.0013s main: -- execute("RESET statement_timeout") main: -> 0.0004s main: == 20240517082413 DropTableDastScannerProfilesTags: reverted (0.0635s) ======== main: == [advisory_lock_connection] object_id: 114100, pg_backend_pid: 153Related to #442744 (closed)
Edited by Arpit Gogia