Fixes #7402 This fixes a regression from changes to the postgres migration template that were incorrect. It also fixes other type errors for `payload.db.drizzle` which needed to be declared for postgres to avoid confusing it with Libsql for SQLite.
17 lines
454 B
TypeScript
17 lines
454 B
TypeScript
import type { MigrationTemplateArgs } from 'payload'
|
|
|
|
export const getMigrationTemplate = ({
|
|
downSQL,
|
|
imports,
|
|
upSQL,
|
|
}: MigrationTemplateArgs): string => `import { MigrateUpArgs, MigrateDownArgs, sql } from '@payloadcms/db-postgres'
|
|
${imports ? `${imports}\n` : ''}
|
|
export async function up({ payload, req }: MigrateUpArgs): Promise<void> {
|
|
${upSQL}
|
|
}
|
|
|
|
export async function down({ payload, req }: MigrateDownArgs): Promise<void> {
|
|
${downSQL}
|
|
}
|
|
`
|