"""plugin add sync fields

Revision ID: 0a2e13051c18
Revises: ef130f92230c
Create Date: 2022-12-23 17:48:06.670161

"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = '0a2e13051c18'
down_revision = 'ef130f92230c'
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.add_column('cmf_plugin', sa.Column('sync_enabled', sa.Boolean(), nullable=True))
    op.add_column('cmf_plugin', sa.Column('sync_period', sa.Integer(), nullable=True))
    op.add_column('cmf_plugin', sa.Column('sync_status', sa.String(length=32), nullable=True))
    op.add_column('cmf_plugin', sa.Column('sync_last_datetime', sa.TIMESTAMP(timezone=True), nullable=True))
    op.add_column('cmf_plugin', sa.Column('sync_last_error_datetime', sa.TIMESTAMP(timezone=True), nullable=True))
    op.add_column('cmf_plugin', sa.Column('sync_last_error_message', sa.TEXT(), nullable=True))
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_column('cmf_plugin', 'sync_last_error_message')
    op.drop_column('cmf_plugin', 'sync_last_error_datetime')
    op.drop_column('cmf_plugin', 'sync_last_datetime')
    op.drop_column('cmf_plugin', 'sync_status')
    op.drop_column('cmf_plugin', 'sync_period')
    op.drop_column('cmf_plugin', 'sync_enabled')
    # ### end Alembic commands ###
