update
This commit is contained in:
15
backend/model/profile.py
Normal file
15
backend/model/profile.py
Normal file
@@ -0,0 +1,15 @@
|
||||
from sqlalchemy import Column, Integer, String
|
||||
from sqlalchemy.orm import Session
|
||||
|
||||
from database.database import Base
|
||||
|
||||
|
||||
class Profile(Base):
|
||||
__tablename__ = "profiles"
|
||||
|
||||
id = Column(Integer, primary_key=True, autoincrement=True)
|
||||
name = Column(String, nullable=False, unique=True)
|
||||
|
||||
@classmethod
|
||||
def get_all(cls, db: Session) -> list["Profile"]:
|
||||
return db.query(cls).all()
|
||||
Reference in New Issue
Block a user