Digitale bierlijst

schema.py 478B

123456789101112131415161718192021
  1. """
  2. Defines the database schema for the backend.
  3. """
  4. from sqlalchemy import Column, Integer, String
  5. from sqlalchemy.ext.declarative import declarative_base
  6. BASE = declarative_base()
  7. class Person(BASE):
  8. ''' Represents a person to be shown on the lists. '''
  9. __tablename__ = 'people'
  10. person_id = Column(Integer, primary_key=True)
  11. name = Column(String, nullable=False)
  12. def __repr__(self):
  13. return f"<Person(id={self.person_id}, name={self.name})>"