@payloadcms/db-postgres 3.0.0-beta.9 → 3.0.0-beta.91

Sign up to get free protection for your applications and to get access to all the features.
Files changed (366) hide show
  1. package/README.md +1 -1
  2. package/dist/connect.d.ts +1 -1
  3. package/dist/connect.d.ts.map +1 -1
  4. package/dist/connect.js +22 -13
  5. package/dist/connect.js.map +1 -1
  6. package/dist/exports/migration-utils.d.ts +2 -0
  7. package/dist/exports/migration-utils.d.ts.map +1 -0
  8. package/dist/exports/migration-utils.js +3 -0
  9. package/dist/exports/migration-utils.js.map +1 -0
  10. package/dist/index.d.ts +3 -3
  11. package/dist/index.d.ts.map +1 -1
  12. package/dist/index.js +49 -75
  13. package/dist/index.js.map +1 -1
  14. package/dist/predefinedMigrations/relationships-v2-v3.d.ts +4 -0
  15. package/dist/predefinedMigrations/relationships-v2-v3.d.ts.map +1 -0
  16. package/dist/predefinedMigrations/relationships-v2-v3.js.map +1 -0
  17. package/dist/predefinedMigrations/relationships-v2-v3.mjs +11 -0
  18. package/dist/predefinedMigrations/v2-v3/fetchAndResave/index.d.ts +20 -0
  19. package/dist/predefinedMigrations/v2-v3/fetchAndResave/index.d.ts.map +1 -0
  20. package/dist/predefinedMigrations/v2-v3/fetchAndResave/index.js +169 -0
  21. package/dist/predefinedMigrations/v2-v3/fetchAndResave/index.js.map +1 -0
  22. package/dist/predefinedMigrations/v2-v3/fetchAndResave/traverseFields.d.ts +11 -0
  23. package/dist/predefinedMigrations/v2-v3/fetchAndResave/traverseFields.d.ts.map +1 -0
  24. package/dist/predefinedMigrations/v2-v3/fetchAndResave/traverseFields.js +191 -0
  25. package/dist/predefinedMigrations/v2-v3/fetchAndResave/traverseFields.js.map +1 -0
  26. package/dist/predefinedMigrations/v2-v3/groupUpSQLStatements.d.ts +3 -0
  27. package/dist/predefinedMigrations/v2-v3/groupUpSQLStatements.d.ts.map +1 -0
  28. package/dist/predefinedMigrations/v2-v3/groupUpSQLStatements.js +56 -0
  29. package/dist/predefinedMigrations/v2-v3/groupUpSQLStatements.js.map +1 -0
  30. package/dist/predefinedMigrations/v2-v3/index.d.ts +23 -0
  31. package/dist/predefinedMigrations/v2-v3/index.d.ts.map +1 -0
  32. package/dist/predefinedMigrations/v2-v3/index.js +211 -0
  33. package/dist/predefinedMigrations/v2-v3/index.js.map +1 -0
  34. package/dist/predefinedMigrations/v2-v3/migrateRelationships.d.ts +20 -0
  35. package/dist/predefinedMigrations/v2-v3/migrateRelationships.d.ts.map +1 -0
  36. package/dist/predefinedMigrations/v2-v3/migrateRelationships.js +57 -0
  37. package/dist/predefinedMigrations/v2-v3/migrateRelationships.js.map +1 -0
  38. package/dist/predefinedMigrations/v2-v3/traverseFields.d.ts +23 -0
  39. package/dist/predefinedMigrations/v2-v3/traverseFields.d.ts.map +1 -0
  40. package/dist/predefinedMigrations/v2-v3/traverseFields.js +85 -0
  41. package/dist/predefinedMigrations/v2-v3/traverseFields.js.map +1 -0
  42. package/dist/predefinedMigrations/v2-v3/types.d.ts +9 -0
  43. package/dist/predefinedMigrations/v2-v3/types.d.ts.map +1 -0
  44. package/dist/predefinedMigrations/v2-v3/types.js +6 -0
  45. package/dist/predefinedMigrations/v2-v3/types.js.map +1 -0
  46. package/dist/types.d.ts +42 -80
  47. package/dist/types.d.ts.map +1 -1
  48. package/dist/types.js.map +1 -1
  49. package/package.json +37 -32
  50. package/dist/create.d.ts +0 -3
  51. package/dist/create.d.ts.map +0 -1
  52. package/dist/create.js +0 -21
  53. package/dist/create.js.map +0 -1
  54. package/dist/createGlobal.d.ts +0 -5
  55. package/dist/createGlobal.d.ts.map +0 -1
  56. package/dist/createGlobal.js +0 -21
  57. package/dist/createGlobal.js.map +0 -1
  58. package/dist/createGlobalVersion.d.ts +0 -6
  59. package/dist/createGlobalVersion.d.ts.map +0 -1
  60. package/dist/createGlobalVersion.js +0 -37
  61. package/dist/createGlobalVersion.js.map +0 -1
  62. package/dist/createMigration.d.ts +0 -3
  63. package/dist/createMigration.d.ts.map +0 -1
  64. package/dist/createMigration.js +0 -81
  65. package/dist/createMigration.js.map +0 -1
  66. package/dist/createVersion.d.ts +0 -5
  67. package/dist/createVersion.d.ts.map +0 -1
  68. package/dist/createVersion.js +0 -48
  69. package/dist/createVersion.js.map +0 -1
  70. package/dist/deleteMany.d.ts +0 -3
  71. package/dist/deleteMany.d.ts.map +0 -1
  72. package/dist/deleteMany.js +0 -31
  73. package/dist/deleteMany.js.map +0 -1
  74. package/dist/deleteOne.d.ts +0 -3
  75. package/dist/deleteOne.d.ts.map +0 -1
  76. package/dist/deleteOne.js +0 -62
  77. package/dist/deleteOne.js.map +0 -1
  78. package/dist/deleteVersions.d.ts +0 -3
  79. package/dist/deleteVersions.d.ts.map +0 -1
  80. package/dist/deleteVersions.js +0 -35
  81. package/dist/deleteVersions.js.map +0 -1
  82. package/dist/destroy.d.ts +0 -3
  83. package/dist/destroy.d.ts.map +0 -1
  84. package/dist/destroy.js +0 -11
  85. package/dist/destroy.js.map +0 -1
  86. package/dist/find/buildFindManyArgs.d.ts +0 -13
  87. package/dist/find/buildFindManyArgs.d.ts.map +0 -1
  88. package/dist/find/buildFindManyArgs.js +0 -64
  89. package/dist/find/buildFindManyArgs.js.map +0 -1
  90. package/dist/find/chainMethods.d.ts +0 -16
  91. package/dist/find/chainMethods.d.ts.map +0 -1
  92. package/dist/find/chainMethods.js +0 -12
  93. package/dist/find/chainMethods.js.map +0 -1
  94. package/dist/find/findMany.d.ts +0 -22
  95. package/dist/find/findMany.d.ts.map +0 -1
  96. package/dist/find/findMany.js +0 -163
  97. package/dist/find/findMany.js.map +0 -1
  98. package/dist/find/traverseFields.d.ts +0 -16
  99. package/dist/find/traverseFields.d.ts.map +0 -1
  100. package/dist/find/traverseFields.js +0 -154
  101. package/dist/find/traverseFields.js.map +0 -1
  102. package/dist/find.d.ts +0 -3
  103. package/dist/find.d.ts.map +0 -1
  104. package/dist/find.js +0 -24
  105. package/dist/find.js.map +0 -1
  106. package/dist/findGlobal.d.ts +0 -3
  107. package/dist/findGlobal.d.ts.map +0 -1
  108. package/dist/findGlobal.js +0 -26
  109. package/dist/findGlobal.js.map +0 -1
  110. package/dist/findGlobalVersions.d.ts +0 -3
  111. package/dist/findGlobalVersions.d.ts.map +0 -1
  112. package/dist/findGlobalVersions.js +0 -28
  113. package/dist/findGlobalVersions.js.map +0 -1
  114. package/dist/findOne.d.ts +0 -5
  115. package/dist/findOne.d.ts.map +0 -1
  116. package/dist/findOne.js +0 -24
  117. package/dist/findOne.js.map +0 -1
  118. package/dist/findVersions.d.ts +0 -3
  119. package/dist/findVersions.d.ts.map +0 -1
  120. package/dist/findVersions.js +0 -28
  121. package/dist/findVersions.js.map +0 -1
  122. package/dist/init.d.ts +0 -3
  123. package/dist/init.d.ts.map +0 -1
  124. package/dist/init.js +0 -94
  125. package/dist/init.js.map +0 -1
  126. package/dist/migrate.d.ts +0 -3
  127. package/dist/migrate.d.ts.map +0 -1
  128. package/dist/migrate.js +0 -99
  129. package/dist/migrate.js.map +0 -1
  130. package/dist/migrateDown.d.ts +0 -3
  131. package/dist/migrateDown.d.ts.map +0 -1
  132. package/dist/migrateDown.js +0 -63
  133. package/dist/migrateDown.js.map +0 -1
  134. package/dist/migrateFresh.d.ts +0 -8
  135. package/dist/migrateFresh.d.ts.map +0 -1
  136. package/dist/migrateFresh.js +0 -72
  137. package/dist/migrateFresh.js.map +0 -1
  138. package/dist/migrateRefresh.d.ts +0 -6
  139. package/dist/migrateRefresh.d.ts.map +0 -1
  140. package/dist/migrateRefresh.js +0 -102
  141. package/dist/migrateRefresh.js.map +0 -1
  142. package/dist/migrateReset.d.ts +0 -6
  143. package/dist/migrateReset.d.ts.map +0 -1
  144. package/dist/migrateReset.js +0 -82
  145. package/dist/migrateReset.js.map +0 -1
  146. package/dist/migrateStatus.d.ts +0 -3
  147. package/dist/migrateStatus.d.ts.map +0 -1
  148. package/dist/migrateStatus.js +0 -44
  149. package/dist/migrateStatus.js.map +0 -1
  150. package/dist/queries/buildAndOrConditions.d.ts +0 -17
  151. package/dist/queries/buildAndOrConditions.d.ts.map +0 -1
  152. package/dist/queries/buildAndOrConditions.js +0 -29
  153. package/dist/queries/buildAndOrConditions.js.map +0 -1
  154. package/dist/queries/buildQuery.d.ts +0 -31
  155. package/dist/queries/buildQuery.d.ts.map +0 -1
  156. package/dist/queries/buildQuery.js +0 -76
  157. package/dist/queries/buildQuery.js.map +0 -1
  158. package/dist/queries/createJSONQuery/convertPathToJSONTraversal.d.ts +0 -2
  159. package/dist/queries/createJSONQuery/convertPathToJSONTraversal.d.ts.map +0 -1
  160. package/dist/queries/createJSONQuery/convertPathToJSONTraversal.js +0 -14
  161. package/dist/queries/createJSONQuery/convertPathToJSONTraversal.js.map +0 -1
  162. package/dist/queries/createJSONQuery/formatJSONPathSegment.d.ts +0 -2
  163. package/dist/queries/createJSONQuery/formatJSONPathSegment.d.ts.map +0 -1
  164. package/dist/queries/createJSONQuery/formatJSONPathSegment.js +0 -5
  165. package/dist/queries/createJSONQuery/formatJSONPathSegment.js.map +0 -1
  166. package/dist/queries/createJSONQuery/index.d.ts +0 -10
  167. package/dist/queries/createJSONQuery/index.d.ts.map +0 -1
  168. package/dist/queries/createJSONQuery/index.js +0 -54
  169. package/dist/queries/createJSONQuery/index.js.map +0 -1
  170. package/dist/queries/getTableColumnFromPath.d.ts +0 -51
  171. package/dist/queries/getTableColumnFromPath.d.ts.map +0 -1
  172. package/dist/queries/getTableColumnFromPath.js +0 -412
  173. package/dist/queries/getTableColumnFromPath.js.map +0 -1
  174. package/dist/queries/operatorMap.d.ts +0 -18
  175. package/dist/queries/operatorMap.d.ts.map +0 -1
  176. package/dist/queries/operatorMap.js +0 -24
  177. package/dist/queries/operatorMap.js.map +0 -1
  178. package/dist/queries/parseParams.d.ts +0 -17
  179. package/dist/queries/parseParams.d.ts.map +0 -1
  180. package/dist/queries/parseParams.js +0 -182
  181. package/dist/queries/parseParams.js.map +0 -1
  182. package/dist/queries/sanitizeQueryValue.d.ts +0 -15
  183. package/dist/queries/sanitizeQueryValue.d.ts.map +0 -1
  184. package/dist/queries/sanitizeQueryValue.js +0 -90
  185. package/dist/queries/sanitizeQueryValue.js.map +0 -1
  186. package/dist/queries/selectDistinct.d.ts +0 -23
  187. package/dist/queries/selectDistinct.d.ts.map +0 -1
  188. package/dist/queries/selectDistinct.js +0 -41
  189. package/dist/queries/selectDistinct.js.map +0 -1
  190. package/dist/queryDrafts.d.ts +0 -3
  191. package/dist/queryDrafts.d.ts.map +0 -1
  192. package/dist/queryDrafts.js +0 -45
  193. package/dist/queryDrafts.js.map +0 -1
  194. package/dist/schema/build.d.ts +0 -29
  195. package/dist/schema/build.d.ts.map +0 -1
  196. package/dist/schema/build.js +0 -285
  197. package/dist/schema/build.js.map +0 -1
  198. package/dist/schema/createIndex.d.ts +0 -12
  199. package/dist/schema/createIndex.d.ts.map +0 -1
  200. package/dist/schema/createIndex.js +0 -18
  201. package/dist/schema/createIndex.js.map +0 -1
  202. package/dist/schema/getTableName.d.ts +0 -32
  203. package/dist/schema/getTableName.d.ts.map +0 -1
  204. package/dist/schema/getTableName.js +0 -31
  205. package/dist/schema/getTableName.js.map +0 -1
  206. package/dist/schema/idToUUID.d.ts +0 -3
  207. package/dist/schema/idToUUID.d.ts.map +0 -1
  208. package/dist/schema/idToUUID.js +0 -11
  209. package/dist/schema/idToUUID.js.map +0 -1
  210. package/dist/schema/parentIDColumnMap.d.ts +0 -4
  211. package/dist/schema/parentIDColumnMap.d.ts.map +0 -1
  212. package/dist/schema/parentIDColumnMap.js +0 -9
  213. package/dist/schema/parentIDColumnMap.js.map +0 -1
  214. package/dist/schema/setColumnID.d.ts +0 -11
  215. package/dist/schema/setColumnID.d.ts.map +0 -1
  216. package/dist/schema/setColumnID.js +0 -24
  217. package/dist/schema/setColumnID.js.map +0 -1
  218. package/dist/schema/traverseFields.d.ts +0 -38
  219. package/dist/schema/traverseFields.d.ts.map +0 -1
  220. package/dist/schema/traverseFields.js +0 -530
  221. package/dist/schema/traverseFields.js.map +0 -1
  222. package/dist/schema/validateExistingBlockIsIdentical.d.ts +0 -11
  223. package/dist/schema/validateExistingBlockIsIdentical.d.ts.map +0 -1
  224. package/dist/schema/validateExistingBlockIsIdentical.js +0 -70
  225. package/dist/schema/validateExistingBlockIsIdentical.js.map +0 -1
  226. package/dist/transactions/beginTransaction.d.ts +0 -3
  227. package/dist/transactions/beginTransaction.d.ts.map +0 -1
  228. package/dist/transactions/beginTransaction.js +0 -47
  229. package/dist/transactions/beginTransaction.js.map +0 -1
  230. package/dist/transactions/commitTransaction.d.ts +0 -3
  231. package/dist/transactions/commitTransaction.d.ts.map +0 -1
  232. package/dist/transactions/commitTransaction.js +0 -14
  233. package/dist/transactions/commitTransaction.js.map +0 -1
  234. package/dist/transactions/rollbackTransaction.d.ts +0 -3
  235. package/dist/transactions/rollbackTransaction.d.ts.map +0 -1
  236. package/dist/transactions/rollbackTransaction.js +0 -13
  237. package/dist/transactions/rollbackTransaction.js.map +0 -1
  238. package/dist/transform/read/hasManyNumber.d.ts +0 -10
  239. package/dist/transform/read/hasManyNumber.d.ts.map +0 -1
  240. package/dist/transform/read/hasManyNumber.js +0 -10
  241. package/dist/transform/read/hasManyNumber.js.map +0 -1
  242. package/dist/transform/read/hasManyText.d.ts +0 -10
  243. package/dist/transform/read/hasManyText.d.ts.map +0 -1
  244. package/dist/transform/read/hasManyText.js +0 -10
  245. package/dist/transform/read/hasManyText.js.map +0 -1
  246. package/dist/transform/read/index.d.ts +0 -12
  247. package/dist/transform/read/index.d.ts.map +0 -1
  248. package/dist/transform/read/index.js +0 -43
  249. package/dist/transform/read/index.js.map +0 -1
  250. package/dist/transform/read/relationship.d.ts +0 -10
  251. package/dist/transform/read/relationship.d.ts.map +0 -1
  252. package/dist/transform/read/relationship.js +0 -64
  253. package/dist/transform/read/relationship.js.map +0 -1
  254. package/dist/transform/read/traverseFields.d.ts +0 -52
  255. package/dist/transform/read/traverseFields.d.ts.map +0 -1
  256. package/dist/transform/read/traverseFields.js +0 -421
  257. package/dist/transform/read/traverseFields.js.map +0 -1
  258. package/dist/transform/write/array.d.ts +0 -26
  259. package/dist/transform/write/array.d.ts.map +0 -1
  260. package/dist/transform/write/array.js +0 -58
  261. package/dist/transform/write/array.js.map +0 -1
  262. package/dist/transform/write/blocks.d.ts +0 -25
  263. package/dist/transform/write/blocks.d.ts.map +0 -1
  264. package/dist/transform/write/blocks.js +0 -54
  265. package/dist/transform/write/blocks.js.map +0 -1
  266. package/dist/transform/write/index.d.ts +0 -13
  267. package/dist/transform/write/index.d.ts.map +0 -1
  268. package/dist/transform/write/index.js +0 -41
  269. package/dist/transform/write/index.js.map +0 -1
  270. package/dist/transform/write/numbers.d.ts +0 -8
  271. package/dist/transform/write/numbers.d.ts.map +0 -1
  272. package/dist/transform/write/numbers.js +0 -11
  273. package/dist/transform/write/numbers.js.map +0 -1
  274. package/dist/transform/write/relationships.d.ts +0 -10
  275. package/dist/transform/write/relationships.d.ts.map +0 -1
  276. package/dist/transform/write/relationships.js +0 -23
  277. package/dist/transform/write/relationships.js.map +0 -1
  278. package/dist/transform/write/selects.d.ts +0 -8
  279. package/dist/transform/write/selects.d.ts.map +0 -1
  280. package/dist/transform/write/selects.js +0 -20
  281. package/dist/transform/write/selects.js.map +0 -1
  282. package/dist/transform/write/texts.d.ts +0 -8
  283. package/dist/transform/write/texts.d.ts.map +0 -1
  284. package/dist/transform/write/texts.js +0 -11
  285. package/dist/transform/write/texts.js.map +0 -1
  286. package/dist/transform/write/traverseFields.d.ts +0 -50
  287. package/dist/transform/write/traverseFields.d.ts.map +0 -1
  288. package/dist/transform/write/traverseFields.js +0 -428
  289. package/dist/transform/write/traverseFields.js.map +0 -1
  290. package/dist/transform/write/types.d.ts +0 -43
  291. package/dist/transform/write/types.d.ts.map +0 -1
  292. package/dist/transform/write/types.js +0 -3
  293. package/dist/transform/write/types.js.map +0 -1
  294. package/dist/update.d.ts +0 -3
  295. package/dist/update.d.ts.map +0 -1
  296. package/dist/update.js +0 -58
  297. package/dist/update.js.map +0 -1
  298. package/dist/updateGlobal.d.ts +0 -5
  299. package/dist/updateGlobal.d.ts.map +0 -1
  300. package/dist/updateGlobal.js +0 -28
  301. package/dist/updateGlobal.js.map +0 -1
  302. package/dist/updateGlobalVersion.d.ts +0 -5
  303. package/dist/updateGlobalVersion.d.ts.map +0 -1
  304. package/dist/updateGlobalVersion.js +0 -40
  305. package/dist/updateGlobalVersion.js.map +0 -1
  306. package/dist/updateVersion.d.ts +0 -5
  307. package/dist/updateVersion.d.ts.map +0 -1
  308. package/dist/updateVersion.js +0 -40
  309. package/dist/updateVersion.js.map +0 -1
  310. package/dist/upsertRow/deleteExistingArrayRows.d.ts +0 -10
  311. package/dist/upsertRow/deleteExistingArrayRows.d.ts.map +0 -1
  312. package/dist/upsertRow/deleteExistingArrayRows.js +0 -10
  313. package/dist/upsertRow/deleteExistingArrayRows.js.map +0 -1
  314. package/dist/upsertRow/deleteExistingRowsByPath.d.ts +0 -14
  315. package/dist/upsertRow/deleteExistingRowsByPath.d.ts.map +0 -1
  316. package/dist/upsertRow/deleteExistingRowsByPath.js +0 -33
  317. package/dist/upsertRow/deleteExistingRowsByPath.js.map +0 -1
  318. package/dist/upsertRow/index.d.ts +0 -4
  319. package/dist/upsertRow/index.d.ts.map +0 -1
  320. package/dist/upsertRow/index.js +0 -276
  321. package/dist/upsertRow/index.js.map +0 -1
  322. package/dist/upsertRow/insertArrays.d.ts +0 -13
  323. package/dist/upsertRow/insertArrays.d.ts.map +0 -1
  324. package/dist/upsertRow/insertArrays.js +0 -68
  325. package/dist/upsertRow/insertArrays.js.map +0 -1
  326. package/dist/upsertRow/types.d.ts +0 -27
  327. package/dist/upsertRow/types.d.ts.map +0 -1
  328. package/dist/upsertRow/types.js +0 -3
  329. package/dist/upsertRow/types.js.map +0 -1
  330. package/dist/utilities/appendPrefixToKeys.d.ts +0 -2
  331. package/dist/utilities/appendPrefixToKeys.d.ts.map +0 -1
  332. package/dist/utilities/appendPrefixToKeys.js +0 -6
  333. package/dist/utilities/appendPrefixToKeys.js.map +0 -1
  334. package/dist/utilities/createBlocksMap.d.ts +0 -5
  335. package/dist/utilities/createBlocksMap.d.ts.map +0 -1
  336. package/dist/utilities/createBlocksMap.js +0 -29
  337. package/dist/utilities/createBlocksMap.js.map +0 -1
  338. package/dist/utilities/createMigrationTable.d.ts +0 -3
  339. package/dist/utilities/createMigrationTable.d.ts.map +0 -1
  340. package/dist/utilities/createMigrationTable.js +0 -13
  341. package/dist/utilities/createMigrationTable.js.map +0 -1
  342. package/dist/utilities/createRelationshipMap.d.ts +0 -2
  343. package/dist/utilities/createRelationshipMap.d.ts.map +0 -1
  344. package/dist/utilities/createRelationshipMap.js +0 -19
  345. package/dist/utilities/createRelationshipMap.js.map +0 -1
  346. package/dist/utilities/hasLocalesTable.d.ts +0 -3
  347. package/dist/utilities/hasLocalesTable.d.ts.map +0 -1
  348. package/dist/utilities/hasLocalesTable.js +0 -11
  349. package/dist/utilities/hasLocalesTable.js.map +0 -1
  350. package/dist/utilities/isArrayOfRows.d.ts +0 -2
  351. package/dist/utilities/isArrayOfRows.d.ts.map +0 -1
  352. package/dist/utilities/isArrayOfRows.js +0 -5
  353. package/dist/utilities/isArrayOfRows.js.map +0 -1
  354. package/dist/utilities/migrationTableExists.d.ts +0 -3
  355. package/dist/utilities/migrationTableExists.d.ts.map +0 -1
  356. package/dist/utilities/migrationTableExists.js +0 -9
  357. package/dist/utilities/migrationTableExists.js.map +0 -1
  358. package/dist/utilities/parseError.d.ts +0 -5
  359. package/dist/utilities/parseError.d.ts.map +0 -1
  360. package/dist/utilities/parseError.js +0 -17
  361. package/dist/utilities/parseError.js.map +0 -1
  362. package/dist/utilities/pushDevSchema.d.ts +0 -9
  363. package/dist/utilities/pushDevSchema.d.ts.map +0 -1
  364. package/dist/utilities/pushDevSchema.js +0 -58
  365. package/dist/utilities/pushDevSchema.js.map +0 -1
  366. package/src/index.ts +0 -156
@@ -1,285 +0,0 @@
1
- /* eslint-disable no-param-reassign */ import { relations } from 'drizzle-orm';
2
- import { index, integer, numeric, serial, timestamp, unique, varchar } from 'drizzle-orm/pg-core';
3
- import { getTableName } from './getTableName.js';
4
- import { parentIDColumnMap } from './parentIDColumnMap.js';
5
- import { setColumnID } from './setColumnID.js';
6
- import { traverseFields } from './traverseFields.js';
7
- export const buildTable = ({ adapter, baseColumns = {}, baseExtraConfig = {}, buildNumbers, buildRelationships, buildTexts, disableNotNull, disableUnique = false, fields, rootRelationsToBuild, rootRelationships, rootTableIDColType, rootTableName: incomingRootTableName, tableName, timestamps, versions })=>{
8
- const rootTableName = incomingRootTableName || tableName;
9
- const columns = baseColumns;
10
- const indexes = {};
11
- let hasLocalizedField = false;
12
- let hasLocalizedRelationshipField = false;
13
- let hasManyTextField = false;
14
- let hasManyNumberField = false;
15
- let hasLocalizedManyTextField = false;
16
- let hasLocalizedManyNumberField = false;
17
- const localesColumns = {};
18
- const localesIndexes = {};
19
- let localesTable;
20
- let textsTable;
21
- let numbersTable;
22
- // Relationships to the base collection
23
- const relationships = rootRelationships || new Set();
24
- let relationshipsTable;
25
- // Drizzle relations
26
- const relationsToBuild = new Map();
27
- const idColType = setColumnID({
28
- adapter,
29
- columns,
30
- fields
31
- });
32
- ({ hasLocalizedField, hasLocalizedManyNumberField, hasLocalizedManyTextField, hasLocalizedRelationshipField, hasManyNumberField, hasManyTextField } = traverseFields({
33
- adapter,
34
- buildNumbers,
35
- buildRelationships,
36
- buildTexts,
37
- columns,
38
- disableNotNull,
39
- disableUnique,
40
- fields,
41
- indexes,
42
- localesColumns,
43
- localesIndexes,
44
- newTableName: tableName,
45
- parentTableName: tableName,
46
- relationsToBuild,
47
- relationships,
48
- rootRelationsToBuild: rootRelationsToBuild || relationsToBuild,
49
- rootTableIDColType: rootTableIDColType || idColType,
50
- rootTableName,
51
- versions
52
- }));
53
- if (timestamps) {
54
- columns.createdAt = timestamp('created_at', {
55
- mode: 'string',
56
- precision: 3,
57
- withTimezone: true
58
- }).defaultNow().notNull();
59
- columns.updatedAt = timestamp('updated_at', {
60
- mode: 'string',
61
- precision: 3,
62
- withTimezone: true
63
- }).defaultNow().notNull();
64
- }
65
- const table = adapter.pgSchema.table(tableName, columns, (cols)=>{
66
- const extraConfig = Object.entries(baseExtraConfig).reduce((config, [key, func])=>{
67
- config[key] = func(cols);
68
- return config;
69
- }, {});
70
- return Object.entries(indexes).reduce((acc, [colName, func])=>{
71
- acc[colName] = func(cols);
72
- return acc;
73
- }, extraConfig);
74
- });
75
- adapter.tables[tableName] = table;
76
- if (hasLocalizedField) {
77
- const localeTableName = `${tableName}${adapter.localesSuffix}`;
78
- localesColumns.id = serial('id').primaryKey();
79
- localesColumns._locale = adapter.enums.enum__locales('_locale').notNull();
80
- localesColumns._parentID = parentIDColumnMap[idColType]('_parent_id').references(()=>table.id, {
81
- onDelete: 'cascade'
82
- }).notNull();
83
- localesTable = adapter.pgSchema.table(localeTableName, localesColumns, (cols)=>{
84
- return Object.entries(localesIndexes).reduce((acc, [colName, func])=>{
85
- acc[colName] = func(cols);
86
- return acc;
87
- }, {
88
- _localeParent: unique(`${localeTableName}_locale_parent_id_unique`).on(cols._locale, cols._parentID)
89
- });
90
- });
91
- adapter.tables[localeTableName] = localesTable;
92
- const localesTableRelations = relations(localesTable, ({ one })=>({
93
- _parentID: one(table, {
94
- fields: [
95
- localesTable._parentID
96
- ],
97
- references: [
98
- table.id
99
- ]
100
- })
101
- }));
102
- adapter.relations[`relations_${localeTableName}`] = localesTableRelations;
103
- }
104
- if (hasManyTextField && buildTexts) {
105
- const textsTableName = `${rootTableName}_texts`;
106
- const columns = {
107
- id: serial('id').primaryKey(),
108
- order: integer('order').notNull(),
109
- parent: parentIDColumnMap[idColType]('parent_id').references(()=>table.id, {
110
- onDelete: 'cascade'
111
- }).notNull(),
112
- path: varchar('path').notNull(),
113
- text: varchar('text')
114
- };
115
- if (hasLocalizedManyTextField) {
116
- columns.locale = adapter.enums.enum__locales('locale');
117
- }
118
- textsTable = adapter.pgSchema.table(textsTableName, columns, (cols)=>{
119
- const indexes = {
120
- orderParentIdx: index(`${textsTableName}_order_parent_idx`).on(cols.order, cols.parent)
121
- };
122
- if (hasManyTextField === 'index') {
123
- indexes.text_idx = index(`${textsTableName}_text_idx`).on(cols.text);
124
- }
125
- if (hasLocalizedManyTextField) {
126
- indexes.localeParent = index(`${textsTableName}_locale_parent`).on(cols.locale, cols.parent);
127
- }
128
- return indexes;
129
- });
130
- adapter.tables[textsTableName] = textsTable;
131
- const textsTableRelations = relations(textsTable, ({ one })=>({
132
- parent: one(table, {
133
- fields: [
134
- textsTable.parent
135
- ],
136
- references: [
137
- table.id
138
- ]
139
- })
140
- }));
141
- adapter.relations[`relations_${textsTableName}`] = textsTableRelations;
142
- }
143
- if (hasManyNumberField && buildNumbers) {
144
- const numbersTableName = `${rootTableName}_numbers`;
145
- const columns = {
146
- id: serial('id').primaryKey(),
147
- number: numeric('number'),
148
- order: integer('order').notNull(),
149
- parent: parentIDColumnMap[idColType]('parent_id').references(()=>table.id, {
150
- onDelete: 'cascade'
151
- }).notNull(),
152
- path: varchar('path').notNull()
153
- };
154
- if (hasLocalizedManyNumberField) {
155
- columns.locale = adapter.enums.enum__locales('locale');
156
- }
157
- numbersTable = adapter.pgSchema.table(numbersTableName, columns, (cols)=>{
158
- const indexes = {
159
- orderParentIdx: index(`${numbersTableName}_order_parent_idx`).on(cols.order, cols.parent)
160
- };
161
- if (hasManyNumberField === 'index') {
162
- indexes.numberIdx = index(`${numbersTableName}_number_idx`).on(cols.number);
163
- }
164
- if (hasLocalizedManyNumberField) {
165
- indexes.localeParent = index(`${numbersTableName}_locale_parent`).on(cols.locale, cols.parent);
166
- }
167
- return indexes;
168
- });
169
- adapter.tables[numbersTableName] = numbersTable;
170
- const numbersTableRelations = relations(numbersTable, ({ one })=>({
171
- parent: one(table, {
172
- fields: [
173
- numbersTable.parent
174
- ],
175
- references: [
176
- table.id
177
- ]
178
- })
179
- }));
180
- adapter.relations[`relations_${numbersTableName}`] = numbersTableRelations;
181
- }
182
- if (buildRelationships) {
183
- if (relationships.size) {
184
- const relationshipColumns = {
185
- id: serial('id').primaryKey(),
186
- order: integer('order'),
187
- parent: parentIDColumnMap[idColType]('parent_id').references(()=>table.id, {
188
- onDelete: 'cascade'
189
- }).notNull(),
190
- path: varchar('path').notNull()
191
- };
192
- if (hasLocalizedRelationshipField) {
193
- relationshipColumns.locale = adapter.enums.enum__locales('locale');
194
- }
195
- relationships.forEach((relationTo)=>{
196
- const relationshipConfig = adapter.payload.collections[relationTo].config;
197
- const formattedRelationTo = getTableName({
198
- adapter,
199
- config: relationshipConfig,
200
- throwValidationError: true
201
- });
202
- let colType = adapter.idType === 'uuid' ? 'uuid' : 'integer';
203
- const relatedCollectionCustomIDType = adapter.payload.collections[relationshipConfig.slug]?.customIDType;
204
- if (relatedCollectionCustomIDType === 'number') colType = 'numeric';
205
- if (relatedCollectionCustomIDType === 'text') colType = 'varchar';
206
- relationshipColumns[`${relationTo}ID`] = parentIDColumnMap[colType](`${formattedRelationTo}_id`).references(()=>adapter.tables[formattedRelationTo].id, {
207
- onDelete: 'cascade'
208
- });
209
- });
210
- const relationshipsTableName = `${tableName}${adapter.relationshipsSuffix}`;
211
- relationshipsTable = adapter.pgSchema.table(relationshipsTableName, relationshipColumns, (cols)=>{
212
- const result = {
213
- order: index(`${relationshipsTableName}_order_idx`).on(cols.order),
214
- parentIdx: index(`${relationshipsTableName}_parent_idx`).on(cols.parent),
215
- pathIdx: index(`${relationshipsTableName}_path_idx`).on(cols.path)
216
- };
217
- if (hasLocalizedRelationshipField) {
218
- result.localeIdx = index(`${relationshipsTableName}_locale_idx`).on(cols.locale);
219
- }
220
- return result;
221
- });
222
- adapter.tables[relationshipsTableName] = relationshipsTable;
223
- const relationshipsTableRelations = relations(relationshipsTable, ({ one })=>{
224
- const result = {
225
- parent: one(table, {
226
- fields: [
227
- relationshipsTable.parent
228
- ],
229
- references: [
230
- table.id
231
- ],
232
- relationName: '_rels'
233
- })
234
- };
235
- relationships.forEach((relationTo)=>{
236
- const relatedTableName = getTableName({
237
- adapter,
238
- config: adapter.payload.collections[relationTo].config,
239
- throwValidationError: true
240
- });
241
- const idColumnName = `${relationTo}ID`;
242
- result[idColumnName] = one(adapter.tables[relatedTableName], {
243
- fields: [
244
- relationshipsTable[idColumnName]
245
- ],
246
- references: [
247
- adapter.tables[relatedTableName].id
248
- ]
249
- });
250
- });
251
- return result;
252
- });
253
- adapter.relations[`relations_${relationshipsTableName}`] = relationshipsTableRelations;
254
- }
255
- }
256
- const tableRelations = relations(table, ({ many })=>{
257
- const result = {};
258
- relationsToBuild.forEach((val, key)=>{
259
- result[key] = many(adapter.tables[val]);
260
- });
261
- if (hasLocalizedField) {
262
- result._locales = many(localesTable);
263
- }
264
- if (hasManyTextField) {
265
- result._texts = many(textsTable);
266
- }
267
- if (hasManyNumberField) {
268
- result._numbers = many(numbersTable);
269
- }
270
- if (relationships.size && relationshipsTable) {
271
- result._rels = many(relationshipsTable, {
272
- relationName: '_rels'
273
- });
274
- }
275
- return result;
276
- });
277
- adapter.relations[`relations_${tableName}`] = tableRelations;
278
- return {
279
- hasManyNumberField,
280
- hasManyTextField,
281
- relationsToBuild
282
- };
283
- };
284
-
285
- //# sourceMappingURL=build.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/schema/build.ts"],"sourcesContent":["/* eslint-disable no-param-reassign */\nimport type { Relation } from 'drizzle-orm'\nimport type {\n IndexBuilder,\n PgColumnBuilder,\n PgTableWithColumns,\n UniqueConstraintBuilder,\n} from 'drizzle-orm/pg-core'\nimport type { Field } from 'payload/types'\n\nimport { relations } from 'drizzle-orm'\nimport { index, integer, numeric, serial, timestamp, unique, varchar } from 'drizzle-orm/pg-core'\nimport { fieldAffectsData } from 'payload/types'\n\nimport type { GenericColumns, GenericTable, IDType, PostgresAdapter } from '../types.js'\n\nimport { getTableName } from './getTableName.js'\nimport { parentIDColumnMap } from './parentIDColumnMap.js'\nimport { setColumnID } from './setColumnID.js'\nimport { traverseFields } from './traverseFields.js'\n\ntype Args = {\n adapter: PostgresAdapter\n baseColumns?: Record<string, PgColumnBuilder>\n baseExtraConfig?: Record<string, (cols: GenericColumns) => IndexBuilder | UniqueConstraintBuilder>\n buildNumbers?: boolean\n buildRelationships?: boolean\n buildTexts?: boolean\n disableNotNull: boolean\n disableUnique: boolean\n fields: Field[]\n rootRelationsToBuild?: Map<string, string>\n rootRelationships?: Set<string>\n rootTableIDColType?: string\n rootTableName?: string\n tableName: string\n timestamps?: boolean\n versions: boolean\n}\n\ntype Result = {\n hasManyNumberField: 'index' | boolean\n hasManyTextField: 'index' | boolean\n relationsToBuild: Map<string, string>\n}\n\nexport const buildTable = ({\n adapter,\n baseColumns = {},\n baseExtraConfig = {},\n buildNumbers,\n buildRelationships,\n buildTexts,\n disableNotNull,\n disableUnique = false,\n fields,\n rootRelationsToBuild,\n rootRelationships,\n rootTableIDColType,\n rootTableName: incomingRootTableName,\n tableName,\n timestamps,\n versions,\n}: Args): Result => {\n const rootTableName = incomingRootTableName || tableName\n const columns: Record<string, PgColumnBuilder> = baseColumns\n const indexes: Record<string, (cols: GenericColumns) => IndexBuilder> = {}\n\n let hasLocalizedField = false\n let hasLocalizedRelationshipField = false\n let hasManyTextField: 'index' | boolean = false\n let hasManyNumberField: 'index' | boolean = false\n let hasLocalizedManyTextField = false\n let hasLocalizedManyNumberField = false\n\n const localesColumns: Record<string, PgColumnBuilder> = {}\n const localesIndexes: Record<string, (cols: GenericColumns) => IndexBuilder> = {}\n let localesTable: GenericTable | PgTableWithColumns<any>\n let textsTable: GenericTable | PgTableWithColumns<any>\n let numbersTable: GenericTable | PgTableWithColumns<any>\n\n // Relationships to the base collection\n const relationships: Set<string> = rootRelationships || new Set()\n\n let relationshipsTable: GenericTable | PgTableWithColumns<any>\n\n // Drizzle relations\n const relationsToBuild: Map<string, string> = new Map()\n\n const idColType: IDType = setColumnID({ adapter, columns, fields })\n\n ;({\n hasLocalizedField,\n hasLocalizedManyNumberField,\n hasLocalizedManyTextField,\n hasLocalizedRelationshipField,\n hasManyNumberField,\n hasManyTextField,\n } = traverseFields({\n adapter,\n buildNumbers,\n buildRelationships,\n buildTexts,\n columns,\n disableNotNull,\n disableUnique,\n fields,\n indexes,\n localesColumns,\n localesIndexes,\n newTableName: tableName,\n parentTableName: tableName,\n relationsToBuild,\n relationships,\n rootRelationsToBuild: rootRelationsToBuild || relationsToBuild,\n rootTableIDColType: rootTableIDColType || idColType,\n rootTableName,\n versions,\n }))\n\n if (timestamps) {\n columns.createdAt = timestamp('created_at', {\n mode: 'string',\n precision: 3,\n withTimezone: true,\n })\n .defaultNow()\n .notNull()\n columns.updatedAt = timestamp('updated_at', {\n mode: 'string',\n precision: 3,\n withTimezone: true,\n })\n .defaultNow()\n .notNull()\n }\n\n const table = adapter.pgSchema.table(tableName, columns, (cols) => {\n const extraConfig = Object.entries(baseExtraConfig).reduce((config, [key, func]) => {\n config[key] = func(cols)\n return config\n }, {})\n\n return Object.entries(indexes).reduce((acc, [colName, func]) => {\n acc[colName] = func(cols)\n return acc\n }, extraConfig)\n })\n\n adapter.tables[tableName] = table\n\n if (hasLocalizedField) {\n const localeTableName = `${tableName}${adapter.localesSuffix}`\n localesColumns.id = serial('id').primaryKey()\n localesColumns._locale = adapter.enums.enum__locales('_locale').notNull()\n localesColumns._parentID = parentIDColumnMap[idColType]('_parent_id')\n .references(() => table.id, { onDelete: 'cascade' })\n .notNull()\n\n localesTable = adapter.pgSchema.table(localeTableName, localesColumns, (cols) => {\n return Object.entries(localesIndexes).reduce(\n (acc, [colName, func]) => {\n acc[colName] = func(cols)\n return acc\n },\n {\n _localeParent: unique(`${localeTableName}_locale_parent_id_unique`).on(\n cols._locale,\n cols._parentID,\n ),\n },\n )\n })\n\n adapter.tables[localeTableName] = localesTable\n\n const localesTableRelations = relations(localesTable, ({ one }) => ({\n _parentID: one(table, {\n fields: [localesTable._parentID],\n references: [table.id],\n }),\n }))\n\n adapter.relations[`relations_${localeTableName}`] = localesTableRelations\n }\n\n if (hasManyTextField && buildTexts) {\n const textsTableName = `${rootTableName}_texts`\n const columns: Record<string, PgColumnBuilder> = {\n id: serial('id').primaryKey(),\n order: integer('order').notNull(),\n parent: parentIDColumnMap[idColType]('parent_id')\n .references(() => table.id, { onDelete: 'cascade' })\n .notNull(),\n path: varchar('path').notNull(),\n text: varchar('text'),\n }\n\n if (hasLocalizedManyTextField) {\n columns.locale = adapter.enums.enum__locales('locale')\n }\n\n textsTable = adapter.pgSchema.table(textsTableName, columns, (cols) => {\n const indexes: Record<string, IndexBuilder> = {\n orderParentIdx: index(`${textsTableName}_order_parent_idx`).on(cols.order, cols.parent),\n }\n\n if (hasManyTextField === 'index') {\n indexes.text_idx = index(`${textsTableName}_text_idx`).on(cols.text)\n }\n\n if (hasLocalizedManyTextField) {\n indexes.localeParent = index(`${textsTableName}_locale_parent`).on(cols.locale, cols.parent)\n }\n\n return indexes\n })\n\n adapter.tables[textsTableName] = textsTable\n\n const textsTableRelations = relations(textsTable, ({ one }) => ({\n parent: one(table, {\n fields: [textsTable.parent],\n references: [table.id],\n }),\n }))\n\n adapter.relations[`relations_${textsTableName}`] = textsTableRelations\n }\n\n if (hasManyNumberField && buildNumbers) {\n const numbersTableName = `${rootTableName}_numbers`\n const columns: Record<string, PgColumnBuilder> = {\n id: serial('id').primaryKey(),\n number: numeric('number'),\n order: integer('order').notNull(),\n parent: parentIDColumnMap[idColType]('parent_id')\n .references(() => table.id, { onDelete: 'cascade' })\n .notNull(),\n path: varchar('path').notNull(),\n }\n\n if (hasLocalizedManyNumberField) {\n columns.locale = adapter.enums.enum__locales('locale')\n }\n\n numbersTable = adapter.pgSchema.table(numbersTableName, columns, (cols) => {\n const indexes: Record<string, IndexBuilder> = {\n orderParentIdx: index(`${numbersTableName}_order_parent_idx`).on(cols.order, cols.parent),\n }\n\n if (hasManyNumberField === 'index') {\n indexes.numberIdx = index(`${numbersTableName}_number_idx`).on(cols.number)\n }\n\n if (hasLocalizedManyNumberField) {\n indexes.localeParent = index(`${numbersTableName}_locale_parent`).on(\n cols.locale,\n cols.parent,\n )\n }\n\n return indexes\n })\n\n adapter.tables[numbersTableName] = numbersTable\n\n const numbersTableRelations = relations(numbersTable, ({ one }) => ({\n parent: one(table, {\n fields: [numbersTable.parent],\n references: [table.id],\n }),\n }))\n\n adapter.relations[`relations_${numbersTableName}`] = numbersTableRelations\n }\n\n if (buildRelationships) {\n if (relationships.size) {\n const relationshipColumns: Record<string, PgColumnBuilder> = {\n id: serial('id').primaryKey(),\n order: integer('order'),\n parent: parentIDColumnMap[idColType]('parent_id')\n .references(() => table.id, { onDelete: 'cascade' })\n .notNull(),\n path: varchar('path').notNull(),\n }\n\n if (hasLocalizedRelationshipField) {\n relationshipColumns.locale = adapter.enums.enum__locales('locale')\n }\n\n relationships.forEach((relationTo) => {\n const relationshipConfig = adapter.payload.collections[relationTo].config\n const formattedRelationTo = getTableName({\n adapter,\n config: relationshipConfig,\n throwValidationError: true,\n })\n let colType = adapter.idType === 'uuid' ? 'uuid' : 'integer'\n\n const relatedCollectionCustomIDType =\n adapter.payload.collections[relationshipConfig.slug]?.customIDType\n\n if (relatedCollectionCustomIDType === 'number') colType = 'numeric'\n if (relatedCollectionCustomIDType === 'text') colType = 'varchar'\n\n relationshipColumns[`${relationTo}ID`] = parentIDColumnMap[colType](\n `${formattedRelationTo}_id`,\n ).references(() => adapter.tables[formattedRelationTo].id, { onDelete: 'cascade' })\n })\n\n const relationshipsTableName = `${tableName}${adapter.relationshipsSuffix}`\n\n relationshipsTable = adapter.pgSchema.table(\n relationshipsTableName,\n relationshipColumns,\n (cols) => {\n const result: Record<string, unknown> = {\n order: index(`${relationshipsTableName}_order_idx`).on(cols.order),\n parentIdx: index(`${relationshipsTableName}_parent_idx`).on(cols.parent),\n pathIdx: index(`${relationshipsTableName}_path_idx`).on(cols.path),\n }\n\n if (hasLocalizedRelationshipField) {\n result.localeIdx = index(`${relationshipsTableName}_locale_idx`).on(cols.locale)\n }\n\n return result\n },\n )\n\n adapter.tables[relationshipsTableName] = relationshipsTable\n\n const relationshipsTableRelations = relations(relationshipsTable, ({ one }) => {\n const result: Record<string, Relation<string>> = {\n parent: one(table, {\n fields: [relationshipsTable.parent],\n references: [table.id],\n relationName: '_rels',\n }),\n }\n\n relationships.forEach((relationTo) => {\n const relatedTableName = getTableName({\n adapter,\n config: adapter.payload.collections[relationTo].config,\n throwValidationError: true,\n })\n const idColumnName = `${relationTo}ID`\n result[idColumnName] = one(adapter.tables[relatedTableName], {\n fields: [relationshipsTable[idColumnName]],\n references: [adapter.tables[relatedTableName].id],\n })\n })\n\n return result\n })\n\n adapter.relations[`relations_${relationshipsTableName}`] = relationshipsTableRelations\n }\n }\n\n const tableRelations = relations(table, ({ many }) => {\n const result: Record<string, Relation<string>> = {}\n\n relationsToBuild.forEach((val, key) => {\n result[key] = many(adapter.tables[val])\n })\n\n if (hasLocalizedField) {\n result._locales = many(localesTable)\n }\n\n if (hasManyTextField) {\n result._texts = many(textsTable)\n }\n if (hasManyNumberField) {\n result._numbers = many(numbersTable)\n }\n\n if (relationships.size && relationshipsTable) {\n result._rels = many(relationshipsTable, {\n relationName: '_rels',\n })\n }\n\n return result\n })\n\n adapter.relations[`relations_${tableName}`] = tableRelations\n\n return { hasManyNumberField, hasManyTextField, relationsToBuild }\n}\n"],"names":["relations","index","integer","numeric","serial","timestamp","unique","varchar","getTableName","parentIDColumnMap","setColumnID","traverseFields","buildTable","adapter","baseColumns","baseExtraConfig","buildNumbers","buildRelationships","buildTexts","disableNotNull","disableUnique","fields","rootRelationsToBuild","rootRelationships","rootTableIDColType","rootTableName","incomingRootTableName","tableName","timestamps","versions","columns","indexes","hasLocalizedField","hasLocalizedRelationshipField","hasManyTextField","hasManyNumberField","hasLocalizedManyTextField","hasLocalizedManyNumberField","localesColumns","localesIndexes","localesTable","textsTable","numbersTable","relationships","Set","relationshipsTable","relationsToBuild","Map","idColType","newTableName","parentTableName","createdAt","mode","precision","withTimezone","defaultNow","notNull","updatedAt","table","pgSchema","cols","extraConfig","Object","entries","reduce","config","key","func","acc","colName","tables","localeTableName","localesSuffix","id","primaryKey","_locale","enums","enum__locales","_parentID","references","onDelete","_localeParent","on","localesTableRelations","one","textsTableName","order","parent","path","text","locale","orderParentIdx","text_idx","localeParent","textsTableRelations","numbersTableName","number","numberIdx","numbersTableRelations","size","relationshipColumns","forEach","relationTo","relationshipConfig","payload","collections","formattedRelationTo","throwValidationError","colType","idType","relatedCollectionCustomIDType","slug","customIDType","relationshipsTableName","relationshipsSuffix","result","parentIdx","pathIdx","localeIdx","relationshipsTableRelations","relationName","relatedTableName","idColumnName","tableRelations","many","val","_locales","_texts","_numbers","_rels"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA,oCAAoC,GAUpC,SAASA,SAAS,QAAQ,cAAa;AACvC,SAASC,KAAK,EAAEC,OAAO,EAAEC,OAAO,EAAEC,MAAM,EAAEC,SAAS,EAAEC,MAAM,EAAEC,OAAO,QAAQ,sBAAqB;AAKjG,SAASC,YAAY,QAAQ,oBAAmB;AAChD,SAASC,iBAAiB,QAAQ,yBAAwB;AAC1D,SAASC,WAAW,QAAQ,mBAAkB;AAC9C,SAASC,cAAc,QAAQ,sBAAqB;AA2BpD,OAAO,MAAMC,aAAa,CAAC,EACzBC,OAAO,EACPC,cAAc,CAAC,CAAC,EAChBC,kBAAkB,CAAC,CAAC,EACpBC,YAAY,EACZC,kBAAkB,EAClBC,UAAU,EACVC,cAAc,EACdC,gBAAgB,KAAK,EACrBC,MAAM,EACNC,oBA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ExF;QAAoBD;QAAkBY;IAAiB;AAClE,EAAC"}
@@ -1,12 +0,0 @@
1
- import type { GenericColumn } from '../types.js';
2
- type CreateIndexArgs = {
3
- columnName: string;
4
- name: string | string[];
5
- tableName: string;
6
- unique?: boolean;
7
- };
8
- export declare const createIndex: ({ name, columnName, tableName, unique }: CreateIndexArgs) => (table: {
9
- [x: string]: GenericColumn;
10
- }) => import("drizzle-orm/pg-core").IndexBuilder;
11
- export {};
12
- //# sourceMappingURL=createIndex.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"createIndex.d.ts","sourceRoot":"","sources":["../../src/schema/createIndex.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAA;AAEhD,KAAK,eAAe,GAAG;IACrB,UAAU,EAAE,MAAM,CAAA;IAClB,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE,CAAA;IACvB,SAAS,EAAE,MAAM,CAAA;IACjB,MAAM,CAAC,EAAE,OAAO,CAAA;CACjB,CAAA;AAED,eAAO,MAAM,WAAW,4CAA6C,eAAe,aACnE;IAAE,CAAC,CAAC,EAAE,MAAM,GAAG,aAAa,CAAA;CAAE,+CAc9C,CAAA"}
@@ -1,18 +0,0 @@
1
- /* eslint-disable no-param-reassign */ import { index, uniqueIndex } from 'drizzle-orm/pg-core';
2
- export const createIndex = ({ name, columnName, tableName, unique })=>{
3
- return (table)=>{
4
- let columns;
5
- if (Array.isArray(name)) {
6
- columns = name.map((columnName)=>table[columnName])// exclude fields were included in compound indexes but do not exist on the table
7
- .filter((col)=>typeof col !== 'undefined');
8
- } else {
9
- columns = [
10
- table[name]
11
- ];
12
- }
13
- if (unique) return uniqueIndex(`${tableName}_${columnName}_idx`).on(columns[0], ...columns.slice(1));
14
- return index(`${tableName}_${columnName}_idx`).on(columns[0], ...columns.slice(1));
15
- };
16
- };
17
-
18
- //# sourceMappingURL=createIndex.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/schema/createIndex.ts"],"sourcesContent":["/* eslint-disable no-param-reassign */\nimport { index, uniqueIndex } from 'drizzle-orm/pg-core'\n\nimport type { GenericColumn } from '../types.js'\n\ntype CreateIndexArgs = {\n columnName: string\n name: string | string[]\n tableName: string\n unique?: boolean\n}\n\nexport const createIndex = ({ name, columnName, tableName, unique }: CreateIndexArgs) => {\n return (table: { [x: string]: GenericColumn }) => {\n let columns\n if (Array.isArray(name)) {\n columns = name\n .map((columnName) => table[columnName])\n // exclude fields were included in compound indexes but do not exist on the table\n .filter((col) => typeof col !== 'undefined')\n } else {\n columns = [table[name]]\n }\n if (unique)\n return uniqueIndex(`${tableName}_${columnName}_idx`).on(columns[0], ...columns.slice(1))\n return index(`${tableName}_${columnName}_idx`).on(columns[0], ...columns.slice(1))\n }\n}\n"],"names":["index","uniqueIndex","createIndex","name","columnName","tableName","unique","table","columns","Array","isArray","map","filter","col","on","slice"],"rangeMappings":";;;;;;;;;;;;;;;","mappings":"AAAA,oCAAoC,GACpC,SAASA,KAAK,EAAEC,WAAW,QAAQ,sBAAqB;AAWxD,OAAO,MAAMC,cAAc,CAAC,EAAEC,IAAI,EAAEC,UAAU,EAAEC,SAAS,EAAEC,MAAM,EAAmB;IAClF,OAAO,CAACC;QACN,IAAIC;QACJ,IAAIC,MAAMC,OAAO,CAACP,OAAO;YACvBK,UAAUL,KACPQ,GAAG,CAAC,CAACP,aAAeG,KAAK,CAACH,WAAW,CACtC,iFAAiF;aAChFQ,MAAM,CAAC,CAACC,MAAQ,OAAOA,QAAQ;QACpC,OAAO;YACLL,UAAU;gBAACD,KAAK,CAACJ,KAAK;aAAC;QACzB;QACA,IAAIG,QACF,OAAOL,YAAY,CAAC,EAAEI,UAAU,CAAC,EAAED,WAAW,IAAI,CAAC,EAAEU,EAAE,CAACN,OAAO,CAAC,EAAE,KAAKA,QAAQO,KAAK,CAAC;QACvF,OAAOf,MAAM,CAAC,EAAEK,UAAU,CAAC,EAAED,WAAW,IAAI,CAAC,EAAEU,EAAE,CAACN,OAAO,CAAC,EAAE,KAAKA,QAAQO,KAAK,CAAC;IACjF;AACF,EAAC"}
@@ -1,32 +0,0 @@
1
- import type { DBIdentifierName } from 'payload/database';
2
- import type { PostgresAdapter } from '../types.js';
3
- type Args = {
4
- adapter: PostgresAdapter;
5
- /** The collection, global or field config **/
6
- config: {
7
- dbName?: DBIdentifierName;
8
- enumName?: DBIdentifierName;
9
- name?: string;
10
- slug?: string;
11
- };
12
- /** Localized tables need to be given the locales suffix */
13
- locales?: boolean;
14
- /** For nested tables passed for the user custom dbName functions to handle their own iterations */
15
- parentTableName?: string;
16
- /** For sub tables (array for example) this needs to include the parentTableName */
17
- prefix?: string;
18
- /** Adds the relationships suffix */
19
- relationships?: boolean;
20
- /** For tables based on fields that could have both enumName and dbName (ie: select with hasMany), default: 'dbName' */
21
- target?: 'dbName' | 'enumName';
22
- throwValidationError?: boolean;
23
- /** Adds the versions suffix, should only be used on the base collection to duplicate suffixing */
24
- versions?: boolean;
25
- };
26
- /**
27
- * Used to name database enums and tables
28
- * Returns the table or enum name for a given entity
29
- */
30
- export declare const getTableName: ({ adapter, config: { name, slug }, config, locales, parentTableName, prefix, relationships, target, throwValidationError, versions, }: Args) => string;
31
- export {};
32
- //# sourceMappingURL=getTableName.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"getTableName.d.ts","sourceRoot":"","sources":["../../src/schema/getTableName.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAA;AAKxD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAA;AAElD,KAAK,IAAI,GAAG;IACV,OAAO,EAAE,eAAe,CAAA;IACxB,8CAA8C;IAC9C,MAAM,EAAE;QACN,MAAM,CAAC,EAAE,gBAAgB,CAAA;QACzB,QAAQ,CAAC,EAAE,gBAAgB,CAAA;QAC3B,IAAI,CAAC,EAAE,MAAM,CAAA;QACb,IAAI,CAAC,EAAE,MAAM,CAAA;KACd,CAAA;IACD,2DAA2D;IAC3D,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,mGAAmG;IACnG,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB,mFAAmF;IACnF,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,oCAAoC;IACpC,aAAa,CAAC,EAAE,OAAO,CAAA;IACvB,uHAAuH;IACvH,MAAM,CAAC,EAAE,QAAQ,GAAG,UAAU,CAAA;IAC9B,oBAAoB,CAAC,EAAE,OAAO,CAAA;IAC9B,kGAAkG;IAClG,QAAQ,CAAC,EAAE,OAAO,CAAA;CACnB,CAAA;AAED;;;GAGG;AACH,eAAO,MAAM,YAAY,0IAWtB,IAAI,KAAG,MA4BT,CAAA"}
@@ -1,31 +0,0 @@
1
- import { APIError } from 'payload/errors';
2
- import toSnakeCase from 'to-snake-case';
3
- /**
4
- * Used to name database enums and tables
5
- * Returns the table or enum name for a given entity
6
- */ export const getTableName = ({ adapter, config: { name, slug }, config, locales = false, parentTableName, prefix = '', relationships = false, target = 'dbName', throwValidationError = false, versions = false })=>{
7
- let result;
8
- let custom = config[target];
9
- if (!custom && target === 'enumName') {
10
- custom = config['dbName'];
11
- }
12
- if (custom) {
13
- result = typeof custom === 'function' ? custom({
14
- tableName: parentTableName
15
- }) : custom;
16
- } else {
17
- result = `${prefix}${toSnakeCase(name ?? slug)}`;
18
- }
19
- if (locales) result = `${result}${adapter.localesSuffix}`;
20
- if (versions) result = `_${result}${adapter.versionsSuffix}`;
21
- if (relationships) result = `${result}${adapter.relationshipsSuffix}`;
22
- if (!throwValidationError) {
23
- return result;
24
- }
25
- if (result.length > 63) {
26
- throw new APIError(`Exceeded max identifier length for table or enum name of 63 characters. Invalid name: ${result}`);
27
- }
28
- return result;
29
- };
30
-
31
- //# sourceMappingURL=getTableName.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/schema/getTableName.ts"],"sourcesContent":["import type { DBIdentifierName } from 'payload/database'\n\nimport { APIError } from 'payload/errors'\nimport toSnakeCase from 'to-snake-case'\n\nimport type { PostgresAdapter } from '../types.js'\n\ntype Args = {\n adapter: PostgresAdapter\n /** The collection, global or field config **/\n config: {\n dbName?: DBIdentifierName\n enumName?: DBIdentifierName\n name?: string\n slug?: string\n }\n /** Localized tables need to be given the locales suffix */\n locales?: boolean\n /** For nested tables passed for the user custom dbName functions to handle their own iterations */\n parentTableName?: string\n /** For sub tables (array for example) this needs to include the parentTableName */\n prefix?: string\n /** Adds the relationships suffix */\n relationships?: boolean\n /** For tables based on fields that could have both enumName and dbName (ie: select with hasMany), default: 'dbName' */\n target?: 'dbName' | 'enumName'\n throwValidationError?: boolean\n /** Adds the versions suffix, should only be used on the base collection to duplicate suffixing */\n versions?: boolean\n}\n\n/**\n * Used to name database enums and tables\n * Returns the table or enum name for a given entity\n */\nexport const getTableName = ({\n adapter,\n config: { name, slug },\n config,\n locales = false,\n parentTableName,\n prefix = '',\n relationships = false,\n target = 'dbName',\n throwValidationError = false,\n versions = false,\n}: Args): string => {\n let result: string\n let custom = config[target]\n\n if (!custom && target === 'enumName') {\n custom = config['dbName']\n }\n\n if (custom) {\n result = typeof custom === 'function' ? custom({ tableName: parentTableName }) : custom\n } else {\n result = `${prefix}${toSnakeCase(name ?? slug)}`\n }\n\n if (locales) result = `${result}${adapter.localesSuffix}`\n if (versions) result = `_${result}${adapter.versionsSuffix}`\n if (relationships) result = `${result}${adapter.relationshipsSuffix}`\n\n if (!throwValidationError) {\n return result\n }\n\n if (result.length > 63) {\n throw new APIError(\n `Exceeded max identifier length for table or enum name of 63 characters. Invalid name: ${result}`,\n )\n }\n return result\n}\n"],"names":["APIError","toSnakeCase","getTableName","adapter","config","name","slug","locales","parentTableName","prefix","relationships","target","throwValidationError","versions","result","custom","tableName","localesSuffix","versionsSuffix","relationshipsSuffix","length"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAEA,SAASA,QAAQ,QAAQ,iBAAgB;AACzC,OAAOC,iBAAiB,gBAAe;AA4BvC;;;CAGC,GACD,OAAO,MAAMC,eAAe,CAAC,EAC3BC,OAAO,EACPC,QAAQ,EAAEC,IAAI,EAAEC,IAAI,EAAE,EACtBF,MAAM,EACNG,UAAU,KAAK,EACfC,eAAe,EACfC,SAAS,EAAE,EACXC,gBAAgB,KAAK,EACrBC,SAAS,QAAQ,EACjBC,uBAAuB,KAAK,EAC5BC,WAAW,KAAK,EACX;IACL,IAAIC;IACJ,IAAIC,SAASX,MAAM,CAACO,OAAO;IAE3B,IAAI,CAACI,UAAUJ,WAAW,YAAY;QACpCI,SAASX,MAAM,CAAC,SAAS;IAC3B;IAEA,IAAIW,QAAQ;QACVD,SAAS,OAAOC,WAAW,aAAaA,OAAO;YAAEC,WAAWR;QAAgB,KAAKO;IACnF,OAAO;QACLD,SAAS,CAAC,EAAEL,OAAO,EAAER,YAAYI,QAAQC,MAAM,CAAC;IAClD;IAEA,IAAIC,SAASO,SAAS,CAAC,EAAEA,OAAO,EAAEX,QAAQc,aAAa,CAAC,CAAC;IACzD,IAAIJ,UAAUC,SAAS,CAAC,CAAC,EAAEA,OAAO,EAAEX,QAAQe,cAAc,CAAC,CAAC;IAC5D,IAAIR,eAAeI,SAAS,CAAC,EAAEA,OAAO,EAAEX,QAAQgB,mBAAmB,CAAC,CAAC;IAErE,IAAI,CAACP,sBAAsB;QACzB,OAAOE;IACT;IAEA,IAAIA,OAAOM,MAAM,GAAG,IAAI;QACtB,MAAM,IAAIpB,SACR,CAAC,sFAAsF,EAAEc,OAAO,CAAC;IAErG;IACA,OAAOA;AACT,EAAC"}
@@ -1,3 +0,0 @@
1
- import type { Field } from 'payload/types';
2
- export declare const idToUUID: (fields: Field[]) => Field[];
3
- //# sourceMappingURL=idToUUID.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"idToUUID.d.ts","sourceRoot":"","sources":["../../src/schema/idToUUID.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,eAAe,CAAA;AAE1C,eAAO,MAAM,QAAQ,WAAY,KAAK,EAAE,KAAG,KAAK,EAU5C,CAAA"}
@@ -1,11 +0,0 @@
1
- export const idToUUID = (fields)=>fields.map((field)=>{
2
- if ('name' in field && field.name === 'id') {
3
- return {
4
- ...field,
5
- name: '_uuid'
6
- };
7
- }
8
- return field;
9
- });
10
-
11
- //# sourceMappingURL=idToUUID.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/schema/idToUUID.ts"],"sourcesContent":["import type { Field } from 'payload/types'\n\nexport const idToUUID = (fields: Field[]): Field[] =>\n fields.map((field) => {\n if ('name' in field && field.name === 'id') {\n return {\n ...field,\n name: '_uuid',\n }\n }\n\n return field\n })\n"],"names":["idToUUID","fields","map","field","name"],"rangeMappings":";;;;;;;;","mappings":"AAEA,OAAO,MAAMA,WAAW,CAACC,SACvBA,OAAOC,GAAG,CAAC,CAACC;QACV,IAAI,UAAUA,SAASA,MAAMC,IAAI,KAAK,MAAM;YAC1C,OAAO;gBACL,GAAGD,KAAK;gBACRC,MAAM;YACR;QACF;QAEA,OAAOD;IACT,GAAE"}
@@ -1,4 +0,0 @@
1
- import { integer, numeric, uuid, varchar } from 'drizzle-orm/pg-core';
2
- import type { IDType } from '../types.js';
3
- export declare const parentIDColumnMap: Record<IDType, typeof integer<string> | typeof numeric<string> | typeof uuid<string> | typeof varchar>;
4
- //# sourceMappingURL=parentIDColumnMap.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"parentIDColumnMap.d.ts","sourceRoot":"","sources":["../../src/schema/parentIDColumnMap.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAErE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AAEzC,eAAO,MAAM,iBAAiB,EAAE,MAAM,CACpC,MAAM,EACN,OAAO,OAAO,CAAC,MAAM,CAAC,GAAG,OAAO,OAAO,CAAC,MAAM,CAAC,GAAG,OAAO,IAAI,CAAC,MAAM,CAAC,GAAG,OAAO,OAAO,CAMvF,CAAA"}
@@ -1,9 +0,0 @@
1
- import { integer, numeric, uuid, varchar } from 'drizzle-orm/pg-core';
2
- export const parentIDColumnMap = {
3
- integer,
4
- numeric,
5
- uuid,
6
- varchar
7
- };
8
-
9
- //# sourceMappingURL=parentIDColumnMap.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/schema/parentIDColumnMap.ts"],"sourcesContent":["import { integer, numeric, uuid, varchar } from 'drizzle-orm/pg-core'\n\nimport type { IDType } from '../types.js'\n\nexport const parentIDColumnMap: Record<\n IDType,\n typeof integer<string> | typeof numeric<string> | typeof uuid<string> | typeof varchar\n> = {\n integer,\n numeric,\n uuid,\n varchar,\n}\n"],"names":["integer","numeric","uuid","varchar","parentIDColumnMap"],"rangeMappings":";;;;;;","mappings":"AAAA,SAASA,OAAO,EAAEC,OAAO,EAAEC,IAAI,EAAEC,OAAO,QAAQ,sBAAqB;AAIrE,OAAO,MAAMC,oBAGT;IACFJ;IACAC;IACAC;IACAC;AACF,EAAC"}
@@ -1,11 +0,0 @@
1
- import type { PgColumnBuilder } from 'drizzle-orm/pg-core';
2
- import { type Field } from 'payload/types';
3
- import type { IDType, PostgresAdapter } from '../types.js';
4
- type Args = {
5
- adapter: PostgresAdapter;
6
- columns: Record<string, PgColumnBuilder>;
7
- fields: Field[];
8
- };
9
- export declare const setColumnID: ({ adapter, columns, fields }: Args) => IDType;
10
- export {};
11
- //# sourceMappingURL=setColumnID.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"setColumnID.d.ts","sourceRoot":"","sources":["../../src/schema/setColumnID.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAA;AAG1D,OAAO,EAAE,KAAK,KAAK,EAAoB,MAAM,eAAe,CAAA;AAG5D,OAAO,KAAK,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM,aAAa,CAAA;AAE1D,KAAK,IAAI,GAAG;IAAE,OAAO,EAAE,eAAe,CAAC;IAAC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,eAAe,CAAC,CAAC;IAAC,MAAM,EAAE,KAAK,EAAE,CAAA;CAAE,CAAA;AACnG,eAAO,MAAM,WAAW,iCAAkC,IAAI,KAAG,MAuBhE,CAAA"}
@@ -1,24 +0,0 @@
1
- import { numeric, serial, uuid, varchar } from 'drizzle-orm/pg-core';
2
- import { fieldAffectsData } from 'payload/types';
3
- import { flattenTopLevelFields } from 'payload/utilities';
4
- export const setColumnID = ({ adapter, columns, fields })=>{
5
- const idField = flattenTopLevelFields(fields).find((field)=>fieldAffectsData(field) && field.name === 'id');
6
- if (idField) {
7
- if (idField.type === 'number') {
8
- columns.id = numeric('id').primaryKey();
9
- return 'numeric';
10
- }
11
- if (idField.type === 'text') {
12
- columns.id = varchar('id').primaryKey();
13
- return 'varchar';
14
- }
15
- }
16
- if (adapter.idType === 'uuid') {
17
- columns.id = uuid('id').defaultRandom().primaryKey();
18
- return 'uuid';
19
- }
20
- columns.id = serial('id').primaryKey();
21
- return 'integer';
22
- };
23
-
24
- //# sourceMappingURL=setColumnID.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/schema/setColumnID.ts"],"sourcesContent":["import type { PgColumnBuilder } from 'drizzle-orm/pg-core'\n\nimport { numeric, serial, uuid, varchar } from 'drizzle-orm/pg-core'\nimport { type Field, fieldAffectsData } from 'payload/types'\nimport { flattenTopLevelFields } from 'payload/utilities'\n\nimport type { IDType, PostgresAdapter } from '../types.js'\n\ntype Args = { adapter: PostgresAdapter; columns: Record<string, PgColumnBuilder>; fields: Field[] }\nexport const setColumnID = ({ adapter, columns, fields }: Args): IDType => {\n const idField = flattenTopLevelFields(fields).find(\n (field) => fieldAffectsData(field) && field.name === 'id',\n )\n if (idField) {\n if (idField.type === 'number') {\n columns.id = numeric('id').primaryKey()\n return 'numeric'\n }\n\n if (idField.type === 'text') {\n columns.id = varchar('id').primaryKey()\n return 'varchar'\n }\n }\n\n if (adapter.idType === 'uuid') {\n columns.id = uuid('id').defaultRandom().primaryKey()\n return 'uuid'\n }\n\n columns.id = serial('id').primaryKey()\n return 'integer'\n}\n"],"names":["numeric","serial","uuid","varchar","fieldAffectsData","flattenTopLevelFields","setColumnID","adapter","columns","fields","idField","find","field","name","type","id","primaryKey","idType","defaultRandom"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;","mappings":"AAEA,SAASA,OAAO,EAAEC,MAAM,EAAEC,IAAI,EAAEC,OAAO,QAAQ,sBAAqB;AACpE,SAAqBC,gBAAgB,QAAQ,gBAAe;AAC5D,SAASC,qBAAqB,QAAQ,oBAAmB;AAKzD,OAAO,MAAMC,cAAc,CAAC,EAAEC,OAAO,EAAEC,OAAO,EAAEC,MAAM,EAAQ;IAC5D,MAAMC,UAAUL,sBAAsBI,QAAQE,IAAI,CAChD,CAACC,QAAUR,iBAAiBQ,UAAUA,MAAMC,IAAI,KAAK;IAEvD,IAAIH,SAAS;QACX,IAAIA,QAAQI,IAAI,KAAK,UAAU;YAC7BN,QAAQO,EAAE,GAAGf,QAAQ,MAAMgB,UAAU;YACrC,OAAO;QACT;QAEA,IAAIN,QAAQI,IAAI,KAAK,QAAQ;YAC3BN,QAAQO,EAAE,GAAGZ,QAAQ,MAAMa,UAAU;YACrC,OAAO;QACT;IACF;IAEA,IAAIT,QAAQU,MAAM,KAAK,QAAQ;QAC7BT,QAAQO,EAAE,GAAGb,KAAK,MAAMgB,aAAa,GAAGF,UAAU;QAClD,OAAO;IACT;IAEAR,QAAQO,EAAE,GAAGd,OAAO,MAAMe,UAAU;IACpC,OAAO;AACT,EAAC"}
@@ -1,38 +0,0 @@
1
- import type { IndexBuilder, PgColumnBuilder } from 'drizzle-orm/pg-core';
2
- import type { Field, TabAsField } from 'payload/types';
3
- import type { GenericColumns, PostgresAdapter } from '../types.js';
4
- type Args = {
5
- adapter: PostgresAdapter;
6
- buildNumbers: boolean;
7
- buildRelationships: boolean;
8
- buildTexts: boolean;
9
- columnPrefix?: string;
10
- columns: Record<string, PgColumnBuilder>;
11
- disableNotNull: boolean;
12
- disableUnique?: boolean;
13
- fieldPrefix?: string;
14
- fields: (Field | TabAsField)[];
15
- forceLocalized?: boolean;
16
- indexes: Record<string, (cols: GenericColumns) => IndexBuilder>;
17
- localesColumns: Record<string, PgColumnBuilder>;
18
- localesIndexes: Record<string, (cols: GenericColumns) => IndexBuilder>;
19
- newTableName: string;
20
- parentTableName: string;
21
- relationsToBuild: Map<string, string>;
22
- relationships: Set<string>;
23
- rootRelationsToBuild?: Map<string, string>;
24
- rootTableIDColType: string;
25
- rootTableName: string;
26
- versions: boolean;
27
- };
28
- type Result = {
29
- hasLocalizedField: boolean;
30
- hasLocalizedManyNumberField: boolean;
31
- hasLocalizedManyTextField: boolean;
32
- hasLocalizedRelationshipField: boolean;
33
- hasManyNumberField: 'index' | boolean;
34
- hasManyTextField: 'index' | boolean;
35
- };
36
- export declare const traverseFields: ({ adapter, buildNumbers, buildRelationships, buildTexts, columnPrefix, columns, disableNotNull, disableUnique, fieldPrefix, fields, forceLocalized, indexes, localesColumns, localesIndexes, newTableName, parentTableName, relationsToBuild, relationships, rootRelationsToBuild, rootTableIDColType, rootTableName, versions, }: Args) => Result;
37
- export {};
38
- //# sourceMappingURL=traverseFields.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"traverseFields.d.ts","sourceRoot":"","sources":["../../src/schema/traverseFields.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,eAAe,EAA2B,MAAM,qBAAqB,CAAA;AACjG,OAAO,KAAK,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAqBtD,OAAO,KAAK,EAAE,cAAc,EAAU,eAAe,EAAE,MAAM,aAAa,CAAA;AAU1E,KAAK,IAAI,GAAG;IACV,OAAO,EAAE,eAAe,CAAA;IACxB,Y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