FastAPI-Project / app /models /votes.py
abdullah090809's picture
initial commit
55fd541
Raw
History Blame Contribute Delete
303 Bytes
from sqlalchemy import Column, ForeignKey, Integer
from app.database import Base
class Votes(Base):
__tablename__= "votes"
user_id= Column(Integer,ForeignKey("users.id",ondelete="CASCADE"),primary_key=True)
post_id= Column(Integer,ForeignKey("posts.id",ondelete="CASCADE"),primary_key=True)