16 lines
523 B
Python
16 lines
523 B
Python
from sqlalchemy import Column, Integer, String
|
|
from sqlalchemy.orm import relationship
|
|
|
|
from app.db.base_class import Base
|
|
|
|
|
|
class Supplier(Base):
|
|
id = Column(Integer, primary_key=True, index=True)
|
|
name = Column(String, index=True, nullable=False)
|
|
contact_name = Column(String, nullable=True)
|
|
email = Column(String, nullable=True)
|
|
phone = Column(String, nullable=True)
|
|
address = Column(String, nullable=True)
|
|
|
|
# Relationships
|
|
products = relationship("Product", back_populates="supplier") |