"""Added triggers on Users login and Check Code

Revision ID: b8a3c9d074aa
Revises: 1ee22bd8371d
Create Date: 2025-04-14 19:34:13.962497

"""
from typing import Sequence, Union
from src.common.database.models.triggers import check_code_created_at_difference_trigger, check_unique_login_active, \
    check_unique_email_active
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision: str = 'b8a3c9d074aa'
down_revision: Union[str, None] = '1ee22bd8371d'
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! ###
    for command in check_unique_login_active['upgrade']:
        op.execute(command)
    for command in check_code_created_at_difference_trigger['upgrade']:
        op.execute(command)
    for command in check_unique_email_active['upgrade']:
        op.execute(command)
    # ### end Alembic commands ###


def downgrade() -> None:
    # ### commands auto generated by Alembic - please adjust! ###
    for command in check_unique_login_active['downgrade']:
        op.execute(command)
    for command in check_code_created_at_difference_trigger['downgrade']:
        op.execute(command)
    for command in check_unique_email_active['downgrade']:
        op.execute(command)
    # ### end Alembic commands ###
