From 72a1ce8750ed74763bb38b26fd00bd6d64fae2dc Mon Sep 17 00:00:00 2001 From: Adam Goldsmith Date: Sun, 4 Feb 2024 22:37:22 -0500 Subject: [PATCH] membershipworks: Add/fix migrations for earlier manual fixes --- .../migrations/0013_eventattendee.py | 22 ++++++++++++++++++- .../0014_remove_eventext_details_timestamp.py | 16 ++++++++++++++ 2 files changed, 37 insertions(+), 1 deletion(-) create mode 100644 membershipworks/migrations/0014_remove_eventext_details_timestamp.py diff --git a/membershipworks/migrations/0013_eventattendee.py b/membershipworks/migrations/0013_eventattendee.py index e95e18e..75fbe11 100644 --- a/membershipworks/migrations/0013_eventattendee.py +++ b/membershipworks/migrations/0013_eventattendee.py @@ -1,6 +1,6 @@ # Generated by Django 5.0.1 on 2024-02-02 22:07 -from django.db import migrations +from django.db import migrations, models import django_db_views.migration_functions import django_db_views.operations @@ -12,6 +12,26 @@ class Migration(migrations.Migration): ] operations = [ + migrations.CreateModel( + name="EventAttendee", + fields=[ + ( + "id", + models.BigAutoField( + auto_created=True, + primary_key=True, + serialize=False, + verbose_name="ID", + ), + ), + ("name", models.CharField(max_length=256)), + ("email", models.CharField(max_length=256)), + ("sum", models.FloatField()), + ], + options={ + "managed": False, + }, + ), django_db_views.operations.ViewRunPython( code=django_db_views.migration_functions.ForwardViewMigration( "SELECT eventext.event_ptr_id as event_id, tkt.uid, tkt.name, tkt.email, tkt.sum\n FROM\n membershipworks_eventext as eventext,\n JSON_TABLE(eventext.details, '$.usr[*]' COLUMNS (\n uid VARCHAR(24) PATH '$.uid',\n name VARCHAR(256) PATH '$.nam',\n email VARCHAR(256) PATH '$.eml',\n sum DOUBLE PATH '$.sum'\n )) as tkt", diff --git a/membershipworks/migrations/0014_remove_eventext_details_timestamp.py b/membershipworks/migrations/0014_remove_eventext_details_timestamp.py new file mode 100644 index 0000000..33bf8f0 --- /dev/null +++ b/membershipworks/migrations/0014_remove_eventext_details_timestamp.py @@ -0,0 +1,16 @@ +# Generated by Django 5.0.1 on 2024-02-05 03:32 + +from django.db import migrations + + +class Migration(migrations.Migration): + dependencies = [ + ("membershipworks", "0013_eventattendee"), + ] + + operations = [ + migrations.RemoveField( + model_name="eventext", + name="details_timestamp", + ), + ]