|
| 1 | +# Generated by Django 5.1.7 on 2025-04-21 14:57 |
| 2 | + |
| 3 | +import pgtrigger.compiler |
| 4 | +import pgtrigger.migrations |
| 5 | +from django.db import migrations, models |
| 6 | + |
| 7 | + |
| 8 | +class Migration(migrations.Migration): |
| 9 | + dependencies = [ |
| 10 | + ("country_workspace", "0010_householdevent_individualevent_and_more"), |
| 11 | + ] |
| 12 | + |
| 13 | + operations = [ |
| 14 | + pgtrigger.migrations.RemoveTrigger( |
| 15 | + model_name="household", |
| 16 | + name="updates_update", |
| 17 | + ), |
| 18 | + pgtrigger.migrations.RemoveTrigger( |
| 19 | + model_name="individual", |
| 20 | + name="updates_update", |
| 21 | + ), |
| 22 | + migrations.RemoveField( |
| 23 | + model_name="program", |
| 24 | + name="active", |
| 25 | + ), |
| 26 | + migrations.AlterField( |
| 27 | + model_name="program", |
| 28 | + name="individual_columns", |
| 29 | + field=models.TextField(default="name\nid", help_text="Columns to display in the Admin table"), |
| 30 | + ), |
| 31 | + pgtrigger.migrations.AddTrigger( |
| 32 | + model_name="household", |
| 33 | + trigger=pgtrigger.compiler.Trigger( |
| 34 | + name="update_update", |
| 35 | + sql=pgtrigger.compiler.UpsertTriggerSql( |
| 36 | + condition='WHEN (OLD."flex_fields" IS DISTINCT FROM (NEW."flex_fields") OR OLD."flex_files" IS DISTINCT FROM (NEW."flex_files") OR OLD."removed" IS DISTINCT FROM (NEW."removed"))', |
| 37 | + func='INSERT INTO "country_workspace_householdevent" ("batch_id", "checksum", "errors", "flex_fields", "flex_files", "id", "last_checked", "last_modified", "name", "pgh_context_id", "pgh_created_at", "pgh_label", "pgh_obj_id", "removed", "system_fields", "version") VALUES (NEW."batch_id", NEW."checksum", NEW."errors", NEW."flex_fields", NEW."flex_files", NEW."id", NEW."last_checked", NEW."last_modified", NEW."name", _pgh_attach_context(), NOW(), \'update\', NEW."id", NEW."removed", NEW."system_fields", NEW."version"); RETURN NULL;', |
| 38 | + hash="8ecf3de9db1d0a404013f2d873e0f061d7d00111", |
| 39 | + operation="UPDATE", |
| 40 | + pgid="pgtrigger_update_update_c2d37", |
| 41 | + table="country_workspace_household", |
| 42 | + when="AFTER", |
| 43 | + ), |
| 44 | + ), |
| 45 | + ), |
| 46 | + pgtrigger.migrations.AddTrigger( |
| 47 | + model_name="individual", |
| 48 | + trigger=pgtrigger.compiler.Trigger( |
| 49 | + name="update_update", |
| 50 | + sql=pgtrigger.compiler.UpsertTriggerSql( |
| 51 | + condition='WHEN (OLD."flex_fields" IS DISTINCT FROM (NEW."flex_fields") OR OLD."flex_files" IS DISTINCT FROM (NEW."flex_files") OR OLD."removed" IS DISTINCT FROM (NEW."removed"))', |
| 52 | + func='INSERT INTO "country_workspace_individualevent" ("batch_id", "checksum", "errors", "flex_fields", "flex_files", "household_id", "id", "last_checked", "last_modified", "name", "pgh_context_id", "pgh_created_at", "pgh_label", "pgh_obj_id", "removed", "system_fields", "version") VALUES (NEW."batch_id", NEW."checksum", NEW."errors", NEW."flex_fields", NEW."flex_files", NEW."household_id", NEW."id", NEW."last_checked", NEW."last_modified", NEW."name", _pgh_attach_context(), NOW(), \'update\', NEW."id", NEW."removed", NEW."system_fields", NEW."version"); RETURN NULL;', |
| 53 | + hash="75976263954d18b98b4e9bdd634a3e7db04f8c60", |
| 54 | + operation="UPDATE", |
| 55 | + pgid="pgtrigger_update_update_6a215", |
| 56 | + table="country_workspace_individual", |
| 57 | + when="AFTER", |
| 58 | + ), |
| 59 | + ), |
| 60 | + ), |
| 61 | + ] |
0 commit comments