Error when pushing twice to planetscale when using T3 stack with drizzle

After setting up a basic app with drizzle, running the first pnpm db:push works fine. But when I run pnpm db:push again, I get the following error: target: drizzle-test.-.primary: vttablet: rpc error: code = InvalidArgument desc = Incorrect table definition; there can be only one auto column and it must be defined as a key (errno 1075) (sqlstate 42000) (CallerID: j49qs0uvtghviros3kfg): Sql: "alter table drizzle-test_post drop primary key", BindVars: {REDACTED} I'm new to drizzle. Any help on this?
3 Replies
Ruiisuuu
Ruiisuuu14mo ago
^ having this same issue. Is there something wrong with the default schema in drizzle t3 app?
Nic
Nic14mo ago
Also had this issue, my research comes down to drizzle's introspection isnt pulling the correct keys from the database
Nic
Nic14mo ago
Their discord says to "create a migration and alter it to remove the drop primary key command". I submitted an issue on their github to raise awareness: https://github.com/drizzle-team/drizzle-orm/issues/1428
GitHub
[BUG]: ER_WRONG_AUTO_KEY - Drizzle Kit not detecting primary keys ·...
What version of drizzle-orm are you using? 0.28.6 What version of drizzle-kit are you using? 0.19.13 Describe the Bug Drizzle-kit isn't introspecting the correct primary keys from planet scale....
Want results from more Discord servers?
Add your server