Hi, does anyone know why I'm getting the following error after replacing
payload.findwith
SELECT * FROM A WHERE C LIMIT 1and import sql from drizzle :
node_modules\@payloadcms\db-postgres\src\schema\createIndex.ts:22
columns = [table[name]]
^
TypeError: Cannot read properties of undefined (reading 'createdAt') at func (node_modules\@payloadcms\db-postgres\src\schema\createIndex.ts:22:23)Even after commenting out the additions that caused the error, I can't rerun my code again
VERSION : V2 , DB : POSTGRES
The only tables that don't have a
created_atcolumn are the
${tableName}_relstables
UPDATE : i add create_at column for each
rels table nothing change${...}
tables
UPDATE : I only keep one simple table (User) in payload config, still in error state
```const User: CollectionConfig = {
slug: 'user',
labels: {
singular: 'User',
plural: 'Users'
},
auth: true,
admin: {
useAsTitle: 'email',
},
fields: [],
}``` This table is the one triggering the error in PayloadCMS
https://github.com/payloadcms/payload/blob/eca1517237c78983c192f4bafa92a86d94a0de9e/packages/db-postgres/src/schema/createIndex.ts#L22
SUMMARY : I removed all the tables from the collections attribute in the config (including user table) and every plugin from plugin attribute, but the error persists with user table.
I am going to delete my node_modules and then reinstall it <:painwithcoffee:1116349314076254300>
Nothing change after re-install
To usesql
, I installeddrizzle-orm
, but havingdrizzle-orm
installed caused this issue. So, I need to uninstall it and reinstall@payloadcms/db-postgres``
Star
Discord
online
Get dedicated engineering support directly from the Payload team.