Automated Action 9c818fbd91 Implement complete user authentication system with FastAPI
- Set up FastAPI application with CORS and proper structure
- Created User model with SQLAlchemy and SQLite database
- Implemented JWT-based authentication with bcrypt password hashing
- Added user registration, login, and profile endpoints
- Created health check endpoint for monitoring
- Set up Alembic for database migrations
- Added comprehensive API documentation
- Configured proper project structure with separate modules
- Updated README with complete setup and usage instructions
2025-06-25 01:56:41 +00:00

35 lines
1.1 KiB
Python

"""Create users table
Revision ID: 001
Revises:
Create Date: 2024-01-01 12:00:00.000000
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '001'
down_revision = None
branch_labels = None
depends_on = None
def upgrade() -> None:
op.create_table('users',
sa.Column('id', sa.Integer(), nullable=False),
sa.Column('email', sa.String(), nullable=False),
sa.Column('hashed_password', sa.String(), nullable=False),
sa.Column('is_active', 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), nullable=True),
sa.PrimaryKeyConstraint('id')
)
op.create_index(op.f('ix_users_email'), 'users', ['email'], unique=True)
op.create_index(op.f('ix_users_id'), 'users', ['id'], unique=False)
def downgrade() -> None:
op.drop_index(op.f('ix_users_id'), table_name='users')
op.drop_index(op.f('ix_users_email'), table_name='users')
op.drop_table('users')