[DB] create additional episodes index
[mygpo.git] / mygpo / podcasts / migrations / 0024_episodes_index.py
blob4cc096749e304b8efbef837fd5b74598ba994870
1 # -*- coding: utf-8 -*-
2 from __future__ import unicode_literals
4 from django.db import models, migrations
5 import django.db.models.deletion
8 class Migration(migrations.Migration):
10 dependencies = [
11 ('podcasts', '0023_auto_20140729_1711'),
14 operations = [
15 migrations.RunSQL(
16 sql = 'CREATE INDEX episodes_podcast_hasreleased ON podcasts_episode (podcast_id, (released IS NOT NULL) DESC, released DESC);',
17 reverse_sql = 'DROP INDEX IF EXISTS episodes_podcast_hasreleased;',