summaryrefslogtreecommitdiff
path: root/chimere/migrations/0016_aggregated_delete_rules.py
blob: b511b3ac7821beebe199c23c94692a3ccd127308 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# -*- coding: utf-8 -*-
# Generated by Django 1.11.5 on 2018-03-17 12:42
from __future__ import unicode_literals

from django.db import migrations


SQL_ROUTE = """
CREATE RULE agg_route_delete AS ON DELETE TO chimere_aggregated_routes
DO INSTEAD(
    DELETE FROM django_migrations where id=id + 1;
);
"""

SQL_POLY = """
CREATE RULE agg_poly_delete AS ON DELETE TO chimere_aggregated_polygons
DO INSTEAD(
    DELETE FROM django_migrations where id=id + 1;
);
"""


class Migration(migrations.Migration):

    dependencies = [
        ('chimere', '0015_force_creation_of_aggregated'),
    ]

    operations = [
        migrations.RunSQL(SQL_POLY),
        migrations.RunSQL(SQL_ROUTE),
    ]