payload icon indicating copy to clipboard operation
payload copied to clipboard

feat: allow loading predefined migrations from proper exports

Open AlessioGr opened this issue 1 year ago • 0 comments

Currently, predefined migrations can only be loaded if they are part of one of our db adapters.

With this PR, plugins will be able to export their own predefined migrations that can be created like this:

pnpm payload migrate:create --file @payloadcms/plugin-someplugin/someMigration

with the plugin exporting it in their package.json:

  "exports": {
    "./someMigration": {
      "import": "./someMigration.mjs",
      "types": "./someMigration.mjs",
      "default": "./someMigration.mjs"
    }
  },

AlessioGr avatar Dec 10 '24 19:12 AlessioGr