mirror of
https://github.com/simple-login/app.git
synced 2024-11-10 17:35:27 +08:00
Align db with models for the audit_log
This commit is contained in:
parent
eea436875a
commit
66c6db773f
2 changed files with 34 additions and 1 deletions
|
@ -2916,7 +2916,9 @@ class AdminAuditLog(Base):
|
|||
|
||||
id = sa.Column(sa.Integer, primary_key=True, autoincrement=True)
|
||||
created_at = sa.Column(ArrowType, default=arrow.utcnow, nullable=False)
|
||||
admin_user_id = sa.Column(sa.ForeignKey("users.id"), nullable=False)
|
||||
admin_user_id = sa.Column(
|
||||
sa.ForeignKey("users.id", ondelete="cascade"), nullable=False, index=True
|
||||
)
|
||||
action = sa.Column(sa.Integer, nullable=False)
|
||||
model = sa.Column(sa.Text, nullable=False)
|
||||
model_id = sa.Column(sa.Integer, nullable=True)
|
||||
|
|
|
@ -0,0 +1,31 @@
|
|||
"""store provider complaints
|
||||
|
||||
Revision ID: 0aaad1740797
|
||||
Revises: 28b9b14c9664
|
||||
Create Date: 2022-05-03 16:44:24.618504
|
||||
|
||||
"""
|
||||
import sqlalchemy_utils
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = '0aaad1740797'
|
||||
down_revision = '28b9b14c9664'
|
||||
branch_labels = None
|
||||
depends_on = None
|
||||
|
||||
|
||||
def upgrade():
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.create_index(op.f('ix_admin_audit_log_admin_user_id'), 'admin_audit_log', ['admin_user_id'], unique=False)
|
||||
op.drop_index('admin_audit_log_admin_user_id_idx', table_name='admin_audit_log')
|
||||
# ### end Alembic commands ###
|
||||
|
||||
|
||||
def downgrade():
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.create_index('admin_audit_log_admin_user_id_idx', 'admin_audit_log', ['admin_user_id'], unique=False)
|
||||
op.drop_index(op.f('ix_admin_audit_log_admin_user_id'), table_name='admin_audit_log')
|
||||
# ### end Alembic commands ###
|
Loading…
Reference in a new issue