Open L-Mario564 opened 3 weeks ago
Same with postgres.
A workaround would be to use foreignKey()
and provide a custom name.
But if one uses .references()
, then drizzle can generate a name longer than 63 characters and Postgres will truncate it.
On the next migration drizzle will drop this truncated constraint and create a new one. This is not good.
Example of drizzle generate
output in my case:
ALTER TABLE "component_dependencies" DROP CONSTRAINT "component_dependencies_component_version_id_component_versions_";
DO $$ BEGIN
ALTER TABLE "component_dependencies" ADD CONSTRAINT "component_dependencies_component_version_id_component_versions_id_fk" FOREIGN KEY ("component_version_id") REFERENCES "public"."component_versions"("id") ON DELETE no action ON UPDATE no action;
EXCEPTION
WHEN duplicate_object THEN null;
END $$;
What version of
drizzle-orm
are you using??
What version of
drizzle-kit
are you using??
Describe the Bug
From drizzle-kit-mirror repo: https://github.com/drizzle-team/drizzle-kit-mirror/issues/128.
Expected behavior
No response
Environment & setup
No response