aboutsummaryrefslogtreecommitdiffstats
path: root/alembic/versions/2faa292e5818_add_indexes_on_message_table.py
blob: 04f424c10b118e610cb44aa6610e08ff3d361183 (plain) (blame)
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
"""
Add indexes on message table.

Revision ID: 2faa292e5818
Revises: d052a6b677e6
Create Date: 2020-10-27 02:52:23.791738

"""

from alembic import op

# revision identifiers, used by Alembic.
revision = "2faa292e5818"
down_revision = "d052a6b677e6"
branch_labels = None
depends_on = None


def upgrade() -> None:
    """Apply the current migration."""
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_index(op.f("ix_messages_author_id"), "messages", ["author_id"], unique=False)
    op.create_index(op.f("ix_messages_channel_id"), "messages", ["channel_id"], unique=False)
    # ### end Alembic commands ###


def downgrade() -> None:
    """Revert the current migration."""
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_index(op.f("ix_messages_channel_id"), table_name="messages")
    op.drop_index(op.f("ix_messages_author_id"), table_name="messages")
    # ### end Alembic commands ###