mirror of
https://github.com/simple-login/app.git
synced 2024-11-17 22:21:38 +08:00
41 lines
1.1 KiB
Python
41 lines
1.1 KiB
Python
|
"""Create admin audit log
|
||
|
|
||
|
Revision ID: b500363567e3
|
||
|
Revises: 9282e982bc05
|
||
|
Create Date: 2022-03-10 15:26:54.538717
|
||
|
|
||
|
"""
|
||
|
import sqlalchemy_utils
|
||
|
from alembic import op
|
||
|
import sqlalchemy as sa
|
||
|
from sqlalchemy.dialects import postgresql
|
||
|
|
||
|
# revision identifiers, used by Alembic.
|
||
|
revision = 'b500363567e3'
|
||
|
down_revision = '9282e982bc05'
|
||
|
branch_labels = None
|
||
|
depends_on = None
|
||
|
|
||
|
|
||
|
def upgrade():
|
||
|
op.create
|
||
|
# ### commands auto generated by Alembic - please adjust! ###
|
||
|
op.alter_column('admin_audit_log', 'data',
|
||
|
existing_type=postgresql.JSONB(astext_type=sa.Text()),
|
||
|
nullable=False)
|
||
|
op.alter_column('admin_audit_log', 'model_id',
|
||
|
existing_type=sa.INTEGER(),
|
||
|
nullable=False)
|
||
|
# ### end Alembic commands ###
|
||
|
|
||
|
|
||
|
def downgrade():
|
||
|
# ### commands auto generated by Alembic - please adjust! ###
|
||
|
op.alter_column('admin_audit_log', 'model_id',
|
||
|
existing_type=sa.INTEGER(),
|
||
|
nullable=True)
|
||
|
op.alter_column('admin_audit_log', 'data',
|
||
|
existing_type=postgresql.JSONB(astext_type=sa.Text()),
|
||
|
nullable=True)
|
||
|
# ### end Alembic commands ###
|