mirror of
https://github.com/payloadcms/payload.git
synced 2026-03-25 13:34:28 +00:00
This PR adds support for polymorphic uploads similar to polymorphic relationships. Closes https://github.com/payloadcms/payload/discussions/13912 It works with bulk upload as well and in the bulk uploader you can choose which collection the files are uploaded into. You can enable this by adding an array of slugs into `relationTo`: ```ts import type { CollectionConfig } from 'payload' export const ExampleCollection: CollectionConfig = { slug: 'example-collection', fields: [ { name: 'media', type: 'upload', relationTo: ['images', 'documents', 'videos'], // references multiple upload collections }, ], } ``` It can also be combined with `hasMany`: ```ts import type { CollectionConfig } from 'payload' export const ExampleCollection: CollectionConfig = { slug: 'example-collection', fields: [ { name: 'media', type: 'upload', relationTo: ['images', 'documents', 'videos'], // references multiple upload collections hasMany: true, // allows multiple uploads }, ], } ``` **Known issue**: https://github.com/payloadcms/payload/issues/12014 Filtering by polymorphic relationships is currently broken and I'll work on that in a separate PR.
348 lines
6.1 KiB
Plaintext
348 lines
6.1 KiB
Plaintext
coverage
|
|
package-lock.json
|
|
dist
|
|
/.idea/*
|
|
!/.idea/runConfigurations
|
|
/.idea/runConfigurations/_template*
|
|
!/.idea/payload.iml
|
|
|
|
# Local AI Agent files
|
|
AGENTS.local.md
|
|
CLAUDE.local.md
|
|
.claude/commands/*.local.md
|
|
.claude/artifacts
|
|
|
|
# Custom actions
|
|
!.github/actions/**/dist
|
|
|
|
test/packed
|
|
test-results
|
|
.devcontainer
|
|
.localstack
|
|
/migrations
|
|
.localstack
|
|
.turbo
|
|
|
|
meta_client.json
|
|
meta_server.json
|
|
meta_index.json
|
|
meta_shared.json
|
|
|
|
packages/payload/esbuild
|
|
packages/ui/esbuild
|
|
packages/next/esbuild
|
|
packages/richtext-lexical/esbuild
|
|
|
|
audit_output.json
|
|
|
|
.turbo
|
|
.wrangler
|
|
|
|
# Ignore test directory media folder/files
|
|
/media
|
|
test/media
|
|
*payloadtests.db
|
|
*payloadtests.db-journal
|
|
*payloadtests.db-shm
|
|
*payloadtests.db-wal
|
|
/versions
|
|
|
|
# Created by https://www.toptal.com/developers/gitignore/api/node,macos,windows,webstorm,sublimetext,visualstudiocode
|
|
# Edit at https://www.toptal.com/developers/gitignore?templates=node,macos,windows,webstorm,sublimetext,visualstudiocode
|
|
|
|
### macOS ###
|
|
# General
|
|
.DS_Store
|
|
.AppleDouble
|
|
.LSOverride
|
|
|
|
# Thumbnails
|
|
._*
|
|
|
|
# Files that might appear in the root of a volume
|
|
.DocumentRevisions-V100
|
|
.fseventsd
|
|
.Spotlight-V100
|
|
.TemporaryItems
|
|
.Trashes
|
|
.VolumeIcon.icns
|
|
.com.apple.timemachine.donotpresent
|
|
|
|
# Directories potentially created on remote AFP share
|
|
.AppleDB
|
|
.AppleDesktop
|
|
Network Trash Folder
|
|
Temporary Items
|
|
.apdisk
|
|
|
|
### macOS Patch ###
|
|
# iCloud generated files
|
|
*.icloud
|
|
|
|
### Node ###
|
|
# Logs
|
|
logs
|
|
*.log
|
|
npm-debug.log*
|
|
yarn-debug.log*
|
|
yarn-error.log*
|
|
lerna-debug.log*
|
|
.pnpm-debug.log*
|
|
|
|
# Diagnostic reports (https://nodejs.org/api/report.html)
|
|
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
|
|
|
|
# Runtime data
|
|
pids
|
|
*.pid
|
|
*.seed
|
|
*.pid.lock
|
|
|
|
# Directory for instrumented libs generated by jscoverage/JSCover
|
|
lib-cov
|
|
|
|
# Coverage directory used by tools like istanbul
|
|
coverage
|
|
*.lcov
|
|
|
|
# nyc test coverage
|
|
.nyc_output
|
|
|
|
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
|
|
.grunt
|
|
|
|
# Bower dependency directory (https://bower.io/)
|
|
bower_components
|
|
|
|
# node-waf configuration
|
|
.lock-wscript
|
|
|
|
# Compiled binary addons (https://nodejs.org/api/addons.html)
|
|
build/Release
|
|
|
|
# Dependency directories
|
|
node_modules/
|
|
jspm_packages/
|
|
|
|
# Snowpack dependency directory (https://snowpack.dev/)
|
|
web_modules/
|
|
|
|
# TypeScript cache
|
|
*.tsbuildinfo
|
|
|
|
# Optional npm cache directory
|
|
.npm
|
|
|
|
# Optional eslint cache
|
|
.eslintcache
|
|
|
|
# Optional stylelint cache
|
|
.stylelintcache
|
|
|
|
# Microbundle cache
|
|
.rpt2_cache/
|
|
.rts2_cache_cjs/
|
|
.rts2_cache_es/
|
|
.rts2_cache_umd/
|
|
|
|
# Optional REPL history
|
|
.node_repl_history
|
|
|
|
# Output of 'npm pack'
|
|
*.tgz
|
|
|
|
# Yarn Integrity file
|
|
.yarn-integrity
|
|
|
|
# dotenv environment variable files
|
|
.env
|
|
.env.development.local
|
|
.env.test.local
|
|
.env.production.local
|
|
.env.local
|
|
|
|
# parcel-bundler cache (https://parceljs.org/)
|
|
.cache
|
|
.parcel-cache
|
|
|
|
# Next.js build output
|
|
.next
|
|
out
|
|
|
|
# Nuxt.js build / generate output
|
|
.nuxt
|
|
dist
|
|
dist_optimized
|
|
|
|
# Gatsby files
|
|
.cache/
|
|
# Comment in the public line in if your project uses Gatsby and not Next.js
|
|
# https://nextjs.org/blog/next-9-1#public-directory-support
|
|
# public
|
|
|
|
# vuepress build output
|
|
.vuepress/dist
|
|
|
|
# vuepress v2.x temp and cache directory
|
|
.temp
|
|
|
|
# Docusaurus cache and generated files
|
|
.docusaurus
|
|
|
|
# Serverless directories
|
|
.serverless/
|
|
|
|
# FuseBox cache
|
|
.fusebox/
|
|
|
|
# DynamoDB Local files
|
|
.dynamodb/
|
|
|
|
# TernJS port file
|
|
.tern-port
|
|
|
|
# Stores VSCode versions used for testing VSCode extensions
|
|
.vscode-test
|
|
|
|
# yarn v2
|
|
.yarn/cache
|
|
.yarn/unplugged
|
|
.yarn/build-state.yml
|
|
.yarn/install-state.gz
|
|
.pnp.*
|
|
|
|
### Node Patch ###
|
|
# Serverless Webpack directories
|
|
.webpack/
|
|
|
|
# Optional stylelint cache
|
|
|
|
# SvelteKit build / generate output
|
|
.svelte-kit
|
|
|
|
### SublimeText ###
|
|
# Cache files for Sublime Text
|
|
*.tmlanguage.cache
|
|
*.tmPreferences.cache
|
|
*.stTheme.cache
|
|
|
|
# Workspace files are user-specific
|
|
*.sublime-workspace
|
|
|
|
# Project files should be checked into the repository, unless a significant
|
|
# proportion of contributors will probably not be using Sublime Text
|
|
# *.sublime-project
|
|
|
|
# SFTP configuration file
|
|
sftp-config.json
|
|
sftp-config-alt*.json
|
|
|
|
# Package control specific files
|
|
Package Control.last-run
|
|
Package Control.ca-list
|
|
Package Control.ca-bundle
|
|
Package Control.system-ca-bundle
|
|
Package Control.cache/
|
|
Package Control.ca-certs/
|
|
Package Control.merged-ca-bundle
|
|
Package Control.user-ca-bundle
|
|
oscrypto-ca-bundle.crt
|
|
bh_unicode_properties.cache
|
|
|
|
# Sublime-github package stores a github token in this file
|
|
# https://packagecontrol.io/packages/sublime-github
|
|
GitHub.sublime-settings
|
|
|
|
### VisualStudioCode ###
|
|
.vscode/*
|
|
!.vscode/settings.json
|
|
!.vscode/tasks.json
|
|
!.vscode/launch.json
|
|
!.vscode/extensions.json
|
|
!.vscode/*.code-snippets
|
|
|
|
# Local History for Visual Studio Code
|
|
.history/
|
|
|
|
# Built Visual Studio Code Extensions
|
|
*.vsix
|
|
|
|
### VisualStudioCode Patch ###
|
|
# Ignore all local history of files
|
|
.history
|
|
.ionide
|
|
|
|
# CMake
|
|
cmake-build-*/
|
|
|
|
# File-based project format
|
|
*.iws
|
|
|
|
# IntelliJ
|
|
out/
|
|
|
|
# JIRA plugin
|
|
atlassian-ide-plugin.xml
|
|
|
|
# Crashlytics plugin (for Android Studio and IntelliJ)
|
|
com_crashlytics_export_strings.xml
|
|
crashlytics.properties
|
|
crashlytics-build.properties
|
|
fabric.properties
|
|
|
|
### Windows ###
|
|
# Windows thumbnail cache files
|
|
Thumbs.db
|
|
Thumbs.db:encryptable
|
|
ehthumbs.db
|
|
ehthumbs_vista.db
|
|
|
|
# Dump file
|
|
*.stackdump
|
|
|
|
# Folder config file
|
|
[Dd]esktop.ini
|
|
|
|
# Recycle Bin used on file shares
|
|
$RECYCLE.BIN/
|
|
|
|
# Windows Installer files
|
|
*.cab
|
|
*.msi
|
|
*.msix
|
|
*.msm
|
|
*.msp
|
|
|
|
# Windows shortcuts
|
|
*.lnk
|
|
|
|
# End of https://www.toptal.com/developers/gitignore/api/node,macos,windows,webstorm,sublimetext,visualstudiocode
|
|
|
|
/build
|
|
.swc
|
|
app/(payload)/admin/importMap.js
|
|
test/admin-bar/app/(payload)/admin/importMap.js
|
|
/test/admin-bar/app/(payload)/admin/importMap.js
|
|
test/live-preview/app/(payload)/admin/importMap.js
|
|
/test/live-preview/app/(payload)/admin/importMap.js
|
|
test/admin-root/app/(payload)/admin/importMap.js
|
|
/test/admin-root/app/(payload)/admin/importMap.js
|
|
test/app/(payload)/admin/importMap.js
|
|
/test/app/(payload)/admin/importMap.js
|
|
test/plugin-ecommerce/app/(payload)/admin/importMap.js
|
|
/test/plugin-ecommerce/app/(payload)/admin/importMap.js
|
|
test/pnpm-lock.yaml
|
|
test/databaseAdapter.js
|
|
/filename-compound-index
|
|
/media-with-relation-preview
|
|
/media-without-relation-preview
|
|
/media-without-cache-tags
|
|
test/.localstack
|
|
test/google-cloud-storage
|
|
test/azurestoragedata/
|
|
/media-without-delete-access
|
|
/media-documents
|
|
|
|
|
|
licenses.csv
|