1
0
mirror of https://github.com/Mailu/Mailu.git synced 2025-01-22 03:39:05 +02:00

Fix an old migration that was reading configuration before migrating

This commit is contained in:
kaiyou 2018-11-08 20:30:20 +01:00
parent 206cce0b47
commit f6013aa29f

@ -13,8 +13,6 @@ down_revision = '2335c80a6bc3'
from alembic import op
import sqlalchemy as sa
from mailu import app
fetch_table = sa.Table(
'fetch',
@ -24,13 +22,7 @@ fetch_table = sa.Table(
def upgrade():
connection = op.get_bind()
op.add_column('fetch', sa.Column('keep', sa.Boolean(), nullable=False, server_default=sa.sql.expression.false()))
# also apply the current config value if set
if app.config.get("FETCHMAIL_KEEP", "False") == "True":
connection.execute(
fetch_table.update().values(keep=True)
)
def downgrade():