UNPKG

@becklyn/contentful-adapter

Version:

[![CI](https://github.com/Becklyn-Studios/contentful-adapter/actions/workflows/ci.yml/badge.svg)](https://github.com/Becklyn-Studios/contentful-adapter/actions/workflows/ci.yml)

48 lines (47 loc) 1.39 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.MIGRATIONS_MODEL_NAME = void 0; exports.MIGRATIONS_MODEL_NAME = "migrationVersions"; const translations = { en: { migration: { name: "Migration", fields: { version: "Version", executedAt: "Executed at", }, }, }, de: { migration: { name: "Migration", fields: { version: "Version", executedAt: "Ausgeführt am", }, }, }, }; const getMigration = (language) => { return { component: "migration", migrations: { 1: migration => { const t = translations[language]; const migrations = migration.createContentType(exports.MIGRATIONS_MODEL_NAME, { name: t.migration.name, }); migrations.createField("version", { type: "Symbol", name: t.migration.fields.version, }); migrations.createField("executedAt", { type: "Symbol", name: t.migration.fields.executedAt, }); migrations.displayField("version"); }, }, }; }; exports.default = getMigration;