#table does not exist in bdd but does exist

12 messages · Page 1 of 1 (latest)

nimble timberBOT
#

To help others find answers, you can mark your question as solved via Right click solution message -> Apps -> ✅ Mark Solution

cyan hemlock
#

main here is potentially the schema, in pg it's usually public by default

grave herald
#

also try mapping each model by adding an @@map(“nameModel”) at the end.

#

and I get this error :

#
PrismaClientKnownRequestError:
0|bundle  | Invalid `prisma.configurations.findMany()` invocation:
0|bundle  | The table `main.Configurations` does not exist in the current database.

code: 'P2021',
0|bundle  |   clientVersion: '5.17.0',
0|bundle  |   meta: { modelName: 'Configurations', table: 'main.Configurations' }
#

is adding the word main

cyan hemlock
#

Can you connect to your sqlite db with a tool like dbeaver so you can see the schemas and such? I only looked quickly, but I didn't see any config value where you could set a different schema. You can think of schemas here as a separate set of tables on the same database similar to how I have many databases on my local pg server. You don't see it often anymore (mostly in data lakes), but in theory From waa-db I could query the jared database with select * from jared.public.table (don't do this in practice please), but cross schema queryies/addressing can be done.

grave herald
#

my tables exist and have content but when generating and in the connection string I use :

datasource db {
  provider = "sqlite"
  url      = "file:./dev.db"
}```

the problem comes when I pack all my backend and I want to use pm2 to build the bundle it tells me that the table main.configurations does not exist and it is only called configurations.
cyan hemlock
#

Ok, can you connect to that remote database and see if say your migrations applied, in this case at all?