forked from ASKBOT/askbot-devel
-
Notifications
You must be signed in to change notification settings - Fork 19
/
Copy path0004_auto_20151219_0751.py
37 lines (30 loc) · 1.13 KB
/
0004_auto_20151219_0751.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from askbot.search.postgresql import setup_full_text_search
from django.db import models, migrations
import askbot
import os.path
def init_postgresql_fts(apps, schema_editor):
conn = schema_editor.connection
if hasattr(conn, 'vendor') and conn.vendor == 'postgresql':
script_path = os.path.join(
askbot.get_install_directory(),
'search',
'postgresql',
'thread_and_post_models_10032013.plsql'
)
setup_full_text_search(script_path)
script_path = os.path.join(
askbot.get_install_directory(),
'search',
'postgresql',
'user_profile_search_12192015.plsql'
)
setup_full_text_search(script_path)
class Migration(migrations.Migration):
dependencies = [
('askbot', '0003_auto_20151218_0909'),
]
operations = [
migrations.RunPython(init_postgresql_fts)
]