-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
85d3ada
commit 5598e00
Showing
2 changed files
with
64 additions
and
21 deletions.
There are no files selected for viewing
33 changes: 33 additions & 0 deletions
33
...nd/alembic/versions/2023_06_11_1544-d18213c629be_add_search_vector_update_date_indexes.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
"""Add search vector update date, indexes | ||
Revision ID: d18213c629be | ||
Revises: c181661eba3a | ||
Create Date: 2023-06-11 15:44:49.911455 | ||
""" | ||
import sqlalchemy as sa | ||
from alembic import op | ||
|
||
# revision identifiers, used by Alembic. | ||
revision = "d18213c629be" | ||
down_revision = "c181661eba3a" | ||
branch_labels = None | ||
depends_on = None | ||
|
||
|
||
def upgrade() -> None: | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
op.add_column("message", sa.Column("search_vector_update_date", sa.DateTime(timezone=True), nullable=True)) | ||
op.create_index( | ||
op.f("ix_message_search_vector_update_date"), "message", ["search_vector_update_date"], unique=False | ||
) | ||
op.create_index(op.f("ix_message_revision_created_date"), "message_revision", ["created_date"], unique=False) | ||
# ### end Alembic commands ### | ||
|
||
|
||
def downgrade() -> None: | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
op.drop_index(op.f("ix_message_revision_created_date"), table_name="message_revision") | ||
op.drop_index(op.f("ix_message_search_vector_update_date"), table_name="message") | ||
op.drop_column("message", "search_vector_update_date") | ||
# ### end Alembic commands ### |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters