payload icon indicating copy to clipboard operation
payload copied to clipboard

(db-postgres): `enable_a_p_i_key` column syntax in Users database table

Open joshuaja opened this issue 1 year ago • 4 comments

Link to reproduction

https://github.com/DapperMountain/payload-3-bun-template

Environment Info

Binaries:
  Node: 22.2.0
  npm: 10.7.0
  Yarn: N/A
  pnpm: N/A
Relevant Packages:
  payload: 3.0.0-beta.97
  next: 15.0.0-canary.104
  @payloadcms/db-postgres: 3.0.0-beta.97
  @payloadcms/email-nodemailer: 3.0.0-beta.97
  @payloadcms/graphql: 3.0.0-beta.97
  @payloadcms/next/utilities: 3.0.0-beta.97
  @payloadcms/richtext-lexical: 3.0.0-beta.97
  @payloadcms/translations: 3.0.0-beta.97
  @payloadcms/ui/shared: 3.0.0-beta.97
  react: 19.0.0-rc-e56f4ae3-20240830
  react-dom: 19.0.0-rc-e56f4ae3-20240830
Operating System:
  Platform: darwin
  Arch: arm64
  Version: Darwin Kernel Version 23.6.0: Mon Jul 29 21:14:46 PDT 2024; root:xnu-10063.141.2~1/RELEASE_ARM64_T6031
  Available memory (MB): 36864
  Available CPU cores: 14

Describe the Bug

When enabling API Key on a users collection (auth.useAPIKey = true) it creates a few columns in the collection database table. The column naming isn't consistent between the enable_a_p_i_key, api_key, and api_key_index columns. I would recommend changing enable_a_p_i_key to enable_api_key to align with the other column names.

image

Reproduction Steps

  1. Enable API Key on a users collection (auth.useAPIKey = true)
  2. Check the collection database table column names
  3. enable_a_p_i_key would better be named enable_api_key

Adapters and Plugins

db-postgres

joshuaja avatar Sep 02 '24 18:09 joshuaja

Looks like this might be related to the to-snake-case npm package. I'm assuming that the variable provided is enableAPIKey which would translate to a rather silly looking enable_a_p_i_key column name in the database.

joshuaja avatar Sep 20 '24 22:09 joshuaja

My build was working, but this error started coming up out of no where on my v2 build. Any ideas?

tansanDOTeth avatar Sep 29 '24 10:09 tansanDOTeth

same for thumbnail_u_r_l and SQLite

karniv00l avatar Nov 23 '24 12:11 karniv00l

This issue has been marked as stale due to lack of activity.

To keep this issue open, please indicate that it is still relevant in a comment below.

github-actions[bot] avatar Dec 17 '24 05:12 github-actions[bot]

Issue is still relevant in 3.59-3.60: seeing thumbnail_u_r_l with Postgres

TmLev avatar Oct 20 '25 12:10 TmLev