-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Changes nullable fields to non-nullable and adding migrations
- Loading branch information
Showing
3 changed files
with
275 additions
and
8 deletions.
There are no files selected for viewing
189 changes: 189 additions & 0 deletions
189
home/migrations/0046_alter_contentpage_whatsapp_body.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,189 @@ | ||
# Generated by Django 4.1.13 on 2024-01-24 04:40 | ||
|
||
import django.core.validators | ||
from django.db import migrations | ||
import home.models | ||
import wagtail.blocks | ||
import wagtail.documents.blocks | ||
import wagtail.fields | ||
import wagtail.images.blocks | ||
|
||
|
||
class Migration(migrations.Migration): | ||
dependencies = [ | ||
("home", "0045_merge_20240123_1102"), | ||
] | ||
|
||
operations = [ | ||
migrations.AlterField( | ||
model_name="contentpage", | ||
name="whatsapp_body", | ||
field=wagtail.fields.StreamField( | ||
[ | ||
( | ||
"Whatsapp_Message", | ||
wagtail.blocks.StructBlock( | ||
[ | ||
( | ||
"image", | ||
wagtail.images.blocks.ImageChooserBlock( | ||
required=False | ||
), | ||
), | ||
( | ||
"document", | ||
wagtail.documents.blocks.DocumentChooserBlock( | ||
icon="document", required=False | ||
), | ||
), | ||
( | ||
"media", | ||
home.models.MediaBlock( | ||
icon="media", required=False | ||
), | ||
), | ||
( | ||
"message", | ||
wagtail.blocks.TextBlock( | ||
help_text="each text message cannot exceed 4096 characters, messages with media cannot exceed 1024 characters.", | ||
validators=( | ||
django.core.validators.MaxLengthValidator( | ||
4096 | ||
), | ||
), | ||
), | ||
), | ||
( | ||
"example_values", | ||
wagtail.blocks.ListBlock( | ||
wagtail.blocks.CharBlock(label="Example Value"), | ||
default=[], | ||
help_text="Please add example values for all variables used in a WhatsApp template", | ||
label="Variable Example Values", | ||
), | ||
), | ||
( | ||
"variation_messages", | ||
wagtail.blocks.ListBlock( | ||
wagtail.blocks.StructBlock( | ||
[ | ||
( | ||
"variation_restrictions", | ||
wagtail.blocks.StreamBlock( | ||
[ | ||
( | ||
"gender", | ||
wagtail.blocks.ChoiceBlock( | ||
choices=home.models.get_gender_choices | ||
), | ||
), | ||
( | ||
"age", | ||
wagtail.blocks.ChoiceBlock( | ||
choices=home.models.get_age_choices | ||
), | ||
), | ||
( | ||
"relationship", | ||
wagtail.blocks.ChoiceBlock( | ||
choices=home.models.get_relationship_choices | ||
), | ||
), | ||
], | ||
help_text="Restrict this variation to users with this profile value. Valid values must be added to the Site Settings", | ||
max_num=1, | ||
min_num=1, | ||
required=False, | ||
use_json_field=True, | ||
), | ||
), | ||
( | ||
"message", | ||
wagtail.blocks.TextBlock( | ||
help_text="each message cannot exceed 4096 characters.", | ||
validators=( | ||
django.core.validators.MaxLengthValidator( | ||
4096 | ||
), | ||
), | ||
), | ||
), | ||
] | ||
), | ||
default=[], | ||
), | ||
), | ||
( | ||
"next_prompt", | ||
wagtail.blocks.CharBlock( | ||
help_text="prompt text for next message", | ||
required=False, | ||
validators=( | ||
django.core.validators.MaxLengthValidator( | ||
20 | ||
), | ||
), | ||
), | ||
), | ||
( | ||
"buttons", | ||
wagtail.blocks.StreamBlock( | ||
[ | ||
( | ||
"next_message", | ||
wagtail.blocks.StructBlock( | ||
[ | ||
( | ||
"title", | ||
wagtail.blocks.CharBlock( | ||
help_text="text for the button, up to 20 characters.", | ||
validators=( | ||
django.core.validators.MaxLengthValidator( | ||
20 | ||
), | ||
), | ||
), | ||
) | ||
] | ||
), | ||
), | ||
( | ||
"go_to_page", | ||
wagtail.blocks.StructBlock( | ||
[ | ||
( | ||
"title", | ||
wagtail.blocks.CharBlock( | ||
help_text="text for the button, up to 20 characters.", | ||
validators=( | ||
django.core.validators.MaxLengthValidator( | ||
20 | ||
), | ||
), | ||
), | ||
), | ||
( | ||
"page", | ||
wagtail.blocks.PageChooserBlock( | ||
help_text="page the button should go to" | ||
), | ||
), | ||
] | ||
), | ||
), | ||
], | ||
max_num=3, | ||
required=False, | ||
), | ||
), | ||
], | ||
help_text="Each message will be sent with the text and media", | ||
), | ||
) | ||
], | ||
blank=True, | ||
null=True, | ||
use_json_field=True, | ||
), | ||
), | ||
] |
79 changes: 79 additions & 0 deletions
79
home/migrations/0047_alter_contentpage_messenger_title_and_more.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
# Generated by Django 4.1.13 on 2024-01-24 05:21 | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
dependencies = [ | ||
("home", "0046_alter_contentpage_whatsapp_body"), | ||
] | ||
|
||
operations = [ | ||
migrations.AlterField( | ||
model_name="contentpage", | ||
name="messenger_title", | ||
field=models.CharField(blank=True, default="", max_length=200), | ||
), | ||
migrations.AlterField( | ||
model_name="contentpage", | ||
name="subtitle", | ||
field=models.CharField(blank=True, default="", max_length=200), | ||
), | ||
migrations.AlterField( | ||
model_name="contentpage", | ||
name="viber_title", | ||
field=models.CharField(blank=True, default="", max_length=200), | ||
), | ||
migrations.AlterField( | ||
model_name="contentpage", | ||
name="whatsapp_title", | ||
field=models.CharField(blank=True, default="", max_length=200), | ||
), | ||
migrations.AlterField( | ||
model_name="pageview", | ||
name="platform", | ||
field=models.CharField( | ||
blank=True, | ||
choices=[ | ||
("WHATSAPP", "whatsapp"), | ||
("SMS", "sms"), | ||
("USSD", "ussd"), | ||
("VIBER", "viber"), | ||
("MESSENGER", "messenger"), | ||
("WEB", "web"), | ||
], | ||
default="web", | ||
max_length=20, | ||
), | ||
), | ||
migrations.AlterField( | ||
model_name="sitesettings", | ||
name="login_message", | ||
field=models.CharField( | ||
blank=True, | ||
default="", | ||
help_text="The login message shown on the login page", | ||
max_length=100, | ||
), | ||
), | ||
migrations.AlterField( | ||
model_name="sitesettings", | ||
name="title", | ||
field=models.CharField( | ||
blank=True, | ||
default="", | ||
help_text="The branding title shown in the CMS", | ||
max_length=30, | ||
), | ||
), | ||
migrations.AlterField( | ||
model_name="sitesettings", | ||
name="welcome_message", | ||
field=models.CharField( | ||
blank=True, | ||
default="", | ||
help_text="The welcome message shown after logging in", | ||
max_length=100, | ||
), | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters