42 lines
1.2 KiB
Python
42 lines
1.2 KiB
Python
"""Add team integrations models
|
|
|
|
Revision ID: 1fc9a051a0a6
|
|
Revises: 65714d7e78f8
|
|
Create Date: 2024-11-11 19:12:42.611838
|
|
|
|
"""
|
|
from alembic import op
|
|
import sqlalchemy as sa
|
|
|
|
|
|
# revision identifiers, used by Alembic.
|
|
revision = '1fc9a051a0a6'
|
|
down_revision = '65714d7e78f8'
|
|
branch_labels = None
|
|
depends_on = None
|
|
|
|
|
|
def upgrade():
|
|
# ### commands auto generated by Alembic - please adjust! ###
|
|
op.create_table('team_integrations',
|
|
sa.Column('id', sa.Integer(), autoincrement=True, nullable=False),
|
|
sa.Column('team_id', sa.Integer(), nullable=False),
|
|
sa.Column('integration_type', sa.String(), nullable=False),
|
|
sa.ForeignKeyConstraint(['team_id'], ['teams.id'], ),
|
|
sa.PrimaryKeyConstraint('id')
|
|
)
|
|
op.create_table('team_discord_integrations',
|
|
sa.Column('integration_id', sa.Integer(), nullable=False),
|
|
sa.Column('webhook_url', sa.String(length=255), nullable=False),
|
|
sa.ForeignKeyConstraint(['integration_id'], ['team_integrations.id'], ),
|
|
sa.PrimaryKeyConstraint('integration_id')
|
|
)
|
|
# ### end Alembic commands ###
|
|
|
|
|
|
def downgrade():
|
|
# ### commands auto generated by Alembic - please adjust! ###
|
|
op.drop_table('team_discord_integrations')
|
|
op.drop_table('team_integrations')
|
|
# ### end Alembic commands ###
|