Skip to content

Problem on "Working with databases" #450

@thiagoluis

Description

@thiagoluis

Description

Link to page: Working with databases

I'm following this guide and writing the code to better understand it. After completing each file, I performed a test by submitting the data to the page table and received the following error:

throwable: Error: Object of class DateTimeImmutable could not be converted to string in /var/www/app/vendor/yiisoft/db/src/Driver/Pdo/AbstractPdoCommand.php:173

I went to the save() method of the PageRepository and forced a formatting, then received another error:

throwable: PDOException: SQLSTATE[42703]: Undefined column: 7 ERROR: column "createdAt" of relation "page" does not exist

I compared it with the columns of the table created in the migration, and they are different: created_at and updated_at. I adjusted the columns in the save() and createPage() methods, and it worked.

When you can, please validate this detail. Thank you!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions