diff --git a/app/model/db/idx_e2e_messaging.py b/app/model/db/idx_e2e_messaging.py index ea4f054d..77df6d6e 100644 --- a/app/model/db/idx_e2e_messaging.py +++ b/app/model/db/idx_e2e_messaging.py @@ -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 diff --git a/migrations/versions/102b3b000e56_v23_3_0.py b/migrations/versions/102b3b000e56_v23_3_0.py new file mode 100644 index 00000000..4d1050ed --- /dev/null +++ b/migrations/versions/102b3b000e56_v23_3_0.py @@ -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 ###