"""audit log Revision ID: 4e094197c9aa Revises: c6af106a04da Create Date: 2026-07-15 10:12:52.859694 """ from alembic import op import sqlalchemy as sa # revision identifiers, used by Alembic. revision = '4e094197c9aa' down_revision = 'c6af106a04da' branch_labels = None depends_on = None def upgrade() -> None: # ### commands auto generated by Alembic - please adjust! ### op.create_table('audit_log', sa.Column('id', sa.String(length=40), nullable=False), sa.Column('at', sa.DateTime(timezone=True), nullable=False), sa.Column('actor', sa.String(length=200), nullable=False), sa.Column('action', sa.String(length=60), nullable=False), sa.Column('entity_type', sa.String(length=40), nullable=False), sa.Column('entity_id', sa.String(length=40), nullable=False), sa.Column('project_id', sa.String(length=40), nullable=True), sa.Column('summary', sa.String(length=400), nullable=False), sa.Column('detail', sa.JSON(), nullable=False), sa.PrimaryKeyConstraint('id') ) op.create_index(op.f('ix_audit_log_action'), 'audit_log', ['action'], unique=False) op.create_index(op.f('ix_audit_log_at'), 'audit_log', ['at'], unique=False) op.create_index(op.f('ix_audit_log_entity_id'), 'audit_log', ['entity_id'], unique=False) op.create_index(op.f('ix_audit_log_entity_type'), 'audit_log', ['entity_type'], unique=False) op.create_index(op.f('ix_audit_log_project_id'), 'audit_log', ['project_id'], unique=False) # ### end Alembic commands ### def downgrade() -> None: # ### commands auto generated by Alembic - please adjust! ### op.drop_index(op.f('ix_audit_log_project_id'), table_name='audit_log') op.drop_index(op.f('ix_audit_log_entity_type'), table_name='audit_log') op.drop_index(op.f('ix_audit_log_entity_id'), table_name='audit_log') op.drop_index(op.f('ix_audit_log_at'), table_name='audit_log') op.drop_index(op.f('ix_audit_log_action'), table_name='audit_log') op.drop_table('audit_log') # ### end Alembic commands ###