summaryrefslogtreecommitdiffstats
path: root/askbot/migrations
diff options
context:
space:
mode:
authorEvgeny Fadeev <evgeny.fadeev@gmail.com>2012-11-27 13:26:10 -0300
committerEvgeny Fadeev <evgeny.fadeev@gmail.com>2012-11-27 13:26:10 -0300
commit4cfbf119df744c5d867a9d5195b5e40d9d91f99e (patch)
treee93772a475bbf62115d54dc6b2a92afb82b31566 /askbot/migrations
parentb719aefcbe92886b1ac49f7de420f283f9811f57 (diff)
downloadaskbot-4cfbf119df744c5d867a9d5195b5e40d9d91f99e.tar.gz
askbot-4cfbf119df744c5d867a9d5195b5e40d9d91f99e.tar.bz2
askbot-4cfbf119df744c5d867a9d5195b5e40d9d91f99e.zip
added title full text search indices for postgresql and mysql
Diffstat (limited to 'askbot/migrations')
-rw-r--r--askbot/migrations/0157_add_title_search_indices_for_postgresql_and_mysql.py (renamed from askbot/migrations/0157_update_mysql_search_indexes.py)11
1 files changed, 11 insertions, 0 deletions
diff --git a/askbot/migrations/0157_update_mysql_search_indexes.py b/askbot/migrations/0157_add_title_search_indices_for_postgresql_and_mysql.py
index 2c9679a9..f2351a02 100644
--- a/askbot/migrations/0157_update_mysql_search_indexes.py
+++ b/askbot/migrations/0157_add_title_search_indices_for_postgresql_and_mysql.py
@@ -1,11 +1,14 @@
# -*- coding: utf-8 -*-
+import askbot
import datetime
+import os
from south.db import db
from south.v2 import DataMigration
from django.db import models
from askbot.migrations_api import mysql_table_supports_full_text_search
from askbot.migrations_api import get_drop_index_sql
from askbot.migrations_api import get_create_full_text_index_sql
+from askbot.search import postgresql
INDEX_NAME = 'askbot_thread_search_index'
@@ -20,6 +23,14 @@ class Migration(DataMigration):
columns = ('title', 'tagnames')
sql = get_create_full_text_index_sql(INDEX_NAME, table_name, columns)
db.execute(sql)
+ elif db.backend_name == 'postgres':
+ script_path = os.path.join(
+ askbot.get_install_directory(),
+ 'search',
+ 'postgresql',
+ 'thread_and_post_models_27112012.plsql'
+ )
+ postgresql.setup_full_text_search(script_path)
def backwards(self, orm):
"Write your backwards methods here."