From 1950648c5da7cc894c93c0c3c27dcdf85727708a Mon Sep 17 00:00:00 2001 From: Shankar Ambady Date: Thu, 27 Jun 2024 15:48:07 -0400 Subject: [PATCH] adding command to remove old tables (#1186) * adding command to remove tables * adding more tables --- .../0009_rename_field_to_channel.py | 51 +++++++++++++++++++ 1 file changed, 51 insertions(+) diff --git a/channels/migrations/0009_rename_field_to_channel.py b/channels/migrations/0009_rename_field_to_channel.py index 16993ba3f4..8afdaf6d1b 100644 --- a/channels/migrations/0009_rename_field_to_channel.py +++ b/channels/migrations/0009_rename_field_to_channel.py @@ -17,6 +17,57 @@ class Migration(migrations.Migration): ] operations = [ + migrations.RunSQL( + "DROP TABLE IF EXISTS channels_channel CASCADE", migrations.RunSQL.noop + ), + migrations.RunSQL( + "DROP TABLE IF EXISTS channels_channelgrouprole CASCADE", + migrations.RunSQL.noop, + ), + migrations.RunSQL( + "DROP TABLE IF EXISTS channels_channelinvitation CASCADE", + migrations.RunSQL.noop, + ), + migrations.RunSQL( + "DROP TABLE IF EXISTS channels_channelmembershipconfig CASCADE", + migrations.RunSQL.noop, + ), + migrations.RunSQL( + "DROP TABLE IF EXISTS channels_channelmembershipconfig_channels CASCADE", + migrations.RunSQL.noop, + ), + migrations.RunSQL( + "DROP TABLE IF EXISTS channels_channelsubscription CASCADE", + migrations.RunSQL.noop, + ), + migrations.RunSQL( + "DROP TABLE IF EXISTS channels_channelinvitation CASCADE", + migrations.RunSQL.noop, + ), + migrations.RunSQL( + "DROP TABLE IF EXISTS channels_comment CASCADE", migrations.RunSQL.noop + ), + migrations.RunSQL( + "DROP TABLE IF EXISTS channels_linkmeta CASCADE", migrations.RunSQL.noop + ), + migrations.RunSQL( + "DROP TABLE IF EXISTS channels_post CASCADE", migrations.RunSQL.noop + ), + migrations.RunSQL( + "DROP TABLE IF EXISTS channels_redditaccesstoken CASCADE", + migrations.RunSQL.noop, + ), + migrations.RunSQL( + "DROP TABLE IF EXISTS channels_redditrefreshtoken CASCADE", + migrations.RunSQL.noop, + ), + migrations.RunSQL( + "DROP TABLE IF EXISTS channels_spamcheckresult CASCADE", + migrations.RunSQL.noop, + ), + migrations.RunSQL( + "DROP TABLE IF EXISTS channels_subscription CASCADE", migrations.RunSQL.noop + ), migrations.RenameModel( old_name="FieldChannel", new_name="Channel",