forked from contentful/contentful-migration
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path08-move-field.js
More file actions
29 lines (23 loc) · 756 Bytes
/
08-move-field.js
File metadata and controls
29 lines (23 loc) · 756 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
// Example of setting the `displayField` of a content type.
module.exports = function (migration) {
const food = migration.editContentType('food');
food.createField('calories')
.type('Number')
.name('How many calories does it have?');
food.createField('sugar')
.type('Number')
.name('Amount of sugar');
food.createField('vegan')
.type('Boolean')
.name('Vegan friendly');
food.createField('producer')
.type('Symbol')
.name('Food producer');
food.createField('gmo')
.type('Boolean')
.name('Genetically modified food');
food.moveField('calories').toTheTop();
food.moveField('sugar').toTheBottom();
food.moveField('producer').beforeField('vegan');
food.moveField('gmo').afterField('vegan');
};