Spaces:
Running
Running
from sqlalchemy import create_engine, Column, Integer, String, Text | |
from sqlalchemy.orm import sessionmaker, declarative_base | |
from config import DATABASE_URL # Import from config.py | |
# Set up SQLAlchemy | |
Base = declarative_base() | |
engine = create_engine(DATABASE_URL) | |
SessionLocal = sessionmaker(bind=engine) | |
# Define Candidate Model | |
class Candidate(Base): | |
__tablename__ = "candidates" | |
id = Column(Integer, primary_key=True, index=True) | |
name = Column(String, index=True) | |
score = Column(Integer) | |
summary = Column(Text) | |
resume_text = Column(Text) | |
pdf_link = Column(String) | |
# Create tables | |
Base.metadata.create_all(bind=engine) | |
# add email to the schema |