diff options
| author | Aurélien Bompard | 2015-12-02 11:49:19 +0100 |
|---|---|---|
| committer | Barry Warsaw | 2015-12-16 11:04:25 -0500 |
| commit | 85fcd4469703c2f234ed1a8554264f5d10151dcf (patch) | |
| tree | e5b2e70d4724188ffc5ca418e51193b8c03d4f6c /src/mailman/database | |
| parent | 08e22a84b5dd9c00373181068803c9d788c74eb9 (diff) | |
| download | mailman-85fcd4469703c2f234ed1a8554264f5d10151dcf.tar.gz mailman-85fcd4469703c2f234ed1a8554264f5d10151dcf.tar.zst mailman-85fcd4469703c2f234ed1a8554264f5d10151dcf.zip | |
Add indexes on the Pendable fields that can be queried upon.
- Pendable.token: queried in the add() and confirm() methods
- Pendable.expiration_date: queried on evict()
- PendableKeyValue.key and PendableKeyValue.value: queried in the find()
method
Diffstat (limited to 'src/mailman/database')
| -rw-r--r-- | src/mailman/database/alembic/versions/47294d3a604_pendable_indexes.py | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/src/mailman/database/alembic/versions/47294d3a604_pendable_indexes.py b/src/mailman/database/alembic/versions/47294d3a604_pendable_indexes.py new file mode 100644 index 000000000..6ad5c7bd5 --- /dev/null +++ b/src/mailman/database/alembic/versions/47294d3a604_pendable_indexes.py @@ -0,0 +1,35 @@ +"""Pendable indexes + +Add indexes on Pendable fields that can be queried upon. + + +Revision ID: 47294d3a604 +Revises: 33bc0099223 +Create Date: 2015-12-02 11:46:47.295174 + +""" + +# revision identifiers, used by Alembic. +revision = '47294d3a604' +down_revision = '33bc0099223' + +from alembic import op + + +def upgrade(): + op.create_index( + op.f('ix_pended_expiration_date'), 'pended', ['expiration_date'], + unique=False) + op.create_index(op.f('ix_pended_token'), 'pended', ['token'], unique=False) + op.create_index( + op.f('ix_pendedkeyvalue_key'), 'pendedkeyvalue', ['key'], unique=False) + op.create_index( + op.f('ix_pendedkeyvalue_value'), 'pendedkeyvalue', ['value'], + unique=False) + + +def downgrade(): + op.drop_index(op.f('ix_pendedkeyvalue_value'), table_name='pendedkeyvalue') + op.drop_index(op.f('ix_pendedkeyvalue_key'), table_name='pendedkeyvalue') + op.drop_index(op.f('ix_pended_token'), table_name='pended') + op.drop_index(op.f('ix_pended_expiration_date'), table_name='pended') |
