backend/_collections/models.py
2025-05-08 20:11:37 +03:00

23 lines
No EOL
866 B
Python
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

from fastapi import HTTPException
from sqlalchemy import Column, Integer, String, Float, Boolean, ForeignKey
from sqlalchemy.dialects.postgresql import ARRAY
from sqlalchemy.orm import Session, relationship
from ..config import Base
'''
##### veri tabanı modelleri #####
class Collections(Base):
__tablename__ = "collections_table"
collection_id = Column(Integer, index=True, primary_key=True , autoincrement=True)
user_id = Column(Integer, ForeignKey('users_table.user_id'), nullable=False)
visibility = Column(Boolean, default=True)
colllection_name = Column(String, default="No name")
collection_description = Column(String, default="No description")
# ilişkiler
user = relationship("DBUser", back_populates="user_collections")
items = relationship("Items", back_populates="collection", cascade="all, delete-orphan")
'''