PostgresError: Relation X does not exist - After reorganizing schema
Hi guys,
I have two tables (team and team_members) , which have a relation.
All my schema was in one file and I decided to split it into multiple to make it cleaner.
I ran the drizzle-kit generate:pg command with success, my app starts and does migration with success. But when I try to insert a new team_member it tells me that the relation does not exists.
I find that odd, I also double checked I didn't delete anything.
Any clue ? It's very late for me, perhaps i'm just missing something super obvious...
7 Replies
PostgresError: relation "team_members" does not existteam.ts: team-member.ts
Make sure you are importing both files and putting them in the schema object you pass to drizzle
Yup,
I have a
schema.ts
file right next to the other two:
Then in my db/index.ts
file:
Oh wait ?
In my drizzle folder I have this migration sql file: lol
So you probably didn't update your config and ran a migration?
I'm gonna delete the folder, re-run generate and try, one sec
Oh no
I forgot about ![PPTheClown](https://cdn.discordapp.com/emojis/824942847869845515.png)
![PPTheClown](https://cdn.discordapp.com/emojis/824942847869845515.png)
Understandable
It's my first time using drizzle
sorry for that lol
Works like a charm now nice