
- Add due dates and priority level to todos - Add tags/categories for better organization - Implement advanced search and filtering - Create database migrations for model changes - Add endpoints for managing tags - Update documentation generated with BackendIM... (backend.im)
30 lines
795 B
Python
30 lines
795 B
Python
"""add priority and due date to todos
|
|
|
|
Revision ID: 002
|
|
Revises: 001
|
|
Create Date: 2023-11-21
|
|
|
|
"""
|
|
from alembic import op
|
|
import sqlalchemy as sa
|
|
from sqlalchemy.dialects import sqlite
|
|
|
|
# revision identifiers, used by Alembic.
|
|
revision = '002'
|
|
down_revision = '001'
|
|
branch_labels = None
|
|
depends_on = None
|
|
|
|
|
|
def upgrade():
|
|
# Add priority column to todos table
|
|
with op.batch_alter_table('todos') as batch_op:
|
|
batch_op.add_column(sa.Column('priority', sa.String(length=10), nullable=False, server_default='medium'))
|
|
batch_op.add_column(sa.Column('due_date', sa.DateTime(timezone=True), nullable=True))
|
|
|
|
|
|
def downgrade():
|
|
# Remove columns
|
|
with op.batch_alter_table('todos') as batch_op:
|
|
batch_op.drop_column('due_date')
|
|
batch_op.drop_column('priority') |