"Fossies" - the Fresh Open Source Software Archive

Member "mailman-3.3.7/src/mailman/database/alembic/versions/781a38e146bf_mailinglist_indexes.py" (10 Nov 2022, 849 Bytes) of package /linux/misc/mailman-3.3.7.tar.bz2:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Python source code syntax highlighting (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file. For more information about "781a38e146bf_mailinglist_indexes.py" see the Fossies "Dox" file reference documentation.

    1 """MailingList indexes
    2 
    3 Revision ID: 781a38e146bf
    4 Revises: 70af5a4e5790
    5 Create Date: 2016-01-14 15:34:29.734429
    6 
    7 """
    8 
    9 from alembic import op
   10 
   11 
   12 # Revision identifiers, used by Alembic.
   13 revision = '781a38e146bf'
   14 down_revision = '70af5a4e5790'
   15 
   16 
   17 def upgrade():
   18     op.create_index(
   19         op.f('ix_mailinglist_list_id'), 'mailinglist', ['list_id'],
   20         unique=True)
   21     op.create_index(
   22         op.f('ix_mailinglist_list_name'), 'mailinglist', ['list_name'],
   23         unique=False)
   24     op.create_index(
   25         op.f('ix_mailinglist_mail_host'), 'mailinglist', ['mail_host'],
   26         unique=False)
   27 
   28 
   29 def downgrade():
   30     op.drop_index(op.f('ix_mailinglist_mail_host'), table_name='mailinglist')
   31     op.drop_index(op.f('ix_mailinglist_list_name'), table_name='mailinglist')
   32     op.drop_index(op.f('ix_mailinglist_list_id'), table_name='mailinglist')