zendev
zendev
Explore posts from servers
DTDrizzle Team
Created by Dr. Pure on 7/14/2024 in #help
Issue with constraint primary key when using drizzle-kit push 2 times.
Just curious - do I now need to keep this “name” property in the schema forever?
21 replies
DTDrizzle Team
Created by Dr. Pure on 7/14/2024 in #help
Issue with constraint primary key when using drizzle-kit push 2 times.
@Raphaël M (@rphlmr) ⚡ it worked! Thank you so much 🙏🏽
21 replies
DTDrizzle Team
Created by Dr. Pure on 7/14/2024 in #help
Issue with constraint primary key when using drizzle-kit push 2 times.
Amazing thank you I will try this and get back to you
21 replies
DTDrizzle Team
Created by Dr. Pure on 7/14/2024 in #help
Issue with constraint primary key when using drizzle-kit push 2 times.
I see. So what is the solution here then?
21 replies
DTDrizzle Team
Created by Dr. Pure on 7/14/2024 in #help
Issue with constraint primary key when using drizzle-kit push 2 times.
Haha yes I am now on 0.23
21 replies
DTDrizzle Team
Created by Dr. Pure on 7/14/2024 in #help
Issue with constraint primary key when using drizzle-kit push 2 times.
Also for reference I have never used push in this project 😊
21 replies
DTDrizzle Team
Created by Dr. Pure on 7/14/2024 in #help
Issue with constraint primary key when using drizzle-kit push 2 times.
I hadn’t changed any names or anything in the schema except for adding that column which you can see at the bottom of the migration file I shared above.
21 replies
DTDrizzle Team
Created by Dr. Pure on 7/14/2024 in #help
Issue with constraint primary key when using drizzle-kit push 2 times.
It was a project with existing migration files, yes. Before upgrade I was on drizzle-kit 0.19, now on 0.23
21 replies
DTDrizzle Team
Created by Dr. Pure on 7/14/2024 in #help
Issue with constraint primary key when using drizzle-kit push 2 times.
Btw this just happened to me after updating to the latest version of drizzle-orm and drizzle-kit
21 replies
DTDrizzle Team
Created by Dr. Pure on 7/14/2024 in #help
Issue with constraint primary key when using drizzle-kit push 2 times.
I am running into a similar issue with migrate. The migration file looks like this
ALTER TABLE "artists_to_songs" DROP CONSTRAINT "artists_to_songs_artist_id_song_id";--> statement-breakpoint
ALTER TABLE "users_to_scenes" DROP CONSTRAINT "users_to_scenes_user_id_scene_unique_name";--> statement-breakpoint
ALTER TABLE "artists_to_songs" ADD CONSTRAINT "artists_to_songs_artist_id_song_id_pk" PRIMARY KEY("artist_id","song_id");--> statement-breakpoint
ALTER TABLE "users_to_scenes" ADD CONSTRAINT "users_to_scenes_user_id_scene_unique_name_pk" PRIMARY KEY("user_id","scene_unique_name");--> statement-breakpoint
ALTER TABLE "songs" ADD COLUMN "image_colors" text[] NOT NULL;
ALTER TABLE "artists_to_songs" DROP CONSTRAINT "artists_to_songs_artist_id_song_id";--> statement-breakpoint
ALTER TABLE "users_to_scenes" DROP CONSTRAINT "users_to_scenes_user_id_scene_unique_name";--> statement-breakpoint
ALTER TABLE "artists_to_songs" ADD CONSTRAINT "artists_to_songs_artist_id_song_id_pk" PRIMARY KEY("artist_id","song_id");--> statement-breakpoint
ALTER TABLE "users_to_scenes" ADD CONSTRAINT "users_to_scenes_user_id_scene_unique_name_pk" PRIMARY KEY("user_id","scene_unique_name");--> statement-breakpoint
ALTER TABLE "songs" ADD COLUMN "image_colors" text[] NOT NULL;
So you can see that drizzle-kit is dropping all composite PKs and then readding? It produces the following error when running drizzle-kit migrate:
PostgresError: constraint "users_to_scenes_user_id_scene_unique_name" of relation "users_to_scenes" does not exist
PostgresError: constraint "users_to_scenes_user_id_scene_unique_name" of relation "users_to_scenes" does not exist
21 replies
DTDrizzle Team
Created by Ilan Yehezkely on 3/19/2024 in #help
Neon postgres, drop all fk constraints on every push without any changes
I have the same issue, did you ever figure out why this was happening?
3 replies
DTDrizzle Team
Created by web_dev_dk on 7/3/2024 in #help
Keep getting relation constraint error when migrating
Without having to drop all the migrations preferably lol
5 replies
DTDrizzle Team
Created by web_dev_dk on 7/3/2024 in #help
Keep getting relation constraint error when migrating
Did you manage to resolve this or figure out what was going wrong?
5 replies
DTDrizzle Team
Created by web_dev_dk on 7/3/2024 in #help
Keep getting relation constraint error when migrating
I am running into almost the identical issue
5 replies
DTDrizzle Team
Created by zendev on 10/26/2023 in #help
Infinite scroll w/ Drizzle + tRPC
Think I made some progress towards figuring it out, thanks for your help
8 replies
DTDrizzle Team
Created by zendev on 10/26/2023 in #help
Infinite scroll w/ Drizzle + tRPC
Right, this would work for ids that autoincrement right? Because then it's a sequential number but what if you're using UUID or CUID or something of the like? I'm trying to figure out if I can use createdAt (which is a Date) but struggling to wrap my head around this for some reason
8 replies
DTDrizzle Team
Created by dBranded1 on 8/29/2023 in #help
Too many clients already (!?)
Think I'm running into the same issue, getting this message from tRPC: tRPC failed: no more connections allowed (max_client_conn) Is this only going to be an issue in dev? Nothing here impacts production?
11 replies
DTDrizzle Team
Created by zendev on 10/5/2023 in #help
How do relational queries work under the hood?
Cool thanks
4 replies
DTDrizzle Team
Created by zendev on 9/27/2023 in #help
get drizzle to correctly infer type with limit 1
I'm aware that you could use a findFirst() from there but didn't want to use that when I'm not querying relations
25 replies
DTDrizzle Team
Created by zendev on 9/27/2023 in #help
get drizzle to correctly infer type with limit 1
Yep, I've had a look but for the sake of separating concerns I prefer to only use that for relational queries. I try to keep all non-relational queries using select, insert, etc.
25 replies