diff --git a/packages/payload/src/collections/config/types.ts b/packages/payload/src/collections/config/types.ts index 9c782bddfd..cdc5c696c1 100644 --- a/packages/payload/src/collections/config/types.ts +++ b/packages/payload/src/collections/config/types.ts @@ -18,6 +18,7 @@ import type { LabelFunction, LivePreviewConfig, } from '../../config/types.js' +import type { DBIdentifierName } from '../../database/types.js' import type { Field } from '../../fields/config/types.js' import type { GeneratedTypes } from '../../index.js' import type { PayloadRequest, RequestContext } from '../../types/index.js' @@ -318,6 +319,11 @@ export type CollectionConfig = { auth?: IncomingAuthType | boolean /** Extension point to add your custom data. Server only. */ custom?: Record + /** + * Used to override the default naming of the database table or collection with your using a function or string + * @WARNING: If you change this property with existing data, you will need to handle the renaming of the table in your database or by using migrations + */ + dbName?: DBIdentifierName /** * Default field to sort by in collection list view */ diff --git a/test/database/config.ts b/test/database/config.ts index 156d1397b6..df08974fe1 100644 --- a/test/database/config.ts +++ b/test/database/config.ts @@ -155,7 +155,6 @@ export default buildConfigWithDefaults({ globals: [ { slug: 'global', - // @ts-expect-error dbName: 'customGlobal', fields: [ {