Initial commit
This commit is contained in:
64
env/lib/python3.10/site-packages/wagtail/contrib/search_promotions/migrations/0001_initial.py
vendored
Normal file
64
env/lib/python3.10/site-packages/wagtail/contrib/search_promotions/migrations/0001_initial.py
vendored
Normal file
@@ -0,0 +1,64 @@
|
||||
# Generated by Django 4.0.7 on 2022-10-10 17:43
|
||||
|
||||
from django.db import migrations, models
|
||||
import django.db.models.deletion
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
("wagtailcore", "0015_add_more_verbose_names"),
|
||||
("wagtailsearch", "0003_remove_editors_pick"),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.CreateModel(
|
||||
name="SearchPromotion",
|
||||
fields=[
|
||||
(
|
||||
"id",
|
||||
models.AutoField(
|
||||
auto_created=True,
|
||||
primary_key=True,
|
||||
serialize=False,
|
||||
verbose_name="ID",
|
||||
),
|
||||
),
|
||||
(
|
||||
"sort_order",
|
||||
models.IntegerField(blank=True, editable=False, null=True),
|
||||
),
|
||||
(
|
||||
"description",
|
||||
models.TextField(blank=True, verbose_name="description"),
|
||||
),
|
||||
(
|
||||
"page",
|
||||
models.ForeignKey(
|
||||
on_delete=django.db.models.deletion.CASCADE,
|
||||
to="wagtailcore.page",
|
||||
verbose_name="page",
|
||||
),
|
||||
),
|
||||
(
|
||||
"query",
|
||||
# Changed in Wagtail 6.0. This was previously a foreign key to
|
||||
# wagtailsearch.query, but that table doesn't exist any more (and we can't
|
||||
# force this migration to run before its deletion, because the searchpromotions
|
||||
# app can be installed at any time). Instead, we arbitrarily point it to
|
||||
# wagtailcore.page - this is fine, because any project that's running this
|
||||
# migration under Wagtail>=6.0 will subsequently run searchpromotions migration
|
||||
# 0005, which will change it to point to wagtailsearchpromotions.query.
|
||||
models.ForeignKey(
|
||||
on_delete=django.db.models.deletion.CASCADE,
|
||||
related_name="editors_picks",
|
||||
to="wagtailcore.page",
|
||||
),
|
||||
),
|
||||
],
|
||||
options={
|
||||
"verbose_name": "Search promotion",
|
||||
"ordering": ("sort_order",),
|
||||
},
|
||||
),
|
||||
]
|
||||
@@ -0,0 +1,27 @@
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
("wagtailsearchpromotions", "0001_initial"),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterModelOptions(
|
||||
name="searchpromotion",
|
||||
options={"ordering": ("sort_order",), "verbose_name": "search promotion"},
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name="searchpromotion",
|
||||
name="description",
|
||||
field=models.TextField(blank=True, verbose_name="description"),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name="searchpromotion",
|
||||
name="page",
|
||||
field=models.ForeignKey(
|
||||
on_delete=models.CASCADE, to="wagtailcore.Page", verbose_name="page"
|
||||
),
|
||||
),
|
||||
]
|
||||
@@ -0,0 +1,58 @@
|
||||
# Generated by Django 3.1.8 on 2021-06-22 14:19
|
||||
|
||||
from django.db import migrations, models
|
||||
import django.db.models.deletion
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
("wagtailsearchpromotions", "0002_capitalizeverbose"),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.CreateModel(
|
||||
name="Query",
|
||||
fields=[
|
||||
(
|
||||
"id",
|
||||
models.AutoField(
|
||||
auto_created=True,
|
||||
primary_key=True,
|
||||
serialize=False,
|
||||
verbose_name="ID",
|
||||
),
|
||||
),
|
||||
("query_string", models.CharField(max_length=255, unique=True)),
|
||||
],
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name="QueryDailyHits",
|
||||
fields=[
|
||||
(
|
||||
"id",
|
||||
models.AutoField(
|
||||
auto_created=True,
|
||||
primary_key=True,
|
||||
serialize=False,
|
||||
verbose_name="ID",
|
||||
),
|
||||
),
|
||||
("date", models.DateField()),
|
||||
("hits", models.IntegerField(default=0)),
|
||||
(
|
||||
"query",
|
||||
models.ForeignKey(
|
||||
on_delete=django.db.models.deletion.CASCADE,
|
||||
related_name="daily_hits",
|
||||
to="wagtailsearchpromotions.query",
|
||||
),
|
||||
),
|
||||
],
|
||||
options={
|
||||
"verbose_name": "Query Daily Hits",
|
||||
"verbose_name_plural": "Query Daily Hits",
|
||||
"unique_together": {("query", "date")},
|
||||
},
|
||||
),
|
||||
]
|
||||
@@ -0,0 +1,19 @@
|
||||
# Generated by Django 3.1.8 on 2021-06-22 14:56
|
||||
|
||||
from django.db import migrations
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
("wagtailsearchpromotions", "0003_query_querydailyhits"),
|
||||
]
|
||||
|
||||
# Changed to a no-op in Wagtail 6.0.
|
||||
# This migration previously copied the contents of the Query table from wagtailsearch to
|
||||
# wagtailsearchpromotions; however, this can't be done after wagtailsearch migration 0008,
|
||||
# which removes the Query table (and we can't force it to run before, because the
|
||||
# searchpromotions app can be installed at any time). However, any project that needs this
|
||||
# data migration would have already applied the real version of this migration while they
|
||||
# were running Wagtail 5.
|
||||
operations = []
|
||||
@@ -0,0 +1,23 @@
|
||||
# Generated by Django 3.1.8 on 2021-06-22 15:36
|
||||
|
||||
from django.db import migrations, models
|
||||
import django.db.models.deletion
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
("wagtailsearchpromotions", "0004_copy_queries"),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name="searchpromotion",
|
||||
name="query",
|
||||
field=models.ForeignKey(
|
||||
on_delete=django.db.models.deletion.CASCADE,
|
||||
related_name="editors_picks",
|
||||
to="wagtailsearchpromotions.query",
|
||||
),
|
||||
),
|
||||
]
|
||||
@@ -0,0 +1,31 @@
|
||||
# Generated by Django 4.0.10 on 2023-09-07 10:41
|
||||
|
||||
from django.db import migrations
|
||||
from django.core.management.color import no_style
|
||||
|
||||
|
||||
def reset_search_promotion_sequence(apps, schema_editor):
|
||||
"""
|
||||
We set an explicit pk instead of relying on auto-incrementation in migration 0004,
|
||||
so we need to reset the database sequence.
|
||||
"""
|
||||
Query = apps.get_model("wagtailsearchpromotions.Query")
|
||||
QueryDailyHits = apps.get_model("wagtailsearchpromotions.QueryDailyHits")
|
||||
|
||||
statements = schema_editor.connection.ops.sequence_reset_sql(
|
||||
no_style(), [Query, QueryDailyHits]
|
||||
)
|
||||
for statement in statements:
|
||||
schema_editor.execute(statement)
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
dependencies = [
|
||||
("wagtailsearchpromotions", "0005_switch_query_model"),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.RunPython(
|
||||
reset_search_promotion_sequence, migrations.RunPython.noop
|
||||
),
|
||||
]
|
||||
@@ -0,0 +1,54 @@
|
||||
# Generated by Django 4.0.10 on 2023-09-25 20:17
|
||||
|
||||
from django.db import migrations, models
|
||||
import django.db.models.deletion
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
("wagtailcore", "0089_log_entry_data_json_null_to_object"),
|
||||
("wagtailsearchpromotions", "0006_reset_query_sequence"),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name="searchpromotion",
|
||||
name="external_link_text",
|
||||
field=models.CharField(
|
||||
blank=True,
|
||||
max_length=200,
|
||||
null=True,
|
||||
),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name="searchpromotion",
|
||||
name="external_link_url",
|
||||
field=models.URLField(
|
||||
blank=True,
|
||||
help_text="Alternatively, use an external link for this promotion",
|
||||
verbose_name="External link URL",
|
||||
),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name="searchpromotion",
|
||||
name="description",
|
||||
field=models.TextField(
|
||||
blank=True,
|
||||
help_text="Applies to internal page or external link",
|
||||
verbose_name="description",
|
||||
),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name="searchpromotion",
|
||||
name="page",
|
||||
field=models.ForeignKey(
|
||||
blank=True,
|
||||
help_text="Choose an internal page for this promotion",
|
||||
null=True,
|
||||
on_delete=django.db.models.deletion.CASCADE,
|
||||
to="wagtailcore.page",
|
||||
verbose_name="page",
|
||||
),
|
||||
),
|
||||
]
|
||||
0
env/lib/python3.10/site-packages/wagtail/contrib/search_promotions/migrations/__init__.py
vendored
Normal file
0
env/lib/python3.10/site-packages/wagtail/contrib/search_promotions/migrations/__init__.py
vendored
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user