Automated Action f047098f40 Create FastAPI REST API with SQLite database
- Set up project structure with FastAPI and SQLAlchemy
- Configure SQLite database with async support
- Implement CRUD endpoints for items resource
- Add health endpoint for monitoring
- Set up Alembic migrations
- Create comprehensive documentation

generated with BackendIM... (backend.im)
2025-05-14 01:20:38 +00:00

40 lines
1.3 KiB
Python

"""Initial migration
Revision ID: 8675309dee
Revises:
Create Date: 2025-05-14
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '8675309dee'
down_revision = None
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.create_table('items',
sa.Column('id', sa.Integer(), nullable=False),
sa.Column('title', sa.String(), nullable=True),
sa.Column('description', sa.String(), nullable=True),
sa.Column('is_active', sa.Boolean(), nullable=True),
sa.Column('created_at', sa.DateTime(), server_default=sa.text('(CURRENT_TIMESTAMP)'), nullable=True),
sa.Column('updated_at', sa.DateTime(), server_default=sa.text('(CURRENT_TIMESTAMP)'), nullable=True),
sa.PrimaryKeyConstraint('id')
)
op.create_index(op.f('ix_items_id'), 'items', ['id'], unique=False)
op.create_index(op.f('ix_items_title'), 'items', ['title'], unique=False)
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_index(op.f('ix_items_title'), table_name='items')
op.drop_index(op.f('ix_items_id'), table_name='items')
op.drop_table('items')
# ### end Alembic commands ###