# Adding CreatedAt Column

* In the `models.py` file we should add the following:

```python
from app.database import Base
from sqlalchemy import TEXT, TIMESTAMP, Column, Integer, String, Boolean, text
from sqlalchemy.sql.expression import null

class Post(Base):
    # Define Tablename
    __tablename__ = 'posts'

    # Define Columns
    id = 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()'))
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.arkannis.net/programming/python/frameworks/sqlalchemy/adding-createdat-column.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
