mirror of
https://github.com/DarkflameUniverse/NexusDashboard.git
synced 2024-11-10 03:58:20 +00:00
36 lines
1.0 KiB
Python
36 lines
1.0 KiB
Python
|
"""Add audio_log table
|
||
|
|
||
|
Revision ID: f56ee94c179e
|
||
|
Revises: aee4c6c24811
|
||
|
Create Date: 2022-02-11 21:28:29.595665
|
||
|
|
||
|
"""
|
||
|
from alembic import op
|
||
|
import sqlalchemy as sa
|
||
|
from sqlalchemy.dialects import mysql
|
||
|
|
||
|
# revision identifiers, used by Alembic.
|
||
|
revision = 'f56ee94c179e'
|
||
|
down_revision = 'aee4c6c24811'
|
||
|
branch_labels = None
|
||
|
depends_on = None
|
||
|
|
||
|
|
||
|
def upgrade():
|
||
|
# ### commands auto generated by Alembic - please adjust! ###
|
||
|
op.create_table('audit_logs',
|
||
|
sa.Column('id', mysql.INTEGER(), nullable=False),
|
||
|
sa.Column('account_id', sa.Integer(), nullable=True),
|
||
|
sa.Column('action', mysql.TEXT(), nullable=True),
|
||
|
sa.Column('date', mysql.TIMESTAMP(), server_default=sa.text('now()'), nullable=False),
|
||
|
sa.ForeignKeyConstraint(['account_id'], ['accounts.id'], ondelete='CASCADE'),
|
||
|
sa.PrimaryKeyConstraint('id')
|
||
|
)
|
||
|
# ### end Alembic commands ###
|
||
|
|
||
|
|
||
|
def downgrade():
|
||
|
# ### commands auto generated by Alembic - please adjust! ###
|
||
|
op.drop_table('audit_logs')
|
||
|
# ### end Alembic commands ###
|