Skip to content

fix(drizzle): use correct syntax for type imports in migration template #13421

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

roydigerhund
Copy link

When creating migrations with payload migrate:create the resulting file will have the following import line:

// Wrong
import { MigrateUpArgs, MigrateDownArgs, sql } from '@payloadcms/db-postgres'

If in the TS config verbatimModuleSyntax is enabled, this will throw an error because the first two imports are a type and using the type-only import syntax.

This PR fixes the templates and changes the import line to:

// Correct
import { type MigrateUpArgs, type MigrateDownArgs, sql } from '@payloadcms/db-postgres'

I wanna fix this because after creating a migration I have to fix the created file before I can execute the migration, which is annoying.

@andershermansen
Copy link
Contributor

Duplicate of #12020 ?

@roydigerhund
Copy link
Author

Duplicate of #12020 ?

Yes, you are right. Since the other PR is open since 4 months, is there anything blocking it?

@andershermansen
Copy link
Contributor

Duplicate of #12020 ?

Yes, you are right. Since the other PR is open since 4 months, is there anything blocking it?

Time from payload team to review I guess. It's a lot of open PR and issues for them to handle.

@DanRibbens
Copy link
Contributor

Working on getting #12020. Thanks for linking it @andershermansen!
My apologies we didn't get to it sooner causing you the extra hassle @roydigerhund.

@DanRibbens DanRibbens closed this Aug 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants