Merge pull request #947 from simple-login/ac-sync-model
Align db with models
This commit is contained in:
commit
67dad33b70
|
@ -2916,7 +2916,9 @@ class AdminAuditLog(Base):
|
||||||
|
|
||||||
id = sa.Column(sa.Integer, primary_key=True, autoincrement=True)
|
id = sa.Column(sa.Integer, primary_key=True, autoincrement=True)
|
||||||
created_at = sa.Column(ArrowType, default=arrow.utcnow, nullable=False)
|
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)
|
action = sa.Column(sa.Integer, nullable=False)
|
||||||
model = sa.Column(sa.Text, nullable=False)
|
model = sa.Column(sa.Text, nullable=False)
|
||||||
model_id = sa.Column(sa.Integer, nullable=True)
|
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