diff --git a/osf/migrations/0053_add_quickfiles.py b/osf/migrations/0053_add_quickfiles.py deleted file mode 100644 index c8e1704e97a8..000000000000 --- a/osf/migrations/0053_add_quickfiles.py +++ /dev/null @@ -1,20 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.11 on 2017-06-13 17:35 -from __future__ import unicode_literals - -import logging - -from django.db import migrations - -logger = logging.getLogger(__name__) -logging.basicConfig(level=logging.INFO) - - -class Migration(migrations.Migration): - - dependencies = [ - ('osf', '0052_preprintprovider_share_publish_type'), - ] - - operations = [ - ] diff --git a/osf/migrations/0054_auto_20170823_1555.py b/osf/migrations/0054_auto_20170823_1555.py index d36458d4ee58..a0bef76b0b89 100644 --- a/osf/migrations/0054_auto_20170823_1555.py +++ b/osf/migrations/0054_auto_20170823_1555.py @@ -15,6 +15,6 @@ class Migration(migrations.Migration): migrations.AlterField( model_name='abstractnode', name='type', - field=models.CharField(choices=[('osf.node', 'node'), ('osf.collection', 'collection'), ('osf.registration', 'registration'), ('osf.quickfilesnode', 'quick files node')], db_index=True, max_length=255), + field=models.CharField(choices=[('osf.node', 'node'), ('osf.collection', 'collection'), ('osf.registration', 'registration')], db_index=True, max_length=255), ), ] diff --git a/osf/migrations/0088_post_migrate_collections.py b/osf/migrations/0088_post_migrate_collections.py index f53f27f817d4..9b513def10aa 100644 --- a/osf/migrations/0088_post_migrate_collections.py +++ b/osf/migrations/0088_post_migrate_collections.py @@ -19,6 +19,6 @@ class Migration(migrations.Migration): migrations.AlterField( model_name='abstractnode', name='type', - field=models.CharField(choices=[('osf.node', 'node'), ('osf.registration', 'registration'), ('osf.quickfilesnode', 'quick files node')], db_index=True, max_length=255), + field=models.CharField(choices=[('osf.node', 'node'), ('osf.registration', 'registration')], db_index=True, max_length=255), ), ] diff --git a/osf/migrations/0198_draft_node_models.py b/osf/migrations/0198_draft_node_models.py index 3f418b4a9741..7e30cf865ec4 100644 --- a/osf/migrations/0198_draft_node_models.py +++ b/osf/migrations/0198_draft_node_models.py @@ -110,7 +110,7 @@ class Migration(migrations.Migration): migrations.AlterField( model_name='abstractnode', name='type', - field=models.CharField(choices=[('osf.node', 'node'), ('osf.draftnode', 'draft node'), ('osf.registration', 'registration'), ('osf.quickfilesnode', 'quick files node')], db_index=True, max_length=255), + field=models.CharField(choices=[('osf.node', 'node'), ('osf.draftnode', 'draft node'), ('osf.registration', 'registration')], db_index=True, max_length=255), ), migrations.AlterField( model_name='draftregistration', diff --git a/osf/migrations/0243_auto_20220324_1105.py b/osf/migrations/0243_auto_20220324_1105.py new file mode 100644 index 000000000000..ca0808c5a6ef --- /dev/null +++ b/osf/migrations/0243_auto_20220324_1105.py @@ -0,0 +1,34 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.11.28 on 2022-03-24 11:05 +from __future__ import unicode_literals + +from django.db import migrations, models +from django.db.utils import ProgrammingError + + +def remove_if_exist(apps, schema_editor): + try: + schema_editor.execute( + schema_editor.sql_delete_table % { + 'table': schema_editor.quote_name('quickfilesnode') + } + ) + except (KeyError, ProgrammingError): + ## No quickfilesnode to delete all good + pass + + +class Migration(migrations.Migration): + + dependencies = [ + ('osf', '0242_auto_20220125_1604'), + ] + + operations = [ + migrations.RunPython(remove_if_exist, migrations.RunPython.noop), + migrations.AlterField( + model_name='abstractnode', + name='type', + field=models.CharField(choices=[('osf.node', 'node'), ('osf.draftnode', 'draft node'), ('osf.registration', 'registration')], db_index=True, max_length=255), + ), + ]