Open valentin0h opened 5 months ago
Having a very similar issue to https://github.com/drizzle-team/drizzle-kit-mirror/issues/45
The following code change
mysqlTable( { id: serial('id').primaryKey(), + publicId: varchar('public_id', { length: 100 }).unique().notNull(), + otherId: varchar('other_id', { length: 100 }).notNull(),
generates this migration file
ALTER TABLE `content_references` ADD CONSTRAINT `content_references_public_id_unique` UNIQUE(`public_id`);--> statement-breakpoint ALTER TABLE `content_references` ADD `public_id` varchar(100) NOT NULL;%
Env:
drizzle-kit 0.20.14 drizzle-orm 0.29.4 MySQL (PlanetScale)
I am facing the same issue. The statement for the unique constraint is generated before the column creation statement in the migration file.
Having a very similar issue to https://github.com/drizzle-team/drizzle-kit-mirror/issues/45
The following code change
generates this migration file
Env:
drizzle-kit 0.20.14 drizzle-orm 0.29.4 MySQL (PlanetScale)