"""Étend le stockage des pièces jointes Outlook.

Revision ID: f1a2b3c4d5e6
Revises: e2f6a7b8c9d0
"""
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import mysql

revision = 'f1a2b3c4d5e6'
down_revision = 'e2f6a7b8c9d0'
branch_labels = None
depends_on = None


def upgrade():
    op.alter_column(
        'outlook_attachments', 'id',
        existing_type=sa.String(length=100),
        type_=sa.String(length=500),
        existing_nullable=False,
    )
    op.alter_column(
        'outlook_attachments', 'content',
        existing_type=sa.LargeBinary(),
        type_=mysql.LONGBLOB(),
        existing_nullable=True,
    )


def downgrade():
    op.alter_column(
        'outlook_attachments', 'content',
        existing_type=mysql.LONGBLOB(),
        type_=sa.LargeBinary(),
        existing_nullable=True,
    )
    op.alter_column(
        'outlook_attachments', 'id',
        existing_type=sa.String(length=500),
        type_=sa.String(length=100),
        existing_nullable=False,
    )
