import Migration, { MigrationFunction } from '@watermarkchurch/contentful-migration' // Generated by contentful-schema-diff // from empty-export.json // to 7yx6ovlj39n5 export = function(migration : Migration, { makeRequest, spaceId, accessToken }) { /************ section-testimonials ******************/ var sectionTestimonials = migration.createContentType('section-testimonials', { displayField: 'internalTitle', name: 'Section: Testimonials', description: 'A Testimonials section can show one or many Testimonials written by leaders, partners, or members who have participated in the Ministry or Conference.' }) sectionTestimonials.createField('internalTitle', { name: 'Internal Title (Contentful Only)', type: 'Symbol', localized: false, required: true, validations: [], disabled: false, omitted: true }) sectionTestimonials.createField('bookmarkTitle', { name: 'Bookmark Title', type: 'Symbol', localized: false, required: true, validations: [], disabled: false, omitted: false }) sectionTestimonials.createField('testimonials', { name: 'Testimonials', type: 'Array', localized: false, required: true, validations: [], disabled: false, omitted: false, items: { type: 'Link', validations: [{ linkContentType: ['testimonial'] }], linkType: 'Entry' } }) sectionTestimonials.createField('style', { name: 'Style', type: 'Symbol', localized: false, required: false, validations: [{ in: ['default', 'jumbo'] }], disabled: false, omitted: false }) sectionTestimonials.changeEditorInterface('bookmarkTitle', 'singleLine') sectionTestimonials.changeEditorInterface('testimonials', 'entryLinksEditor') sectionTestimonials.changeEditorInterface('style', 'dropdown') sectionTestimonials.changeEditorInterface('internalTitle', 'singleLine') /************ testimonial ******************/ var testimonial = migration.createContentType('testimonial', { displayField: 'internalTitle', name: 'Testimonial', description: 'A Testimonial must be attached to a Testimonial Section to be displayed.' }) testimonial.createField('internalTitle', { name: 'Internal Title (Contentful Only)', type: 'Symbol', localized: false, required: true, validations: [], disabled: false, omitted: true }) testimonial.createField('name', { name: 'Name', type: 'Symbol', localized: false, required: true, validations: [], disabled: false, omitted: false }) testimonial.createField('miniBio', { name: 'Mini Bio', type: 'Text', localized: false, required: false, validations: [], disabled: false, omitted: false }) testimonial.createField('photo', { name: 'Photo', type: 'Link', localized: false, required: false, validations: [{ linkMimetypeGroup: ['image'] }, { assetImageDimensions: { width: { min: 480, max: Infinity }, height: { min: 480, max: Infinity } }, message: 'Your image needs to be bigger! Lots of people have high resolution displays. Please submit an image at least 480 by 480 pixels.' }, { assetFileSize: { min: 0, max: 1048576 }, message: 'Your image needs to be compressed! Typically, large high quality images should be kept between 100 and 60 Kilobytes. Smaller images should be closer to 30 Kilobytes and lower. Think of the poor souls who only get 1GB/mo of 3G!' }], disabled: false, omitted: false, linkType: 'Asset' }) testimonial.createField('quote', { name: 'Quote', type: 'Text', localized: false, required: true, validations: [], disabled: false, omitted: false }) testimonial.createField('linkedVideo', { name: 'Linked Video', type: 'Link', localized: false, required: false, validations: [{ linkContentType: ['video'] }], disabled: false, omitted: false, linkType: 'Entry' }) testimonial.createField('linkText', { name: 'Link Text', type: 'Symbol', localized: false, required: false, validations: [], disabled: false, omitted: false }) testimonial.changeEditorInterface('internalTitle', 'singleLine') testimonial.changeEditorInterface('name', 'singleLine') testimonial.changeEditorInterface('miniBio', 'markdown') testimonial.changeEditorInterface('photo', 'assetLinkEditor') testimonial.changeEditorInterface('quote', 'multipleLine') testimonial.changeEditorInterface('linkedVideo', 'entryLinkEditor') testimonial.changeEditorInterface('linkText', 'singleLine') } as MigrationFunction