zulip/zephyr/migrations
Zev Benjamin c6d196a22f [manual] Add South migration for creating a Postgres full text index of messages
This schema migration is only for use in automated migrations.  To
deploy on the production database (the migration only needs to be
done once for both of staging and prod because they share a
database), you should instead execute the following SQL manually:

$ ssh postgres.humbughq.com
$ psql
humbug=> CREATE INDEX CONCURRENTLY zephyr_message_full_text_idx ON zephyr_message USING gin(to_tsvector('english', subject || ' ' || content));

Note the addition of the "CONCURRENTLY" keyword.  The problem is that
creating the index takes non-trivial time and requires a write lock
on the table while the index is being created.  This would mean that
users would be unable to send messages while we were generating the
index, which isn't acceptable.  We can't create the index
concurrently in the South migration because concurrent index
creations can't happen inside of a transaction and South forces a
transaction on migration functions.

Also note that this index must be created before Postgres full text
search is deployed to the app because full text search without an index
is actually much slower than plain search using the LIKE operator.

(imported from commit 8b9445c27d0e427278de997b22342bffe6d855b7)
2013-01-31 15:57:45 -05:00
..
0001_initial.py Include autogenerated initial migrations for South. 2013-01-08 18:14:39 -05:00
0002_auto__add_field_preregistrationuser_referred_by__add_field_preregistra.py [south] Migration for PreregistrationUser 2013-01-14 10:25:26 -05:00
0003_auto__add_field_stream_invite_only.py [schema][manual] Add schema invite_only flag for streams 2013-01-24 17:34:21 -05:00
0004_add_postgres_zephyr_message_full_text_idx.py [manual] Add South migration for creating a Postgres full text index of messages 2013-01-31 15:57:45 -05:00
__init__.py Include autogenerated initial migrations for South. 2013-01-08 18:14:39 -05:00