forked from contentful/contentful-migration
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path47-create-resource-link-fields.js
More file actions
30 lines (28 loc) · 897 Bytes
/
47-create-resource-link-fields.js
File metadata and controls
30 lines (28 loc) · 897 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
module.exports = function (migration) {
const contentTypeWithResourceLinks = migration
.createContentType('contentTypeWithResourceLinks')
.name('contentTypeWithResourceLinks')
contentTypeWithResourceLinks
.createField('resourceLink')
.name('resourceLink')
.type('ResourceLink')
.allowedResources([
{
type: 'Contentful:Entry',
source: 'crn:contentful:::content:spaces/another-space',
contentTypes: ['contentType1', 'contentType2', 'contentType3']
}
])
contentTypeWithResourceLinks.createField('resourceLinkArray', {
name: 'resourceLinkArray',
type: 'Array',
items: { type: 'ResourceLink' },
allowedResources: [
{
type: 'Contentful:Entry',
source: 'crn:contentful:::content:spaces/another-space',
contentTypes: ['contentType1', 'contentType2', 'contentType3']
}
]
})
}