我正在尝试使用本地数据库将我的v3 strapi应用程序迁移到本地计算机上的v4。我正在尝试执行代码迁移。最初,我根据strapi v4的文档更改了配置文件。我使用codemods更改了文件夹结构并更新了路由,控制器和服务。
现在,当我试图运行我的strapi应用程序,我得到这个错误和应用程序的建设是打破。
这些是我的路由、控制器、服务和schema.json文件
路线:
'use strict';
/**
* blog router
*/
const { createCoreRouter } = require('@strapi/strapi').factories;
module.exports = createCoreRouter('api::blog.blog');
Controller:
'use strict';
/**
* blog controller
*/
const { createCoreController } = require('@strapi/strapi').factories;
module.exports = createCoreController('api::blog.blog');
service:
'use strict';
/**
* blog service
*/
const { createCoreService } = require('@strapi/strapi').factories;
module.exports = createCoreService('api::blog.blog');
schema.json:
{
"kind": "collectionType",
"collectionName": "blogs",
"info": {
"singularName": "blog",
"pluralName": "blogs",
"displayName": "Blog",
"name": "blog"
},
"options": {
"increments": true,
"timestamps": true,
"draftAndPublish": true
},
"pluginOptions": {},
"attributes": {
"insightImage": {
"type": "media",
"allowedTypes": [
"images",
"files",
"videos"
],
"multiple": false,
"required": false
},
"insightTitle": {
"type": "string"
},
"insightDescription": {
"type": "text"
},
"insightContent": {
"type": "richtext"
},
"slug": {
"type": "string",
"unique": true
},
"categories": {
"type": "relation",
"relation": "manyToMany",
"target": "api::category.category",
"mappedBy": "blogs"
},
"insightDate": {
"type": "date"
},
"views": {
"type": "integer",
"default": 0
},
"featured": {
"type": "boolean"
},
"frontImage": {
"type": "boolean"
},
"insightsMetaData": {
"type": "component",
"repeatable": false,
"component": "meta.metadata"
},
"industry": {
"type": "relation",
"relation": "manyToOne",
"target": "api::industry.industry",
"inversedBy": "blogs"
},
"solution": {
"type": "relation",
"relation": "manyToOne",
"target": "api::solution.solution",
"inversedBy": "blogs"
},
"type": {
"type": "relation",
"relation": "manyToOne",
"target": "api::type.type",
"inversedBy": "blogs"
},
"featured_topics": {
"type": "relation",
"relation": "manyToMany",
"target": "api::featured-topic.featured-topic",
"inversedBy": "blogs"
},
"formTitle": {
"type": "string"
},
"formId": {
"type": "string"
},
"author": {
"type": "relation",
"relation": "manyToOne",
"target": "api::author.author",
"inversedBy": "blogs"
},
"enableGated": {
"type": "boolean"
},
"insightBannerImage": {
"type": "media",
"allowedTypes": [
"images",
"files",
"videos"
],
"multiple": false,
"required": false
},
"breakTitleText": {
"type": "boolean",
"default": false
}
}
}
1条答案
按热度按时间m2xkgtsf1#
查看您创建的所有集合,并删除once without
content-types
文件夹或schema.js
。您可以稍后重新创建它们。那是我的问题