Automated Action 2cb6659b63 Add comprehensive travel app backend with FastAPI
- User authentication with JWT tokens
- Trip management with itineraries
- Destination database with search functionality
- Booking management for flights, hotels, car rentals, activities
- SQLite database with Alembic migrations
- Health monitoring endpoint
- CORS enabled for all origins
- Complete API documentation at /docs and /redoc
- Environment variable support for SECRET_KEY

Requirements for production:
- Set SECRET_KEY environment variable
2025-06-20 01:29:17 +00:00

21 lines
821 B
Python

from sqlalchemy import Column, Integer, String, DateTime, Boolean
from sqlalchemy.orm import relationship
from sqlalchemy.sql import func
from app.db.base import Base
class User(Base):
__tablename__ = "users"
id = Column(Integer, primary_key=True, index=True)
email = Column(String, unique=True, index=True, nullable=False)
username = Column(String, unique=True, index=True, nullable=False)
full_name = Column(String, nullable=False)
hashed_password = Column(String, nullable=False)
is_active = Column(Boolean, default=True)
created_at = Column(DateTime(timezone=True), server_default=func.now())
updated_at = Column(DateTime(timezone=True), onupdate=func.now())
trips = relationship("Trip", back_populates="user")
bookings = relationship("Booking", back_populates="user")