"Fossies" - the Fresh Open Source Software Archive

Member "mailman-3.3.7/src/mailman/database/alembic/versions/89913992dd5a_remove_mime_is_default_digest.py" (10 Nov 2022, 844 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 "89913992dd5a_remove_mime_is_default_digest.py" see the Fossies "Dox" file reference documentation.

    1 """remove mime_is_default_digest
    2 
    3 Revision ID: 89913992dd5a
    4 Revises: 448a93984c35
    5 Create Date: 2016-10-31 09:21:24.941438
    6 
    7 """
    8 
    9 import sqlalchemy as sa
   10 
   11 from alembic import op
   12 from mailman.database.helpers import exists_in_db, is_sqlite
   13 
   14 
   15 # revision identifiers, used by Alembic.
   16 revision = '89913992dd5a'
   17 down_revision = 'dfe82cf73702'
   18 
   19 
   20 def upgrade():
   21     if not is_sqlite(op.get_bind()):
   22         # SQLite does not support dropping columns.
   23         op.drop_column(                                       # pragma: nocover
   24             'mailinglist', 'mime_is_default_digest')          # pragma: nocover
   25 
   26 
   27 def downgrade():
   28     if not exists_in_db(
   29             op.get_bind(), 'mailinglist', 'mime_is_default_digest'):
   30         op.add_column(
   31             'mailinglist',
   32             sa.Column('mime_is_default_digest', sa.BOOLEAN(), nullable=True))