-
Notifications
You must be signed in to change notification settings - Fork 150
/
03-long-example.js
54 lines (46 loc) · 1.16 KB
/
03-long-example.js
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
// Long migration example showcasing how migrations are split into one chunk per content type.
module.exports = function (migration) {
const person = migration.createContentType('person', {
name: 'Person',
description: 'A content type for a person'
});
person.createField('age', {
name: 'Age',
type: 'Number',
required: true
});
person.createField('fullName', {
name: 'Full name',
type: 'Symbol',
required: true,
localized: true
});
const animal = migration.createContentType('animal', {
description: 'An animal',
name: 'Animal'
});
animal.createField('species', {
name: 'The species of the animal',
type: 'Symbol',
required: true
});
animal.createField('isFurry', {
name: 'Is this a furry animal',
type: 'Boolean',
required: false
});
const tag = migration.createTag('longexampletag');
tag.name('long example marketing');
person.createField('pet', {
name: 'Their pet',
type: 'Link',
linkType: 'Entry',
required: false
});
animal.createField('name', {
name: 'The name of the animal',
type: 'Symbol',
required: true,
localized: true
});
};