john-bodley opened a new pull request, #24629:
URL: https://github.com/apache/superset/pull/24629

   <!---
   Please write the PR title following the conventions at 
https://www.conventionalcommits.org/en/v1.0.0/
   Example:
   fix(dashboard): load charts correctly
   -->
   
   ### SUMMARY
   
   Looking at the current schema,
   
   ```
   $ rm superset.db
   $ FLASK_DEBUG=true superset db upgrade
   $ sqlite3 superset.db
   sqlite> .tables
   ab_permission               metrics                   
   ab_permission_view          query                     
   ab_permission_view_role     report_execution_log      
   ab_register_user            report_recipient          
   ab_role                     report_schedule           
   ab_user                     report_schedule_user      
   ab_user_role                rls_filter_roles          
   ab_view_menu                rls_filter_tables         
   alembic_version             row_level_security_filters
   alert_logs                  saved_query               
   alert_owner                 sl_columns                
   alerts                      sl_dataset_columns        
   annotation                  sl_dataset_tables         
   annotation_layer            sl_dataset_users          
   cache_keys                  sl_datasets               
   clusters                    sl_table_columns          
   columns                     sl_tables                 
   css_templates               slice_email_schedules     
   dashboard_email_schedules   slice_user                
   dashboard_roles             slices                    
   dashboard_slices            sql_metrics               
   dashboard_user              sql_observations          
   dashboards                  sqlatable_user            
   datasources                 ssh_tunnels               
   dbs                         tab_state                 
   druiddatasource_user        table_columns             
   dynamic_plugin              table_schema              
   embedded_dashboards         tables                    
   favstar                     tag                       
   filter_sets                 tagged_object             
   key_value                   url                       
   keyvalue                    user_attribute            
   logs                      
   sqlite> 
   ```
   
   it became apparent that there were a number of rouge tables—those which 
technically were likely dropped in other migrations—but seem to remain in the 
database. I speculate maybe these were accidentally skipped when resolving a 
diamond dependency.
   
   This PR adds a migration to drop these tables. Note that the downgrade is a 
no-op as there's no reference to the underlying schemas in the code 
pre-migration. I'm made sure the migration is atomic by first checking that the 
table exists prior to it being dropped. 
   
   ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
   <!--- Skip this if not applicable -->
   
   ### TESTING INSTRUCTIONS
   
   CI.
   
   ### ADDITIONAL INFORMATION
   <!--- Check any relevant boxes with "x" -->
   <!--- HINT: Include "Fixes #nnn" if you are fixing an existing issue -->
   - [ ] Has associated issue:
   - [ ] Required feature flags:
   - [ ] Changes UI
   - [x] Includes DB Migration (follow approval process in 
[SIP-59](https://github.com/apache/superset/issues/13351))
     - [x] Migration is atomic, supports rollback & is backwards-compatible
     - [x] Confirm DB migration upgrade and downgrade tested
     - [x] Runtime estimates and downtime expectations provided: < 5 seconds
   - [ ] Introduces new feature or API
   - [ ] Removes existing feature or API
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to