In the models.py file we should add the following:
from app.database import Basefrom sqlalchemy import TEXT, TIMESTAMP, Column, Integer, String, Boolean, textfrom sqlalchemy.sql.expression import nullclassPost(Base):# Define Tablename __tablename__ ='posts'# Define Columnsid=Column(Integer, primary_key=True, nullable=False) title =Column(String, nullable=False) content =Column(String, nullable=False) published =Column(Boolean, server_default='TRUE', nullable=False)# This is how you create the Timestamp for the table created_at =Column(TIMESTAMP(timezone=True), nullable=False, server_default=text('now()'))