strapi/test/helpers/generators.js

115 lines
2.2 KiB
JavaScript
Raw Normal View History

'use strict';
module.exports = {
article: {
2019-11-14 16:37:57 +01:00
attributes: {
title: {
type: 'string',
},
date: {
type: 'date',
},
jsonField: {
type: 'json',
},
content: {
type: 'richtext',
},
author: {
nature: 'manyToOne',
target: 'plugins::users-permissions.user',
targetAttribute: 'articles',
},
},
2021-07-06 14:18:03 +02:00
uid: 'application::article.article',
name: 'article',
description: '',
collectionName: '',
},
tag: {
2019-11-14 16:37:57 +01:00
attributes: {
name: {
type: 'string',
},
articles: {
dominant: true,
nature: 'manyToMany',
target: 'application::article.article',
targetAttribute: 'tags',
},
},
2021-07-06 14:18:03 +02:00
uid: 'application::tag.tag',
name: 'tag',
description: '',
collectionName: '',
},
category: {
2019-11-14 16:37:57 +01:00
attributes: {
name: {
type: 'string',
},
articles: {
nature: 'oneToMany',
target: 'application::article.article',
targetAttribute: 'category',
},
},
2021-07-06 14:18:03 +02:00
uid: 'application::category.category',
name: 'category',
description: '',
collectionName: '',
},
reference: {
2019-11-14 16:37:57 +01:00
attributes: {
name: {
type: 'string',
},
article: {
target: 'application::article.article',
targetAttribute: 'reference',
nature: 'oneToOne',
},
tag: {
nature: 'oneWay',
target: 'application::tag.tag',
},
},
2021-07-06 14:18:03 +02:00
uid: 'application::reference.reference',
name: 'reference',
description: '',
2021-07-02 02:26:14 +02:00
collectionName: 'refs',
},
product: {
2019-11-14 16:37:57 +01:00
attributes: {
name: {
type: 'string',
},
description: {
type: 'richtext',
},
published: {
type: 'boolean',
},
},
2021-07-06 14:18:03 +02:00
uid: 'application::product.product',
name: 'product',
description: '',
collectionName: '',
},
2019-07-09 09:25:22 +02:00
articlewithtag: {
2019-11-14 16:37:57 +01:00
attributes: {
title: {
type: 'string',
},
tags: {
nature: 'manyWay',
target: 'application::tag.tag',
},
},
2021-07-06 14:18:03 +02:00
uid: 'application::articlewit.articlewit',
2019-07-09 09:25:22 +02:00
name: 'articlewithtag',
2019-07-08 17:34:56 +02:00
description: '',
collectionName: '',
},
};