forked from contentful/contentful-migration
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path16-change-field-control.js
More file actions
37 lines (36 loc) · 988 Bytes
/
16-change-field-control.js
File metadata and controls
37 lines (36 loc) · 988 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
31
32
33
34
35
36
37
// This migration might fail dur to some race condition
// if that happens please consider split this migration into 2 steps
// 1 create a content type
/*
// first file create content type first
module.exports = function (migration) {
const blogPost = migration.createContentType('blogPost', {
name: 'Blog post',
description: 'super angry'
});
blogPost.createField('slug', {
name: 'URL Slug',
type: 'Symbol',
required: true
});
}
*/
/*
// second file
module.exports = function (migration) {
const blogPost = migration.editContentType('blogPost');
blogPost.changeEditorInterface('slug', 'slugEditor');
}
*/
module.exports = function (migration) {
const blogPost = migration.createContentType('blogPost', {
name: 'Blog post',
description: 'super angry'
});
blogPost.createField('slug', {
name: 'URL Slug',
type: 'Symbol',
required: true
});
blogPost.changeFieldControl('slug', 'builtin', 'slugEditor', { setting: 'value' });
};