kopia lustrzana https://github.com/wagtail/wagtail
Fix wagtailembeds thumbnail_url migration for MySQL 8.0.13 (#6999)
* Upgrade mysql to 8.0.23 for github actions * Fix thumbnail_url migration to work on Django 3 / MySQL 8.0.13+ Work around https://code.djangoproject.com/ticket/32503 by applying the not-null constraint before converting to TextField.pull/6980/head
rodzic
88cebcd43a
commit
f2be408f62
|
@ -125,7 +125,7 @@ jobs:
|
|||
|
||||
services:
|
||||
mysql:
|
||||
image: mysql:5.7
|
||||
image: mysql:8.0.23
|
||||
env:
|
||||
MYSQL_ALLOW_EMPTY_PASSWORD: yes
|
||||
MYSQL_DATABASE: wagtail
|
||||
|
|
|
@ -24,13 +24,24 @@ class Migration(migrations.Migration):
|
|||
name="url",
|
||||
field=models.TextField(),
|
||||
),
|
||||
# Converting URLField to TextField with a default specified (even with preserve_default=False)
|
||||
# fails with Django 3.0 and MySQL >=8.0.13 (see https://code.djangoproject.com/ticket/32503) -
|
||||
# work around this by altering in two stages, first making the URLField non-null then converting
|
||||
# to TextField
|
||||
migrations.AlterField(
|
||||
model_name="embed",
|
||||
name="thumbnail_url",
|
||||
field=models.TextField(
|
||||
field=models.URLField(
|
||||
blank=True,
|
||||
default="",
|
||||
),
|
||||
preserve_default=False,
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name="embed",
|
||||
name="thumbnail_url",
|
||||
field=models.TextField(
|
||||
blank=True,
|
||||
),
|
||||
),
|
||||
]
|
||||
|
|
Ładowanie…
Reference in New Issue