"""Add room options

Revision ID: 62dea3db63a5
Revises: 1340c04426b8
Create Date: 2024-09-03 16:19:26.861027

"""

from typing import Sequence, Union

import sqlalchemy as sa
from alembic import op

# revision identifiers, used by Alembic.
revision: str = "62dea3db63a5"
down_revision: Union[str, None] = "1340c04426b8"
branch_labels: Union[str, Sequence[str], None] = None
depends_on: Union[str, Sequence[str], None] = None


def upgrade() -> None:
    # ### commands auto generated by Alembic - please adjust! ###
    op.add_column(
        "meeting",
        sa.Column(
            "is_locked", sa.Boolean(), server_default=sa.text("0"), nullable=False
        ),
    )
    op.add_column(
        "meeting",
        sa.Column("room_mode", sa.String(), server_default="normal", nullable=False),
    )
    op.add_column(
        "meeting",
        sa.Column(
            "recording_type", sa.String(), server_default="cloud", nullable=False
        ),
    )
    op.add_column(
        "meeting",
        sa.Column(
            "recording_trigger",
            sa.String(),
            server_default="automatic-2nd-participant",
            nullable=False,
        ),
    )
    op.add_column(
        "room",
        sa.Column(
            "is_locked", sa.Boolean(), server_default=sa.text("0"), nullable=False
        ),
    )
    op.add_column(
        "room",
        sa.Column("room_mode", sa.String(), server_default="normal", nullable=False),
    )
    op.add_column(
        "room",
        sa.Column(
            "recording_type", sa.String(), server_default="cloud", nullable=False
        ),
    )
    op.add_column(
        "room",
        sa.Column(
            "recording_trigger",
            sa.String(),
            server_default="automatic-2nd-participant",
            nullable=False,
        ),
    )
    # ### end Alembic commands ###


def downgrade() -> None:
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_column("room", "recording_trigger")
    op.drop_column("room", "recording_type")
    op.drop_column("room", "room_mode")
    op.drop_column("room", "is_locked")
    op.drop_column("meeting", "recording_trigger")
    op.drop_column("meeting", "recording_type")
    op.drop_column("meeting", "room_mode")
    op.drop_column("meeting", "is_locked")
    # ### end Alembic commands ###
