mirror of
https://github.com/simple-login/app.git
synced 2024-11-10 21:27:10 +01:00
e9e863807c
* Rate limit the sudo route * Add missing indexes * Updated index * Update index creation to run with concurrent * With autocommit block --------- Co-authored-by: Adrià Casajús <adria.casajus@proton.ch>
43 lines
2.0 KiB
Python
43 lines
2.0 KiB
Python
"""empty message
|
|
|
|
Revision ID: 01827104004b
|
|
Revises: 2634b41f54db
|
|
Create Date: 2023-07-28 19:39:28.675490
|
|
|
|
"""
|
|
import sqlalchemy_utils
|
|
from alembic import op
|
|
import sqlalchemy as sa
|
|
|
|
|
|
# revision identifiers, used by Alembic.
|
|
revision = '01827104004b'
|
|
down_revision = '2634b41f54db'
|
|
branch_labels = None
|
|
depends_on = None
|
|
|
|
|
|
def upgrade():
|
|
with op.get_context().autocommit_block():
|
|
# ### commands auto generated by Alembic - please adjust! ###
|
|
op.create_index(op.f('ix_alias_hibp_last_check'), 'alias', ['hibp_last_check'], unique=False, postgresql_concurrently=True)
|
|
op.create_index('ix_bounce_created_at', 'bounce', ['created_at'], unique=False, postgresql_concurrently=True)
|
|
op.create_index('ix_monitoring_created_at', 'monitoring', ['created_at'], unique=False, postgresql_concurrently=True)
|
|
op.create_index('ix_transactional_email_created_at', 'transactional_email', ['created_at'], unique=False, postgresql_concurrently=True)
|
|
op.create_index(op.f('ix_users_activated'), 'users', ['activated'], unique=False, postgresql_concurrently=True)
|
|
op.create_index('ix_users_activated_trial_end_lifetime', 'users', ['activated', 'trial_end', 'lifetime'], unique=False, postgresql_concurrently=True)
|
|
op.create_index(op.f('ix_users_referral_id'), 'users', ['referral_id'], unique=False, postgresql_concurrently=True)
|
|
# ### end Alembic commands ###
|
|
|
|
|
|
def downgrade():
|
|
# ### commands auto generated by Alembic - please adjust! ###
|
|
op.drop_index(op.f('ix_users_referral_id'), table_name='users')
|
|
op.drop_index('ix_users_activated_trial_end_lifetime', table_name='users')
|
|
op.drop_index(op.f('ix_users_activated'), table_name='users')
|
|
op.drop_index('ix_transactional_email_created_at', table_name='transactional_email')
|
|
op.drop_index('ix_monitoring_created_at', table_name='monitoring')
|
|
op.drop_index('ix_bounce_created_at', table_name='bounce')
|
|
op.drop_index(op.f('ix_alias_hibp_last_check'), table_name='alias')
|
|
# ### end Alembic commands ###
|