# Generated by Django 3.2.11 on 2022-01-27 06:54

from django.db import migrations


class Migration(migrations.Migration):

    dependencies = [
        ('labels', '0003_auto_20220127_0654'),
        ('api', '0032_auto_20220127_0654'),
    ]

    operations = [
        migrations.SeparateDatabaseAndState(
            state_operations=[
                migrations.DeleteModel(
                    name='CategoryType',
                ),
                migrations.DeleteModel(
                    name='RelationTypes',
                ),
                migrations.DeleteModel(
                    name='SpanType',
                ),
            ],
            database_operations=[
                migrations.AlterModelTable(
                    name='CategoryType',
                    table='label_types_categorytype'
                ),
                migrations.AlterModelTable(
                    name='RelationTypes',
                    table='label_types_relationtypes'
                ),
                migrations.AlterModelTable(
                    name='SpanType',
                    table='label_types_spanType'
                )
            ]
        )
    ]

backend/api/migrations/0033_auto_20220127_0654.py
# Generated by Django 3.2.11 on 2022-01-27 06:54

from django.db import migrations


class Migration(migrations.Migration):

    dependencies = [
        ('labels', '0003_auto_20220127_0654'),
        ('api', '0032_auto_20220127_0654'),
    ]

    operations = [
        migrations.SeparateDatabaseAndState(
            state_operations=[
                migrations.DeleteModel(
                    name='CategoryType',
                ),
                migrations.DeleteModel(
                    name='RelationTypes',
                ),
                migrations.DeleteModel(
                    name='SpanType',
                ),
            ],
            database_operations=[
                migrations.AlterModelTable(
                    name='CategoryType',
                    table='label_types_categorytype'
                ),
                migrations.AlterModelTable(
                    name='RelationTypes',
                    table='label_types_relationtypes'
                ),
                migrations.AlterModelTable(
                    name='SpanType',
                    table='label_types_spantype'
                )
            ]
        )
    ]

backend/api/migrations/0033_auto_20220127_0654.py
diff --git a/backend/api/migrations/0033_auto_20220127_0654.py b/backend/api/migrations/0033_auto_20220127_0654.py
index e6da429eb9..fd2cb1f52d 100644
--- a/backend/api/migrations/0033_auto_20220127_0654.py
+++ b/backend/api/migrations/0033_auto_20220127_0654.py
@@ -34,7 +34,7 @@ class Migration(migrations.Migration):
                 ),
                 migrations.AlterModelTable(
                     name='SpanType',
-                    table='label_types_spanType'
+                    table='label_types_spantype'
                 )
             ]
         )

Database table for SpanType has invalid name 
How to reproduce the behaviour
---------
- Pull latest changes from master
- ./manage.py migrate
- ./api/migrations/0033_auto_20220127_0654.py will migrate the database table for `SpanType` to `label_types_spanType`
- Delete a project `Project.objects.first().delete()``

Exception:

<img width="511" alt="image" src="https://user-images.githubusercontent.com/6747788/152384221-a6a549b8-1cca-49c0-86e4-6a20f7d0a266.png">
 
The issue can be resolved by either renaming db table `label_types_spanType` to `label_types_spantype` or by explicitly setting `tb_table` for SpanType model like this: `db_table = "label_types_spanType"`

Your Environment
---------
*   Operating System: macOS Monterey, doccano is locally executed
*   Python Version Used: 3.9

