@payloadcms/drizzle 4.0.0-internal.38b7f1d → 4.0.0-internal.40de3ec

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (110) hide show
  1. package/dist/createTableName.d.ts.map +1 -1
  2. package/dist/find/buildFindManyArgs.d.ts.map +1 -1
  3. package/dist/find/chainMethods.d.ts.map +1 -1
  4. package/dist/find/findMany.d.ts.map +1 -1
  5. package/dist/find/traverseFields.d.ts.map +1 -1
  6. package/dist/find/traverseFields.js +1 -1
  7. package/dist/find/traverseFields.js.map +1 -1
  8. package/dist/index.d.ts +0 -1
  9. package/dist/index.d.ts.map +1 -1
  10. package/dist/index.js +0 -1
  11. package/dist/index.js.map +1 -1
  12. package/dist/migrate.d.ts.map +1 -1
  13. package/dist/migrate.js +1 -3
  14. package/dist/migrate.js.map +1 -1
  15. package/dist/postgres/createDatabase.d.ts.map +1 -1
  16. package/dist/postgres/createExtensions.d.ts.map +1 -1
  17. package/dist/postgres/createJSONQuery/index.d.ts.map +1 -1
  18. package/dist/postgres/predefinedMigrations/v2-v3/fetchAndResave/index.d.ts.map +1 -1
  19. package/dist/postgres/predefinedMigrations/v2-v3/fetchAndResave/traverseFields.d.ts.map +1 -1
  20. package/dist/postgres/predefinedMigrations/v2-v3/fetchAndResave/traverseFields.js.map +1 -1
  21. package/dist/postgres/predefinedMigrations/v2-v3/groupUpSQLStatements.d.ts.map +1 -1
  22. package/dist/postgres/predefinedMigrations/v2-v3/index.d.ts.map +1 -1
  23. package/dist/postgres/predefinedMigrations/v2-v3/migrateRelationships.d.ts.map +1 -1
  24. package/dist/postgres/predefinedMigrations/v2-v3/traverseFields.d.ts.map +1 -1
  25. package/dist/postgres/schema/buildDrizzleTable.d.ts.map +1 -1
  26. package/dist/postgres/schema/geometryColumn.d.ts.map +1 -1
  27. package/dist/queries/addJoinTable.d.ts.map +1 -1
  28. package/dist/queries/buildOrderBy.d.ts.map +1 -1
  29. package/dist/queries/buildQuery.d.ts.map +1 -1
  30. package/dist/queries/getTableAlias.d.ts.map +1 -1
  31. package/dist/queries/getTableColumnFromPath.d.ts.map +1 -1
  32. package/dist/queries/getTableColumnFromPath.js +2 -2
  33. package/dist/queries/getTableColumnFromPath.js.map +1 -1
  34. package/dist/queries/sanitizeQueryValue.d.ts.map +1 -1
  35. package/dist/queries/selectDistinct.d.ts.map +1 -1
  36. package/dist/schema/build.d.ts.map +1 -1
  37. package/dist/schema/buildDrizzleRelations.d.ts.map +1 -1
  38. package/dist/schema/buildRawSchema.d.ts.map +1 -1
  39. package/dist/schema/idToUUID.d.ts.map +1 -1
  40. package/dist/schema/traverseFields.d.ts.map +1 -1
  41. package/dist/schema/traverseFields.js +1 -1
  42. package/dist/schema/traverseFields.js.map +1 -1
  43. package/dist/schema/withDefault.d.ts.map +1 -1
  44. package/dist/sqlite/createJSONQuery/convertPathToJSONTraversal.d.ts.map +1 -1
  45. package/dist/sqlite/createJSONQuery/index.d.ts.map +1 -1
  46. package/dist/transform/read/hasManyNumber.d.ts.map +1 -1
  47. package/dist/transform/read/hasManyText.d.ts.map +1 -1
  48. package/dist/transform/read/index.d.ts.map +1 -1
  49. package/dist/transform/read/relationship.d.ts.map +1 -1
  50. package/dist/transform/read/traverseFields.d.ts.map +1 -1
  51. package/dist/transform/read/traverseFields.js +2 -2
  52. package/dist/transform/read/traverseFields.js.map +1 -1
  53. package/dist/transform/write/array.d.ts.map +1 -1
  54. package/dist/transform/write/blocks.d.ts.map +1 -1
  55. package/dist/transform/write/blocks.js +1 -1
  56. package/dist/transform/write/blocks.js.map +1 -1
  57. package/dist/transform/write/index.d.ts.map +1 -1
  58. package/dist/transform/write/numbers.d.ts.map +1 -1
  59. package/dist/transform/write/relationships.d.ts.map +1 -1
  60. package/dist/transform/write/selects.d.ts.map +1 -1
  61. package/dist/transform/write/texts.d.ts.map +1 -1
  62. package/dist/transform/write/traverseFields.d.ts.map +1 -1
  63. package/dist/transform/write/traverseFields.js +1 -1
  64. package/dist/transform/write/traverseFields.js.map +1 -1
  65. package/dist/upsertRow/deleteExistingArrayRows.d.ts.map +1 -1
  66. package/dist/upsertRow/deleteExistingRowsByPath.d.ts.map +1 -1
  67. package/dist/upsertRow/handleUpsertError.d.ts.map +1 -1
  68. package/dist/upsertRow/index.d.ts.map +1 -1
  69. package/dist/upsertRow/insertArrays.d.ts.map +1 -1
  70. package/dist/upsertRow/shouldUseOptimizedUpsertRow.d.ts.map +1 -1
  71. package/dist/utilities/appendPrefixToKeys.d.ts.map +1 -1
  72. package/dist/utilities/blocksToJsonMigrator.d.ts.map +1 -1
  73. package/dist/utilities/buildCreateMigration.d.ts.map +1 -1
  74. package/dist/utilities/buildCreateMigration.js +2 -30
  75. package/dist/utilities/buildCreateMigration.js.map +1 -1
  76. package/dist/utilities/buildForeignKeyName.d.ts.map +1 -1
  77. package/dist/utilities/buildIndexName.d.ts.map +1 -1
  78. package/dist/utilities/createBlocksMap.d.ts.map +1 -1
  79. package/dist/utilities/createRelationshipMap.d.ts.map +1 -1
  80. package/dist/utilities/createSchemaGenerator.d.ts.map +1 -1
  81. package/dist/utilities/escapeSQLValue.d.ts.map +1 -1
  82. package/dist/utilities/executeSchemaHooks.d.ts.map +1 -1
  83. package/dist/utilities/extendDrizzleTable.d.ts.map +1 -1
  84. package/dist/utilities/getArrayRelationName.d.ts.map +1 -1
  85. package/dist/utilities/getCollectionIdType.d.ts.map +1 -1
  86. package/dist/utilities/getMigrationTemplate.d.ts.map +1 -1
  87. package/dist/utilities/getNameFromDrizzleTable.d.ts.map +1 -1
  88. package/dist/utilities/getPrimaryDb.d.ts.map +1 -1
  89. package/dist/utilities/getTransaction.d.ts.map +1 -1
  90. package/dist/utilities/hasLocalesTable.d.ts.map +1 -1
  91. package/dist/utilities/isPolymorphicRelationship.d.ts.map +1 -1
  92. package/dist/utilities/isUUIDType.d.ts.map +1 -1
  93. package/dist/utilities/json.d.ts.map +1 -1
  94. package/dist/utilities/migrationTableExists.d.ts.map +1 -1
  95. package/dist/utilities/parseError.d.ts.map +1 -1
  96. package/dist/utilities/pushDevSchema.d.ts.map +1 -1
  97. package/dist/utilities/pushDevSchema.js +0 -14
  98. package/dist/utilities/pushDevSchema.js.map +1 -1
  99. package/dist/utilities/rawConstraint.d.ts.map +1 -1
  100. package/dist/utilities/sanitizePathSegment.d.ts.map +1 -1
  101. package/dist/utilities/validateExistingBlockIsIdentical.d.ts.map +1 -1
  102. package/package.json +4 -9
  103. package/dist/exports/types-deprecated.d.ts +0 -150
  104. package/dist/exports/types-deprecated.d.ts.map +0 -1
  105. package/dist/exports/types-deprecated.js +0 -5
  106. package/dist/exports/types-deprecated.js.map +0 -1
  107. package/dist/migrateVersionsEnabled.d.ts +0 -9
  108. package/dist/migrateVersionsEnabled.d.ts.map +0 -1
  109. package/dist/migrateVersionsEnabled.js +0 -52
  110. package/dist/migrateVersionsEnabled.js.map +0 -1
@@ -1,5 +1,4 @@
1
1
  import { dequal } from 'dequal';
2
- import { diffConfig, readConfigState, serializeConfig } from 'payload';
3
2
  import prompts from 'prompts';
4
3
  const previousSchema = {
5
4
  localeCodes: null,
@@ -60,19 +59,6 @@ const previousSchema = {
60
59
  }
61
60
  }
62
61
  await apply();
63
- // Warn if config changes require a data migration that dev push cannot handle
64
- const prevSnapshot = await readConfigState(adapter.migrationDir);
65
- if (prevSnapshot !== null) {
66
- const changes = diffConfig(prevSnapshot, serializeConfig(adapter.payload.config));
67
- const dataChanges = changes.filter((c)=>![
68
- 'autosave_enabled',
69
- 'locale_added',
70
- 'versions_enabled'
71
- ].includes(c.type));
72
- if (dataChanges.length > 0) {
73
- adapter.payload.logger.warn(`[payload] Config changes detected that require a data migration:\n` + dataChanges.map((c)=>` • ${c.type} on "${c.slug ?? c.locale}"`).join('\n') + `\nRun "payload migrate:create" and "payload migrate" to apply.`);
74
- }
75
- }
76
62
  const migrationsTable = adapter.schemaName ? `"${adapter.schemaName}"."payload_migrations"` : '"payload_migrations"';
77
63
  const drizzle = adapter.drizzle;
78
64
  const result = await adapter.execute({
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/utilities/pushDevSchema.ts"],"sourcesContent":["import { dequal } from 'dequal'\nimport { diffConfig, readConfigState, serializeConfig } from 'payload'\nimport prompts from 'prompts'\n\nimport type { BasePostgresAdapter } from '../postgres/types.js'\nimport type { DrizzleAdapter, PostgresDB, RawTable } from '../types.js'\n\nconst previousSchema: {\n localeCodes: null | string[]\n rawTables: null | Record<string, RawTable>\n} = {\n localeCodes: null,\n rawTables: null,\n}\n\n/**\n * Pushes the development schema to the database using Drizzle.\n *\n * @param {DrizzleAdapter} adapter - The PostgresAdapter instance connected to the database.\n * @returns {Promise<void>} - A promise that resolves once the schema push is complete.\n */\nexport const pushDevSchema = async (adapter: DrizzleAdapter) => {\n if (process.env.PAYLOAD_FORCE_DRIZZLE_PUSH !== 'true') {\n const localeCodes =\n adapter.payload.config.localization && adapter.payload.config.localization.localeCodes\n\n const equal = dequal(previousSchema, {\n localeCodes,\n rawTables: adapter.rawTables,\n })\n\n if (equal) {\n if (adapter.logger) {\n adapter.payload.logger.info('No changes detected in schema, skipping schema push.')\n }\n\n return\n } else {\n previousSchema.localeCodes = localeCodes\n previousSchema.rawTables = adapter.rawTables\n }\n }\n\n const { pushSchema } = adapter.requireDrizzleKit()\n\n const { extensions = {}, tablesFilter } = adapter as BasePostgresAdapter\n\n // This will prompt if clarifications are needed for Drizzle to push new schema\n const { apply, hasDataLoss, warnings } = await pushSchema(\n adapter.schema,\n adapter.drizzle,\n adapter.schemaName ? [adapter.schemaName] : undefined,\n tablesFilter,\n // Drizzle extensionsFilter supports only postgis for now\n // https://github.com/drizzle-team/drizzle-orm/blob/83daf2d5cf023112de878bc2249ee2c41a2a5b1b/drizzle-kit/src/cli/validations/cli.ts#L26\n extensions.postgis ? ['postgis'] : undefined,\n )\n\n if (warnings.length) {\n let message = `Warnings detected during schema push: \\n\\n${warnings.join('\\n')}\\n\\n`\n\n if (hasDataLoss) {\n message += `DATA LOSS WARNING: Possible data loss detected if schema is pushed.\\n\\n`\n }\n\n message += `Accept warnings and push schema to database?`\n\n const { confirm: acceptWarnings } = await prompts(\n {\n name: 'confirm',\n type: 'confirm',\n initial: false,\n message,\n },\n {\n onCancel: () => {\n process.exit(0)\n },\n },\n )\n\n // Exit if user does not accept warnings.\n // Q: Is this the right type of exit for this interaction?\n if (!acceptWarnings) {\n process.exit(0)\n }\n }\n\n await apply()\n\n // Warn if config changes require a data migration that dev push cannot handle\n const prevSnapshot = await readConfigState(adapter.migrationDir)\n if (prevSnapshot !== null) {\n const changes = diffConfig(prevSnapshot, serializeConfig(adapter.payload.config))\n const dataChanges = changes.filter(\n (c) => !['autosave_enabled', 'locale_added', 'versions_enabled'].includes(c.type),\n )\n if (dataChanges.length > 0) {\n adapter.payload.logger.warn(\n `[payload] Config changes detected that require a data migration:\\n` +\n dataChanges\n .map((c) => ` • ${c.type} on \"${(c as any).slug ?? (c as any).locale}\"`)\n .join('\\n') +\n `\\nRun \"payload migrate:create\" and \"payload migrate\" to apply.`,\n )\n }\n }\n\n const migrationsTable = adapter.schemaName\n ? `\"${adapter.schemaName}\".\"payload_migrations\"`\n : '\"payload_migrations\"'\n\n const drizzle = adapter.drizzle as PostgresDB\n\n const result = await adapter.execute({\n drizzle,\n raw: `SELECT * FROM ${migrationsTable} WHERE batch = '-1'`,\n })\n\n const devPush = result.rows\n\n if (!devPush.length) {\n // Use drizzle for insert so $defaultFn's are called\n await drizzle.insert(adapter.tables.payload_migrations).values({\n name: 'dev',\n batch: -1,\n })\n } else {\n await adapter.execute({\n drizzle,\n raw: `UPDATE ${migrationsTable} SET updated_at = CURRENT_TIMESTAMP WHERE batch = '-1'`,\n })\n }\n}\n"],"names":["dequal","diffConfig","readConfigState","serializeConfig","prompts","previousSchema","localeCodes","rawTables","pushDevSchema","adapter","process","env","PAYLOAD_FORCE_DRIZZLE_PUSH","payload","config","localization","equal","logger","info","pushSchema","requireDrizzleKit","extensions","tablesFilter","apply","hasDataLoss","warnings","schema","drizzle","schemaName","undefined","postgis","length","message","join","confirm","acceptWarnings","name","type","initial","onCancel","exit","prevSnapshot","migrationDir","changes","dataChanges","filter","c","includes","warn","map","slug","locale","migrationsTable","result","execute","raw","devPush","rows","insert","tables","payload_migrations","values","batch"],"mappings":"AAAA,SAASA,MAAM,QAAQ,SAAQ;AAC/B,SAASC,UAAU,EAAEC,eAAe,EAAEC,eAAe,QAAQ,UAAS;AACtE,OAAOC,aAAa,UAAS;AAK7B,MAAMC,iBAGF;IACFC,aAAa;IACbC,WAAW;AACb;AAEA;;;;;CAKC,GACD,OAAO,MAAMC,gBAAgB,OAAOC;IAClC,IAAIC,QAAQC,GAAG,CAACC,0BAA0B,KAAK,QAAQ;QACrD,MAAMN,cACJG,QAAQI,OAAO,CAACC,MAAM,CAACC,YAAY,IAAIN,QAAQI,OAAO,CAACC,MAAM,CAACC,YAAY,CAACT,WAAW;QAExF,MAAMU,QAAQhB,OAAOK,gBAAgB;YACnCC;YACAC,WAAWE,QAAQF,SAAS;QAC9B;QAEA,IAAIS,OAAO;YACT,IAAIP,QAAQQ,MAAM,EAAE;gBAClBR,QAAQI,OAAO,CAACI,MAAM,CAACC,IAAI,CAAC;YAC9B;YAEA;QACF,OAAO;YACLb,eAAeC,WAAW,GAAGA;YAC7BD,eAAeE,SAAS,GAAGE,QAAQF,SAAS;QAC9C;IACF;IAEA,MAAM,EAAEY,UAAU,EAAE,GAAGV,QAAQW,iBAAiB;IAEhD,MAAM,EAAEC,aAAa,CAAC,CAAC,EAAEC,YAAY,EAAE,GAAGb;IAE1C,+EAA+E;IAC/E,MAAM,EAAEc,KAAK,EAAEC,WAAW,EAAEC,QAAQ,EAAE,GAAG,MAAMN,WAC7CV,QAAQiB,MAAM,EACdjB,QAAQkB,OAAO,EACflB,QAAQmB,UAAU,GAAG;QAACnB,QAAQmB,UAAU;KAAC,GAAGC,WAC5CP,cACA,yDAAyD;IACzD,uIAAuI;IACvID,WAAWS,OAAO,GAAG;QAAC;KAA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QAAQkB,OAAO;IAE/B,MAAM0B,SAAS,MAAM5C,QAAQ6C,OAAO,CAAC;QACnC3B;QACA4B,KAAK,CAAC,cAAc,EAAEH,gBAAgB,mBAAmB,CAAC;IAC5D;IAEA,MAAMI,UAAUH,OAAOI,IAAI;IAE3B,IAAI,CAACD,QAAQzB,MAAM,EAAE;QACnB,oDAAoD;QACpD,MAAMJ,QAAQ+B,MAAM,CAACjD,QAAQkD,MAAM,CAACC,kBAAkB,EAAEC,MAAM,CAAC;YAC7DzB,MAAM;YACN0B,OAAO,CAAC;QACV;IACF,OAAO;QACL,MAAMrD,QAAQ6C,OAAO,CAAC;YACpB3B;YACA4B,KAAK,CAAC,OAAO,EAAEH,gBAAgB,sDAAsD,CAAC;QACxF;IACF;AACF,EAAC"}
1
+ {"version":3,"sources":["../../src/utilities/pushDevSchema.ts"],"sourcesContent":["import { dequal } from 'dequal'\nimport prompts from 'prompts'\n\nimport type { BasePostgresAdapter } from '../postgres/types.js'\nimport type { DrizzleAdapter, PostgresDB, RawTable } from '../types.js'\n\nconst previousSchema: {\n localeCodes: null | string[]\n rawTables: null | Record<string, RawTable>\n} = {\n localeCodes: null,\n rawTables: null,\n}\n\n/**\n * Pushes the development schema to the database using Drizzle.\n *\n * @param {DrizzleAdapter} adapter - The PostgresAdapter instance connected to the database.\n * @returns {Promise<void>} - A promise that resolves once the schema push is complete.\n */\nexport const pushDevSchema = async (adapter: DrizzleAdapter) => {\n if (process.env.PAYLOAD_FORCE_DRIZZLE_PUSH !== 'true') {\n const localeCodes =\n adapter.payload.config.localization && adapter.payload.config.localization.localeCodes\n\n const equal = dequal(previousSchema, {\n localeCodes,\n rawTables: adapter.rawTables,\n })\n\n if (equal) {\n if (adapter.logger) {\n adapter.payload.logger.info('No changes detected in schema, skipping schema push.')\n }\n\n return\n } else {\n previousSchema.localeCodes = localeCodes\n previousSchema.rawTables = adapter.rawTables\n }\n }\n\n const { pushSchema } = adapter.requireDrizzleKit()\n\n const { extensions = {}, tablesFilter } = adapter as BasePostgresAdapter\n\n // This will prompt if clarifications are needed for Drizzle to push new schema\n const { apply, hasDataLoss, warnings } = await pushSchema(\n adapter.schema,\n adapter.drizzle,\n adapter.schemaName ? [adapter.schemaName] : undefined,\n tablesFilter,\n // Drizzle extensionsFilter supports only postgis for now\n // https://github.com/drizzle-team/drizzle-orm/blob/83daf2d5cf023112de878bc2249ee2c41a2a5b1b/drizzle-kit/src/cli/validations/cli.ts#L26\n extensions.postgis ? ['postgis'] : undefined,\n )\n\n if (warnings.length) {\n let message = `Warnings detected during schema push: \\n\\n${warnings.join('\\n')}\\n\\n`\n\n if (hasDataLoss) {\n message += `DATA LOSS WARNING: Possible data loss detected if schema is pushed.\\n\\n`\n }\n\n message += `Accept warnings and push schema to database?`\n\n const { confirm: acceptWarnings } = await prompts(\n {\n name: 'confirm',\n type: 'confirm',\n initial: false,\n message,\n },\n {\n onCancel: () => {\n process.exit(0)\n },\n },\n )\n\n // Exit if user does not accept warnings.\n // Q: Is this the right type of exit for this interaction?\n if (!acceptWarnings) {\n process.exit(0)\n }\n }\n\n await apply()\n const migrationsTable = adapter.schemaName\n ? `\"${adapter.schemaName}\".\"payload_migrations\"`\n : '\"payload_migrations\"'\n\n const drizzle = adapter.drizzle as PostgresDB\n\n const result = await adapter.execute({\n drizzle,\n raw: `SELECT * FROM ${migrationsTable} WHERE batch = '-1'`,\n })\n\n const devPush = result.rows\n\n if (!devPush.length) {\n // Use drizzle for insert so $defaultFn's are called\n await drizzle.insert(adapter.tables.payload_migrations).values({\n name: 'dev',\n batch: -1,\n })\n } else {\n await adapter.execute({\n drizzle,\n raw: `UPDATE ${migrationsTable} SET updated_at = CURRENT_TIMESTAMP WHERE batch = '-1'`,\n })\n }\n}\n"],"names":["dequal","prompts","previousSchema","localeCodes","rawTables","pushDevSchema","adapter","process","env","PAYLOAD_FORCE_DRIZZLE_PUSH","payload","config","localization","equal","logger","info","pushSchema","requireDrizzleKit","extensions","tablesFilter","apply","hasDataLoss","warnings","schema","drizzle","schemaName","undefined","postgis","length","message","join","confirm","acceptWarnings","name","type","initial","onCancel","exit","migrationsTable","result","execute","raw","devPush","rows","insert","tables","payload_migrations","values","batch"],"mappings":"AAAA,SAASA,MAAM,QAAQ,SAAQ;AAC/B,OAAOC,aAAa,UAAS;AAK7B,MAAMC,iBAGF;IACFC,aAAa;IACbC,WAAW;AACb;AAEA;;;;;CAKC,GACD,OAAO,MAAMC,gBAAgB,OAAOC;IAClC,IAAIC,QAAQC,GAAG,CAACC,0BAA0B,KAAK,QAAQ;QACrD,MAAMN,cACJG,QAAQI,OAAO,CAACC,MAAM,CAACC,YAAY,IAAIN,QAAQI,OAAO,CAACC,MAAM,CAACC,YAAY,CAACT,WAAW;QAExF,MAAMU,QAAQb,OAAOE,gBAAgB;YACnCC;YACAC,WAAWE,QAAQF,SAAS;QAC9B;QAEA,IAAIS,OAAO;YACT,IAAIP,QAAQQ,MAAM,EAAE;gBAClBR,QAAQI,OAAO,CAACI,MAAM,CAACC,IAAI,CAAC;YAC9B;YAEA;QACF,OAAO;YACLb,eAAeC,WAAW,GAAGA;YAC7BD,eAAeE,SAAS,GAAGE,QAAQF,SAAS;QAC9C;IACF;IAEA,MAAM,EAAEY,UAAU,EAAE,GAAGV,QAAQW,iBAAiB;IAEhD,MAAM,EAAEC,aAAa,CAAC,CAAC,EAAEC,YAAY,EAAE,GAAGb;IAE1C,+EAA+E;IAC/E,MAAM,EAAEc,KAAK,EAAEC,WAAW,EAAEC,QAAQ,EAAE,GAAG,MAAMN,WAC7CV,QAAQiB,MAAM,EACdjB,QAAQkB,OAAO,EACflB,QAAQmB,UAAU,GAAG;QAACnB,QAAQmB,UAAU;KAAC,GAAGC,WAC5CP,cACA,yDAAyD;IACzD,uIAAuI;IACvID,WAAWS,OAAO,GAAG;QAAC;KAAU,GAAGD;IAGrC,IAAIJ,SAASM,MAAM,EAAE;QACnB,IAAIC,UAAU,CAAC,0CAA0C,EAAEP,SAASQ,IAAI,CAAC,MAAM,IAA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I,UAAU,CAAC,OAAO,aAAa,CAExF,CAAA"}
1
+ {"version":3,"file":"rawConstraint.d.ts","sourceRoot":"","sources":["../../src/utilities/rawConstraint.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,cAAc,eAA2B,CAAA;AAEtD;;GAEG;AACH,eAAO,MAAM,aAAa,GAAI,OAAO,OAAO;;;CAG1C,CAAA;AAEF,eAAO,MAAM,eAAe,GAAI,OAAO,OAAO,KAAG,KAAK,IAAI,UAAU,CAAC,OAAO,aAAa,CAExF,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"sanitizePathSegment.d.ts","sourceRoot":"","sources":["../../src/utilities/sanitizePathSegment.ts"],"names":[],"mappings":"AASA,eAAO,MAAM,mBAAmB,YAAa,MAAM,KAAG,MAQrD,CAAA"}
1
+ {"version":3,"file":"sanitizePathSegment.d.ts","sourceRoot":"","sources":["../../src/utilities/sanitizePathSegment.ts"],"names":[],"mappings":"AASA,eAAO,MAAM,mBAAmB,GAAI,SAAS,MAAM,KAAG,MAQrD,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"validateExistingBlockIsIdentical.d.ts","sourceRoot":"","sources":["../../src/utilities/validateExistingBlockIsIdentical.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAS,cAAc,EAAE,MAAM,SAAS,CAAA;AAS3D,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AAE3C,KAAK,IAAI,GAAG;IACV,KAAK,EAAE,KAAK,CAAA;IACZ,SAAS,EAAE,OAAO,CAAA;IAClB;;OAEG;IACH,iBAAiB,CAAC,EAAE,OAAO,CAAA;IAC3B,aAAa,EAAE,MAAM,CAAA;IACrB,KAAK,EAAE,QAAQ,CAAA;IACf,YAAY,CAAC,EAAE,QAAQ,CAAA;CACxB,CAAA;AA+DD;;GAEG;AACH,eAAO,MAAM,gCAAgC,kEAM1C,IAAI,KAAG,OAwBT,CAAA;AAED,eAAO,MAAM,2BAA2B,eAAwC,CAAA;AAChF,eAAO,MAAM,qBAAqB,UAAW,cAAc,SAAS,MAAM,SAEzE,CAAA;AAED,eAAO,MAAM,qBAAqB,UAAW,cAAc,qBAAqB,MAAM,WAMrF,CAAA"}
1
+ {"version":3,"file":"validateExistingBlockIsIdentical.d.ts","sourceRoot":"","sources":["../../src/utilities/validateExistingBlockIsIdentical.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAS,cAAc,EAAE,MAAM,SAAS,CAAA;AAS3D,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AAE3C,KAAK,IAAI,GAAG;IACV,KAAK,EAAE,KAAK,CAAA;IACZ,SAAS,EAAE,OAAO,CAAA;IAClB;;OAEG;IACH,iBAAiB,CAAC,EAAE,OAAO,CAAA;IAC3B,aAAa,EAAE,MAAM,CAAA;IACrB,KAAK,EAAE,QAAQ,CAAA;IACf,YAAY,CAAC,EAAE,QAAQ,CAAA;CACxB,CAAA;AA+DD;;GAEG;AACH,eAAO,MAAM,gCAAgC,GAAI,+DAM9C,IAAI,KAAG,OAwBT,CAAA;AAED,eAAO,MAAM,2BAA2B,eAAwC,CAAA;AAChF,eAAO,MAAM,qBAAqB,GAAI,OAAO,cAAc,EAAE,OAAO,MAAM,SAEzE,CAAA;AAED,eAAO,MAAM,qBAAqB,GAAI,OAAO,cAAc,EAAE,mBAAmB,MAAM,WAMrF,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@payloadcms/drizzle",
3
- "version": "4.0.0-internal.38b7f1d",
3
+ "version": "4.0.0-internal.40de3ec",
4
4
  "description": "A library of shared functions used by different payload database adapters",
5
5
  "homepage": "https://payloadcms.com",
6
6
  "repository": {
@@ -34,11 +34,6 @@
34
34
  "import": "./dist/exports/sqlite.js",
35
35
  "types": "./dist/exports/sqlite.d.ts",
36
36
  "default": "./dist/exports/sqlite.js"
37
- },
38
- "./types": {
39
- "import": "./dist/exports/types-deprecated.js",
40
- "types": "./dist/exports/types-deprecated.d.ts",
41
- "default": "./dist/exports/types-deprecated.js"
42
37
  }
43
38
  },
44
39
  "main": "./dist/index.js",
@@ -48,7 +43,7 @@
48
43
  "mock.js"
49
44
  ],
50
45
  "dependencies": {
51
- "console-table-printer": "2.12.1",
46
+ "console-table-printer": "2.15.0",
52
47
  "dequal": "2.0.3",
53
48
  "drizzle-orm": "0.45.2",
54
49
  "prompts": "2.4.2",
@@ -60,10 +55,10 @@
60
55
  "@types/pg": "8.20.0",
61
56
  "@types/to-snake-case": "1.0.0",
62
57
  "@payloadcms/eslint-config": "3.28.0",
63
- "payload": "4.0.0-internal.38b7f1d"
58
+ "payload": "4.0.0-internal.40de3ec"
64
59
  },
65
60
  "peerDependencies": {
66
- "payload": "4.0.0-internal.38b7f1d"
61
+ "payload": "4.0.0-internal.40de3ec"
67
62
  },
68
63
  "scripts": {
69
64
  "build": "pnpm build:swc && pnpm build:types",
@@ -1,150 +0,0 @@
1
- import type { BaseRawColumn as _BaseRawColumn, BuildDrizzleTable as _BuildDrizzleTable, BuildQueryJoinAliases as _BuildQueryJoinAliases, ChainedMethods as _ChainedMethods, ColumnToCodeConverter as _ColumnToCodeConverter, CountDistinct as _CountDistinct, CreateJSONQueryArgs as _CreateJSONQueryArgs, DeleteWhere as _DeleteWhere, DrizzleAdapter as _DrizzleAdapter, DrizzleTransaction as _DrizzleTransaction, DropDatabase as _DropDatabase, EnumRawColumn as _EnumRawColumn, Execute as _Execute, GenericColumn as _GenericColumn, GenericColumns as _GenericColumns, GenericPgColumn as _GenericPgColumn, GenericRelation as _GenericRelation, GenericTable as _GenericTable, IDType as _IDType, Insert as _Insert, IntegerRawColumn as _IntegerRawColumn, Migration as _Migration, PostgresDB as _PostgresDB, RawColumn as _RawColumn, RawForeignKey as _RawForeignKey, RawIndex as _RawIndex, RawRelation as _RawRelation, RawTable as _RawTable, RelationMap as _RelationMap, RequireDrizzleKit as _RequireDrizzleKit, SetColumnID as _SetColumnID, SQLiteDB as _SQLiteDB, TimestampRawColumn as _TimestampRawColumn, TransactionPg as _TransactionPg, TransactionSQLite as _TransactionSQLite, UUIDRawColumn as _UUIDRawColumn, VectorRawColumn as _VectorRawColumn } from '../types.js';
2
- /**
3
- * @deprecated - import from `@payloadcms/drizzle` instead
4
- */
5
- export type BaseRawColumn = _BaseRawColumn;
6
- /**
7
- * @deprecated - import from `@payloadcms/drizzle` instead
8
- */
9
- export type BuildDrizzleTable = _BuildDrizzleTable;
10
- /**
11
- * @deprecated - import from `@payloadcms/drizzle` instead
12
- */
13
- export type BuildQueryJoinAliases = _BuildQueryJoinAliases;
14
- /**
15
- * @deprecated - import from `@payloadcms/drizzle` instead
16
- */
17
- export type ChainedMethods = _ChainedMethods;
18
- /**
19
- * @deprecated - import from `@payloadcms/drizzle` instead
20
- */
21
- export type ColumnToCodeConverter = _ColumnToCodeConverter;
22
- /**
23
- * @deprecated - import from `@payloadcms/drizzle` instead
24
- */
25
- export type CountDistinct = _CountDistinct;
26
- /**
27
- * @deprecated - import from `@payloadcms/drizzle` instead
28
- */
29
- export type CreateJSONQueryArgs = _CreateJSONQueryArgs;
30
- /**
31
- * @deprecated - import from `@payloadcms/drizzle` instead
32
- */
33
- export type DeleteWhere = _DeleteWhere;
34
- /**
35
- * @deprecated - import from `@payloadcms/drizzle` instead
36
- */
37
- export type DrizzleAdapter = _DrizzleAdapter;
38
- /**
39
- * @deprecated - import from `@payloadcms/drizzle` instead
40
- */
41
- export type DrizzleTransaction = _DrizzleTransaction;
42
- /**
43
- * @deprecated - import from `@payloadcms/drizzle` instead
44
- */
45
- export type DropDatabase = _DropDatabase;
46
- /**
47
- * @deprecated - import from `@payloadcms/drizzle` instead
48
- */
49
- export type EnumRawColumn = _EnumRawColumn;
50
- /**
51
- * @deprecated - import from `@payloadcms/drizzle` instead
52
- */
53
- export type Execute<T> = _Execute<T>;
54
- /**
55
- * @deprecated - import from `@payloadcms/drizzle` instead
56
- */
57
- export type GenericColumn = _GenericColumn;
58
- /**
59
- * @deprecated - import from `@payloadcms/drizzle` instead
60
- */
61
- export type GenericColumns<T> = _GenericColumns<T>;
62
- /**
63
- * @deprecated - import from `@payloadcms/drizzle` instead
64
- */
65
- export type GenericPgColumn = _GenericPgColumn;
66
- /**
67
- * @deprecated - import from `@payloadcms/drizzle` instead
68
- */
69
- export type GenericRelation = _GenericRelation;
70
- /**
71
- * @deprecated - import from `@payloadcms/drizzle` instead
72
- */
73
- export type GenericTable = _GenericTable;
74
- /**
75
- * @deprecated - import from `@payloadcms/drizzle` instead
76
- */
77
- export type IDType = _IDType;
78
- /**
79
- * @deprecated - import from `@payloadcms/drizzle` instead
80
- */
81
- export type Insert = _Insert;
82
- /**
83
- * @deprecated - import from `@payloadcms/drizzle` instead
84
- */
85
- export type IntegerRawColumn = _IntegerRawColumn;
86
- /**
87
- * @deprecated - import from `@payloadcms/drizzle` instead
88
- */
89
- export type Migration = _Migration;
90
- /**
91
- * @deprecated - import from `@payloadcms/drizzle` instead
92
- */
93
- export type PostgresDB = _PostgresDB;
94
- /**
95
- * @deprecated - import from `@payloadcms/drizzle` instead
96
- */
97
- export type RawColumn = _RawColumn;
98
- /**
99
- * @deprecated - import from `@payloadcms/drizzle` instead
100
- */
101
- export type RawForeignKey = _RawForeignKey;
102
- /**
103
- * @deprecated - import from `@payloadcms/drizzle` instead
104
- */
105
- export type RawIndex = _RawIndex;
106
- /**
107
- * @deprecated - import from `@payloadcms/drizzle` instead
108
- */
109
- export type RawRelation = _RawRelation;
110
- /**
111
- * @deprecated - import from `@payloadcms/drizzle` instead
112
- */
113
- export type RawTable = _RawTable;
114
- /**
115
- * @deprecated - import from `@payloadcms/drizzle` instead
116
- */
117
- export type RelationMap = _RelationMap;
118
- /**
119
- * @deprecated - import from `@payloadcms/drizzle` instead
120
- */
121
- export type RequireDrizzleKit = _RequireDrizzleKit;
122
- /**
123
- * @deprecated - import from `@payloadcms/drizzle` instead
124
- */
125
- export type SetColumnID = _SetColumnID;
126
- /**
127
- * @deprecated - import from `@payloadcms/drizzle` instead
128
- */
129
- export type SQLiteDB = _SQLiteDB;
130
- /**
131
- * @deprecated - import from `@payloadcms/drizzle` instead
132
- */
133
- export type TimestampRawColumn = _TimestampRawColumn;
134
- /**
135
- * @deprecated - import from `@payloadcms/drizzle` instead
136
- */
137
- export type TransactionPg = _TransactionPg;
138
- /**
139
- * @deprecated - import from `@payloadcms/drizzle` instead
140
- */
141
- export type TransactionSQLite = _TransactionSQLite;
142
- /**
143
- * @deprecated - import from `@payloadcms/drizzle` instead
144
- */
145
- export type UUIDRawColumn = _UUIDRawColumn;
146
- /**
147
- * @deprecated - import from `@payloadcms/drizzle` instead
148
- */
149
- export type VectorRawColumn = _VectorRawColumn;
150
- //# sourceMappingURL=types-deprecated.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types-deprecated.d.ts","sourceRoot":"","sources":["../../src/exports/types-deprecated.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,aAAa,IAAI,cAAc,EAC/B,iBAAiB,IAAI,kBAAkB,EACvC,qBAAqB,IAAI,sBAAsB,EAC/C,cAAc,IAAI,eAAe,EACjC,qBAAqB,IAAI,sBAAsB,EAC/C,aAAa,IAAI,cAAc,EAC/B,mBAAmB,IAAI,oBAAoB,EAC3C,WAAW,IAAI,YAAY,EAC3B,cAAc,IAAI,eAAe,EACjC,kBAAkB,IAAI,mBAAmB,EACzC,YAAY,IAAI,aAAa,EAC7B,aAAa,IAAI,cAAc,EAC/B,OAAO,IAAI,QAAQ,EACnB,aAAa,IAAI,cAAc,EAC/B,cAAc,IAAI,eAAe,EACjC,eAAe,IAAI,gBAAgB,EACnC,eAAe,IAAI,gBAAgB,EACnC,YAAY,IAAI,aAAa,EAC7B,MAAM,IAAI,OAAO,EACjB,MAAM,IAAI,OAAO,EACjB,gBAAgB,IAAI,iBAAiB,EACrC,SAAS,IAAI,UAAU,EACvB,UAAU,IAAI,WAAW,EACzB,SAAS,IAAI,UAAU,EACvB,aA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AM,eAAe,GAAG,gBAAgB,CAAA"}
@@ -1,5 +0,0 @@
1
- /**
2
- * @deprecated - import from `@payloadcms/drizzle` instead
3
- */ export { };
4
-
5
- //# sourceMappingURL=types-deprecated.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/exports/types-deprecated.ts"],"sourcesContent":["import type {\n BaseRawColumn as _BaseRawColumn,\n BuildDrizzleTable as _BuildDrizzleTable,\n BuildQueryJoinAliases as _BuildQueryJoinAliases,\n ChainedMethods as _ChainedMethods,\n ColumnToCodeConverter as _ColumnToCodeConverter,\n CountDistinct as _CountDistinct,\n CreateJSONQueryArgs as _CreateJSONQueryArgs,\n DeleteWhere as _DeleteWhere,\n DrizzleAdapter as _DrizzleAdapter,\n DrizzleTransaction as _DrizzleTransaction,\n DropDatabase as _DropDatabase,\n EnumRawColumn as _EnumRawColumn,\n Execute as _Execute,\n GenericColumn as _GenericColumn,\n GenericColumns as _GenericColumns,\n GenericPgColumn as _GenericPgColumn,\n GenericRelation as _GenericRelation,\n GenericTable as _GenericTable,\n IDType as _IDType,\n Insert as _Insert,\n IntegerRawColumn as _IntegerRawColumn,\n Migration as _Migration,\n PostgresDB as _PostgresDB,\n RawColumn as _RawColumn,\n RawForeignKey as _RawForeignKey,\n RawIndex as _RawIndex,\n RawRelation as _RawRelation,\n RawTable as _RawTable,\n RelationMap as _RelationMap,\n RequireDrizzleKit as _RequireDrizzleKit,\n SetColumnID as _SetColumnID,\n SQLiteDB as _SQLiteDB,\n TimestampRawColumn as _TimestampRawColumn,\n TransactionPg as _TransactionPg,\n TransactionSQLite as _TransactionSQLite,\n UUIDRawColumn as _UUIDRawColumn,\n VectorRawColumn as _VectorRawColumn,\n} from '../types.js'\n\n/**\n * @deprecated - import from `@payloadcms/drizzle` instead\n */\nexport type BaseRawColumn = _BaseRawColumn\n/**\n * @deprecated - import from `@payloadcms/drizzle` instead\n */\nexport type BuildDrizzleTable = _BuildDrizzleTable\n/**\n * @deprecated - import from `@payloadcms/drizzle` instead\n */\nexport type BuildQueryJoinAliases = _BuildQueryJoinAliases\n/**\n * @deprecated - import from `@payloadcms/drizzle` instead\n */\nexport type ChainedMethods = _ChainedMethods\n/**\n * @deprecated - import from `@payloadcms/drizzle` instead\n */\nexport type ColumnToCodeConverter = _ColumnToCodeConverter\n/**\n * @deprecated - import from `@payloadcms/drizzle` instead\n */\nexport type CountDistinct = _CountDistinct\n/**\n * @deprecated - import from `@payloadcms/drizzle` instead\n */\nexport type CreateJSONQueryArgs = _CreateJSONQueryArgs\n/**\n * @deprecated - import from `@payloadcms/drizzle` instead\n */\nexport type DeleteWhere = _DeleteWhere\n/**\n * @deprecated - import from `@payloadcms/drizzle` instead\n */\nexport type DrizzleAdapter = _DrizzleAdapter\n/**\n * @deprecated - import from `@payloadcms/drizzle` instead\n */\nexport type DrizzleTransaction = _DrizzleTransaction\n/**\n * @deprecated - import from `@payloadcms/drizzle` instead\n */\nexport type DropDatabase = _DropDatabase\n/**\n * @deprecated - import from `@payloadcms/drizzle` instead\n */\nexport type EnumRawColumn = _EnumRawColumn\n/**\n * @deprecated - import from `@payloadcms/drizzle` instead\n */\nexport type Execute<T> = _Execute<T>\n/**\n * @deprecated - import from `@payloadcms/drizzle` instead\n */\nexport type GenericColumn = _GenericColumn\n/**\n * @deprecated - import from `@payloadcms/drizzle` instead\n */\nexport type GenericColumns<T> = _GenericColumns<T>\n/**\n * @deprecated - import from `@payloadcms/drizzle` instead\n */\nexport type GenericPgColumn = _GenericPgColumn\n/**\n * @deprecated - import from `@payloadcms/drizzle` instead\n */\nexport type GenericRelation = _GenericRelation\n/**\n * @deprecated - import from `@payloadcms/drizzle` instead\n */\nexport type GenericTable = _GenericTable\n/**\n * @deprecated - import from `@payloadcms/drizzle` instead\n */\nexport type IDType = _IDType\n/**\n * @deprecated - import from `@payloadcms/drizzle` instead\n */\nexport type Insert = _Insert\n/**\n * @deprecated - import from `@payloadcms/drizzle` instead\n */\nexport type IntegerRawColumn = _IntegerRawColumn\n/**\n * @deprecated - import from `@payloadcms/drizzle` instead\n */\nexport type Migration = _Migration\n/**\n * @deprecated - import from `@payloadcms/drizzle` instead\n */\nexport type PostgresDB = _PostgresDB\n/**\n * @deprecated - import from `@payloadcms/drizzle` instead\n */\nexport type RawColumn = _RawColumn\n/**\n * @deprecated - import from `@payloadcms/drizzle` instead\n */\nexport type RawForeignKey = _RawForeignKey\n/**\n * @deprecated - import from `@payloadcms/drizzle` instead\n */\nexport type RawIndex = _RawIndex\n/**\n * @deprecated - import from `@payloadcms/drizzle` instead\n */\nexport type RawRelation = _RawRelation\n/**\n * @deprecated - import from `@payloadcms/drizzle` instead\n */\nexport type RawTable = _RawTable\n/**\n * @deprecated - import from `@payloadcms/drizzle` instead\n */\nexport type RelationMap = _RelationMap\n/**\n * @deprecated - import from `@payloadcms/drizzle` instead\n */\nexport type RequireDrizzleKit = _RequireDrizzleKit\n/**\n * @deprecated - import from `@payloadcms/drizzle` instead\n */\nexport type SetColumnID = _SetColumnID\n/**\n * @deprecated - import from `@payloadcms/drizzle` instead\n */\nexport type SQLiteDB = _SQLiteDB\n/**\n * @deprecated - import from `@payloadcms/drizzle` instead\n */\nexport type TimestampRawColumn = _TimestampRawColumn\n/**\n * @deprecated - import from `@payloadcms/drizzle` instead\n */\nexport type TransactionPg = _TransactionPg\n/**\n * @deprecated - import from `@payloadcms/drizzle` instead\n */\nexport type TransactionSQLite = _TransactionSQLite\n/**\n * @deprecated - import from `@payloadcms/drizzle` instead\n */\nexport type UUIDRawColumn = _UUIDRawColumn\n/**\n * @deprecated - import from `@payloadcms/drizzle` instead\n */\nexport type VectorRawColumn = _VectorRawColumn\n"],"names":[],"mappings":"AAwLA;;CAEC,GACD,WAA8C"}
@@ -1,9 +0,0 @@
1
- import type { PayloadRequest } from 'payload';
2
- import type { DrizzleAdapter } from './types.js';
3
- export declare function migrateVersionsEnabled(this: DrizzleAdapter, args: {
4
- entity: 'collection' | 'global';
5
- initialStatus: 'draft' | 'published';
6
- req: PayloadRequest;
7
- slug: string;
8
- }): Promise<void>;
9
- //# sourceMappingURL=migrateVersionsEnabled.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"migrateVersionsEnabled.d.ts","sourceRoot":"","sources":["../src/migrateVersionsEnabled.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AAI7C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAA;AAIhD,wBAAsB,sBAAsB,CAC1C,IAAI,EAAE,cAAc,EACpB,IAAI,EAAE;IACJ,MAAM,EAAE,YAAY,GAAG,QAAQ,CAAA;IAC/B,aAAa,EAAE,OAAO,GAAG,WAAW,CAAA;IACpC,GAAG,EAAE,cAAc,CAAA;IACnB,IAAI,EAAE,MAAM,CAAA;CACb,GACA,OAAO,CAAC,IAAI,CAAC,CAsCf"}
@@ -1,52 +0,0 @@
1
- import { batchTransform } from 'payload/migrations';
2
- const BATCH_SIZE = 1000;
3
- export async function migrateVersionsEnabled(args) {
4
- const { slug, entity, initialStatus, req } = args;
5
- const { payload } = this;
6
- payload.logger.info(`[config-migration] Creating version entries for existing ${entity} "${slug}" with _status: ${initialStatus}`);
7
- if (entity === 'collection') {
8
- await batchTransform({
9
- batchSize: BATCH_SIZE,
10
- fetcher: ({ limit, page })=>payload.db.find({
11
- collection: slug,
12
- limit,
13
- page,
14
- pagination: true,
15
- req
16
- }),
17
- transform: async (doc)=>{
18
- await payload.db.createVersion({
19
- autosave: false,
20
- collectionSlug: slug,
21
- createdAt: doc.createdAt ?? new Date().toISOString(),
22
- parent: doc.id,
23
- req,
24
- updatedAt: doc.updatedAt ?? new Date().toISOString(),
25
- versionData: {
26
- ...doc,
27
- _status: initialStatus
28
- }
29
- });
30
- }
31
- });
32
- } else {
33
- const globalDoc = await payload.db.findGlobal({
34
- slug,
35
- req
36
- });
37
- await payload.db.createGlobalVersion({
38
- autosave: false,
39
- createdAt: globalDoc.createdAt ?? new Date().toISOString(),
40
- globalSlug: slug,
41
- req,
42
- updatedAt: globalDoc.updatedAt ?? new Date().toISOString(),
43
- versionData: {
44
- ...globalDoc,
45
- _status: initialStatus
46
- }
47
- });
48
- }
49
- payload.logger.info(`[config-migration] Done creating version entries for "${slug}"`);
50
- }
51
-
52
- //# sourceMappingURL=migrateVersionsEnabled.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/migrateVersionsEnabled.ts"],"sourcesContent":["import type { PayloadRequest } from 'payload'\n\nimport { batchTransform } from 'payload/migrations'\n\nimport type { DrizzleAdapter } from './types.js'\n\nconst BATCH_SIZE = 1000\n\nexport async function migrateVersionsEnabled(\n this: DrizzleAdapter,\n args: {\n entity: 'collection' | 'global'\n initialStatus: 'draft' | 'published'\n req: PayloadRequest\n slug: string\n },\n): Promise<void> {\n const { slug, entity, initialStatus, req } = args\n const { payload } = this\n\n payload.logger.info(\n `[config-migration] Creating version entries for existing ${entity} \"${slug}\" with _status: ${initialStatus}`,\n )\n\n if (entity === 'collection') {\n await batchTransform({\n batchSize: BATCH_SIZE,\n fetcher: ({ limit, page }: { limit: number; page: number }) =>\n payload.db.find({ collection: slug, limit, page, pagination: true, req }),\n transform: async (doc: any) => {\n await payload.db.createVersion({\n autosave: false,\n collectionSlug: slug as any,\n createdAt: doc.createdAt ?? new Date().toISOString(),\n parent: doc.id,\n req,\n updatedAt: doc.updatedAt ?? new Date().toISOString(),\n versionData: { ...doc, _status: initialStatus },\n })\n },\n })\n } else {\n const globalDoc = await payload.db.findGlobal({ slug, req })\n await payload.db.createGlobalVersion({\n autosave: false,\n createdAt: globalDoc.createdAt ?? new Date().toISOString(),\n globalSlug: slug as any,\n req,\n updatedAt: globalDoc.updatedAt ?? new Date().toISOString(),\n versionData: { ...globalDoc, _status: initialStatus },\n })\n }\n\n payload.logger.info(`[config-migration] Done creating version entries for \"${slug}\"`)\n}\n"],"names":["batchTransform","BATCH_SIZE","migrateVersionsEnabled","args","slug","entity","initialStatus","req","payload","logger","info","batchSize","fetcher","limit","page","db","find","collection","pagination","transform","doc","createVersion","autosave","collectionSlug","createdAt","Date","toISOString","parent","id","updatedAt","versionData","_status","globalDoc","findGlobal","createGlobalVersion","globalSlug"],"mappings":"AAEA,SAASA,cAAc,QAAQ,qBAAoB;AAInD,MAAMC,aAAa;AAEnB,OAAO,eAAeC,uBAEpBC,IAKC;IAED,MAAM,EAAEC,IAAI,EAAEC,MAAM,EAAEC,aAAa,EAAEC,GAAG,EAAE,GAAGJ;IAC7C,MAAM,EAAEK,OAAO,EAAE,GAAG,IAAI;IAExBA,QAAQC,MAAM,CAACC,IAAI,CACjB,CAAC,yDAAyD,EAAEL,OAAO,EAAE,EAAED,KAAK,gBAAgB,EAAEE,eAAe;IAG/G,IAAID,WAAW,cAAc;QAC3B,MAAML,eAAe;YACnBW,WAAWV;YACXW,SAAS,CAAC,EAAEC,KAAK,EAAEC,IAAI,EAAmC,GACxDN,QAAQO,EAAE,CAACC,IAAI,CAAC;oBAAEC,YAAYb;oBAAMS;oBAAOC;oBAAMI,YAAY;oBAAMX;gBAAI;YACzEY,WAAW,OAAOC;gBAChB,MAAMZ,QAAQO,EAAE,CAACM,aAAa,CAAC;oBAC7BC,UAAU;oBACVC,gBAAgBnB;oBAChBoB,WAAWJ,IAAII,SAAS,IAAI,IAAIC,OAAOC,WAAW;oBAClDC,QAAQP,IAAIQ,EAAE;oBACdrB;oBACAsB,WAAWT,IAAIS,SAAS,IAAI,IAAIJ,OAAOC,WAAW;oBAClDI,aAAa;wBAAE,GAAGV,GAAG;wBAAEW,SAASzB;oBAAc;gBAChD;YACF;QACF;IACF,OAAO;QACL,MAAM0B,YAAY,MAAMxB,QAAQO,EAAE,CAACkB,UAAU,CAAC;YAAE7B;YAAMG;QAAI;QAC1D,MAAMC,QAAQO,EAAE,CAACmB,mBAAmB,CAAC;YACnCZ,UAAU;YACVE,WAAWQ,UAAUR,SAAS,IAAI,IAAIC,OAAOC,WAAW;YACxDS,YAAY/B;YACZG;YACAsB,WAAWG,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