[BUG]: Introspect migration has unterminated comment
Author: jansedlonCreated Apr 8, 2024Updated Sep 29, 2026
Labelsbugdrizzle/kitpriority
What version of drizzle-orm are you using?
0.30.7
What version of drizzle-kit are you using?
0.20.14
Describe the Bug
- Have an existing Prisma DB
- Create drizzle config
- Run
drizzle-kit introspect:pg - Run the generated migration
It throws
error: unterminated /* comment at or near "/*
DO $$ BEGIN
CREATE TYPE "UserRole" AS ENUM('ADMIN', 'USER');
EXCEPTION
WHEN duplicate_object THEN null;
END $$;
"
error: unterminated /* comment at or near "/*
DO $$ BEGIN
CREATE TYPE "UserRole" AS ENUM('ADMIN', 'USER');
EXCEPTION
WHEN duplicate_object THEN null;
END $$;
"Expected behavior
It shouldn't do anything since the whole migration is commented
The initial migration looks like this
-- Current sql file was generated after introspecting the database
-- If you want to run this migration please uncomment this code before executing migrations
/*
DO $$ BEGIN
CREATE TYPE "UserRole" AS ENUM('ADMIN', 'USER');
EXCEPTION
WHEN duplicate_object THEN null;
END $$;
-- Rest of the migration
-- ...Environment & setup
No response
Source: drizzle-team/drizzle-orm