availabili.tf/backend-flask/migrations/versions/65714d7e78f8_add_teaminvite.py

36 lines
991 B
Python

"""Add TeamInvite
Revision ID: 65714d7e78f8
Revises: f50a79c4ae22
Create Date: 2024-11-08 23:16:04.669526
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '65714d7e78f8'
down_revision = 'f50a79c4ae22'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.create_table('team_invites',
sa.Column('key', sa.String(length=31), nullable=False),
sa.Column('team_id', sa.Integer(), nullable=False),
sa.Column('created_at', sa.TIMESTAMP(), server_default=sa.text('(CURRENT_TIMESTAMP)'), nullable=False),
sa.Column('delete_on_use', sa.Boolean(), nullable=False),
sa.ForeignKeyConstraint(['team_id'], ['teams.id'], ),
sa.PrimaryKeyConstraint('key')
)
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_table('team_invites')
# ### end Alembic commands ###