"""Added tables for dataset collections

Revision ID: 2615496ee71c
Revises: <KEY>
Create Date: 2021-07-20 08:59:30.536114

"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = "2615496ee71c"
down_revision = "<KEY>"
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table(
        "collection",
        sa.Column("id", sa.Integer(), nullable=False),
        sa.Column("name", sa.String(length=1024), nullable=True),
        sa.Column("user_id", sa.Integer(), nullable=True),
        sa.ForeignKeyConstraint(
            ["user_id"],
            ["user.id"],
        ),
        sa.PrimaryKeyConstraint("id"),
    )
    op.create_table(
        "dataset_collection_assoc_table",
        sa.Column("collection_id", sa.Integer(), nullable=True),
        sa.Column("dataset_id", sa.Integer(), nullable=True),
        sa.ForeignKeyConstraint(
            ["collection_id"],
            ["collection.id"],
        ),
        sa.ForeignKeyConstraint(
            ["dataset_id"],
            ["dataset.id"],
        ),
    )
    op.create_table(
        "session_collection_assoc_table",
        sa.Column("session_id", sa.Integer(), nullable=True),
        sa.Column("collection_id", sa.Integer(), nullable=True),
        sa.ForeignKeyConstraint(
            ["collection_id"],
            ["collection.id"],
        ),
        sa.ForeignKeyConstraint(
            ["session_id"],
            ["session.id"],
        ),
    )
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_table("session_collection_assoc_table")
    op.drop_table("dataset_collection_assoc_table")
    op.drop_table("collection")
    # ### end Alembic commands ###

"""Added tables for dataset collections

Revision ID: 2615496ee71c
Revises: <KEY>
Create Date: 2021-07-20 08:59:30.536114

"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = "2615496ee71c"
down_revision = "<KEY>"
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table(
        "collection",
        sa.Column("id", sa.Integer(), nullable=False),
        sa.Column("name", sa.String(length=1024), nullable=True),
        sa.Column("user_id", sa.Integer(), nullable=True),
        sa.ForeignKeyConstraint(
            ["user_id"],
            ["user.id"],
        ),
        sa.PrimaryKeyConstraint("id"),
    )
    op.create_table(
        "dataset_collection_assoc_table",
        sa.Column("collection_id", sa.Integer(), nullable=True),
        sa.Column("dataset_id", sa.Integer(), nullable=True),
        sa.ForeignKeyConstraint(
            ["collection_id"],
            ["collection.id"],
        ),
        sa.ForeignKeyConstraint(
            ["dataset_id"],
            ["dataset.id"],
        ),
    )
    op.create_table(
        "session_collection_assoc_table",
        sa.Column("session_id", sa.Integer(), nullable=True),
        sa.Column("collection_id", sa.Integer(), nullable=True),
        sa.ForeignKeyConstraint(
            ["collection_id"],
            ["collection.id"],
        ),
        sa.ForeignKeyConstraint(
            ["session_id"],
            ["session.id"],
        ),
    )
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_table("session_collection_assoc_table")
    op.drop_table("dataset_collection_assoc_table")
    op.drop_table("collection")
    # ### end Alembic commands ###

Added tables for dataset collections  Revision ID: 2615496ee71c Revises: <KEY> Create Date: 2021-07-20 08:59:30.536114 # revision identifiers, used by Alembic. # ### commands auto generated by Alembic - please adjust! ### # ### end Alembic commands ### # ### commands auto generated by Alembic - please adjust! ### # ### end Alembic commands ###