"""Added course table

Revision ID: 8ed37bb65379
Revises: 218f011a4c51
Create Date: 2024-08-26 12:39:43.429154

"""
from alembic import op
import sqlalchemy as sa
import sqlmodel.sql.sqltypes


# revision identifiers, used by Alembic.
revision = '8ed37bb65379'
down_revision = '218f011a4c51'
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table('course',
    sa.Column('title', sqlmodel.sql.sqltypes.AutoString(length=255), nullable=False),
    sa.Column('sort_description', sqlmodel.sql.sqltypes.AutoString(length=1024), nullable=False),
    sa.Column('long_description', sqlmodel.sql.sqltypes.AutoString(length=2048), nullable=False),
    sa.Column('information', sqlmodel.sql.sqltypes.AutoString(length=1024), nullable=False),
    sa.Column('contant', sqlmodel.sql.sqltypes.AutoString(length=1024), nullable=False),
    sa.Column('remark', sqlmodel.sql.sqltypes.AutoString(length=512), nullable=False),
    sa.Column('id', sa.Uuid(), nullable=False),
    sa.Column('created_at', sa.DateTime(), nullable=False),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_table('image',
    sa.Column('image', sqlmodel.sql.sqltypes.AutoString(length=255), nullable=False),
    sa.Column('index', sa.Integer(), nullable=False),
    sa.Column('id', sa.Uuid(), nullable=False),
    sa.Column('course_id', sa.Uuid(), nullable=False),
    sa.ForeignKeyConstraint(['course_id'], ['course.id'], ondelete='CASCADE'),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_table('info_image',
    sa.Column('image', sqlmodel.sql.sqltypes.AutoString(length=255), nullable=False),
    sa.Column('index', sa.Integer(), nullable=False),
    sa.Column('id', sa.Uuid(), nullable=False),
    sa.Column('course_id', sa.Uuid(), nullable=False),
    sa.ForeignKeyConstraint(['course_id'], ['course.id'], ondelete='CASCADE'),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_table('schedule',
    sa.Column('title', sqlmodel.sql.sqltypes.AutoString(length=255), nullable=False),
    sa.Column('info1', sqlmodel.sql.sqltypes.AutoString(length=255), nullable=False),
    sa.Column('info2', sqlmodel.sql.sqltypes.AutoString(length=255), nullable=False),
    sa.Column('date', sqlmodel.sql.sqltypes.AutoString(), nullable=False),
    sa.Column('id', sa.Uuid(), nullable=False),
    sa.Column('course_id', sa.Uuid(), nullable=False),
    sa.ForeignKeyConstraint(['course_id'], ['course.id'], ondelete='CASCADE'),
    sa.PrimaryKeyConstraint('id')
    )
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_table('schedule')
    op.drop_table('info_image')
    op.drop_table('image')
    op.drop_table('course')
    # ### end Alembic commands ###
