
Create a complete e-commerce application with the following features: - User authentication and authorization - Product and category management - Shopping cart functionality - Order processing - Database migrations with Alembic - Comprehensive documentation
13 lines
257 B
Python
13 lines
257 B
Python
|
|
from app.db.base import Base
|
|
from app.db.session import engine
|
|
|
|
|
|
def init_db() -> None:
|
|
# Create tables if they don't exist
|
|
Base.metadata.create_all(bind=engine)
|
|
|
|
|
|
def drop_db() -> None:
|
|
# Drop all tables
|
|
Base.metadata.drop_all(bind=engine) |