"""Add vitals table

Revision ID: f2eef408dabf
Revises: d6dd7b7e8b03
Create Date: 2025-06-17 19:05:12.959760

"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = 'f2eef408dabf'
down_revision = 'd6dd7b7e8b03'
branch_labels = None
depends_on = None


def upgrade() -> None:
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table('vitals',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('patient_id', sa.Integer(), nullable=False),
    sa.Column('practitioner_id', sa.Integer(), nullable=True),
    sa.Column('recorded_date', sa.DateTime(), nullable=False),
    sa.Column('systolic_bp', sa.Integer(), nullable=True),
    sa.Column('diastolic_bp', sa.Integer(), nullable=True),
    sa.Column('heart_rate', sa.Integer(), nullable=True),
    sa.Column('temperature', sa.Float(), nullable=True),
    sa.Column('weight', sa.Float(), nullable=True),
    sa.Column('height', sa.Float(), nullable=True),
    sa.Column('oxygen_saturation', sa.Float(), nullable=True),
    sa.Column('respiratory_rate', sa.Integer(), nullable=True),
    sa.Column('blood_glucose', sa.Float(), nullable=True),
    sa.Column('bmi', sa.Float(), nullable=True),
    sa.Column('pain_scale', sa.Integer(), nullable=True),
    sa.Column('notes', sa.Text(), nullable=True),
    sa.Column('location', sa.String(), nullable=True),
    sa.Column('device_used', sa.String(), nullable=True),
    sa.Column('created_at', sa.DateTime(), nullable=False),
    sa.Column('updated_at', sa.DateTime(), nullable=False),
    sa.ForeignKeyConstraint(['patient_id'], ['patients.id'], ),
    sa.ForeignKeyConstraint(['practitioner_id'], ['practitioners.id'], ),
    sa.PrimaryKeyConstraint('id')
    )
    # ### end Alembic commands ###


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