@payloadcms/db-postgres 0.8.1 → 0.8.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (76) hide show
  1. package/dist/count.d.ts.map +1 -1
  2. package/dist/count.js +3 -6
  3. package/dist/create.d.ts.map +1 -1
  4. package/dist/create.js +9 -6
  5. package/dist/createGlobal.d.ts.map +1 -1
  6. package/dist/createGlobal.js +9 -6
  7. package/dist/createGlobalVersion.d.ts.map +1 -1
  8. package/dist/createGlobalVersion.js +11 -10
  9. package/dist/createVersion.d.ts.map +1 -1
  10. package/dist/createVersion.js +22 -21
  11. package/dist/deleteMany.d.ts.map +1 -1
  12. package/dist/deleteMany.js +8 -6
  13. package/dist/deleteOne.d.ts.map +1 -1
  14. package/dist/deleteOne.js +3 -6
  15. package/dist/deleteVersions.d.ts.map +1 -1
  16. package/dist/deleteVersions.js +8 -7
  17. package/dist/find/traverseFields.d.ts.map +1 -1
  18. package/dist/find/traverseFields.js +13 -22
  19. package/dist/find.d.ts.map +1 -1
  20. package/dist/find.js +8 -6
  21. package/dist/findGlobal.d.ts.map +1 -1
  22. package/dist/findGlobal.js +8 -6
  23. package/dist/findGlobalVersions.d.ts.map +1 -1
  24. package/dist/findGlobalVersions.js +8 -7
  25. package/dist/findOne.d.ts.map +1 -1
  26. package/dist/findOne.js +8 -6
  27. package/dist/findVersions.d.ts.map +1 -1
  28. package/dist/findVersions.js +8 -7
  29. package/dist/index.d.ts.map +1 -1
  30. package/dist/index.js +6 -8
  31. package/dist/init.d.ts.map +1 -1
  32. package/dist/init.js +10 -8
  33. package/dist/queries/getTableColumnFromPath.d.ts.map +1 -1
  34. package/dist/queries/getTableColumnFromPath.js +12 -41
  35. package/dist/queries/parseParams.js +2 -2
  36. package/dist/queryDrafts.d.ts.map +1 -1
  37. package/dist/queryDrafts.js +8 -7
  38. package/dist/schema/build.d.ts +4 -3
  39. package/dist/schema/build.d.ts.map +1 -1
  40. package/dist/schema/build.js +86 -45
  41. package/dist/schema/{getTableName.d.ts → createTableName.d.ts} +5 -7
  42. package/dist/schema/createTableName.d.ts.map +1 -0
  43. package/dist/schema/createTableName.js +43 -0
  44. package/dist/schema/traverseFields.d.ts.map +1 -1
  45. package/dist/schema/traverseFields.js +40 -18
  46. package/dist/schema/validateExistingBlockIsIdentical.d.ts.map +1 -1
  47. package/dist/schema/validateExistingBlockIsIdentical.js +1 -1
  48. package/dist/transform/read/hasManyText.d.ts +2 -2
  49. package/dist/transform/read/hasManyText.d.ts.map +1 -1
  50. package/dist/transform/read/hasManyText.js +2 -2
  51. package/dist/transform/read/index.js +3 -3
  52. package/dist/transform/write/array.d.ts +2 -2
  53. package/dist/transform/write/array.d.ts.map +1 -1
  54. package/dist/transform/write/array.js +4 -4
  55. package/dist/transform/write/blocks.js +2 -2
  56. package/dist/transform/write/index.js +5 -5
  57. package/dist/transform/write/texts.js +3 -3
  58. package/dist/transform/write/traverseFields.d.ts.map +1 -1
  59. package/dist/transform/write/traverseFields.js +6 -15
  60. package/dist/transform/write/types.d.ts +1 -1
  61. package/dist/transform/write/types.d.ts.map +1 -1
  62. package/dist/types.d.ts +3 -6
  63. package/dist/types.d.ts.map +1 -1
  64. package/dist/update.d.ts.map +1 -1
  65. package/dist/update.js +3 -6
  66. package/dist/updateGlobal.d.ts.map +1 -1
  67. package/dist/updateGlobal.js +8 -6
  68. package/dist/updateGlobalVersion.d.ts.map +1 -1
  69. package/dist/updateGlobalVersion.js +3 -7
  70. package/dist/updateVersion.d.ts.map +1 -1
  71. package/dist/updateVersion.js +3 -7
  72. package/dist/upsertRow/index.js +3 -3
  73. package/dist/upsertRow/insertArrays.js +2 -2
  74. package/package.json +3 -3
  75. package/dist/schema/getTableName.d.ts.map +0 -1
  76. package/dist/schema/getTableName.js +0 -43
@@ -8,23 +8,23 @@ Object.defineProperty(exports, "buildTable", {
8
8
  return buildTable;
9
9
  }
10
10
  });
11
+ const _types = require("payload/types");
11
12
  const _drizzleorm = require("drizzle-orm");
12
13
  const _pgcore = require("drizzle-orm/pg-core");
13
- const _types = require("payload/types");
14
- const _getTableName = require("./getTableName");
14
+ const _tosnakecase = /*#__PURE__*/ _interop_require_default(require("to-snake-case"));
15
+ const _createTableName = require("./createTableName");
15
16
  const _parentIDColumnMap = require("./parentIDColumnMap");
16
17
  const _setColumnID = require("./setColumnID");
17
18
  const _traverseFields = require("./traverseFields");
19
+ function _interop_require_default(obj) {
20
+ return obj && obj.__esModule ? obj : {
21
+ default: obj
22
+ };
23
+ }
18
24
  const buildTable = ({ adapter, baseColumns = {}, baseExtraConfig = {}, buildNumbers, buildRelationships, buildTexts, disableNotNull, disableUnique = false, fields, rootRelationsToBuild, rootRelationships, rootTableIDColType, rootTableName: incomingRootTableName, tableName, timestamps, versions })=>{
19
25
  const rootTableName = incomingRootTableName || tableName;
20
26
  const columns = baseColumns;
21
27
  const indexes = {};
22
- let hasLocalizedField = false;
23
- let hasLocalizedRelationshipField = false;
24
- let hasManyTextField = false;
25
- let hasManyNumberField = false;
26
- let hasLocalizedManyTextField = false;
27
- let hasLocalizedManyNumberField = false;
28
28
  const localesColumns = {};
29
29
  const localesIndexes = {};
30
30
  let localesTable;
@@ -40,7 +40,7 @@ const buildTable = ({ adapter, baseColumns = {}, baseExtraConfig = {}, buildNumb
40
40
  columns,
41
41
  fields
42
42
  });
43
- ({ hasLocalizedField, hasLocalizedManyNumberField, hasLocalizedManyTextField, hasLocalizedRelationshipField, hasManyNumberField, hasManyTextField } = (0, _traverseFields.traverseFields)({
43
+ const { hasLocalizedField, hasLocalizedManyNumberField, hasLocalizedManyTextField, hasLocalizedRelationshipField, hasManyNumberField, hasManyTextField } = (0, _traverseFields.traverseFields)({
44
44
  adapter,
45
45
  buildNumbers,
46
46
  buildRelationships,
@@ -60,7 +60,7 @@ const buildTable = ({ adapter, baseColumns = {}, baseExtraConfig = {}, buildNumb
60
60
  rootTableIDColType: rootTableIDColType || idColType,
61
61
  rootTableName,
62
62
  versions
63
- }));
63
+ });
64
64
  if (timestamps) {
65
65
  columns.createdAt = (0, _pgcore.timestamp)('created_at', {
66
66
  mode: 'string',
@@ -78,25 +78,33 @@ const buildTable = ({ adapter, baseColumns = {}, baseExtraConfig = {}, buildNumb
78
78
  config[key] = func(cols);
79
79
  return config;
80
80
  }, {});
81
- return Object.entries(indexes).reduce((acc, [colName, func])=>{
81
+ const result = Object.entries(indexes).reduce((acc, [colName, func])=>{
82
82
  acc[colName] = func(cols);
83
83
  return acc;
84
84
  }, extraConfig);
85
+ return result;
85
86
  });
86
87
  adapter.tables[tableName] = table;
87
88
  if (hasLocalizedField) {
88
89
  const localeTableName = `${tableName}${adapter.localesSuffix}`;
89
90
  localesColumns.id = (0, _pgcore.serial)('id').primaryKey();
90
91
  localesColumns._locale = adapter.enums.enum__locales('_locale').notNull();
91
- localesColumns._parentID = _parentIDColumnMap.parentIDColumnMap[idColType]('_parent_id').references(()=>table.id, {
92
- onDelete: 'cascade'
93
- }).notNull();
92
+ localesColumns._parentID = _parentIDColumnMap.parentIDColumnMap[idColType]('_parent_id').notNull();
94
93
  localesTable = adapter.pgSchema.table(localeTableName, localesColumns, (cols)=>{
95
94
  return Object.entries(localesIndexes).reduce((acc, [colName, func])=>{
96
95
  acc[colName] = func(cols);
97
96
  return acc;
98
97
  }, {
99
- _localeParent: (0, _pgcore.unique)(`${localeTableName}_locale_parent_id_unique`).on(cols._locale, cols._parentID)
98
+ _localeParent: (0, _pgcore.unique)(`${localeTableName}_locale_parent_id_unique`).on(cols._locale, cols._parentID),
99
+ _parentIdFk: (0, _pgcore.foreignKey)({
100
+ name: `${localeTableName}_parent_id_fk`,
101
+ columns: [
102
+ cols._parentID
103
+ ],
104
+ foreignColumns: [
105
+ table.id
106
+ ]
107
+ }).onDelete('cascade')
100
108
  });
101
109
  });
102
110
  adapter.tables[localeTableName] = localesTable;
@@ -117,9 +125,7 @@ const buildTable = ({ adapter, baseColumns = {}, baseExtraConfig = {}, buildNumb
117
125
  const columns = {
118
126
  id: (0, _pgcore.serial)('id').primaryKey(),
119
127
  order: (0, _pgcore.integer)('order').notNull(),
120
- parent: _parentIDColumnMap.parentIDColumnMap[idColType]('parent_id').references(()=>table.id, {
121
- onDelete: 'cascade'
122
- }).notNull(),
128
+ parent: _parentIDColumnMap.parentIDColumnMap[idColType]('parent_id').notNull(),
123
129
  path: (0, _pgcore.varchar)('path').notNull(),
124
130
  text: (0, _pgcore.varchar)('text')
125
131
  };
@@ -127,16 +133,25 @@ const buildTable = ({ adapter, baseColumns = {}, baseExtraConfig = {}, buildNumb
127
133
  columns.locale = adapter.enums.enum__locales('locale');
128
134
  }
129
135
  textsTable = adapter.pgSchema.table(textsTableName, columns, (cols)=>{
130
- const indexes = {
131
- orderParentIdx: (0, _pgcore.index)(`${textsTableName}_order_parent_idx`).on(cols.order, cols.parent)
136
+ const config = {
137
+ orderParentIdx: (0, _pgcore.index)(`${textsTableName}_order_parent_idx`).on(cols.order, cols.parent),
138
+ parentFk: (0, _pgcore.foreignKey)({
139
+ name: `${textsTableName}_parent_fk`,
140
+ columns: [
141
+ cols.parent
142
+ ],
143
+ foreignColumns: [
144
+ table.id
145
+ ]
146
+ }).onDelete('cascade')
132
147
  };
133
148
  if (hasManyTextField === 'index') {
134
- indexes.text_idx = (0, _pgcore.index)(`${textsTableName}_text_idx`).on(cols.text);
149
+ config.text_idx = (0, _pgcore.index)(`${textsTableName}_text_idx`).on(cols.text);
135
150
  }
136
151
  if (hasLocalizedManyTextField) {
137
- indexes.localeParent = (0, _pgcore.index)(`${textsTableName}_locale_parent`).on(cols.locale, cols.parent);
152
+ config.localeParent = (0, _pgcore.index)(`${textsTableName}_locale_parent`).on(cols.locale, cols.parent);
138
153
  }
139
- return indexes;
154
+ return config;
140
155
  });
141
156
  adapter.tables[textsTableName] = textsTable;
142
157
  const textsTableRelations = (0, _drizzleorm.relations)(textsTable, ({ one })=>({
@@ -157,25 +172,32 @@ const buildTable = ({ adapter, baseColumns = {}, baseExtraConfig = {}, buildNumb
157
172
  id: (0, _pgcore.serial)('id').primaryKey(),
158
173
  number: (0, _pgcore.numeric)('number'),
159
174
  order: (0, _pgcore.integer)('order').notNull(),
160
- parent: _parentIDColumnMap.parentIDColumnMap[idColType]('parent_id').references(()=>table.id, {
161
- onDelete: 'cascade'
162
- }).notNull(),
175
+ parent: _parentIDColumnMap.parentIDColumnMap[idColType]('parent_id').notNull(),
163
176
  path: (0, _pgcore.varchar)('path').notNull()
164
177
  };
165
178
  if (hasLocalizedManyNumberField) {
166
179
  columns.locale = adapter.enums.enum__locales('locale');
167
180
  }
168
181
  numbersTable = adapter.pgSchema.table(numbersTableName, columns, (cols)=>{
169
- const indexes = {
170
- orderParentIdx: (0, _pgcore.index)(`${numbersTableName}_order_parent_idx`).on(cols.order, cols.parent)
182
+ const config = {
183
+ orderParentIdx: (0, _pgcore.index)(`${numbersTableName}_order_parent_idx`).on(cols.order, cols.parent),
184
+ parentFk: (0, _pgcore.foreignKey)({
185
+ name: `${numbersTableName}_parent_fk`,
186
+ columns: [
187
+ cols.parent
188
+ ],
189
+ foreignColumns: [
190
+ table.id
191
+ ]
192
+ }).onDelete('cascade')
171
193
  };
172
194
  if (hasManyNumberField === 'index') {
173
- indexes.numberIdx = (0, _pgcore.index)(`${numbersTableName}_number_idx`).on(cols.number);
195
+ config.numberIdx = (0, _pgcore.index)(`${numbersTableName}_number_idx`).on(cols.number);
174
196
  }
175
197
  if (hasLocalizedManyNumberField) {
176
- indexes.localeParent = (0, _pgcore.index)(`${numbersTableName}_locale_parent`).on(cols.locale, cols.parent);
198
+ config.localeParent = (0, _pgcore.index)(`${numbersTableName}_locale_parent`).on(cols.locale, cols.parent);
177
199
  }
178
- return indexes;
200
+ return config;
179
201
  });
180
202
  adapter.tables[numbersTableName] = numbersTable;
181
203
  const numbersTableRelations = (0, _drizzleorm.relations)(numbersTable, ({ one })=>({
@@ -195,36 +217,55 @@ const buildTable = ({ adapter, baseColumns = {}, baseExtraConfig = {}, buildNumb
195
217
  const relationshipColumns = {
196
218
  id: (0, _pgcore.serial)('id').primaryKey(),
197
219
  order: (0, _pgcore.integer)('order'),
198
- parent: _parentIDColumnMap.parentIDColumnMap[idColType]('parent_id').references(()=>table.id, {
199
- onDelete: 'cascade'
200
- }).notNull(),
220
+ parent: _parentIDColumnMap.parentIDColumnMap[idColType]('parent_id').notNull(),
201
221
  path: (0, _pgcore.varchar)('path').notNull()
202
222
  };
203
223
  if (hasLocalizedRelationshipField) {
204
224
  relationshipColumns.locale = adapter.enums.enum__locales('locale');
205
225
  }
226
+ const relationExtraConfig = {};
227
+ const relationshipsTableName = `${tableName}${adapter.relationshipsSuffix}`;
206
228
  relationships.forEach((relationTo)=>{
207
229
  const relationshipConfig = adapter.payload.collections[relationTo].config;
208
- const formattedRelationTo = (0, _getTableName.getTableName)({
230
+ const formattedRelationTo = (0, _createTableName.createTableName)({
209
231
  adapter,
210
232
  config: relationshipConfig,
211
233
  throwValidationError: true
212
234
  });
213
235
  let colType = adapter.idType === 'uuid' ? 'uuid' : 'integer';
214
236
  const relatedCollectionCustomID = relationshipConfig.fields.find((field)=>(0, _types.fieldAffectsData)(field) && field.name === 'id');
215
- if (relatedCollectionCustomID?.type === 'number') colType = 'numeric';
216
- if (relatedCollectionCustomID?.type === 'text') colType = 'varchar';
217
- relationshipColumns[`${relationTo}ID`] = _parentIDColumnMap.parentIDColumnMap[colType](`${formattedRelationTo}_id`).references(()=>adapter.tables[formattedRelationTo].id, {
218
- onDelete: 'cascade'
219
- });
237
+ const relatedCollectionCustomIDType = relatedCollectionCustomID?.type;
238
+ if (relatedCollectionCustomIDType === 'number') colType = 'numeric';
239
+ if (relatedCollectionCustomIDType === 'text') colType = 'varchar';
240
+ relationshipColumns[`${relationTo}ID`] = _parentIDColumnMap.parentIDColumnMap[colType](`${formattedRelationTo}_id`);
241
+ relationExtraConfig[`${relationTo}IdFk`] = (cols)=>(0, _pgcore.foreignKey)({
242
+ name: `${relationshipsTableName}_${(0, _tosnakecase.default)(relationTo)}_fk`,
243
+ columns: [
244
+ cols[`${relationTo}ID`]
245
+ ],
246
+ foreignColumns: [
247
+ adapter.tables[formattedRelationTo].id
248
+ ]
249
+ }).onDelete('cascade');
220
250
  });
221
- const relationshipsTableName = `${tableName}${adapter.relationshipsSuffix}`;
222
251
  relationshipsTable = adapter.pgSchema.table(relationshipsTableName, relationshipColumns, (cols)=>{
223
- const result = {
252
+ const result = Object.entries(relationExtraConfig).reduce((config, [key, func])=>{
253
+ config[key] = func(cols);
254
+ return config;
255
+ }, {
224
256
  order: (0, _pgcore.index)(`${relationshipsTableName}_order_idx`).on(cols.order),
257
+ parentFk: (0, _pgcore.foreignKey)({
258
+ name: `${relationshipsTableName}_parent_fk`,
259
+ columns: [
260
+ cols.parent
261
+ ],
262
+ foreignColumns: [
263
+ table.id
264
+ ]
265
+ }).onDelete('cascade'),
225
266
  parentIdx: (0, _pgcore.index)(`${relationshipsTableName}_parent_idx`).on(cols.parent),
226
267
  pathIdx: (0, _pgcore.index)(`${relationshipsTableName}_path_idx`).on(cols.path)
227
- };
268
+ });
228
269
  if (hasLocalizedRelationshipField) {
229
270
  result.localeIdx = (0, _pgcore.index)(`${relationshipsTableName}_locale_idx`).on(cols.locale);
230
271
  }
@@ -244,7 +285,7 @@ const buildTable = ({ adapter, baseColumns = {}, baseExtraConfig = {}, buildNumb
244
285
  })
245
286
  };
246
287
  relationships.forEach((relationTo)=>{
247
- const relatedTableName = (0, _getTableName.getTableName)({
288
+ const relatedTableName = (0, _createTableName.createTableName)({
248
289
  adapter,
249
290
  config: adapter.payload.collections[relationTo].config,
250
291
  throwValidationError: true
@@ -293,4 +334,4 @@ const buildTable = ({ adapter, baseColumns = {}, baseExtraConfig = {}, buildNumb
293
334
  };
294
335
  };
295
336
 
296
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9zY2hlbWEvYnVpbGQudHMiXSwic291cmNlc0NvbnRlbnQiOlsiLyogZXNsaW50LWRpc2FibGUgbm8tcGFyYW0tcmVhc3NpZ24gKi9cbmltcG9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cmVsYXRpb25zaGlwc1RhYmxlID0gYWRhcHRlci5wZ1NjaGVtYS50YWJsZShcbiAgICAgICAgcmVsYXRpb25zaGlwc1RhYmxlTmFtZSxcbiAgICAgICAgcmVsYXRpb25zaGlwQ29sdW1ucyxcbiAgICAgICAgKGNvbHMpID0+IHtcbiAgICAgICAgICBjb25zdCByZXN1bHQ6IFJlY29yZDxzdHJpbmcsIEZvcmVpZ25LZXlCdWlsZGVyIHwgSW5kZXhCdWlsZGVyPiA9IE9iamVjdC5lbnRyaWVzKFxuICAgICAgICAgICAgcmVsYXRpb25FeHRyYUNvbmZpZyxcbiAgICAgICAgICApLnJlZHVjZShcbiAgICAgICAgICAgIChjb25maWcsIFtrZXksIGZ1bmNdKSA9PiB7XG4gICAgICAgICAgICAgIGNvbmZpZ1trZXldID0gZnVuYyhjb2xzKVxuICAgICAgICAgICAgICByZXR1cm4gY29uZmlnXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAge1xuICAgICAgICAgICAgICBvcmRlcjogaW5kZXgoYCR7cmVsYXRpb25zaGlwc1RhYmxlTmFtZX1fb3JkZXJfaWR4YCkub24oY29scy5vcmRlciksXG4gICAgICAgICAgICAgIHBhcmVudEZrOiBmb3JlaWduS2V5KHtcbiAgICAgICAgICAgICAgICBuYW1lOiBgJHtyZWxhdGlvbnNoaXBzVGFibGVOYW1lfV9wYXJlbnRfZmtgLFxuICAgICAgICAgICAgICAgIGNvbHVtbnM6IFtjb2xzLnBhcmVudF0sXG4gICAgICAgICAgICAgICAgZm9yZWlnbkNvbHVtbnM6IFt0YWJsZS5pZF0sXG4gICAgICAgICAgICAgIH0pLm9uRGVsZXRlKCdjYXNjYWRlJyksXG4gICAgICAgICAgICAgIHBhcmVudElkeDogaW5kZXgoYCR7cmVsYXRpb25zaGlwc1RhYmxlTmFtZX1fcGFyZW50X2lkeGApLm9uKGNvbHMucGFyZW50KSxcbiAgICAgICAgICAgICAgcGF0aElkeDogaW5kZXgoYCR7cmVsYXRpb25zaGlwc1RhYmxlTmFtZX1fcGF0aF9pZHhgKS5vbihjb2xzLnBhdGgpLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICApXG5cbiAgICAgICAgICBpZiAoaGFzTG9jYWxpemVkUmVsYXRpb25zaGlwRmllbGQpIHtcbiAgICAgICAgICAgIHJlc3VsdC5sb2NhbGVJZHggPSBpbmRleChgJHtyZWxhdGlvbnNoaXBzVGFibGVOYW1lfV9sb2NhbGVfaWR4YCkub24oY29scy5sb2NhbGUpXG4gICAgICAgICAgfVxuXG4gICAgICAgICAgcmV0dXJuIHJlc3VsdFxuICAgICAgICB9LFxuICAgICAgKVxuXG4gICAgICBhZGFwdGVyLnRhYmxlc1tyZWxhdGlvbnNoaXBzVGFibGVOYW1lXSA9IHJlbGF0aW9uc2hpcHNUYWJsZVxuXG4gICAgICBjb25zdCByZWxhdGlvbnNoaXBzVGFibGVSZWxhdGlvbnMgPSByZWxhdGlvbnMocmVsYXRpb25zaGlwc1RhYmxlLCAoeyBvbmUgfSkgPT4ge1xuICAgICAgICBjb25zdCByZXN1bHQ6IFJlY29yZDxzdHJpbmcsIFJlbGF0aW9uPHN0cmluZz4+ID0ge1xuICAgICAgICAgIHBhcmVudDogb25lKHRhYmxlLCB7XG4gICAgICAgICAgICBmaWVsZHM6IFtyZWxhdGlvbnNoaXBzVGFibGUucGFyZW50XSxcbiAgICAgICAgICAgIHJlZmVyZW5jZXM6IFt0YWJsZS5pZF0sXG4gICAgICAgICAgICByZWxhdGlvbk5hbWU6ICdfcmVscycsXG4gICAgICAgICAgfSksXG4gICAgICAgIH1cblxuICAgICAgICByZWxhdGlvbnNoaXBzLmZvckVhY2goKHJlbGF0aW9uVG8pID0+IHtcbiAgICAgICAgICBjb25zdCByZWxhdGVkVGFibGVOYW1lID0gY3JlYXRlVGFibGVOYW1lKHtcbiAgICAgICAgICAgIGFkYXB0ZXIsXG4gICAgICAgICAgICBjb25maWc6IGFkYXB0ZXIucGF5bG9hZC5jb2xsZWN0aW9u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lhLG9CQUFvQjtZQUN0QnVCLE9BQU8rRSxRQUFRLEdBQUdKLEtBQUs5RztRQUN6QjtRQUVBLElBQUlDLGNBQWMrRSxJQUFJLElBQUk3RSxvQkFBb0I7WUFDNUNnQyxPQUFPZ0YsS0FBSyxHQUFHTCxLQUFLM0csb0JBQW9CO2dCQUN0Q3VHLGNBQWM7WUFDaEI7UUFDRjtRQUVBLE9BQU92RTtJQUNUO0lBRUExRCxRQUFRaUYsU0FBUyxDQUFDLENBQUMsVUFBVSxFQUFFbkUsVUFBVSxDQUFDLENBQUMsR0FBR3NIO0lBRTlDLE9BQU87UUFBRWpHO1FBQW9CQztRQUFrQlQ7SUFBaUI7QUFDbEUifQ==
@@ -9,24 +9,22 @@ type Args = {
9
9
  name?: string;
10
10
  slug?: string;
11
11
  };
12
- /** Localized tables need to be given the locales suffix */
13
- locales?: boolean;
14
12
  /** For nested tables passed for the user custom dbName functions to handle their own iterations */
15
13
  parentTableName?: string;
16
14
  /** For sub tables (array for example) this needs to include the parentTableName */
17
15
  prefix?: string;
18
- /** Adds the relationships suffix */
19
- relationships?: boolean;
20
16
  /** For tables based on fields that could have both enumName and dbName (ie: select with hasMany), default: 'dbName' */
21
17
  target?: 'dbName' | 'enumName';
22
18
  throwValidationError?: boolean;
23
- /** Adds the versions suffix, should only be used on the base collection to duplicate suffixing */
19
+ /** Adds the versions suffix to the default table name - should only be used on the base collection to avoid duplicate suffixing */
24
20
  versions?: boolean;
21
+ /** Adds the versions suffix to custom dbName only - this is used while creating blocks / selects / arrays / etc */
22
+ versionsCustomName?: boolean;
25
23
  };
26
24
  /**
27
25
  * Used to name database enums and tables
28
26
  * Returns the table or enum name for a given entity
29
27
  */
30
- export declare const getTableName: ({ adapter, config: { name, slug }, config, locales, parentTableName, prefix, relationships, target, throwValidationError, versions, }: Args) => string;
28
+ export declare const createTableName: ({ adapter, config: { name, slug }, config, parentTableName, prefix, target, throwValidationError, versions, versionsCustomName, }: Args) => string;
31
29
  export {};
32
- //# sourceMappingURL=getTableName.d.ts.map
30
+ //# sourceMappingURL=createTableName.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"createTableName.d.ts","sourceRoot":"","sources":["../../src/schema/createTableName.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAA;AAKxD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAA;AAE/C,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,mGAAmG;IACnG,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB,mFAAmF;IACnF,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,uHAAuH;IACvH,MAAM,CAAC,EAAE,QAAQ,GAAG,UAAU,CAAA;IAC9B,oBAAoB,CAAC,EAAE,OAAO,CAAA;IAC9B,mIAAmI;IACnI,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,mHAAmH;IACnH,kBAAkB,CAAC,EAAE,OAAO,CAAA;CAC7B,CAAA;AAED;;;GAGG;AACH,eAAO,MAAM,eAAe,sIAUzB,IAAI,KAAG,MAsCT,CAAA"}
@@ -0,0 +1,43 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ Object.defineProperty(exports, "createTableName", {
6
+ enumerable: true,
7
+ get: function() {
8
+ return createTableName;
9
+ }
10
+ });
11
+ const _errors = require("payload/errors");
12
+ const _tosnakecase = /*#__PURE__*/ _interop_require_default(require("to-snake-case"));
13
+ function _interop_require_default(obj) {
14
+ return obj && obj.__esModule ? obj : {
15
+ default: obj
16
+ };
17
+ }
18
+ const createTableName = ({ adapter, config: { name, slug }, config, parentTableName, prefix = '', target = 'dbName', throwValidationError = false, versions = false, versionsCustomName = false })=>{
19
+ let customNameDefinition = config[target];
20
+ let defaultTableName = `${prefix}${(0, _tosnakecase.default)(name ?? slug)}`;
21
+ if (versions) defaultTableName = `_${defaultTableName}${adapter.versionsSuffix}`;
22
+ let customTableNameResult;
23
+ if (!customNameDefinition && target === 'enumName') {
24
+ customNameDefinition = config['dbName'];
25
+ }
26
+ if (customNameDefinition) {
27
+ customTableNameResult = typeof customNameDefinition === 'function' ? customNameDefinition({
28
+ tableName: parentTableName
29
+ }) : customNameDefinition;
30
+ if (versionsCustomName) customTableNameResult = `_${customTableNameResult}${adapter.versionsSuffix}`;
31
+ }
32
+ const result = customTableNameResult || defaultTableName;
33
+ adapter.tableNameMap.set(defaultTableName, result);
34
+ if (!throwValidationError) {
35
+ return result;
36
+ }
37
+ if (result.length > 63) {
38
+ throw new _errors.APIError(`Exceeded max identifier length for table or enum name of 63 characters. Invalid name: ${result}`);
39
+ }
40
+ return result;
41
+ };
42
+
43
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9zY2hlbWEvY3JlYXRlVGFibGVOYW1lLnRzIl0sInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB0eXBlIHsgREJJZGVudGlmaWVyTmFtZSB9IGZyb20gJ3BheWxvYWQvZGF0YWJhc2UnXG5cbmltcG9ydCB7IEFQSUVycm9yIH0gZnJvbSAncGF5bG9hZC9lcnJvcnMnXG5pbXBvcnQgdG9TbmFrZUNhc2UgZnJvbSAndG8tc25ha2UtY2FzZSdcblxuaW1wb3J0IHR5cGUgeyBQb3N0Z3Jlc0FkYXB0ZXIgfSBmcm9tICcuLi90eXBlcydcblxudHlwZSBBcmdzID0ge1xuICBhZGFwdGVyOiBQb3N0Z3Jlc0FkYXB0ZXJcbiAgLyoqIFRoZSBjb2xsZWN0aW9uLCBnbG9iYWwgb3IgZmll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