Skip to content

Commit

Permalink
Merge pull request #4672 from open-formulieren/chore/4663-squash-migr…
Browse files Browse the repository at this point in the history
…ations

Squash migrations for 2.8.0 release cycle
  • Loading branch information
sergei-maertens authored Sep 16, 2024
2 parents f5c11e6 + 9c162fe commit 353b51f
Show file tree
Hide file tree
Showing 102 changed files with 34 additions and 3,696 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -435,7 +435,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
start: ['2.7.0', '2.7.4']
start: ['2.7.4', '2.7.6']

steps:
- uses: actions/checkout@v4
Expand All @@ -459,7 +459,7 @@ jobs:
docker compose run -e RELEASE=${RELEASE} web \
python src/manage.py migrate
env:
RELEASE: '2.8.0'
RELEASE: '2.8.0-beta.0'
# ensure local image gets used
TAG: ${{ needs.docker_build_setup.outputs.version }}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,64 +2,6 @@

from django.db import migrations

from openforms.translations.utils import get_language_codes


def add_extra_source_id_govmetric(apps, schema_editor):
AnalyticsToolsConfiguration = apps.get_model(
"analytics_tools", "AnalyticsToolsConfiguration"
)

config = AnalyticsToolsConfiguration.objects.first()
if not config:
return

language_codes = get_language_codes()

for language_code in language_codes:
if old_id := getattr(config, f"govmetric_source_id_{language_code}"):
setattr(config, f"govmetric_source_id_form_aborted_{language_code}", old_id)
setattr(
config, f"govmetric_source_id_form_finished_{language_code}", old_id
)

if old_guid := getattr(config, f"govmetric_secure_guid_{language_code}"):
setattr(
config, f"govmetric_secure_guid_form_aborted_{language_code}", old_guid
)
setattr(
config, f"govmetric_secure_guid_form_finished_{language_code}", old_guid
)

config.save()


def remove_extra_source_id_govmetric(apps, schema_editor):
AnalyticsToolsConfiguration = apps.get_model(
"analytics_tools", "AnalyticsToolsConfiguration"
)

config = AnalyticsToolsConfiguration.objects.first()
if not config:
return

language_codes = get_language_codes()

for language_code in language_codes:
new_id = getattr(
config, f"govmetric_source_id_form_finished_{language_code}"
) or getattr(config, f"govmetric_source_id_form_aborted_{language_code}")
if new_id:
setattr(config, f"govmetric_source_id_{language_code}", new_id)

new_guid = getattr(
config, f"govmetric_secure_guid_form_finished_{language_code}"
) or getattr(config, f"govmetric_secure_guid_form_aborted_{language_code}")
if new_guid:
setattr(config, f"govmetric_secure_guid_{language_code}", new_guid)

config.save()


class Migration(migrations.Migration):
dependencies = [
Expand All @@ -69,8 +11,5 @@ class Migration(migrations.Migration):
),
]

operations = [
migrations.RunPython(
add_extra_source_id_govmetric, remove_extra_source_id_govmetric
),
]
# RunPython operation removed as part of the 2.8.0 release cycle
operations = []
73 changes: 0 additions & 73 deletions src/openforms/analytics_tools/tests/test_migrations.py

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,6 @@

class Migration(migrations.Migration):

replaces = [
("qmatic", "0001_initial"),
("qmatic", "0002_qmaticconfig_required_customer_fields"),
("qmatic", "0003_strip_qmatic_service_v1"),
]

initial = True

dependencies = [
Expand Down

This file was deleted.

This file was deleted.

12 changes: 0 additions & 12 deletions src/openforms/config/migrations/0054_enable_new_builder.py

This file was deleted.

12 changes: 0 additions & 12 deletions src/openforms/config/migrations/0054_v250_to_v270.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,18 +61,6 @@ def move_from_flagstate_to_config(apps, _):

class Migration(migrations.Migration):

replaces = [
("config", "0054_enable_new_builder"),
("config", "0055_remove_globalconfiguration_enable_react_formio_builder"),
("config", "0056_globalconfiguration_enable_backend_formio_validation"),
("config", "0057_migrate_to_order_id_template"),
("config", "0058_remove_globalconfiguration_enable_backend_formio_validation"),
("config", "0059_theme_email_logo"),
("config", "0058_globalconfiguration_cosign_request_template_and_more"),
("config", "0060_merge_20240517_1517"),
("config", "0061_move_feature_flags"),
]

dependencies = [
("config", "0001_initial_to_v250"),
("upgrades", "0001_initial"),
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

Loading

0 comments on commit 353b51f

Please sign in to comment.