"""add_dashboards_table

Revision ID: 4e084a86c962
Revises: da2b9e81cc14
Create Date: 2025-10-01 14:53:30.715381

"""

from alembic import op
import sqlalchemy as sa



# revision identifiers, used by Alembic.
revision = '4e084a86c962'
down_revision = 'da2b9e81cc14'
branch_labels = None
depends_on = None


def upgrade() -> None:
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table('dashboards',
    sa.Column('id', sa.String(length=36), nullable=False),
    sa.Column('notebook_id', sa.String(length=36), nullable=False),
    sa.Column('version_num', sa.Integer(), nullable=False),
    sa.Column('html_content', sa.Text(), nullable=False),
    sa.Column('created_at', sa.TIMESTAMP(), server_default=sa.text('(CURRENT_TIMESTAMP)'), nullable=False),
    sa.ForeignKeyConstraint(['notebook_id'], ['notebooks.id'], name=op.f('fk_dashboards_notebook_id_notebooks'), ondelete='CASCADE'),
    sa.PrimaryKeyConstraint('id', name=op.f('pk_dashboards'))
    )
    # ### end Alembic commands ###


def downgrade() -> None:
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_table('dashboards')
    # ### end Alembic commands ###

