Browse Source

ref: clean up obsolete django version checks (#64450)

<!-- Describe your PR here. -->
anthony sottile 1 year ago
parent
commit
34685bdbf1
1 changed files with 1 additions and 5 deletions
  1. 1 5
      src/sentry/migrations/0216_cdc_setup_replication_index.py

+ 1 - 5
src/sentry/migrations/0216_cdc_setup_replication_index.py

@@ -1,6 +1,5 @@
 # Generated by Django 1.11.29 on 2021-06-30 18:51
 
-import django
 from django.db import migrations
 
 
@@ -13,10 +12,7 @@ def set_replication_identity(schema_editor, model, column_names):
 
     if not unique_constraint_names:
         # Create a unique index since there is no unique index on the columns we want.
-        if django.VERSION[:2] < (2, 0):
-            index = schema_editor._create_index_name(model, column_names, "_uniq")
-        else:
-            index = schema_editor._create_index_name(model._meta.db_table, column_names, "_uniq")
+        index = schema_editor._create_index_name(model._meta.db_table, column_names, "_uniq")
 
         cursor.execute(
             f'CREATE UNIQUE INDEX CONCURRENTLY IF NOT EXISTS {schema_editor.quote_name(index)} ON {schema_editor.quote_name(model._meta.db_table)} ({", ".join(schema_editor.quote_name(col) for col in column_names)});'