Skip to content

Commit

Permalink
XXX removing book_authors_search_vector_trigger tests pass?
Browse files Browse the repository at this point in the history
  • Loading branch information
dato committed Nov 25, 2023
1 parent 7472383 commit 4594de3
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,18 @@
# it's _very_ convenient for development that this migration be reversible
search_vector_trigger = trigger_migration.Migration.operations[4]
author_search_vector_trigger = trigger_migration.Migration.operations[5]
book_authors_search_vector_trigger = trigger_migration.Migration.operations[6]


assert re.search(r"\bCREATE TRIGGER search_vector_trigger\b", search_vector_trigger.sql)
assert re.search(
r"\bCREATE TRIGGER author_search_vector_trigger\b",
author_search_vector_trigger.sql,
)
assert re.search(
r"\bCREATE TRIGGER book_authors_search_vector_trigger\b",
book_authors_search_vector_trigger.sql,
)


class Migration(migrations.Migration):
Expand Down Expand Up @@ -67,4 +72,11 @@ class Migration(migrations.Migration):
""",
reverse_sql=author_search_vector_trigger.sql,
),
migrations.RunSQL(
# XXX not migrated yet
sql="""DROP TRIGGER IF EXISTS book_authors_search_vector_trigger ON bookwyrm_book_authors;
DROP FUNCTION IF EXISTS book_authors_trigger;
""",
reverse_sql=book_authors_search_vector_trigger.sql,
),
]
1 change: 1 addition & 0 deletions bookwyrm/models/book.py
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,7 @@ def __repr__(self):

class Meta:
"""set up indexes and triggers"""

# pylint: disable=line-too-long

indexes = (GinIndex(fields=["search_vector"]),)
Expand Down

0 comments on commit 4594de3

Please sign in to comment.