"Fossies" - the Fresh Open Source Software Archive

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

    1 """roster_visibility
    2 
    3 Revision ID: 15401063d4e3
    4 Revises: b2e694dfde35
    5 Create Date: 2019-01-20 20:45:50.773097
    6 
    7 """
    8 
    9 # revision identifiers, used by Alembic.
   10 
   11 import sqlalchemy as sa
   12 
   13 from alembic import op
   14 from mailman.database.helpers import exists_in_db, is_sqlite
   15 
   16 
   17 revision = '15401063d4e3'
   18 down_revision = 'b2e694dfde35'
   19 
   20 
   21 def upgrade():
   22     # ### commands auto generated by Alembic - please adjust! ###
   23     if not exists_in_db(
   24             op.get_bind(), 'mailinglist', 'member_roster_visibility'):
   25         op.add_column(                                       # pragma: nocover
   26             'mailinglist',
   27             sa.Column('member_roster_visibility', sa.Integer(), nullable=True))
   28 
   29 
   30 def downgrade():
   31     # ### commands auto generated by Alembic - please adjust! ###
   32     if not is_sqlite(op.get_bind()):
   33         op.drop_column('mailinglist', 'member_roster_visibility')   # noqa: E501 # pragma: nocover