"""email_out: create table relating to email_in

Revision ID: 4b9dee6df9e1
Revises: 33ec882b4a75
Create Date: 2025-12-02 15:54:38.730754

"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = '4b9dee6df9e1'
down_revision = '33ec882b4a75'
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table('email_out',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('email_in_mid', sa.String(), nullable=False),
    sa.Column('message_id', sa.String(), nullable=False),
    sa.Column('recipients', sa.JSON(), nullable=True),
    sa.Column('sent_at', sa.DateTime(), nullable=True),
    sa.ForeignKeyConstraint(['email_in_mid'], ['email_in.message_id'], ),
    sa.PrimaryKeyConstraint('id'),
    sa.UniqueConstraint('message_id')
    )
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_table('email_out')
    # ### end Alembic commands ###
