-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bug: create-T3 app with drizzle missing default id value for users table on new user #1906
Labels
Comments
current solution i can think of is to assign a default value to user id
|
and for SQLite |
same error with same initial setup |
Same applies to MySQL as well. |
TheDevilOnLine
added a commit
to TheDevilOnLine/create-t3-app
that referenced
this issue
Jun 3, 2024
TheDevilOnLine
added a commit
to TheDevilOnLine/create-t3-app
that referenced
this issue
Jun 3, 2024
3 tasks
Closed
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Provide environment information
System:
OS: macOS 14.2.1
CPU: (12) arm64 Apple M2 Max
Memory: 1.44 GB / 32.00 GB
Shell: 5.9 - /bin/zsh
Binaries:
Node: 18.17.0 - ~/.nvm/versions/node/v18.17.0/bin/node
Yarn: 1.22.19 - /usr/local/bin/yarn
npm: 9.6.7 - ~/.nvm/versions/node/v18.17.0/bin/npm
pnpm: 9.0.6 - ~/.nvm/versions/node/v18.17.0/bin/pnpm
Watchman: 2023.12.04.00 - /opt/homebrew/bin/watchman
Describe the bug
[next-auth][error][adapter_error_createUser]
https://next-auth.js.org/errors#adapter_error_createuser null value in column "id" of relation "t3-c_user" violates not-null constraint {
message: 'null value in column "id" of relation "t3-c_user" violates not-null constraint',
stack: 'PostgresError: null value in column "id" of relation "t3-c_user" violates not-null constraint\n' +
' at ErrorResponse (webpack-internal:///(rsc)/./node_modules/.pnpm/[email protected]/node_modules/postgres/src/connection.js:803:66)\n' +
' at handle (webpack-internal:///(rsc)/./node_modules/.pnpm/[email protected]/node_modules/postgres/src/connection.js:489:6)\n' +
' at Socket.data (webpack-internal:///(rsc)/./node_modules/.pnpm/[email protected]/node_modules/postgres/src/connection.js:330:9)\n' +
' at Socket.emit (node:events:514:28)\n' +
' at addChunk (node:internal/streams/readable:324:12)\n' +
' at readableAddChunk (node:internal/streams/readable:297:9)\n' +
' at Readable.push (node:internal/streams/readable:234:10)\n' +
' at TCP.onStreamRead (node:internal/stream_base_commons:190:23)\n' +
' at TCP.callbackTrampoline (node:internal/async_hooks:130:17)',
name: 'PostgresError'
}
GET /api/auth/callback/discord?code=KlGcFSWb4LrXqN4kDv8zdQcIj8UYzX&state=aU_NrRWwP9zBsz6FJ13Pt5hzyWLZq86t7HSwV5qQh1k 302 in 516ms
GET /api/auth/error?error=OAuthCreateAccount 302 in 14ms
GET /api/auth/signin?error=OAuthCreateAccount 200 in 5ms
Reproduction repo
no applicable
To reproduce
pnpm create t3-app@latest --CI --trpc --tailwind --nextAuth --drizzle --dbProvider postgress
pnpm db:push
pnpm dev
set up discord_app
login with discord provider
Additional information
the issue occur when logging with a new user with oAuth by discord, no user_id is created by drizzle ORM.
where as Prisma supports CUID
as Drizzle requires not-null value without creating one on account creation
The text was updated successfully, but these errors were encountered: