@@ -0,0 +1,1297 @@
+# -*- coding: utf-8 -*-%0A# Generated by Django 1.9 on 2016-01-07 13:01%0Afrom __future__ import unicode_literals%0A%0Afrom django import db%0Afrom django.db import migrations, models%0Aimport django.db.models.deletion%0A%0Afrom djorm_pgfulltext.fields import VectorField%0A%0A# Add search indexes for %22text%22 and %22iati_identifier%22%0Aclass Migration(migrations.Migration):%0A%0A    dependencies = %5B%0A        ('iati', '0023_auto_20160325_0914'),%0A    %5D%0A%0A    def create_search_indexes(apps, schema_editor):%0A        def create_search_index(column_name):%0A            schema_editor.execute(%22CREATE INDEX %7Btable_name%7D_%7Bcolumn_name%7D_simple_tsv ON %7Btable_name%7D USING gin(%7Bcolumn_name%7D);%22.format(table_name='iati_activitysearch', column_name=column_name))%0A%0A        for column in %5B'iati_identifier', 'text'%5D:%0A            create_search_index(column)%0A%0A    def drop_search_indexes(apps, schema_editor):%0A        def drop_search_index(column_name):%0A            schema_editor.execute(%22DROP INDEX %7Btable_name%7D_%7Bcolumn_name%7D_simple_tsv ;%22.format(%0A                table_name='iati_activitysearch',%0A                column_name=column_name,%0A            ))%0A%0A        for column in %5B'iati_identifier', 'text'%5D:%0A            drop_search_index(column)%0A%0A    operations = %5B%0A        migrations.RunPython(create_search_indexes, drop_search_indexes),%0A    %5D%0A%0A

add full text indexes to iati_identifier and text fields