from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('wagtailcore', '0066_collection_management_permissions'),
('wagtailforms', '0004_add_verbose_name_plural'),
('wagtailredirects', '0006_redirect_increase_max_length'),
('home', '0017_alter_orderdetailpage_options'),
]
operations = [
# migrations.RemoveField(
# # model_name='orderdetailpage',
# name='page_ptr',
# ),
# migrations.RemoveField(
# # model_name='successpage',
# name='page_ptr',
# ),
migrations.DeleteModel(
name='MerchantHomePage',
),
migrations.DeleteModel(
name='OrderDetailPage',
),
migrations.DeleteModel(
name='SuccessPage',
),
]
return Database.Cursor.execute(self, query, params) django.db.utils.OperationalError: near ")": syntax error
- It occurs because you are trying to Delete a Class that has no Fields.
- Get rid of the RemoveField section in your migration: normally such migrations have auto in their names eg
0021_auto_20211126_0955.py
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('wagtailcore', '0066_collection_management_permissions'),
('wagtailredirects', '0006_redirect_increase_max_length'),
('wagtailforms', '0004_add_verbose_name_plural'),
('home', '0020_auto_20211126_0945'),
]
operations = [
migrations.RemoveField(
model_name='orderdetailpage',
name='page_ptr',
),
migrations.DeleteModel(
name='MerchantHomePage',
),
migrations.DeleteModel(
name='OrderDetailPage',
),
]
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('wagtailcore', '0066_collection_management_permissions'),
('wagtailredirects', '0006_redirect_increase_max_length'),
('wagtailforms', '0004_add_verbose_name_plural'),
('home', '0020_auto_20211126_0945'),
]
operations = [
# ..removed the RemoveField section
migrations.DeleteModel(
name='MerchantHomePage',
),
migrations.DeleteModel(
name='OrderDetailPage',
),
]
- Then run
python manage.py migrate again and everything should be good
thanks for this