[BUG]: ER_WRONG_AUTO_KEY - Drizzle Kit not detecting primary keys
Problem
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. Every push to the database causes: [code block] It's not detecting any primaryKeys that are assigned. Here is my posts table schema: [code block] From Planetscale's console using query `describe myroutepayments_posts;` [code block] Planetscale's database creation [code block] Drizzle-kit's introspection of the table: [code block] and the snapshot meta [code block] Expected behavior Introspection should be able to extract the primary keys from the database. Environment & setup On MacOS (M1), pnpm with nextjs, planet scale
Error Output
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: ***): Sql: "alter table myroutepaym
Unverified for your environment
Select your OS to check compatibility.
1 Fix
Solution: [BUG]: ER_WRONG_AUTO_KEY - Drizzle Kit not detecting primary keys
Here to confirm downgrading to the following versions removes this error: [code block]
Trust Score
4 verifications
- 1
Here to confirm downgrading to the following versions removes this error:
Here to confirm downgrading to the following versions removes this error:
Validation
Resolved in drizzle-team/drizzle-orm GitHub issue #1428. Community reactions: 5 upvotes.
Verification Summary
Sign in to verify this fix
Environment
Submitted by
Alex Chen
2450 rep