"""create projects table Revision ID: b2c3d4e5f6g7 Revises: Create Date: 2024-01-01 12:00:00.000000 """ from alembic import op import sqlalchemy as sa from sqlalchemy.sql import func import uuid revision = 'b2c3d4e5f6g7' down_revision = None branch_labels = None depends_on = None def upgrade(): op.create_table( 'projects', sa.Column('id', sa.String(), primary_key=True, default=lambda: str(uuid.uuid4())), sa.Column('title', sa.String(255)), sa.Column('description', sa.Text(), nullable=False), sa.Column('student_name', sa.String(100)), sa.Column('supervisor_name', sa.String(100)), sa.Column('department', sa.String(100)), sa.Column('year', sa.Integer(), nullable=False), sa.Column('status', sa.String(50)), sa.Column('technologies_used', sa.String(255)), sa.Column('github_link', sa.String(255)), sa.Column('documentation_link', sa.String(255)), sa.Column('grade', sa.String(10)), sa.Column('is_published', sa.Boolean(), default=False), sa.Column('created_at', sa.DateTime(), server_default=sa.func.now()), sa.Column('updated_at', sa.DateTime(), server_default=sa.func.now(), onupdate=sa.func.now()), sa.PrimaryKeyConstraint('id') ) op.create_index('ix_projects_title', 'projects', ['title']) op.create_index('ix_projects_student_name', 'projects', ['student_name']) op.create_index('ix_projects_year', 'projects', ['year']) def downgrade(): op.drop_index('ix_projects_year', 'projects') op.drop_index('ix_projects_student_name', 'projects') op.drop_index('ix_projects_title', 'projects') op.drop_table('projects')