Skip to content

Commit

Permalink
Merge pull request #446 from BoostryJP/fix/add_e2em_index
Browse files Browse the repository at this point in the history
fix: Add index to idx_e2e_messaging
  • Loading branch information
YoshihitoAso authored Dec 28, 2022
2 parents 102a455 + f2b343d commit bbb4727
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 1 deletion.
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 ###

0 comments on commit bbb4727

Please sign in to comment.