Drizzle TeamDT
Drizzle Team•6mo ago
Eric

Error creating migration in PayloadCMS

Not sure if this is the place to ask, but as Payload is just using Drizzle for DB Management and Migrations, I figured this might be a drizzle issue and not a payload issue. Anyways, when I try to create a new migration, I get the following error:

/node_modules/.pnpm/payload@3.45.0_graphql@16.11.0_typescript@5.7.2/node_modules/payload/src/bin/migrate.ts:100
        throw new Error(Error creating migration: ${error})
              ^


Error: Error creating migration: [
  {
    "code": "invalid_literal",
    "expected": "7",
    "path": [
      "version"
    ],
    "message": "Invalid literal value, expected "7""
  },
  {
    "code": "invalid_literal",
    "expected": "postgresql",
    "path": [
      "dialect"
    ],
    "message": "Invalid literal value, expected "postgresql""
  },
  {
    "code": "invalid_type",
    "expected": "object",
    "received": "undefined",
    "path": [
      "tables"
    ],
    "message": "Required"
  },
  {
    "code": "invalid_type",
    "expected": "object",
    "received": "undefined",
    "path": [
      "enums"
    ],
    "message": "Required"
  },
  {
    "code": "invalid_type",
    "expected": "object",
    "received": "undefined",
    "path": [
      "schemas"
    ],
    "message": "Required"
  },
  {
    "code": "invalid_type",
    "expected": "object",
    "received": "undefined",
    "path": [
      "_meta"
    ],
    "message": "Required"
  },
  {
    "code": "invalid_type",
    "expected": "string",
    "received": "undefined",
    "path": [
      "prevId"
    ],
    "message": "Required"
  }
]
    at migrate (/node_modules/payload/src/bin/migrate.ts💯15)
    at async start (/node_modules/.pnpm/payload@3.45.0_graphql@16.11.0_typescript@5.7.2/node_modules/payload/bin.js:30:7)

Node.js v23.11.1
 ELIFECYCLE  Command failed with exit code 1.


If this is not the right place to ask, I apologize, but maybe someone has an idea on how to debug this further, thanks!
Was this page helpful?