mirror of
https://github.com/OHV-IT/collabrix.git
synced 2025-12-15 16:48:36 +01:00
32 lines
899 B
Python
32 lines
899 B
Python
"""create last_seen table
|
|
|
|
Revision ID: 0001_create_last_seen_table
|
|
Revises:
|
|
Create Date: 2025-12-12 00:00:00.000000
|
|
"""
|
|
from alembic import op
|
|
import sqlalchemy as sa
|
|
|
|
# revision identifiers, used by Alembic.
|
|
revision = '0001_create_last_seen_table'
|
|
down_revision = None
|
|
branch_labels = None
|
|
depends_on = None
|
|
|
|
|
|
def upgrade():
|
|
op.create_table(
|
|
'last_seen',
|
|
sa.Column('id', sa.Integer(), primary_key=True),
|
|
sa.Column('user_id', sa.Integer(), nullable=False),
|
|
sa.Column('channel_id', sa.Integer(), nullable=True),
|
|
sa.Column('dm_user_id', sa.Integer(), nullable=True),
|
|
sa.Column('last_seen', sa.DateTime(), nullable=False),
|
|
)
|
|
op.create_index(op.f('ix_last_seen_last_seen'), 'last_seen', ['last_seen'], unique=False)
|
|
|
|
|
|
def downgrade():
|
|
op.drop_index(op.f('ix_last_seen_last_seen'), table_name='last_seen')
|
|
op.drop_table('last_seen')
|