Open TArch64 opened 2 months ago
I've tried to drop a database and run migrations again however the error is still present
This bug happens when switching from serial to identity. Drizzle generate the following:
CREATE SCHEMA "test";
--> statement-breakpoint
CREATE TABLE IF NOT EXISTS "test"."users" (
"id" serial PRIMARY KEY NOT NULL,
"first_name" varchar(100) NOT NULL,
"last_name" varchar(100) NOT NULL
);
ALTER TABLE "test"."users" ALTER COLUMN "id" SET DATA TYPE integer;--> statement-breakpoint
ALTER TABLE "test"."users" ALTER COLUMN "id" ADD GENERATED ALWAYS AS IDENTITY (sequence name "test"."users_id_seq" INCREMENT BY 1 MINVALUE 1 MAXVALUE 2147483647 START WITH 1 CACHE 1);
What version of
drizzle-orm
are you using?0.32.0
What version of
drizzle-kit
are you using?0.32.0
Describe the Bug
Hi. I've updated to the latest version to try out sequences for id column but when I running a migration it fails with error
Error:
Here is table example
Here is generated migration
Expected behavior
Migration works
Environment & setup
OS: MacOS 14.5 Docker: Docker version 27.0.3, build 7d4bcd8 Docker Compose: Docker Compose version v2.28.1-desktop.1 Database: PostgreSQL 16.3 Node.js: v20.14.0