41 lines
1.3 KiB
Python
41 lines
1.3 KiB
Python
"""empty message
|
|
|
|
Revision ID: cdf401a636ea
|
|
Revises:
|
|
Create Date: 2025-03-14 04:16:49.143794
|
|
|
|
"""
|
|
from typing import Sequence, Union
|
|
|
|
from alembic import op
|
|
import sqlalchemy as sa
|
|
|
|
|
|
# revision identifiers, used by Alembic.
|
|
revision: str = 'cdf401a636ea'
|
|
down_revision: Union[str, None] = None
|
|
branch_labels: Union[str, Sequence[str], None] = None
|
|
depends_on: Union[str, Sequence[str], None] = None
|
|
|
|
|
|
def upgrade() -> None:
|
|
"""Upgrade schema."""
|
|
# ### commands auto generated by Alembic - please adjust! ###
|
|
op.create_table('log',
|
|
sa.Column('id', sa.INTEGER(), autoincrement=True, nullable=False),
|
|
sa.Column('user_id', sa.Integer(), nullable=False),
|
|
sa.Column('datetime', sa.TIMESTAMP(timezone=True), nullable=False),
|
|
sa.Column('action', sa.Enum('FIRST_ENTRY', 'REGISTRATION', 'LOGIN', 'LOGOUT', 'CREATE_THEME', 'ENTRY_THEME', 'DELETE_THEME', 'WRITE_MESSAGE', name='useractions'), nullable=False),
|
|
sa.Column('object_id', sa.Integer(), nullable=True),
|
|
sa.Column('response', sa.SMALLINT(), nullable=False),
|
|
sa.PrimaryKeyConstraint('id')
|
|
)
|
|
# ### end Alembic commands ###
|
|
|
|
|
|
def downgrade() -> None:
|
|
"""Downgrade schema."""
|
|
# ### commands auto generated by Alembic - please adjust! ###
|
|
op.drop_table('log')
|
|
# ### end Alembic commands ###
|