"""start

Revision ID: 16f759612879
Revises: 
Create Date: 2024-10-07 16:27:42.427904

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


# revision identifiers, used by Alembic.
revision = '16f759612879'
down_revision = None
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table('aboutus',
    sa.Column('description', sqlmodel.sql.sqltypes.AutoString(length=1024), nullable=False),
    sa.Column('image', sqlmodel.sql.sqltypes.AutoString(length=255), nullable=True),
    sa.Column('title', sqlmodel.sql.sqltypes.AutoString(length=255), nullable=False),
    sa.Column('index', sa.Integer(), nullable=False),
    sa.Column('id', sa.Uuid(), nullable=False),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_table('course',
    sa.Column('title', sqlmodel.sql.sqltypes.AutoString(length=255), nullable=False),
    sa.Column('sort_description', sqlmodel.sql.sqltypes.AutoString(length=32768), nullable=False),
    sa.Column('long_description', sqlmodel.sql.sqltypes.AutoString(length=32768), nullable=False),
    sa.Column('information', sqlmodel.sql.sqltypes.AutoString(length=32768), nullable=False),
    sa.Column('contant', sqlmodel.sql.sqltypes.AutoString(length=32768), nullable=False),
    sa.Column('remark', sqlmodel.sql.sqltypes.AutoString(length=32768), nullable=False),
    sa.Column('id', sa.Uuid(), nullable=False),
    sa.Column('created_at', sa.DateTime(), nullable=False),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_table('message',
    sa.Column('name', sqlmodel.sql.sqltypes.AutoString(length=255), nullable=False),
    sa.Column('phone', sqlmodel.sql.sqltypes.AutoString(length=255), nullable=False),
    sa.Column('email', sqlmodel.sql.sqltypes.AutoString(length=255), nullable=False),
    sa.Column('message', sqlmodel.sql.sqltypes.AutoString(length=1024), nullable=False),
    sa.Column('id', sa.Uuid(), nullable=False),
    sa.Column('created_at', sa.DateTime(), nullable=False),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_table('setting',
    sa.Column('address', sqlmodel.sql.sqltypes.AutoString(length=255), nullable=False),
    sa.Column('google_map_api_key', sqlmodel.sql.sqltypes.AutoString(length=255), nullable=False),
    sa.Column('latitude', sa.Float(), nullable=False),
    sa.Column('longitude', sa.Float(), nullable=False),
    sa.Column('phone', sqlmodel.sql.sqltypes.AutoString(length=255), nullable=False),
    sa.Column('email', sqlmodel.sql.sqltypes.AutoString(length=255), nullable=False),
    sa.Column('facebook', sqlmodel.sql.sqltypes.AutoString(length=255), nullable=False),
    sa.Column('instagram', sqlmodel.sql.sqltypes.AutoString(length=255), nullable=False),
    sa.Column('youtube', sqlmodel.sql.sqltypes.AutoString(length=255), nullable=False),
    sa.Column('youtube_link', sqlmodel.sql.sqltypes.AutoString(length=255), nullable=False),
    sa.Column('whatsapp', sqlmodel.sql.sqltypes.AutoString(length=255), nullable=False),
    sa.Column('id', sa.Uuid(), nullable=False),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_table('user',
    sa.Column('email', sqlmodel.sql.sqltypes.AutoString(length=255), nullable=False),
    sa.Column('is_active', sa.Boolean(), nullable=False),
    sa.Column('is_superuser', sa.Boolean(), nullable=False),
    sa.Column('full_name', sqlmodel.sql.sqltypes.AutoString(length=255), nullable=True),
    sa.Column('id', sa.Uuid(), nullable=False),
    sa.Column('hashed_password', sqlmodel.sql.sqltypes.AutoString(), nullable=False),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_index(op.f('ix_user_email'), 'user', ['email'], unique=True)
    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('item',
    sa.Column('description', sqlmodel.sql.sqltypes.AutoString(length=255), nullable=True),
    sa.Column('id', sa.Uuid(), nullable=False),
    sa.Column('title', sqlmodel.sql.sqltypes.AutoString(length=255), nullable=False),
    sa.Column('owner_id', sa.Uuid(), nullable=False),
    sa.ForeignKeyConstraint(['owner_id'], ['user.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('item')
    op.drop_table('info_image')
    op.drop_table('image')
    op.drop_index(op.f('ix_user_email'), table_name='user')
    op.drop_table('user')
    op.drop_table('setting')
    op.drop_table('message')
    op.drop_table('course')
    op.drop_table('aboutus')
    # ### end Alembic commands ###
