From fb68643165d7ec61ab72d9d5d43b7e8055559e63 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Stefan=20K=C3=B6gl?= Date: Fri, 22 Aug 2014 15:58:08 +0200 Subject: [PATCH] [DB] create additional episodes index --- mygpo/podcasts/migrations/0024_episodes_index.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 mygpo/podcasts/migrations/0024_episodes_index.py diff --git a/mygpo/podcasts/migrations/0024_episodes_index.py b/mygpo/podcasts/migrations/0024_episodes_index.py new file mode 100644 index 00000000..4cc09674 --- /dev/null +++ b/mygpo/podcasts/migrations/0024_episodes_index.py @@ -0,0 +1,19 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.db import models, migrations +import django.db.models.deletion + + +class Migration(migrations.Migration): + + dependencies = [ + ('podcasts', '0023_auto_20140729_1711'), + ] + + operations = [ + migrations.RunSQL( + sql = 'CREATE INDEX episodes_podcast_hasreleased ON podcasts_episode (podcast_id, (released IS NOT NULL) DESC, released DESC);', + reverse_sql = 'DROP INDEX IF EXISTS episodes_podcast_hasreleased;', + ) + ] -- 2.11.4.GIT