"""create task table Revision ID: 202308201234 Revises: Create Date: 2023-08-20 12:34:56.789012 """ from alembic import op import sqlalchemy as sa # revision identifiers, used by Alembic. revision = '202308201234' down_revision = None branch_labels = None depends_on = None def upgrade(): op.create_table( 'task', sa.Column('id', sa.Integer(), nullable=False), sa.Column('title', sa.String(length=255), nullable=False), sa.Column('description', sa.Text(), nullable=True), sa.Column('is_completed', sa.Boolean(), nullable=False, default=False), sa.Column('priority', sa.Integer(), nullable=False, default=2), sa.Column('created_at', sa.DateTime(), nullable=False, server_default=sa.func.now()), sa.Column('updated_at', sa.DateTime(), nullable=False, server_default=sa.func.now(), onupdate=sa.func.now()), sa.Column('completed_at', sa.DateTime(), nullable=True), sa.Column('due_date', sa.DateTime(), nullable=True), sa.PrimaryKeyConstraint('id') ) op.create_index(op.f('ix_task_id'), 'task', ['id'], unique=False) op.create_index(op.f('ix_task_title'), 'task', ['title'], unique=False) def downgrade(): op.drop_index(op.f('ix_task_title'), table_name='task') op.drop_index(op.f('ix_task_id'), table_name='task') op.drop_table('task')