felicity-lims/felicity/migrations/versions/28042fd2e903_removed_auditlog.py
Aurthur Musendame 75792078a4 updated db
2024-08-02 17:30:53 +02:00

39 lines
1.3 KiB
Python

"""removed-auditlog
Revision ID: 28042fd2e903
Revises: e598ed62784d
Create Date: 2024-08-02 17:30:19.725564
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '28042fd2e903'
down_revision = 'e598ed62784d'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_index('ix_audit_log_uid', table_name='audit_log')
op.drop_table('audit_log')
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.create_table('audit_log',
sa.Column('user_id', sa.VARCHAR(), autoincrement=False, nullable=True),
sa.Column('target_type', sa.VARCHAR(length=100), autoincrement=False, nullable=False),
sa.Column('target_id', sa.VARCHAR(), autoincrement=False, nullable=True),
sa.Column('action', sa.INTEGER(), autoincrement=False, nullable=True),
sa.Column('state_before', sa.TEXT(), autoincrement=False, nullable=True),
sa.Column('state_after', sa.TEXT(), autoincrement=False, nullable=True),
sa.Column('uid', sa.VARCHAR(), autoincrement=False, nullable=False),
sa.PrimaryKeyConstraint('uid', name='audit_log_pkey')
)
op.create_index('ix_audit_log_uid', 'audit_log', ['uid'], unique=False)
# ### end Alembic commands ###