Only allow one session
This commit is contained in:
28
alembic/versions/ab1167fc8260_add_user_last_session_id.py
Normal file
28
alembic/versions/ab1167fc8260_add_user_last_session_id.py
Normal file
@@ -0,0 +1,28 @@
|
||||
"""add_user_last_session_id
|
||||
|
||||
Revision ID: ab1167fc8260
|
||||
Revises: 432c5287256d
|
||||
Create Date: 2019-05-15 16:25:48.766451
|
||||
|
||||
"""
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
from sqlalchemy.dialects import postgresql
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = 'ab1167fc8260'
|
||||
down_revision = '432c5287256d'
|
||||
branch_labels = None
|
||||
depends_on = None
|
||||
|
||||
|
||||
def upgrade():
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.add_column('users', sa.Column('last_session_id', postgresql.UUID(as_uuid=True), server_default=sa.text('uuid_generate_v4()'), nullable=True))
|
||||
# ### end Alembic commands ###
|
||||
|
||||
|
||||
def downgrade():
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.drop_column('users', 'last_session_id')
|
||||
# ### end Alembic commands ###
|
Reference in New Issue
Block a user