"""Add audit fields to LicenseUsage

Revision ID: 845d0428c5fe
Revises: 9f4ea4aff2f5
Create Date: 2025-05-17 13:51:21.696328

"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = '845d0428c5fe'
down_revision = '9f4ea4aff2f5'
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    with op.batch_alter_table('license_usage', schema=None) as batch_op:
        batch_op.add_column(sa.Column('created_at', sa.DateTime(), server_default=sa.text('now()'), nullable=True))
        batch_op.add_column(sa.Column('updated_at', sa.DateTime(), server_default=sa.text('now()'), nullable=True))
        batch_op.add_column(sa.Column('created_by', sa.Integer(), nullable=True))
        batch_op.add_column(sa.Column('updated_by', sa.Integer(), nullable=True))
        batch_op.create_foreign_key(None, 'user', ['created_by'], ['id'], referent_schema='public')
        batch_op.create_foreign_key(None, 'user', ['updated_by'], ['id'], referent_schema='public')
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    pass
    # ### end Alembic commands ###
