#"The underlying table does not contain a valid unique identifier and can therefore currently not be"
26 messages · Page 1 of 1 (latest)
What's my solution? I can't change the db, only read
Add the @id to your model
To the right field
So on schema.prisma I'm adding @id then should I run a prisma command?
Because it still doesn't work
/// The underlying table does not contain a valid unique identifier and can therefore currently not be handled by Prisma Client.
model trading_post_items_for_sale {
sale_id Int? @id @unique(map: "sale_id")
sold_by_player String? @db.VarChar(15)
item_name String? @db.VarChar(250)
item_id Int?
item_amount_start Int?
item_price Int?
item_price_estimate_at_time Int?
sold_by_player_session_id String? @db.VarChar(12)
sold_by_player_session_state_id String? @db.VarChar(12)
has_been_pulled_of_sale_by_owner Int? @default(0) @db.TinyInt
pulled_of_sale_time Int?
created_at Int?
@@index([sold_by_player], map: "sold_by_player")
@@ignore
}
Yes
I did npx prisma db pull
Then I added the @id field
@naive venture See line 17
But still not working
(After adding the @id field and saving the file I ran npx prisma generate)
Maybe I'm missing something here. Like the two tables should be joined, it's relational after all, I'm not sure what the best way to handle this stuff is in prisma
Is your prisma variable instantiated correctly?
Because it says your model is undefined, which should not be right
It only says that for trading_post_items_for_sale though, on the other model it doesn't throw that error
model trading_post_items_sold_log works fine for querying
I mean it is warning me on line 15 that Prisma can't work with it, and on line 31 it says @@ignore not sure what it means
Could be a typing error
Ok how do I solve?
Any help? :/
Prisma requires every model to have a unique identifier. In your case, the