42 lines
1.5 KiB
Python
42 lines
1.5 KiB
Python
"""Initial migration
|
|
|
|
Revision ID: 9ef21b34c10a
|
|
Revises:
|
|
Create Date: 2023-08-01 10:00:00.000000
|
|
|
|
"""
|
|
from alembic import op
|
|
import sqlalchemy as sa
|
|
|
|
|
|
# revision identifiers, used by Alembic.
|
|
revision = '9ef21b34c10a'
|
|
down_revision = None
|
|
branch_labels = None
|
|
depends_on = None
|
|
|
|
|
|
def upgrade() -> None:
|
|
# ### commands auto generated by Alembic - please adjust! ###
|
|
op.create_table('tasks',
|
|
sa.Column('id', sa.Integer(), nullable=False),
|
|
sa.Column('title', sa.String(), nullable=True),
|
|
sa.Column('description', sa.String(), nullable=True),
|
|
sa.Column('status', sa.String(), nullable=True),
|
|
sa.Column('priority', sa.String(), nullable=True),
|
|
sa.Column('is_completed', sa.Boolean(), nullable=True),
|
|
sa.Column('created_at', sa.DateTime(timezone=True), server_default=sa.text('(CURRENT_TIMESTAMP)'), nullable=True),
|
|
sa.Column('updated_at', sa.DateTime(timezone=True), server_default=sa.text('(CURRENT_TIMESTAMP)'), nullable=True),
|
|
sa.PrimaryKeyConstraint('id')
|
|
)
|
|
op.create_index(op.f('ix_tasks_id'), 'tasks', ['id'], unique=False)
|
|
op.create_index(op.f('ix_tasks_title'), 'tasks', ['title'], unique=False)
|
|
# ### end Alembic commands ###
|
|
|
|
|
|
def downgrade() -> None:
|
|
# ### commands auto generated by Alembic - please adjust! ###
|
|
op.drop_index(op.f('ix_tasks_title'), table_name='tasks')
|
|
op.drop_index(op.f('ix_tasks_id'), table_name='tasks')
|
|
op.drop_table('tasks')
|
|
# ### end Alembic commands ### |