© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
Drizzle TeamDT
Drizzle Team•2y ago•
34 replies
addamsson

How can I "tell" Drizzle if a migration is considered "done" or not when migrating from Prisma?

I'm migrating my project from Prisma to Drizzle following the migration guide and I've bumped into a problem. Drizzle correctly generates a migration file that says:
-- Current sql file was generated after introspecting the database
-- If you want to run this migration please uncomment this code before executing migrations
-- Current sql file was generated after introspecting the database
-- If you want to run this migration please uncomment this code before executing migrations

my problem is that this will fail when I start my application:
await client.connect();
// This command run all migrations from the migrations folder and apply changes to the database
await migrate(db, {
    migrationsFolder: resolve(__dirname, "../src/drizzle"),
});
await client.connect();
// This command run all migrations from the migrations folder and apply changes to the database
await migrate(db, {
    migrationsFolder: resolve(__dirname, "../src/drizzle"),
});

with:
error: unterminated /* comment at or near "/*
DO $$ BEGIN
 CREATE TYPE "public"."AccountProvider" AS ENUM('LOCAL', 'DISCORD');
EXCEPTION
 WHEN duplicate_object THEN null;
END $$;
"
error: unterminated /* comment at or near "/*
DO $$ BEGIN
 CREATE TYPE "public"."AccountProvider" AS ENUM('LOCAL', 'DISCORD');
EXCEPTION
 WHEN duplicate_object THEN null;
END $$;
"

so right after the unterminated
/*
/*
that comes with the script. If I uncomment this script then it fails with:
error: column "providerid" does not exist
error: column "providerid" does not exist

I think this migration shouldn't run at all, since it was generated from my existing schema (so no migration is necessary). Is there a way to mark a migration as "done"? I checked and Drizzle created a
drizzle
drizzle
schema in my database and it has an empty
__drizzle_migrations
__drizzle_migrations
table.
Drizzle TeamJoin
The official Discord for all Drizzle related projects, such as Drizzle ORM, Drizzle Kit, Drizzle Studio and more!
11,879Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

Drizzle not migrating (SupaBase) when I run npx drizzle-kit migrate
Drizzle TeamDTDrizzle Team / help
2y ago
Is drizzle's transaction considered interactive or non-interactive?
Drizzle TeamDTDrizzle Team / help
2y ago
Migration from prisma to Drizzle
Drizzle TeamDTDrizzle Team / help
2y ago
How can I close connections after a query is done
Drizzle TeamDTDrizzle Team / help
3y ago