Skip to content

Commit 953b717

Browse files
Merge pull request #4491 from open-formulieren/release/4486-squash-migrations
Squash migrations for the 2.7 release
2 parents ca65f8a + 8db60ef commit 953b717

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+1206
-1759
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
# Generated by Django 4.2.11 on 2024-07-04 14:21
2+
3+
import django.db.models.deletion
4+
from django.db import migrations, models
5+
6+
import django_jsonform.models.fields
7+
8+
import openforms.appointments.contrib.qmatic.models
9+
10+
11+
class Migration(migrations.Migration):
12+
13+
replaces = [
14+
("qmatic", "0001_initial"),
15+
("qmatic", "0002_qmaticconfig_required_customer_fields"),
16+
("qmatic", "0003_strip_qmatic_service_v1"),
17+
]
18+
19+
initial = True
20+
21+
dependencies = [
22+
("zgw_consumers", "0012_auto_20210104_1039"),
23+
]
24+
25+
operations = [
26+
migrations.CreateModel(
27+
name="QmaticConfig",
28+
fields=[
29+
(
30+
"id",
31+
models.AutoField(
32+
auto_created=True,
33+
primary_key=True,
34+
serialize=False,
35+
verbose_name="ID",
36+
),
37+
),
38+
(
39+
"service",
40+
models.OneToOneField(
41+
help_text="The Qmatic Orchestra Calendar Public Appointment API service. Example: https://example.com:8443/calendar-backend/public/api/v1/",
42+
limit_choices_to={"api_type": "orc"},
43+
null=True,
44+
on_delete=django.db.models.deletion.PROTECT,
45+
related_name="+",
46+
to="zgw_consumers.service",
47+
verbose_name="Calendar API",
48+
),
49+
),
50+
(
51+
"required_customer_fields",
52+
django_jsonform.models.fields.ArrayField(
53+
base_field=models.CharField(
54+
choices=[
55+
("firstName", "First name"),
56+
("lastName", "Last name"),
57+
("email", "Email address"),
58+
("phone", "Phone number"),
59+
("addressLine1", "Street name and number"),
60+
("addressLine2", "Address line 2"),
61+
("addressCity", "City"),
62+
("addressState", "State"),
63+
("addressZip", "Postal code"),
64+
("addressCountry", "Country"),
65+
("identificationNumber", "Identification number"),
66+
(
67+
"externalId",
68+
"Unique customer identification/account number",
69+
),
70+
("dateOfBirth", "Birthday"),
71+
],
72+
max_length=50,
73+
),
74+
default=openforms.appointments.contrib.qmatic.models.get_default_customer_fields,
75+
help_text="Select the customer fields for the contact details step. Fields that you select here are REQUIRED fields for the user making the appointment. You must have at least one field to be able to identify the customer.",
76+
size=None,
77+
verbose_name="Required customer fields",
78+
),
79+
),
80+
],
81+
options={
82+
"verbose_name": "Qmatic configuration",
83+
},
84+
),
85+
]

src/openforms/appointments/contrib/qmatic/migrations/0003_strip_qmatic_service_v1.py

+2-30
Original file line numberDiff line numberDiff line change
@@ -2,39 +2,11 @@
22
from django.db import migrations
33

44

5-
def strip_v1_suffix(apps, _):
6-
QmaticConfig = apps.get_model("qmatic", "QmaticConfig")
7-
config = QmaticConfig.objects.first()
8-
if config is None or not config.service:
9-
return
10-
11-
# zgw-consumers normalizes api_root to add a trailing slash
12-
if not (base := config.service.api_root).endswith("/v1/"):
13-
return
14-
15-
head, _ = base.rsplit("v1", 1)
16-
config.service.api_root = head
17-
config.service.save()
18-
19-
20-
def readd_v1_suffix(apps, _):
21-
QmaticConfig = apps.get_model("qmatic", "QmaticConfig")
22-
config = QmaticConfig.objects.first()
23-
if config is None or not config.service:
24-
return
25-
26-
if (base := config.service.api_root).endswith("/v1/"):
27-
return
28-
29-
# zgw-consumers normalizes api_root to add a trailing slash
30-
config.service.api_root = f"{base}v1/"
31-
config.service.save()
32-
33-
345
class Migration(migrations.Migration):
356

367
dependencies = [
378
("qmatic", "0002_qmaticconfig_required_customer_fields"),
389
]
3910

40-
operations = [migrations.RunPython(strip_v1_suffix, readd_v1_suffix)]
11+
# Removed as part of Open Forms 2.7 release cycle
12+
operations = []

src/openforms/appointments/contrib/qmatic/tests/test_migrations.py

-57
This file was deleted.

src/openforms/conf/base.py

-1
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,6 @@
207207
"openforms.submissions",
208208
"openforms.logging.apps.LoggingAppConfig",
209209
"openforms.contrib.brk",
210-
"openforms.contrib.brp",
211210
"openforms.contrib.digid_eherkenning",
212211
"openforms.contrib.haal_centraal",
213212
"openforms.contrib.kadaster",

src/openforms/config/migrations/0054_enable_new_builder.py

+1-14
Original file line numberDiff line numberDiff line change
@@ -3,23 +3,10 @@
33
from django.db import migrations
44

55

6-
def enable_new_builder(apps, _):
7-
GlobalConfiguration = apps.get_model("config", "GlobalConfiguration")
8-
# there can only ever be one record
9-
config = GlobalConfiguration.objects.first()
10-
if config is None or config.enable_react_formio_builder:
11-
return
12-
13-
config.enable_react_formio_builder = True
14-
config.save()
15-
16-
176
class Migration(migrations.Migration):
187

198
dependencies = [
209
("config", "0001_initial_to_v250"),
2110
]
2211

23-
operations = [
24-
migrations.RunPython(enable_new_builder, migrations.RunPython.noop),
25-
]
12+
operations = []

0 commit comments

Comments
 (0)