From b7f7823639680d772fa1374317510d06c79a89c6 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Laur=C3=A9line=20Gu=C3=A9rin?= <zebuline@entrouvert.com>
Date: Mon, 14 Oct 2019 13:33:00 +0200
Subject: [PATCH 1/5] dj2: add explicit on_delete on all ForeignKey (#36895)

remove RemovedInDjango20Warning:
on_delete will be a required arg for ForeignKey in Django 2.0.
Set it to models.CASCADE on models and in existing migrations if you want to maintain the current default behavior.
See https://docs.djangoproject.com/en/1.11/ref/models/fields/#django.db.models.ForeignKey.on_delete
---
 combo/apps/calendar/migrations/0001_initial.py    |  2 +-
 combo/apps/dashboard/migrations/0001_initial.py   |  8 ++++----
 combo/apps/dashboard/models.py                    |  6 +++---
 combo/apps/dataviz/migrations/0001_initial.py     |  2 +-
 .../migrations/0003_cubesbarchart_cubestable.py   |  4 ++--
 combo/apps/dataviz/migrations/0006_chartcell.py   |  2 +-
 combo/apps/family/migrations/0001_initial.py      |  2 +-
 combo/apps/fargo/migrations/0001_initial.py       |  2 +-
 combo/apps/gallery/migrations/0001_initial.py     |  4 ++--
 combo/apps/gallery/models.py                      |  2 +-
 combo/apps/lingo/migrations/0001_initial.py       |  6 +++---
 .../lingo/migrations/0005_auto_20150307_1242.py   |  4 ++--
 .../lingo/migrations/0007_lingobasketlinkcell.py  |  2 +-
 .../lingo/migrations/0008_auto_20150908_1538.py   |  4 ++--
 .../lingo/migrations/0009_auto_20150917_1456.py   |  4 ++--
 .../lingo/migrations/0021_transactionoperation.py |  2 +-
 .../migrations/0024_selfdeclaredinvoicepayment.py |  2 +-
 .../lingo/migrations/0025_auto_20161206_1713.py   |  2 +-
 .../lingo/migrations/0028_tipipaymentformcell.py  |  2 +-
 combo/apps/lingo/models.py                        | 10 +++++-----
 combo/apps/maps/migrations/0002_map.py            |  2 +-
 combo/apps/newsletters/migrations/0001_initial.py |  2 +-
 .../apps/notifications/migrations/0001_initial.py |  4 ++--
 combo/apps/pwa/models.py                          |  5 +++--
 combo/apps/search/migrations/0001_initial.py      |  2 +-
 combo/apps/usersearch/migrations/0001_initial.py  |  2 +-
 combo/apps/wcs/migrations/0001_initial.py         | 12 ++++++------
 combo/apps/wcs/migrations/0006_categoriescell.py  |  2 +-
 .../wcs/migrations/0007_trackingcodeinputcell.py  |  2 +-
 combo/data/migrations/0001_initial.py             | 10 +++++-----
 combo/data/migrations/0003_menucell.py            |  2 +-
 combo/data/migrations/0006_linkcell.py            |  2 +-
 combo/data/migrations/0007_auto_20150529_1003.py  |  2 +-
 combo/data/migrations/0008_auto_20150529_1504.py  |  2 +-
 combo/data/migrations/0009_auto_20150529_2247.py  |  2 +-
 combo/data/migrations/0010_feedcell.py            |  2 +-
 combo/data/migrations/0013_parameterscell.py      |  2 +-
 combo/data/migrations/0017_menucell_root_page.py  |  2 +-
 combo/data/migrations/0018_parentcontentcell.py   |  2 +-
 combo/data/migrations/0021_jsoncell.py            |  2 +-
 combo/data/migrations/0024_configjsoncell.py      |  2 +-
 combo/data/models.py                              | 15 ++++++++-------
 combo/profile/migrations/0001_initial.py          |  2 +-
 combo/profile/models.py                           |  2 +-
 44 files changed, 79 insertions(+), 77 deletions(-)

diff --git a/combo/apps/calendar/migrations/0001_initial.py b/combo/apps/calendar/migrations/0001_initial.py
index fbb134e..d2a604e 100644
--- a/combo/apps/calendar/migrations/0001_initial.py
+++ b/combo/apps/calendar/migrations/0001_initial.py
@@ -30,7 +30,7 @@ class Migration(migrations.Migration):
                 ('slot_duration', models.DurationField(default=datetime.timedelta(0, 1800), help_text='Format is hours:minutes:seconds', verbose_name='Slot duration')),
                 ('minimal_booking_duration', models.DurationField(default=datetime.timedelta(0, 3600), help_text='Format is hours:minutes:seconds', verbose_name='Minimal booking duration')),
                 ('groups', models.ManyToManyField(to='auth.Group', verbose_name='Groups', blank=True)),
-                ('page', models.ForeignKey(to='data.Page')),
+                ('page', models.ForeignKey(to='data.Page', on_delete=models.CASCADE)),
             ],
             options={
                 'verbose_name': 'Booking Calendar',
diff --git a/combo/apps/dashboard/migrations/0001_initial.py b/combo/apps/dashboard/migrations/0001_initial.py
index 357a7bb..c308e53 100644
--- a/combo/apps/dashboard/migrations/0001_initial.py
+++ b/combo/apps/dashboard/migrations/0001_initial.py
@@ -27,7 +27,7 @@ class Migration(migrations.Migration):
                 ('restricted_to_unlogged', models.BooleanField(default=False, verbose_name='Restrict to unlogged users')),
                 ('last_update_timestamp', models.DateTimeField(auto_now=True)),
                 ('groups', models.ManyToManyField(to='auth.Group', verbose_name='Groups', blank=True)),
-                ('page', models.ForeignKey(to='data.Page')),
+                ('page', models.ForeignKey(to='data.Page', on_delete=models.CASCADE)),
             ],
             options={
                 'verbose_name': 'Dashboard',
@@ -39,9 +39,9 @@ class Migration(migrations.Migration):
                 ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
                 ('cell_pk', models.PositiveIntegerField()),
                 ('order', models.PositiveIntegerField()),
-                ('cell_type', models.ForeignKey(to='contenttypes.ContentType')),
-                ('dashboard', models.ForeignKey(to='dashboard.DashboardCell')),
-                ('user', models.ForeignKey(to=settings.AUTH_USER_MODEL)),
+                ('cell_type', models.ForeignKey(to='contenttypes.ContentType', on_delete=models.CASCADE)),
+                ('dashboard', models.ForeignKey(to='dashboard.DashboardCell', on_delete=models.CASCADE)),
+                ('user', models.ForeignKey(to=settings.AUTH_USER_MODEL, on_delete=models.CASCADE)),
             ],
             options={
                 'ordering': ('order',),
diff --git a/combo/apps/dashboard/models.py b/combo/apps/dashboard/models.py
index 6e6072f..4868be1 100644
--- a/combo/apps/dashboard/models.py
+++ b/combo/apps/dashboard/models.py
@@ -50,11 +50,11 @@ class DashboardCell(CellBase):
 
 
 class Tile(models.Model):
-    dashboard = models.ForeignKey(DashboardCell)
-    cell_type = models.ForeignKey(ContentType)
+    dashboard = models.ForeignKey(DashboardCell, on_delete=models.CASCADE)
+    cell_type = models.ForeignKey(ContentType, on_delete=models.CASCADE)
     cell_pk = models.PositiveIntegerField()
     cell = fields.GenericForeignKey('cell_type', 'cell_pk')
-    user = models.ForeignKey(settings.AUTH_USER_MODEL)
+    user = models.ForeignKey(settings.AUTH_USER_MODEL, on_delete=models.CASCADE)
     order = models.IntegerField()
 
     class Meta:
diff --git a/combo/apps/dataviz/migrations/0001_initial.py b/combo/apps/dataviz/migrations/0001_initial.py
index 51dff8f..84ae447 100644
--- a/combo/apps/dataviz/migrations/0001_initial.py
+++ b/combo/apps/dataviz/migrations/0001_initial.py
@@ -26,7 +26,7 @@ class Migration(migrations.Migration):
                 ('data_source', models.CharField(max_length=150, null=True, verbose_name='Data Source', blank=True)),
                 ('max_value', models.PositiveIntegerField(null=True, verbose_name='Max Value', blank=True)),
                 ('groups', models.ManyToManyField(to='auth.Group', verbose_name='Groups', blank=True)),
-                ('page', models.ForeignKey(to='data.Page')),
+                ('page', models.ForeignKey(to='data.Page', on_delete=models.CASCADE)),
             ],
             options={
                 'verbose_name': 'Gauge',
diff --git a/combo/apps/dataviz/migrations/0003_cubesbarchart_cubestable.py b/combo/apps/dataviz/migrations/0003_cubesbarchart_cubestable.py
index cd6ba1f..537f36d 100644
--- a/combo/apps/dataviz/migrations/0003_cubesbarchart_cubestable.py
+++ b/combo/apps/dataviz/migrations/0003_cubesbarchart_cubestable.py
@@ -30,7 +30,7 @@ class Migration(migrations.Migration):
                 ('drilldown2', models.CharField(max_length=64, null=True, verbose_name='Drilldown 2', blank=True)),
                 ('other_parameters', models.TextField(null=True, verbose_name='Other parameters', blank=True)),
                 ('groups', models.ManyToManyField(to='auth.Group', verbose_name='Groups', blank=True)),
-                ('page', models.ForeignKey(to='data.Page')),
+                ('page', models.ForeignKey(to='data.Page', on_delete=models.CASCADE)),
             ],
             options={
                 'verbose_name': 'Cubes Barchart',
@@ -54,7 +54,7 @@ class Migration(migrations.Migration):
                 ('drilldown2', models.CharField(max_length=64, null=True, verbose_name='Drilldown 2', blank=True)),
                 ('other_parameters', models.TextField(null=True, verbose_name='Other parameters', blank=True)),
                 ('groups', models.ManyToManyField(to='auth.Group', verbose_name='Groups', blank=True)),
-                ('page', models.ForeignKey(to='data.Page')),
+                ('page', models.ForeignKey(to='data.Page', on_delete=models.CASCADE)),
             ],
             options={
                 'verbose_name': 'Cubes Table',
diff --git a/combo/apps/dataviz/migrations/0006_chartcell.py b/combo/apps/dataviz/migrations/0006_chartcell.py
index 7911966..b83762a 100644
--- a/combo/apps/dataviz/migrations/0006_chartcell.py
+++ b/combo/apps/dataviz/migrations/0006_chartcell.py
@@ -25,7 +25,7 @@ class Migration(migrations.Migration):
                 ('title', models.CharField(max_length=150, null=True, verbose_name='Title', blank=True)),
                 ('url', models.URLField(max_length=150, null=True, verbose_name='URL', blank=True)),
                 ('groups', models.ManyToManyField(to='auth.Group', verbose_name='Groups', blank=True)),
-                ('page', models.ForeignKey(to='data.Page')),
+                ('page', models.ForeignKey(to='data.Page', on_delete=models.CASCADE)),
             ],
             options={
                 'verbose_name': 'Chart',
diff --git a/combo/apps/family/migrations/0001_initial.py b/combo/apps/family/migrations/0001_initial.py
index c0d27ef..4732d0c 100644
--- a/combo/apps/family/migrations/0001_initial.py
+++ b/combo/apps/family/migrations/0001_initial.py
@@ -22,7 +22,7 @@ class Migration(migrations.Migration):
                 ('slug', models.SlugField(verbose_name='Slug', blank=True)),
                 ('public', models.BooleanField(default=True, verbose_name='Public')),
                 ('groups', models.ManyToManyField(to='auth.Group', verbose_name='Groups', blank=True)),
-                ('page', models.ForeignKey(to='data.Page')),
+                ('page', models.ForeignKey(to='data.Page', on_delete=models.CASCADE)),
             ],
             options={
                 'verbose_name': 'Family Information Cell',
diff --git a/combo/apps/fargo/migrations/0001_initial.py b/combo/apps/fargo/migrations/0001_initial.py
index 65ebceb..2de3d34 100644
--- a/combo/apps/fargo/migrations/0001_initial.py
+++ b/combo/apps/fargo/migrations/0001_initial.py
@@ -22,7 +22,7 @@ class Migration(migrations.Migration):
                 ('public', models.BooleanField(default=True, verbose_name='Public')),
                 ('restricted_to_unlogged', models.BooleanField(default=False, verbose_name='Restrict to unlogged users')),
                 ('groups', models.ManyToManyField(to='auth.Group', verbose_name='Groups', blank=True)),
-                ('page', models.ForeignKey(to='data.Page')),
+                ('page', models.ForeignKey(to='data.Page', on_delete=models.CASCADE)),
             ],
             options={
                 'verbose_name': 'Recent Documents',
diff --git a/combo/apps/gallery/migrations/0001_initial.py b/combo/apps/gallery/migrations/0001_initial.py
index cd460bc..0cc4dc1 100644
--- a/combo/apps/gallery/migrations/0001_initial.py
+++ b/combo/apps/gallery/migrations/0001_initial.py
@@ -24,7 +24,7 @@ class Migration(migrations.Migration):
                 ('restricted_to_unlogged', models.BooleanField(default=False, verbose_name='Restrict to unlogged users')),
                 ('last_update_timestamp', models.DateTimeField(auto_now=True)),
                 ('groups', models.ManyToManyField(to='auth.Group', verbose_name='Groups', blank=True)),
-                ('page', models.ForeignKey(to='data.Page')),
+                ('page', models.ForeignKey(to='data.Page', on_delete=models.CASCADE)),
             ],
             options={
                 'verbose_name': 'Gallery',
@@ -37,7 +37,7 @@ class Migration(migrations.Migration):
                 ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
                 ('image', models.ImageField(upload_to=b'uploads/gallery/%Y/%m/', verbose_name='Image')),
                 ('order', models.PositiveIntegerField()),
-                ('gallery', models.ForeignKey(verbose_name='Gallery', to='gallery.GalleryCell')),
+                ('gallery', models.ForeignKey(verbose_name='Gallery', to='gallery.GalleryCell', on_delete=models.CASCADE)),
             ],
             options={
                 'ordering': ['order'],
diff --git a/combo/apps/gallery/models.py b/combo/apps/gallery/models.py
index c6b1a89..cd1ee90 100644
--- a/combo/apps/gallery/models.py
+++ b/combo/apps/gallery/models.py
@@ -50,7 +50,7 @@ class GalleryCell(CellBase):
 
 
 class Image(models.Model):
-    gallery = models.ForeignKey(GalleryCell, verbose_name=_('Gallery'))
+    gallery = models.ForeignKey(GalleryCell, on_delete=models.CASCADE, verbose_name=_('Gallery'))
     image = models.ImageField(_('Image'),
             upload_to='uploads/gallery/%Y/%m/')
     order = models.PositiveIntegerField()
diff --git a/combo/apps/lingo/migrations/0001_initial.py b/combo/apps/lingo/migrations/0001_initial.py
index 984259d..e2755be 100644
--- a/combo/apps/lingo/migrations/0001_initial.py
+++ b/combo/apps/lingo/migrations/0001_initial.py
@@ -40,7 +40,7 @@ class Migration(migrations.Migration):
                 ('slug', models.SlugField(verbose_name='Slug', blank=True)),
                 ('public', models.BooleanField(default=True, verbose_name='Public')),
                 ('groups', models.ManyToManyField(to='auth.Group', verbose_name='Groups', blank=True)),
-                ('page', models.ForeignKey(to='data.Page')),
+                ('page', models.ForeignKey(to='data.Page', on_delete=models.CASCADE)),
             ],
             options={
                 'verbose_name': 'Basket',
@@ -65,13 +65,13 @@ class Migration(migrations.Migration):
         migrations.AddField(
             model_name='basketitem',
             name='regie',
-            field=models.ForeignKey(to='lingo.Regie'),
+            field=models.ForeignKey(to='lingo.Regie', on_delete=models.CASCADE),
             preserve_default=True,
         ),
         migrations.AddField(
             model_name='basketitem',
             name='user',
-            field=models.ForeignKey(to=settings.AUTH_USER_MODEL),
+            field=models.ForeignKey(to=settings.AUTH_USER_MODEL, on_delete=models.CASCADE),
             preserve_default=True,
         ),
     ]
diff --git a/combo/apps/lingo/migrations/0005_auto_20150307_1242.py b/combo/apps/lingo/migrations/0005_auto_20150307_1242.py
index b5392e8..2898f3a 100644
--- a/combo/apps/lingo/migrations/0005_auto_20150307_1242.py
+++ b/combo/apps/lingo/migrations/0005_auto_20150307_1242.py
@@ -24,7 +24,7 @@ class Migration(migrations.Migration):
                 ('slug', models.SlugField(verbose_name='Slug', blank=True)),
                 ('public', models.BooleanField(default=True, verbose_name='Public')),
                 ('groups', models.ManyToManyField(to='auth.Group', verbose_name='Groups', blank=True)),
-                ('page', models.ForeignKey(to='data.Page')),
+                ('page', models.ForeignKey(to='data.Page', on_delete=models.CASCADE)),
             ],
             options={
                 'verbose_name': 'Recent Transactions',
@@ -34,7 +34,7 @@ class Migration(migrations.Migration):
         migrations.AddField(
             model_name='transaction',
             name='user',
-            field=models.ForeignKey(default=0, to=settings.AUTH_USER_MODEL),
+            field=models.ForeignKey(default=0, to=settings.AUTH_USER_MODEL, on_delete=models.CASCADE),
             preserve_default=False,
         ),
     ]
diff --git a/combo/apps/lingo/migrations/0007_lingobasketlinkcell.py b/combo/apps/lingo/migrations/0007_lingobasketlinkcell.py
index 4af84dd..3a65307 100644
--- a/combo/apps/lingo/migrations/0007_lingobasketlinkcell.py
+++ b/combo/apps/lingo/migrations/0007_lingobasketlinkcell.py
@@ -22,7 +22,7 @@ class Migration(migrations.Migration):
                 ('slug', models.SlugField(verbose_name='Slug', blank=True)),
                 ('public', models.BooleanField(default=True, verbose_name='Public')),
                 ('groups', models.ManyToManyField(to='auth.Group', verbose_name='Groups', blank=True)),
-                ('page', models.ForeignKey(to='data.Page')),
+                ('page', models.ForeignKey(to='data.Page', on_delete=models.CASCADE)),
             ],
             options={
                 'verbose_name': 'Basket Link',
diff --git a/combo/apps/lingo/migrations/0008_auto_20150908_1538.py b/combo/apps/lingo/migrations/0008_auto_20150908_1538.py
index d88b3df..1678bff 100644
--- a/combo/apps/lingo/migrations/0008_auto_20150908_1538.py
+++ b/combo/apps/lingo/migrations/0008_auto_20150908_1538.py
@@ -25,7 +25,7 @@ class Migration(migrations.Migration):
                 ('regie', models.CharField(max_length=50, verbose_name='Regie', blank=True)),
                 ('title', ckeditor.fields.RichTextField(verbose_name='Title', blank=True)),
                 ('groups', models.ManyToManyField(to='auth.Group', verbose_name='Groups', blank=True)),
-                ('page', models.ForeignKey(to='data.Page')),
+                ('page', models.ForeignKey(to='data.Page', on_delete=models.CASCADE)),
             ],
             options={
                 'verbose_name': 'Active Items Cell',
@@ -43,7 +43,7 @@ class Migration(migrations.Migration):
                 ('regie', models.CharField(max_length=50, verbose_name='Regie', blank=True)),
                 ('title', ckeditor.fields.RichTextField(verbose_name='Title', blank=True)),
                 ('groups', models.ManyToManyField(to='auth.Group', verbose_name='Groups', blank=True)),
-                ('page', models.ForeignKey(to='data.Page')),
+                ('page', models.ForeignKey(to='data.Page', on_delete=models.CASCADE)),
             ],
             options={
                 'verbose_name': 'Items History Cell',
diff --git a/combo/apps/lingo/migrations/0009_auto_20150917_1456.py b/combo/apps/lingo/migrations/0009_auto_20150917_1456.py
index 29f5dd9..f67ad49 100644
--- a/combo/apps/lingo/migrations/0009_auto_20150917_1456.py
+++ b/combo/apps/lingo/migrations/0009_auto_20150917_1456.py
@@ -15,7 +15,7 @@ class Migration(migrations.Migration):
         migrations.AddField(
             model_name='transaction',
             name='regie',
-            field=models.ForeignKey(to='lingo.Regie', null=True),
+            field=models.ForeignKey(to='lingo.Regie', null=True, on_delete=models.CASCADE),
             preserve_default=True,
         ),
         migrations.AddField(
@@ -27,7 +27,7 @@ class Migration(migrations.Migration):
         migrations.AlterField(
             model_name='transaction',
             name='user',
-            field=models.ForeignKey(to=settings.AUTH_USER_MODEL, null=True),
+            field=models.ForeignKey(to=settings.AUTH_USER_MODEL, null=True, on_delete=models.CASCADE),
             preserve_default=True,
         ),
     ]
diff --git a/combo/apps/lingo/migrations/0021_transactionoperation.py b/combo/apps/lingo/migrations/0021_transactionoperation.py
index f0637c2..5c81e49 100644
--- a/combo/apps/lingo/migrations/0021_transactionoperation.py
+++ b/combo/apps/lingo/migrations/0021_transactionoperation.py
@@ -20,7 +20,7 @@ class Migration(migrations.Migration):
                 ('amount', models.DecimalField(max_digits=8, decimal_places=2)),
                 ('creation_date', models.DateTimeField(auto_now_add=True)),
                 ('bank_result', jsonfield.fields.JSONField(default=dict, blank=True)),
-                ('transaction', models.ForeignKey(to='lingo.Transaction')),
+                ('transaction', models.ForeignKey(to='lingo.Transaction', on_delete=models.CASCADE)),
             ],
         ),
     ]
diff --git a/combo/apps/lingo/migrations/0024_selfdeclaredinvoicepayment.py b/combo/apps/lingo/migrations/0024_selfdeclaredinvoicepayment.py
index cfb06c5..34a4fe4 100644
--- a/combo/apps/lingo/migrations/0024_selfdeclaredinvoicepayment.py
+++ b/combo/apps/lingo/migrations/0024_selfdeclaredinvoicepayment.py
@@ -27,7 +27,7 @@ class Migration(migrations.Migration):
                 ('title', models.CharField(max_length=200, verbose_name='Title', blank=True)),
                 ('text', ckeditor.fields.RichTextField(null=True, verbose_name='Text', blank=True)),
                 ('groups', models.ManyToManyField(to='auth.Group', verbose_name='Groups', blank=True)),
-                ('page', models.ForeignKey(to='data.Page')),
+                ('page', models.ForeignKey(to='data.Page', on_delete=models.CASCADE)),
             ],
             options={
                 'verbose_name': 'Self declared invoice payment',
diff --git a/combo/apps/lingo/migrations/0025_auto_20161206_1713.py b/combo/apps/lingo/migrations/0025_auto_20161206_1713.py
index 7021496..6b01fc7 100644
--- a/combo/apps/lingo/migrations/0025_auto_20161206_1713.py
+++ b/combo/apps/lingo/migrations/0025_auto_20161206_1713.py
@@ -15,6 +15,6 @@ class Migration(migrations.Migration):
         migrations.AlterField(
             model_name='basketitem',
             name='user',
-            field=models.ForeignKey(to=settings.AUTH_USER_MODEL, null=True),
+            field=models.ForeignKey(to=settings.AUTH_USER_MODEL, null=True, on_delete=models.CASCADE),
         ),
     ]
diff --git a/combo/apps/lingo/migrations/0028_tipipaymentformcell.py b/combo/apps/lingo/migrations/0028_tipipaymentformcell.py
index 93b835a..63a3ed0 100644
--- a/combo/apps/lingo/migrations/0028_tipipaymentformcell.py
+++ b/combo/apps/lingo/migrations/0028_tipipaymentformcell.py
@@ -31,7 +31,7 @@ class Migration(migrations.Migration):
                 ('control_protocol', models.CharField(default=b'pesv2', max_length=8, verbose_name='Control protocol', choices=[(b'pesv2', 'Indigo/PES v2'), (b'rolmre', 'ROLMRE')])),
                 ('test_mode', models.BooleanField(default=False, verbose_name='Test mode')),
                 ('groups', models.ManyToManyField(to='auth.Group', verbose_name='Groups', blank=True)),
-                ('page', models.ForeignKey(to='data.Page')),
+                ('page', models.ForeignKey(to='data.Page', on_delete=models.CASCADE)),
             ],
             options={
                 'verbose_name': 'TIPI Payment Form',
diff --git a/combo/apps/lingo/models.py b/combo/apps/lingo/models.py
index 0619967..ed83712 100644
--- a/combo/apps/lingo/models.py
+++ b/combo/apps/lingo/models.py
@@ -328,8 +328,8 @@ class Regie(models.Model):
 
 
 class BasketItem(models.Model):
-    user = models.ForeignKey(settings.AUTH_USER_MODEL, null=True)
-    regie = models.ForeignKey(Regie)
+    user = models.ForeignKey(settings.AUTH_USER_MODEL, on_delete=models.CASCADE, null=True)
+    regie = models.ForeignKey(Regie, on_delete=models.CASCADE)
     subject = models.CharField(verbose_name=_('Subject'), max_length=200)
     source_url = models.URLField(_('Source URL'), blank=True)
     details = models.TextField(verbose_name=_('Details'), blank=True)
@@ -427,7 +427,7 @@ class RemoteItem(object):
 
 
 class Transaction(models.Model):
-    regie = models.ForeignKey(Regie, null=True)
+    regie = models.ForeignKey(Regie, on_delete=models.CASCADE, null=True)
     items = models.ManyToManyField(BasketItem, blank=True)
     remote_items = models.CharField(max_length=512)
     to_be_paid_remote_items = models.CharField(max_length=512, null=True)
@@ -436,7 +436,7 @@ class Transaction(models.Model):
     bank_data = JSONField(blank=True)
     order_id = models.CharField(max_length=200)
     bank_transaction_id = models.CharField(max_length=200, null=True)
-    user = models.ForeignKey(settings.AUTH_USER_MODEL, null=True)
+    user = models.ForeignKey(settings.AUTH_USER_MODEL, on_delete=models.CASCADE, null=True)
     status = models.IntegerField(null=True)
     amount = models.DecimalField(default=0, max_digits=7, decimal_places=2)
 
@@ -504,7 +504,7 @@ class TransactionOperation(models.Model):
         ('validation', _('Validation')),
         ('cancellation', _('Cancellation')),
     ]
-    transaction = models.ForeignKey(Transaction)
+    transaction = models.ForeignKey(Transaction, on_delete=models.CASCADE)
     kind = models.CharField(max_length=65, choices=OPERATIONS)
     amount = models.DecimalField(decimal_places=2, max_digits=8)
     creation_date = models.DateTimeField(auto_now_add=True)
diff --git a/combo/apps/maps/migrations/0002_map.py b/combo/apps/maps/migrations/0002_map.py
index de86c1e..fe40bb6 100644
--- a/combo/apps/maps/migrations/0002_map.py
+++ b/combo/apps/maps/migrations/0002_map.py
@@ -30,7 +30,7 @@ class Migration(migrations.Migration):
                 ('max_zoom', models.CharField(default=19, max_length=2, verbose_name='Maximal zoom level', choices=[(b'0', 'Whole world'), (b'9', 'Wide area'), (b'11', 'Area'), (b'13', 'Town'), (b'16', 'Small road'), (b'18', 'Neighbourhood'), (b'19', 'Ant')])),
                 ('groups', models.ManyToManyField(to='auth.Group', verbose_name='Groups', blank=True)),
                 ('layers', models.ManyToManyField(to='maps.MapLayer', verbose_name='Layers', blank=True)),
-                ('page', models.ForeignKey(to='data.Page')),
+                ('page', models.ForeignKey(to='data.Page', on_delete=models.CASCADE)),
             ],
             options={
                 'verbose_name': 'Map',
diff --git a/combo/apps/newsletters/migrations/0001_initial.py b/combo/apps/newsletters/migrations/0001_initial.py
index af7b209..74f5fba 100644
--- a/combo/apps/newsletters/migrations/0001_initial.py
+++ b/combo/apps/newsletters/migrations/0001_initial.py
@@ -26,7 +26,7 @@ class Migration(migrations.Migration):
                 ('resources_restrictions', models.CharField(help_text='list of resources(themes) separated by commas', max_length=1024, verbose_name='resources restrictions', blank=True)),
                 ('transports_restrictions', models.CharField(help_text='list of transports separated by commas', max_length=1024, verbose_name='transports restrictions', blank=True)),
                 ('groups', models.ManyToManyField(to='auth.Group', verbose_name='Groups', blank=True)),
-                ('page', models.ForeignKey(to='data.Page')),
+                ('page', models.ForeignKey(to='data.Page', on_delete=models.CASCADE)),
             ],
             options={
                 'verbose_name': 'Newsletters',
diff --git a/combo/apps/notifications/migrations/0001_initial.py b/combo/apps/notifications/migrations/0001_initial.py
index 838389c..4d33b0a 100644
--- a/combo/apps/notifications/migrations/0001_initial.py
+++ b/combo/apps/notifications/migrations/0001_initial.py
@@ -24,7 +24,7 @@ class Migration(migrations.Migration):
                 ('end_timestamp', models.DateTimeField(verbose_name='End date and time')),
                 ('acked', models.BooleanField(default=False, verbose_name='Acked')),
                 ('external_id', models.SlugField(null=True, verbose_name='External identifier')),
-                ('user', models.ForeignKey(to=settings.AUTH_USER_MODEL)),
+                ('user', models.ForeignKey(to=settings.AUTH_USER_MODEL, on_delete=models.CASCADE)),
             ],
             options={
                 'verbose_name': 'Notification',
@@ -41,7 +41,7 @@ class Migration(migrations.Migration):
                 ('public', models.BooleanField(default=True, verbose_name='Public')),
                 ('restricted_to_unlogged', models.BooleanField(default=False, verbose_name='Restrict to unlogged users')),
                 ('groups', models.ManyToManyField(to='auth.Group', verbose_name='Groups', blank=True)),
-                ('page', models.ForeignKey(to='data.Page')),
+                ('page', models.ForeignKey(to='data.Page', on_delete=models.CASCADE)),
             ],
             options={
                 'verbose_name': 'User Notifications',
diff --git a/combo/apps/pwa/models.py b/combo/apps/pwa/models.py
index 997f784..49afb5e 100644
--- a/combo/apps/pwa/models.py
+++ b/combo/apps/pwa/models.py
@@ -104,8 +104,9 @@ class PwaSettings(models.Model):
 class PwaNavigationEntry(models.Model):
     label = models.CharField(verbose_name=_('Label'), max_length=150, blank=True)
     url = models.CharField(verbose_name=_('External URL'), max_length=200, blank=True)
-    link_page = models.ForeignKey('data.Page', blank=True,
-            null=True, verbose_name=_('Internal link'))
+    link_page = models.ForeignKey(
+        'data.Page', on_delete=models.CASCADE, blank=True,
+        null=True, verbose_name=_('Internal link'))
     icon = models.FileField(_('Icon'), upload_to='pwa', blank=True, null=True)
     extra_css_class = models.CharField(_('Extra classes for CSS styling'), max_length=100, blank=True)
     order = models.PositiveIntegerField()
diff --git a/combo/apps/search/migrations/0001_initial.py b/combo/apps/search/migrations/0001_initial.py
index 23f780a..d79a7d0 100644
--- a/combo/apps/search/migrations/0001_initial.py
+++ b/combo/apps/search/migrations/0001_initial.py
@@ -24,7 +24,7 @@ class Migration(migrations.Migration):
                 ('last_update_timestamp', models.DateTimeField(auto_now=True)),
                 ('_search_service', models.CharField(max_length=64, verbose_name='Search Service')),
                 ('groups', models.ManyToManyField(to='auth.Group', verbose_name='Groups', blank=True)),
-                ('page', models.ForeignKey(to='data.Page')),
+                ('page', models.ForeignKey(to='data.Page', on_delete=models.CASCADE)),
             ],
             options={
                 'verbose_name': 'Search',
diff --git a/combo/apps/usersearch/migrations/0001_initial.py b/combo/apps/usersearch/migrations/0001_initial.py
index 8873287..ecbeb54 100644
--- a/combo/apps/usersearch/migrations/0001_initial.py
+++ b/combo/apps/usersearch/migrations/0001_initial.py
@@ -22,7 +22,7 @@ class Migration(migrations.Migration):
                 ('public', models.BooleanField(default=True, verbose_name='Public')),
                 ('restricted_to_unlogged', models.BooleanField(default=False, verbose_name='Restrict to unlogged users')),
                 ('groups', models.ManyToManyField(to='auth.Group', verbose_name='Groups', blank=True)),
-                ('page', models.ForeignKey(to='data.Page')),
+                ('page', models.ForeignKey(to='data.Page', on_delete=models.CASCADE)),
             ],
             options={
                 'verbose_name': 'User Search',
diff --git a/combo/apps/wcs/migrations/0001_initial.py b/combo/apps/wcs/migrations/0001_initial.py
index b958e06..de28a32 100644
--- a/combo/apps/wcs/migrations/0001_initial.py
+++ b/combo/apps/wcs/migrations/0001_initial.py
@@ -25,8 +25,8 @@ class Migration(migrations.Migration):
                 ('cached_description', models.TextField(verbose_name='Description', blank=True)),
                 ('cached_url', models.URLField(verbose_name='Cached URL')),
                 ('groups', models.ManyToManyField(to='auth.Group', verbose_name='Groups', blank=True)),
-                ('link_page', models.ForeignKey(related_name='link', to='data.Page', null=True)),
-                ('page', models.ForeignKey(to='data.Page')),
+                ('link_page', models.ForeignKey(related_name='link', to='data.Page', null=True, on_delete=models.CASCADE)),
+                ('page', models.ForeignKey(to='data.Page', on_delete=models.CASCADE)),
             ],
             options={
                 'verbose_name': 'Category Link',
@@ -42,7 +42,7 @@ class Migration(migrations.Migration):
                 ('public', models.BooleanField(default=True, verbose_name='Public')),
                 ('wcs_site', models.CharField(max_length=50, verbose_name='Site')),
                 ('groups', models.ManyToManyField(to='auth.Group', verbose_name='Groups', blank=True)),
-                ('page', models.ForeignKey(to='data.Page')),
+                ('page', models.ForeignKey(to='data.Page', on_delete=models.CASCADE)),
             ],
             options={
                 'verbose_name': 'Current Drafts',
@@ -58,7 +58,7 @@ class Migration(migrations.Migration):
                 ('public', models.BooleanField(default=True, verbose_name='Public')),
                 ('wcs_site', models.CharField(max_length=50, verbose_name='Site')),
                 ('groups', models.ManyToManyField(to='auth.Group', verbose_name='Groups', blank=True)),
-                ('page', models.ForeignKey(to='data.Page')),
+                ('page', models.ForeignKey(to='data.Page', on_delete=models.CASCADE)),
             ],
             options={
                 'verbose_name': 'Current Forms',
@@ -76,7 +76,7 @@ class Migration(migrations.Migration):
                 ('cached_title', models.CharField(max_length=50, verbose_name='Title')),
                 ('cached_url', models.URLField(verbose_name='URL')),
                 ('groups', models.ManyToManyField(to='auth.Group', verbose_name='Groups', blank=True)),
-                ('page', models.ForeignKey(to='data.Page')),
+                ('page', models.ForeignKey(to='data.Page', on_delete=models.CASCADE)),
             ],
             options={
                 'verbose_name': 'Form Link',
@@ -97,7 +97,7 @@ class Migration(migrations.Migration):
                 ('ordering', models.CharField(default=b'', max_length=20, verbose_name='Order', blank=True, choices=[(b'', 'Default'), (b'alpha', 'Alphabetical'), (b'popularity', 'Popularity')])),
                 ('limit', models.PositiveSmallIntegerField(null=True, verbose_name='Limit', blank=True)),
                 ('groups', models.ManyToManyField(to='auth.Group', verbose_name='Groups', blank=True)),
-                ('page', models.ForeignKey(to='data.Page')),
+                ('page', models.ForeignKey(to='data.Page', on_delete=models.CASCADE)),
             ],
             options={
                 'verbose_name': 'Forms of Category',
diff --git a/combo/apps/wcs/migrations/0006_categoriescell.py b/combo/apps/wcs/migrations/0006_categoriescell.py
index 67fbb4f..f2200f8 100644
--- a/combo/apps/wcs/migrations/0006_categoriescell.py
+++ b/combo/apps/wcs/migrations/0006_categoriescell.py
@@ -24,7 +24,7 @@ class Migration(migrations.Migration):
                 ('public', models.BooleanField(default=True, verbose_name='Public')),
                 ('wcs_site', models.CharField(max_length=50, verbose_name='Site', blank=True)),
                 ('groups', models.ManyToManyField(to='auth.Group', verbose_name='Groups', blank=True)),
-                ('page', models.ForeignKey(to='data.Page')),
+                ('page', models.ForeignKey(to='data.Page', on_delete=models.CASCADE)),
             ],
             options={
                 'verbose_name': 'Form Categories',
diff --git a/combo/apps/wcs/migrations/0007_trackingcodeinputcell.py b/combo/apps/wcs/migrations/0007_trackingcodeinputcell.py
index 64f4eb5..3f77569 100644
--- a/combo/apps/wcs/migrations/0007_trackingcodeinputcell.py
+++ b/combo/apps/wcs/migrations/0007_trackingcodeinputcell.py
@@ -23,7 +23,7 @@ class Migration(migrations.Migration):
                 ('public', models.BooleanField(default=True, verbose_name='Public')),
                 ('wcs_site', models.CharField(max_length=50, verbose_name='Site', blank=True)),
                 ('groups', models.ManyToManyField(to='auth.Group', verbose_name='Groups', blank=True)),
-                ('page', models.ForeignKey(to='data.Page')),
+                ('page', models.ForeignKey(to='data.Page', on_delete=models.CASCADE)),
             ],
             options={
                 'abstract': False,
diff --git a/combo/data/migrations/0001_initial.py b/combo/data/migrations/0001_initial.py
index d1b7685..7d90c6c 100644
--- a/combo/data/migrations/0001_initial.py
+++ b/combo/data/migrations/0001_initial.py
@@ -53,7 +53,7 @@ class Migration(migrations.Migration):
                 ('redirect_url', models.CharField(max_length=100, verbose_name='Redirect URL', blank=True)),
                 ('public', models.BooleanField(default=True, verbose_name='Public')),
                 ('groups', models.ManyToManyField(to='auth.Group', verbose_name='Groups', blank=True)),
-                ('parent', models.ForeignKey(blank=True, to='data.Page', null=True)),
+                ('parent', models.ForeignKey(blank=True, to='data.Page', null=True, on_delete=models.CASCADE)),
             ],
             options={
                 'ordering': ['order'],
@@ -69,7 +69,7 @@ class Migration(migrations.Migration):
                 ('public', models.BooleanField(default=True, verbose_name='Public')),
                 ('text', ckeditor.fields.RichTextField(null=True, verbose_name='Text')),
                 ('groups', models.ManyToManyField(to='auth.Group', verbose_name='Groups', blank=True)),
-                ('page', models.ForeignKey(to='data.Page')),
+                ('page', models.ForeignKey(to='data.Page', on_delete=models.CASCADE)),
             ],
             options={
                 'verbose_name': 'Text',
@@ -84,7 +84,7 @@ class Migration(migrations.Migration):
                 ('order', models.PositiveIntegerField()),
                 ('public', models.BooleanField(default=True, verbose_name='Public')),
                 ('groups', models.ManyToManyField(to='auth.Group', verbose_name='Groups', blank=True)),
-                ('page', models.ForeignKey(to='data.Page')),
+                ('page', models.ForeignKey(to='data.Page', on_delete=models.CASCADE)),
             ],
             options={
                 'verbose_name': 'Unlock Marker',
@@ -94,13 +94,13 @@ class Migration(migrations.Migration):
         migrations.AddField(
             model_name='fortunecell',
             name='page',
-            field=models.ForeignKey(to='data.Page'),
+            field=models.ForeignKey(to='data.Page', on_delete=models.CASCADE),
             preserve_default=True,
         ),
         migrations.AddField(
             model_name='blurpcell',
             name='page',
-            field=models.ForeignKey(to='data.Page'),
+            field=models.ForeignKey(to='data.Page', on_delete=models.CASCADE),
             preserve_default=True,
         ),
     ]
diff --git a/combo/data/migrations/0003_menucell.py b/combo/data/migrations/0003_menucell.py
index e181260..9f7b954 100644
--- a/combo/data/migrations/0003_menucell.py
+++ b/combo/data/migrations/0003_menucell.py
@@ -21,7 +21,7 @@ class Migration(migrations.Migration):
                 ('slug', models.SlugField(verbose_name='Slug', blank=True)),
                 ('public', models.BooleanField(default=True, verbose_name='Public')),
                 ('groups', models.ManyToManyField(to='auth.Group', verbose_name='Groups', blank=True)),
-                ('page', models.ForeignKey(to='data.Page')),
+                ('page', models.ForeignKey(to='data.Page', on_delete=models.CASCADE)),
             ],
             options={
                 'verbose_name': 'Menu',
diff --git a/combo/data/migrations/0006_linkcell.py b/combo/data/migrations/0006_linkcell.py
index c7a90c5..0f1316e 100644
--- a/combo/data/migrations/0006_linkcell.py
+++ b/combo/data/migrations/0006_linkcell.py
@@ -23,7 +23,7 @@ class Migration(migrations.Migration):
                 ('title', models.CharField(max_length=150, verbose_name='Title')),
                 ('url', models.URLField(verbose_name='URL')),
                 ('groups', models.ManyToManyField(to='auth.Group', verbose_name='Groups', blank=True)),
-                ('page', models.ForeignKey(to='data.Page')),
+                ('page', models.ForeignKey(to='data.Page', on_delete=models.CASCADE)),
             ],
             options={
                 'verbose_name': 'Link',
diff --git a/combo/data/migrations/0007_auto_20150529_1003.py b/combo/data/migrations/0007_auto_20150529_1003.py
index 9a26b34..9a50f1f 100644
--- a/combo/data/migrations/0007_auto_20150529_1003.py
+++ b/combo/data/migrations/0007_auto_20150529_1003.py
@@ -20,7 +20,7 @@ class Migration(migrations.Migration):
         migrations.AddField(
             model_name='linkcell',
             name='link_page',
-            field=models.ForeignKey(related_name='link_cell', to='data.Page', null=True),
+            field=models.ForeignKey(related_name='link_cell', to='data.Page', null=True, on_delete=models.CASCADE),
             preserve_default=True,
         ),
         migrations.AlterField(
diff --git a/combo/data/migrations/0008_auto_20150529_1504.py b/combo/data/migrations/0008_auto_20150529_1504.py
index 9dae1a6..8b56dfa 100644
--- a/combo/data/migrations/0008_auto_20150529_1504.py
+++ b/combo/data/migrations/0008_auto_20150529_1504.py
@@ -14,7 +14,7 @@ class Migration(migrations.Migration):
         migrations.AlterField(
             model_name='linkcell',
             name='link_page',
-            field=models.ForeignKey(related_name='link_cell', blank=True, to='data.Page', null=True),
+            field=models.ForeignKey(related_name='link_cell', blank=True, to='data.Page', null=True, on_delete=models.CASCADE),
             preserve_default=True,
         ),
     ]
diff --git a/combo/data/migrations/0009_auto_20150529_2247.py b/combo/data/migrations/0009_auto_20150529_2247.py
index 1e3e17b..68658da 100644
--- a/combo/data/migrations/0009_auto_20150529_2247.py
+++ b/combo/data/migrations/0009_auto_20150529_2247.py
@@ -14,7 +14,7 @@ class Migration(migrations.Migration):
         migrations.AlterField(
             model_name='linkcell',
             name='link_page',
-            field=models.ForeignKey(related_name='link_cell', verbose_name='Internal link', blank=True, to='data.Page', null=True),
+            field=models.ForeignKey(related_name='link_cell', verbose_name='Internal link', blank=True, to='data.Page', null=True, on_delete=models.CASCADE),
             preserve_default=True,
         ),
     ]
diff --git a/combo/data/migrations/0010_feedcell.py b/combo/data/migrations/0010_feedcell.py
index e3df2f2..087cdf9 100644
--- a/combo/data/migrations/0010_feedcell.py
+++ b/combo/data/migrations/0010_feedcell.py
@@ -22,7 +22,7 @@ class Migration(migrations.Migration):
                 ('public', models.BooleanField(default=True, verbose_name='Public')),
                 ('url', models.URLField(verbose_name='URL', blank=True)),
                 ('groups', models.ManyToManyField(to='auth.Group', verbose_name='Groups', blank=True)),
-                ('page', models.ForeignKey(to='data.Page')),
+                ('page', models.ForeignKey(to='data.Page', on_delete=models.CASCADE)),
             ],
             options={
                 'verbose_name': 'RSS/Atom Feed',
diff --git a/combo/data/migrations/0013_parameterscell.py b/combo/data/migrations/0013_parameterscell.py
index ba85d38..24ff4a9 100644
--- a/combo/data/migrations/0013_parameterscell.py
+++ b/combo/data/migrations/0013_parameterscell.py
@@ -27,7 +27,7 @@ class Migration(migrations.Migration):
                 ('empty_label', models.CharField(default=b'---', max_length=64, verbose_name='Empty label')),
                 ('parameters', jsonfield.fields.JSONField(default=dict, help_text='Must be a JSON list, containing dictionaries with 3 keys: name, value and optionnally roles; name must be a string, value must be a dictionary and roles must a list of role names. Role names limit the visibility of the choice.', verbose_name='Parameters', blank=True)),
                 ('groups', models.ManyToManyField(to='auth.Group', verbose_name='Groups', blank=True)),
-                ('page', models.ForeignKey(to='data.Page')),
+                ('page', models.ForeignKey(to='data.Page', on_delete=models.CASCADE)),
             ],
             options={
                 'verbose_name': 'Parameters',
diff --git a/combo/data/migrations/0017_menucell_root_page.py b/combo/data/migrations/0017_menucell_root_page.py
index 37a378b..953b2dc 100644
--- a/combo/data/migrations/0017_menucell_root_page.py
+++ b/combo/data/migrations/0017_menucell_root_page.py
@@ -14,6 +14,6 @@ class Migration(migrations.Migration):
         migrations.AddField(
             model_name='menucell',
             name='root_page',
-            field=models.ForeignKey(related_name='root_page', verbose_name='Root Page', blank=True, to='data.Page', null=True),
+            field=models.ForeignKey(related_name='root_page', verbose_name='Root Page', blank=True, to='data.Page', null=True, on_delete=models.CASCADE),
         ),
     ]
diff --git a/combo/data/migrations/0018_parentcontentcell.py b/combo/data/migrations/0018_parentcontentcell.py
index 9b400af..39bea74 100644
--- a/combo/data/migrations/0018_parentcontentcell.py
+++ b/combo/data/migrations/0018_parentcontentcell.py
@@ -21,7 +21,7 @@ class Migration(migrations.Migration):
                 ('public', models.BooleanField(default=True, verbose_name='Public')),
                 ('restricted_to_unlogged', models.BooleanField(default=False, verbose_name='Restrict to unlogged users')),
                 ('groups', models.ManyToManyField(to='auth.Group', verbose_name='Groups', blank=True)),
-                ('page', models.ForeignKey(to='data.Page')),
+                ('page', models.ForeignKey(to='data.Page', on_delete=models.CASCADE)),
             ],
             options={
                 'verbose_name': 'Same as parent',
diff --git a/combo/data/migrations/0021_jsoncell.py b/combo/data/migrations/0021_jsoncell.py
index 6637d6b..bbcceff 100644
--- a/combo/data/migrations/0021_jsoncell.py
+++ b/combo/data/migrations/0021_jsoncell.py
@@ -27,7 +27,7 @@ class Migration(migrations.Migration):
                 ('template_string', models.TextField(null=True, verbose_name='Display Template', blank=True, validators=[combo.data.models.django_template_validator])),
                 ('cache_duration', models.PositiveIntegerField(default=60, verbose_name='Cache duration')),
                 ('groups', models.ManyToManyField(to='auth.Group', verbose_name='Groups', blank=True)),
-                ('page', models.ForeignKey(to='data.Page')),
+                ('page', models.ForeignKey(to='data.Page', on_delete=models.CASCADE)),
             ],
             options={
                 'verbose_name': 'JSON Prototype',
diff --git a/combo/data/migrations/0024_configjsoncell.py b/combo/data/migrations/0024_configjsoncell.py
index 707602d..15751aa 100644
--- a/combo/data/migrations/0024_configjsoncell.py
+++ b/combo/data/migrations/0024_configjsoncell.py
@@ -27,7 +27,7 @@ class Migration(migrations.Migration):
                 ('key', models.CharField(max_length=50)),
                 ('parameters', jsonfield.fields.JSONField(default=dict, blank=True)),
                 ('groups', models.ManyToManyField(to='auth.Group', verbose_name='Groups', blank=True)),
-                ('page', models.ForeignKey(to='data.Page')),
+                ('page', models.ForeignKey(to='data.Page', on_delete=models.CASCADE)),
             ],
             options={
                 'abstract': False,
diff --git a/combo/data/models.py b/combo/data/models.py
index 66b9393..e4c0483 100644
--- a/combo/data/models.py
+++ b/combo/data/models.py
@@ -131,7 +131,7 @@ class Page(models.Model):
                         ))
     description = models.TextField(_('Description'), blank=True)
     template_name = models.CharField(_('Template'), max_length=50)
-    parent = models.ForeignKey('self', null=True, blank=True)
+    parent = models.ForeignKey('self', on_delete=models.CASCADE, null=True, blank=True)
     order = models.PositiveIntegerField()
     exclude_from_navigation = models.BooleanField(_('Exclude from navigation'), default=False)
     redirect_url = models.CharField(_('Redirect URL'), max_length=200, blank=True)
@@ -438,7 +438,7 @@ class Page(models.Model):
 class PageSnapshot(models.Model):
     page = models.ForeignKey(Page, on_delete=models.SET_NULL, null=True)
     timestamp = models.DateTimeField(auto_now_add=True)
-    user = models.ForeignKey(settings.AUTH_USER_MODEL, null=True)
+    user = models.ForeignKey(settings.AUTH_USER_MODEL, on_delete=models.CASCADE, null=True)
     comment = models.TextField(blank=True, null=True)
     serialization = JSONField(blank=True)
 
@@ -475,7 +475,7 @@ class PageSnapshot(models.Model):
 
 class Redirect(models.Model):
     old_url = models.CharField(max_length=512)
-    page = models.ForeignKey(Page)
+    page = models.ForeignKey(Page, on_delete=models.CASCADE)
     creation_timestamp = models.DateTimeField(auto_now_add=True)
 
     class Meta:
@@ -489,7 +489,7 @@ class CellMeta(MediaDefiningClass, ModelBase):
 @python_2_unicode_compatible
 class CellBase(six.with_metaclass(CellMeta, models.Model)):
 
-    page = models.ForeignKey(Page)
+    page = models.ForeignKey(Page, on_delete=models.CASCADE)
     placeholder = models.CharField(max_length=20)
     order = models.PositiveIntegerField()
     slug = models.SlugField(_('Slug'), blank=True)
@@ -828,7 +828,7 @@ class MenuCell(CellBase):
     initial_level = models.IntegerField(_('Initial Level'),
             choices=[(-1, _('Same as page'))] +
                     [(i, i) for i in range(1, 3)], default=-1, null=False)
-    root_page = models.ForeignKey(Page, related_name='root_page',
+    root_page = models.ForeignKey(Page, on_delete=models.CASCADE, related_name='root_page',
             null=True, blank=True, verbose_name=_('Root Page'))
 
     template_name = 'combo/menu-cell.html'
@@ -856,8 +856,9 @@ class MenuCell(CellBase):
 class LinkCell(CellBase):
     title = models.CharField(_('Title'), max_length=150, blank=True)
     url = models.CharField(_('URL'), max_length=200, blank=True)
-    link_page = models.ForeignKey('data.Page', related_name='link_cell', blank=True,
-            null=True, verbose_name=_('Internal link'))
+    link_page = models.ForeignKey(
+        'data.Page', on_delete=models.CASCADE, related_name='link_cell', blank=True,
+        null=True, verbose_name=_('Internal link'))
     anchor = models.CharField(_('Anchor'), max_length=150, blank=True)
 
     template_name = 'combo/link-cell.html'
diff --git a/combo/profile/migrations/0001_initial.py b/combo/profile/migrations/0001_initial.py
index 2bc4891..11dc668 100644
--- a/combo/profile/migrations/0001_initial.py
+++ b/combo/profile/migrations/0001_initial.py
@@ -17,7 +17,7 @@ class Migration(migrations.Migration):
             fields=[
                 ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
                 ('initial_login_view_timestamp', models.DateTimeField(null=True)),
-                ('user', models.OneToOneField(to=settings.AUTH_USER_MODEL)),
+                ('user', models.OneToOneField(to=settings.AUTH_USER_MODEL, on_delete=models.CASCADE)),
             ],
         ),
     ]
diff --git a/combo/profile/models.py b/combo/profile/models.py
index 229b0c6..1bcc84d 100644
--- a/combo/profile/models.py
+++ b/combo/profile/models.py
@@ -27,7 +27,7 @@ from combo.data.library import register_cell_class
 
 
 class Profile(models.Model):
-    user = models.OneToOneField(settings.AUTH_USER_MODEL)
+    user = models.OneToOneField(settings.AUTH_USER_MODEL, on_delete=models.CASCADE)
     initial_login_view_timestamp = models.DateTimeField(null=True)
 
 
-- 
2.20.1

