"""Initial version

Revision ID: 7bf19e47b4ab
Revises:
Create Date: 2024-11-20 11:39:47.563091

"""
from typing import (
    Sequence,
    Union,
)

from alembic import op
from sqlalchemy import (
    BLOB,
    Column,
    DATE,
    DATETIME,
    INTEGER,
    TEXT,
    VARCHAR,
)

# revision identifiers, used by Alembic.
revision: str = "2f33894eaa09"
down_revision: Union[str, None] = None
branch_labels: Union[str, Sequence[str], None] = None
depends_on: Union[str, Sequence[str], None] = None


def upgrade() -> None:

    op.create_table(
        "Users",
        Column("UserId", INTEGER, nullable=False, primary_key=True),
        Column("UserName", VARCHAR(15), nullable=False),
        Column("LongName", VARCHAR(50), nullable=False),
        Column("Password", VARCHAR(32), nullable=False),
        Column("PasswordValidity", DATETIME),
        Column("Level", INTEGER, nullable=False, default=0),
        Column("Status", INTEGER, nullable=False),
        Column("AdmissionDate", DATE, nullable=False),
        Column("TerminationDate", DATETIME),
        Column("PayRate", VARCHAR(30)),
        Column("BadgeNumber", TEXT),
        Column("FingerPrintMinutiae", BLOB),
        Column("NfcUuid", VARCHAR(32), unique=True),
        if_not_exists=True,
    )


def downgrade() -> None:

    op.drop_table("Users")
