mirror of
https://github.com/dograh-hq/dograh.git
synced 2026-06-10 08:05:22 +02:00
51 lines
1.6 KiB
Python
51 lines
1.6 KiB
Python
"""add integrations
|
|
|
|
Revision ID: d666f3244648
|
|
Revises: 45fa7fec2993
|
|
Create Date: 2025-06-09 16:50:56.647020
|
|
|
|
"""
|
|
|
|
from typing import Sequence, Union
|
|
|
|
import sqlalchemy as sa
|
|
from alembic import op
|
|
|
|
# revision identifiers, used by Alembic.
|
|
revision: str = "d666f3244648"
|
|
down_revision: Union[str, None] = "45fa7fec2993"
|
|
branch_labels: Union[str, Sequence[str], None] = None
|
|
depends_on: Union[str, Sequence[str], None] = None
|
|
|
|
|
|
def upgrade() -> None:
|
|
# ### commands auto generated by Alembic - please adjust! ###
|
|
op.create_table(
|
|
"integrations",
|
|
sa.Column("id", sa.Integer(), nullable=False),
|
|
sa.Column("integration_id", sa.String(), nullable=False),
|
|
sa.Column("organisation_id", sa.Integer(), nullable=False),
|
|
sa.Column("is_active", sa.Boolean(), nullable=False),
|
|
sa.Column("created_at", sa.DateTime(timezone=True), nullable=True),
|
|
sa.ForeignKeyConstraint(
|
|
["organisation_id"],
|
|
["organizations.id"],
|
|
),
|
|
sa.PrimaryKeyConstraint("id"),
|
|
)
|
|
op.create_index(op.f("ix_integrations_id"), "integrations", ["id"], unique=False)
|
|
op.create_index(
|
|
op.f("ix_integrations_integration_id"),
|
|
"integrations",
|
|
["integration_id"],
|
|
unique=False,
|
|
)
|
|
# ### end Alembic commands ###
|
|
|
|
|
|
def downgrade() -> None:
|
|
# ### commands auto generated by Alembic - please adjust! ###
|
|
op.drop_index(op.f("ix_integrations_integration_id"), table_name="integrations")
|
|
op.drop_index(op.f("ix_integrations_id"), table_name="integrations")
|
|
op.drop_table("integrations")
|
|
# ### end Alembic commands ###
|