[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

  1. Have an existing Prisma DB
  2. Create drizzle config
  3. Run drizzle-kit introspect:pg
  4. 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

sql
-- 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