migrations: Remove pgroonga check for postgres database.

Zulip has only supported postgres for a long time, and this is
unlikely to change, so this code was just extra clutter.
This commit is contained in:
Tim Abbott 2021-05-27 16:21:40 -07:00 committed by Tim Abbott
parent 7a4c212dff
commit e0992c85fb
1 changed files with 17 additions and 19 deletions

View File

@ -9,12 +9,12 @@ class Migration(migrations.Migration):
]
database_setting = settings.DATABASES["default"]
if "postgres" in database_setting["ENGINE"]:
operations = [
migrations.RunSQL(
[
(
"""
operations = [
migrations.RunSQL(
[
(
"""
DO $$BEGIN
EXECUTE format('ALTER ROLE %%I SET search_path TO %%L,public,pgroonga,pg_catalog', %(USER)s, %(SCHEMA)s);
@ -29,12 +29,12 @@ CREATE INDEX zerver_message_search_pgroonga ON zerver_message
USING pgroonga(search_pgroonga pgroonga.text_full_text_search_ops);
END$$
""",
database_setting,
)
],
[
(
"""
database_setting,
)
],
[
(
"""
DO $$BEGIN
SET search_path = %(SCHEMA)s,public,pgroonga,pg_catalog;
@ -46,10 +46,8 @@ SET search_path = %(SCHEMA)s,public;
EXECUTE format('ALTER ROLE %%I SET search_path TO %%L,public', %(USER)s, %(SCHEMA)s);
END$$
""",
database_setting,
)
],
),
]
else:
operations = []
database_setting,
)
],
),
]