Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Add index to idx_e2e_messaging #446

Merged
merged 2 commits into from
Dec 28, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/model/db/idx_e2e_messaging.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class IDXE2EMessaging(Base):
# to address
to_address = Column(String(42), index=True)
# type
type = Column(String(50), nullable=False)
type = Column(String(50), nullable=False, index=True)
# message
message = Column(String(5000), nullable=False)
# send timestamp
Expand Down
30 changes: 30 additions & 0 deletions migrations/versions/102b3b000e56_v23_3_0.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
"""v23_3_0

Revision ID: 102b3b000e56
Revises: ff1d28df9f37
Create Date: 2022-12-28 14:16:11.566526

"""
from alembic import op
import sqlalchemy as sa


from app.database import get_db_schema

# revision identifiers, used by Alembic.
revision = '102b3b000e56'
down_revision = 'ff1d28df9f37'
branch_labels = None
depends_on = None


def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.create_index(op.f('ix_idx_e2e_messaging_type'), 'idx_e2e_messaging', ['type'], unique=False, schema=get_db_schema())
# ### end Alembic commands ###


def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_index(op.f('ix_idx_e2e_messaging_type'), table_name='idx_e2e_messaging', schema=get_db_schema())
# ### end Alembic commands ###