When I run Django makemigrations
on Wagtail I get a migration (pasted at the bottom) which doesn’t seem to migrate properly. Here you see me making the migration successfully, applying it without errors and then, after doing runserver
, being told that I have migrations to run.
(.venv) development ➜ app ???? manpy makemigrations
/root/.cache/pypoetry/virtualenvs/.venv/lib/python3.10/site-packages/wagtail/utils/widgets.py:10: RemovedInWagtail70Warning: The usage of `WidgetWithScript` hook is deprecated. Use external scripts instead.
warn(
System check identified some issues:
WARNINGS:
?: (urls.W005) URL namespace 'freetag_chooser' isn't unique. You may not be able to reverse all URLs in this namespace
?: (urls.W005) URL namespace 'pagetag_chooser' isn't unique. You may not be able to reverse all URLs in this namespace
?: (urls.W005) URL namespace 'sectiontag_chooser' isn't unique. You may not be able to reverse all URLs in this namespace
Migrations for 'core':
modules/core/migrations/0019_whofundsyoupage_stream.py
- Add field stream to whofundsyoupage
(.venv) development ➜ app ???? manpy migrate
/root/.cache/pypoetry/virtualenvs/.venv/lib/python3.10/site-packages/wagtail/utils/widgets.py:10: RemovedInWagtail70Warning: The usage of `WidgetWithScript` hook is deprecated. Use external scripts instead.
warn(
System check identified some issues:
WARNINGS:
?: (urls.W005) URL namespace 'freetag_chooser' isn't unique. You may not be able to reverse all URLs in this namespace
?: (urls.W005) URL namespace 'pagetag_chooser' isn't unique. You may not be able to reverse all URLs in this namespace
?: (urls.W005) URL namespace 'sectiontag_chooser' isn't unique. You may not be able to reverse all URLs in this namespace
Operations to perform:
Apply all migrations: admin, auth, contenttypes, core, csp, django_cron, donations, importers, sessions, submissions, taggit, taxonomy, users, wagtail_localize, wagtailadmin, wagtailcore, wagtaildocs, wagtailembeds, wagtailforms, wagtailimages, wagtailredirects, wagtailsearch, wagtailsearchpromotions, wagtailusers
Running migrations:
Applying core.0019_whofundsyoupage_stream...⏎
(.venv) development ➜ app ???? runserver
/root/.cache/pypoetry/virtualenvs/.venv/lib/python3.10/site-packages/wagtail/utils/widgets.py:10: RemovedInWagtail70Warning: The usage of `WidgetWithScript` hook is deprecated. Use external scripts instead.
warn(
/root/.cache/pypoetry/virtualenvs/.venv/lib/python3.10/site-packages/wagtail/utils/widgets.py:10: RemovedInWagtail70Warning: The usage of `WidgetWithScript` hook is deprecated. Use external scripts instead.
warn(
Performing system checks...
System check identified some issues:
WARNINGS:
?: (urls.W005) URL namespace 'freetag_chooser' isn't unique. You may not be able to reverse all URLs in this namespace
?: (urls.W005) URL namespace 'pagetag_chooser' isn't unique. You may not be able to reverse all URLs in this namespace
?: (urls.W005) URL namespace 'sectiontag_chooser' isn't unique. You may not be able to reverse all URLs in this namespace
System check identified 3 issues (0 silenced).
You have 1 unapplied migration(s). Your project may not work properly until you apply the migrations for app(s): core.
Run 'python manage.py migrate' to apply them.
May 14, 2024 - 16:33:16
Django version 5.0.4, using settings 'config.settings.development'
Starting development server at http://0.0.0.0:5000/
Quit the server with CONTROL-C.
And here is the code of the migration that’s been made and doesn’t seem to be being applied:
modules/core/migrations/0019_whofundsyoupage_stream.py
# Generated by Django 5.0.4 on 2024-05-14 16:31
import modules.core.blocks.override
import wagtail.blocks
import wagtail.fields
import wagtail.images.blocks
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('core', '0018_auto_20240226_1608'),
]
operations = [
migrations.AddField(
model_name='whofundsyoupage',
name='stream',
field=wagtail.fields.StreamField([('rich_text', wagtail.blocks.StructBlock([('text', modules.core.blocks.override.RichTextBlock(label='Body text', required=True))], group=' Content')), ('image', wagtail.blocks.StructBlock([('image', wagtail.images.blocks.ImageChooserBlock(required=True)), ('alt_text', wagtail.blocks.CharBlock(label='Override image alt-text', required=False)), ('caption', wagtail.blocks.RichTextBlock(features=['link', 'document-link'], label='Override caption', required=False)), ('credit', wagtail.blocks.RichTextBlock(features=['link', 'document-link'], label='Override credit', required=False)), ('image_display', wagtail.blocks.ChoiceBlock(choices=[('full', 'Full'), ('long', 'Long'), ('medium', 'Medium'), ('small-image', 'Small')]))], group=' Content')), ('html_advanced', wagtail.blocks.StructBlock([('html', wagtail.blocks.RawHTMLBlock(label='HTML code', required=True)), ('styling', wagtail.blocks.ChoiceBlock(choices=[('default', 'Default'), ('remove-styles', 'Remove style')]))], group=' Content'))], blank=True, verbose_name='Additional content'),
),
]