mitodl / mit-open

BSD 3-Clause "New" or "Revised" License
0 stars 1 forks source link

adding command to remove old tables #1186

Closed shanbady closed 1 week ago

shanbady commented 1 week ago

What are the relevant tickets?

Removes old tables that were left behind by legacy apps

Description (What does it do?)

This pr modifies a migration that is failing on deploy by prepending it with sql to remove conflicting tables

How can this be tested?

  1. checkout main
  2. roll the channels app migration to 0008 via python manage.py migrate channels 0008
  3. get into the db shell python manage.py dbshell and artificially create a channels table with a conflicting relation via

CREATE TABLE channels_channel ( widget_list_id integer, name varchar(40) ); alter table channels_channel add constraint fk_widgets_w foreign key (widget_list_id) references widgets_widgetlist (id);

  1. attempt to re-run migrations and see that it fails with an error we see on rc deploy.
  2. checkout this branch
  3. re-run migrations and it should succeed

Additional Context

@rhysyngsun is looking for other tables we need to add to this migration