drizzle-team / drizzle-team/drizzle-orm
[BUG]: Introspect migration has unterminated comment
- Dominant language
- TypeScript
- Stars
- 35.8k
- Forks
- 1.6k
- Avg merge
- 2d 7h
- Merged PRs (30d)
- 4
Description
### 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_
Contributor guide
Assessment
This issue has not been assessed yet.