text: #!/var/www/FlaskApp/venv/bin/python3
  # Module to set up database.
  from sqlalchemy import Column, ForeignKey, Integer, String
  from sqlalchemy.ext.declarative import declarative_base
  from sqlalchemy.orm import relationship
  from sqlalchemy import create_engine
  
  Base = declarative_base()
  
  
  class User(Base):
      """Class to create the table 'user'."""
  
      __tablename__ = "user"
  
      id = Column(Integer, primary_key=True)
      name = Column(String(250), nullable=False)
      email = Column(String(250), nullable=False)
      picture = Column(String(250))
  
  
  class Category(Base):
      """Class to create the table 'category'."""
  
      __tablename__ = "category"
  
      id = Column(Integer, primary_key=True)
      name = Column(String(50), nullable=False)
      user_id = Column(Integer, ForeignKey('user.id'))
      user = relationship(User)
  
      @property
      def serialize(self):
          """Return object data in easily serializeable format."""
          return {
              'id': self.id,
              'name': self.name,
              'user_id': self.user_id
          }
  
  
  class Item(Base):
      """Class to create the table 'item'."""
  
      __tablename__ = "item"
  
      id = Column(Integer, primary_key=True)
      name = Column(String(80), nullable=False)
      description = Column(String(250))
      category_id = Column(Integer, ForeignKey('category.id'))
      category = relationship(Category)
      user_id = Column(Integer, ForeignKey('user.id'))
      user = relationship(User)
  
      @property
      def serialize(self):
          """Return object data in easily serializeable format."""
          return {
              'id': self.id,
              'name': self.name,
              'description': self.description,
              'user_id': self.user_id,
              'category_id': self.category_id
          }
  
  
  engine = create_engine('postgresql://catalog:password@localhost/catalog')
  Base.metadata.create_all(engine)
  