| 
									
										
										
										
											2021-06-24 18:28:36 +02:00
										 |  |  | 'use strict'; | 
					
						
							| 
									
										
										
										
											2021-07-26 17:52:59 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-06-24 18:28:36 +02:00
										 |  |  | const category = { | 
					
						
							|  |  |  |   modelName: 'category', | 
					
						
							|  |  |  |   uid: 'category', | 
					
						
							|  |  |  |   collectionName: 'categories', | 
					
						
							|  |  |  |   attributes: { | 
					
						
							|  |  |  |     title: { | 
					
						
							|  |  |  |       type: 'string', | 
					
						
							|  |  |  |     }, | 
					
						
							|  |  |  |     price: { | 
					
						
							|  |  |  |       type: 'integer', | 
					
						
							| 
									
										
										
										
											2021-07-28 15:32:21 +02:00
										 |  |  |       required: true, | 
					
						
							|  |  |  |       default: 12, | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-06-24 18:28:36 +02:00
										 |  |  |       column: { | 
					
						
							| 
									
										
										
										
											2021-07-28 15:32:21 +02:00
										 |  |  |         unique: true, | 
					
						
							| 
									
										
										
										
											2021-06-24 18:28:36 +02:00
										 |  |  |         nonNullable: true, | 
					
						
							|  |  |  |         unsigned: true, | 
					
						
							| 
									
										
										
										
											2021-07-28 15:32:21 +02:00
										 |  |  |         defaultTo: 12, | 
					
						
							| 
									
										
										
										
											2021-06-24 18:28:36 +02:00
										 |  |  |       }, | 
					
						
							|  |  |  |     }, | 
					
						
							|  |  |  |     articles: { | 
					
						
							|  |  |  |       type: 'relation', | 
					
						
							|  |  |  |       relation: 'oneToMany', | 
					
						
							|  |  |  |       target: 'article', | 
					
						
							|  |  |  |       mappedBy: 'category', | 
					
						
							|  |  |  |     }, | 
					
						
							| 
									
										
										
										
											2021-06-28 21:37:44 +02:00
										 |  |  |     compo: { | 
					
						
							|  |  |  |       type: 'component', | 
					
						
							| 
									
										
										
										
											2021-07-26 17:52:59 +02:00
										 |  |  |       component: 'compo', | 
					
						
							| 
									
										
										
										
											2021-06-28 21:37:44 +02:00
										 |  |  |     }, | 
					
						
							| 
									
										
										
										
											2021-06-24 18:28:36 +02:00
										 |  |  |   }, | 
					
						
							|  |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | const article = { | 
					
						
							|  |  |  |   modelName: 'article', | 
					
						
							|  |  |  |   uid: 'article', | 
					
						
							|  |  |  |   collectionName: 'articles', | 
					
						
							|  |  |  |   attributes: { | 
					
						
							|  |  |  |     title: { | 
					
						
							|  |  |  |       type: 'string', | 
					
						
							|  |  |  |     }, | 
					
						
							| 
									
										
										
										
											2021-07-07 18:04:39 +02:00
										 |  |  |     category: { | 
					
						
							|  |  |  |       type: 'relation', | 
					
						
							|  |  |  |       relation: 'manyToOne', | 
					
						
							|  |  |  |       target: 'category', | 
					
						
							|  |  |  |       inversedBy: 'articles', | 
					
						
							|  |  |  |       // useJoinTable: false,
 | 
					
						
							|  |  |  |     }, | 
					
						
							| 
									
										
										
										
											2021-07-06 14:18:03 +02:00
										 |  |  |     // tags: {
 | 
					
						
							|  |  |  |     //   type: 'relation',
 | 
					
						
							|  |  |  |     //   relation: 'manyToMany',
 | 
					
						
							|  |  |  |     //   target: 'tag',
 | 
					
						
							|  |  |  |     //   inversedBy: 'articles',
 | 
					
						
							|  |  |  |     // },
 | 
					
						
							| 
									
										
										
										
											2021-07-07 18:04:39 +02:00
										 |  |  |     // compo: {
 | 
					
						
							|  |  |  |     //   type: 'component',
 | 
					
						
							| 
									
										
										
										
											2021-07-26 17:52:59 +02:00
										 |  |  |     //   component: 'compo',
 | 
					
						
							| 
									
										
										
										
											2021-07-07 18:04:39 +02:00
										 |  |  |     //   // repeatable: true,
 | 
					
						
							|  |  |  |     // },
 | 
					
						
							| 
									
										
										
										
											2021-06-24 18:28:36 +02:00
										 |  |  |     // cover: {
 | 
					
						
							|  |  |  |     //   type: 'media',
 | 
					
						
							|  |  |  |     //   single: true,
 | 
					
						
							|  |  |  |     // },
 | 
					
						
							|  |  |  |     // gallery: {
 | 
					
						
							|  |  |  |     //   type: 'media',
 | 
					
						
							|  |  |  |     //   multiple: true,
 | 
					
						
							|  |  |  |     // },
 | 
					
						
							|  |  |  |   }, | 
					
						
							|  |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | const tags = { | 
					
						
							|  |  |  |   modelName: 'tag', | 
					
						
							|  |  |  |   uid: 'tag', | 
					
						
							|  |  |  |   collectionName: 'tags', | 
					
						
							|  |  |  |   attributes: { | 
					
						
							|  |  |  |     name: { | 
					
						
							|  |  |  |       type: 'string', | 
					
						
							|  |  |  |     }, | 
					
						
							|  |  |  |     articles: { | 
					
						
							|  |  |  |       type: 'relation', | 
					
						
							|  |  |  |       relation: 'manyToMany', | 
					
						
							|  |  |  |       target: 'article', | 
					
						
							|  |  |  |       mappedBy: 'tag', | 
					
						
							|  |  |  |     }, | 
					
						
							|  |  |  |   }, | 
					
						
							|  |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | const compo = { | 
					
						
							| 
									
										
										
										
											2021-07-26 17:52:59 +02:00
										 |  |  |   modelName: 'compo', | 
					
						
							|  |  |  |   uid: 'compo', | 
					
						
							|  |  |  |   collectionName: 'compos', | 
					
						
							| 
									
										
										
										
											2021-06-24 18:28:36 +02:00
										 |  |  |   attributes: { | 
					
						
							|  |  |  |     key: { | 
					
						
							|  |  |  |       type: 'string', | 
					
						
							|  |  |  |     }, | 
					
						
							|  |  |  |     value: { | 
					
						
							| 
									
										
										
										
											2021-06-25 12:07:32 +02:00
										 |  |  |       type: 'string', | 
					
						
							| 
									
										
										
										
											2021-06-24 18:28:36 +02:00
										 |  |  |     }, | 
					
						
							|  |  |  |   }, | 
					
						
							|  |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | const user = { | 
					
						
							|  |  |  |   modelName: 'user', | 
					
						
							|  |  |  |   uid: 'user', | 
					
						
							|  |  |  |   collectionName: 'users', | 
					
						
							|  |  |  |   attributes: { | 
					
						
							|  |  |  |     address: { | 
					
						
							|  |  |  |       type: 'relation', | 
					
						
							|  |  |  |       relation: 'oneToOne', | 
					
						
							|  |  |  |       target: 'address', | 
					
						
							|  |  |  |       inversedBy: 'user', | 
					
						
							|  |  |  |       // useJoinTable: false,
 | 
					
						
							|  |  |  |     }, | 
					
						
							|  |  |  |   }, | 
					
						
							|  |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | const address = { | 
					
						
							|  |  |  |   modelName: 'address', | 
					
						
							|  |  |  |   uid: 'address', | 
					
						
							|  |  |  |   collectionName: 'addresses', | 
					
						
							|  |  |  |   attributes: { | 
					
						
							|  |  |  |     name: { | 
					
						
							|  |  |  |       type: 'string', | 
					
						
							|  |  |  |     }, | 
					
						
							|  |  |  |     user: { | 
					
						
							|  |  |  |       type: 'relation', | 
					
						
							|  |  |  |       relation: 'oneToOne', | 
					
						
							|  |  |  |       target: 'user', | 
					
						
							|  |  |  |       mappedBy: 'address', | 
					
						
							|  |  |  |     }, | 
					
						
							|  |  |  |   }, | 
					
						
							|  |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | const file = { | 
					
						
							|  |  |  |   modelName: 'file', | 
					
						
							|  |  |  |   uid: 'file', | 
					
						
							|  |  |  |   collectionName: 'files', | 
					
						
							|  |  |  |   attributes: { | 
					
						
							|  |  |  |     name: { | 
					
						
							|  |  |  |       type: 'string', | 
					
						
							|  |  |  |     }, | 
					
						
							|  |  |  |     alternativeText: { | 
					
						
							|  |  |  |       type: 'string', | 
					
						
							|  |  |  |     }, | 
					
						
							|  |  |  |     caption: { | 
					
						
							|  |  |  |       type: 'string', | 
					
						
							|  |  |  |     }, | 
					
						
							|  |  |  |     width: { | 
					
						
							|  |  |  |       type: 'integer', | 
					
						
							|  |  |  |     }, | 
					
						
							|  |  |  |     height: { | 
					
						
							|  |  |  |       type: 'integer', | 
					
						
							|  |  |  |     }, | 
					
						
							|  |  |  |     formats: { | 
					
						
							|  |  |  |       type: 'json', | 
					
						
							|  |  |  |     }, | 
					
						
							|  |  |  |     hash: { | 
					
						
							|  |  |  |       type: 'string', | 
					
						
							|  |  |  |     }, | 
					
						
							|  |  |  |     ext: { | 
					
						
							|  |  |  |       type: 'string', | 
					
						
							|  |  |  |     }, | 
					
						
							|  |  |  |     mime: { | 
					
						
							|  |  |  |       type: 'string', | 
					
						
							|  |  |  |     }, | 
					
						
							|  |  |  |     size: { | 
					
						
							|  |  |  |       type: 'decimal', | 
					
						
							|  |  |  |     }, | 
					
						
							|  |  |  |     url: { | 
					
						
							|  |  |  |       type: 'string', | 
					
						
							|  |  |  |     }, | 
					
						
							|  |  |  |     previewUrl: { | 
					
						
							|  |  |  |       type: 'string', | 
					
						
							|  |  |  |     }, | 
					
						
							|  |  |  |     provider: { | 
					
						
							|  |  |  |       type: 'string', | 
					
						
							|  |  |  |     }, | 
					
						
							|  |  |  |     provider_metadata: { | 
					
						
							|  |  |  |       type: 'json', | 
					
						
							|  |  |  |     }, | 
					
						
							|  |  |  |     // related: {
 | 
					
						
							|  |  |  |     //   type: 'relation',
 | 
					
						
							|  |  |  |     //   relation: 'oneToMany',
 | 
					
						
							|  |  |  |     //   target: 'file_morph',
 | 
					
						
							|  |  |  |     //   mappedBy: 'file',
 | 
					
						
							|  |  |  |     // },
 | 
					
						
							|  |  |  |     // related: {
 | 
					
						
							|  |  |  |     //   type: 'relation',
 | 
					
						
							|  |  |  |     //   realtion: 'morphTo',
 | 
					
						
							|  |  |  |     // },
 | 
					
						
							|  |  |  |   }, | 
					
						
							|  |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | const fileMorph = { | 
					
						
							|  |  |  |   modelName: 'file-morph', | 
					
						
							|  |  |  |   uid: 'file-morph', | 
					
						
							|  |  |  |   collectionName: 'file_morphs', | 
					
						
							|  |  |  |   attributes: { | 
					
						
							|  |  |  |     // file: {
 | 
					
						
							|  |  |  |     //   type: 'relation',
 | 
					
						
							|  |  |  |     //   relation: 'manyToOne',
 | 
					
						
							|  |  |  |     //   target: 'file',
 | 
					
						
							|  |  |  |     //   inversedBy: 'related',
 | 
					
						
							|  |  |  |     //   useJoinTable: false,
 | 
					
						
							|  |  |  |     // },
 | 
					
						
							|  |  |  |   }, | 
					
						
							|  |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-06-28 21:37:44 +02:00
										 |  |  | const blogPost = { | 
					
						
							|  |  |  |   modelName: 'blogPost', | 
					
						
							|  |  |  |   uid: 'blogPost', | 
					
						
							|  |  |  |   collectionName: 'blog_posts', | 
					
						
							|  |  |  |   attributes: { | 
					
						
							|  |  |  |     passwordField: { | 
					
						
							|  |  |  |       type: 'password', | 
					
						
							|  |  |  |     }, | 
					
						
							|  |  |  |     emailField: { | 
					
						
							|  |  |  |       type: 'email', | 
					
						
							|  |  |  |     }, | 
					
						
							|  |  |  |     stringField: { | 
					
						
							|  |  |  |       type: 'string', | 
					
						
							|  |  |  |     }, | 
					
						
							|  |  |  |     uidField: { | 
					
						
							|  |  |  |       type: 'uid', | 
					
						
							|  |  |  |     }, | 
					
						
							|  |  |  |     richtextField: { | 
					
						
							|  |  |  |       type: 'richtext', | 
					
						
							|  |  |  |     }, | 
					
						
							|  |  |  |     textField: { | 
					
						
							|  |  |  |       type: 'text', | 
					
						
							|  |  |  |     }, | 
					
						
							|  |  |  |     enumerationField: { | 
					
						
							|  |  |  |       type: 'enumeration', | 
					
						
							|  |  |  |       enum: ['A', 'B'], | 
					
						
							|  |  |  |     }, | 
					
						
							|  |  |  |     jsonField: { | 
					
						
							|  |  |  |       type: 'json', | 
					
						
							|  |  |  |     }, | 
					
						
							|  |  |  |     bigintegerField: { | 
					
						
							|  |  |  |       type: 'biginteger', | 
					
						
							|  |  |  |     }, | 
					
						
							|  |  |  |     integerField: { | 
					
						
							|  |  |  |       type: 'integer', | 
					
						
							|  |  |  |     }, | 
					
						
							|  |  |  |     floatField: { | 
					
						
							|  |  |  |       type: 'float', | 
					
						
							|  |  |  |     }, | 
					
						
							|  |  |  |     decimalField: { | 
					
						
							|  |  |  |       type: 'decimal', | 
					
						
							|  |  |  |     }, | 
					
						
							|  |  |  |     dateField: { | 
					
						
							|  |  |  |       type: 'date', | 
					
						
							|  |  |  |     }, | 
					
						
							|  |  |  |     timeField: { | 
					
						
							|  |  |  |       type: 'time', | 
					
						
							|  |  |  |     }, | 
					
						
							|  |  |  |     datetimeField: { | 
					
						
							|  |  |  |       type: 'datetime', | 
					
						
							|  |  |  |     }, | 
					
						
							|  |  |  |     timestampField: { | 
					
						
							|  |  |  |       type: 'timestamp', | 
					
						
							|  |  |  |     }, | 
					
						
							|  |  |  |     booleanField: { | 
					
						
							|  |  |  |       type: 'boolean', | 
					
						
							|  |  |  |     }, | 
					
						
							|  |  |  |   }, | 
					
						
							|  |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-07-26 17:52:59 +02:00
										 |  |  | module.exports = [category, article, tags, compo, user, address, file, fileMorph, blogPost]; | 
					
						
							| 
									
										
										
										
											2021-07-21 18:14:16 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-07-28 15:32:21 +02:00
										 |  |  | // const article = {
 | 
					
						
							|  |  |  | //   modelName: 'article',
 | 
					
						
							|  |  |  | //   uid: 'article',
 | 
					
						
							|  |  |  | //   collectionName: 'articles',
 | 
					
						
							|  |  |  | //   attributes: {
 | 
					
						
							|  |  |  | //     commentable: {
 | 
					
						
							|  |  |  | //       type: 'relation',
 | 
					
						
							|  |  |  | //       relation: 'morphToOne',
 | 
					
						
							|  |  |  | //     },
 | 
					
						
							|  |  |  | //     reportables: {
 | 
					
						
							|  |  |  | //       type: 'relation',
 | 
					
						
							|  |  |  | //       relation: 'morphToMany',
 | 
					
						
							|  |  |  | //     },
 | 
					
						
							|  |  |  | //     dz: {
 | 
					
						
							|  |  |  | //       type: 'dynamiczone',
 | 
					
						
							|  |  |  | //       components: ['comment', 'video-comment'],
 | 
					
						
							|  |  |  | //     },
 | 
					
						
							|  |  |  | //   },
 | 
					
						
							|  |  |  | // };
 | 
					
						
							| 
									
										
										
										
											2021-07-26 17:52:59 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-07-28 15:32:21 +02:00
										 |  |  | // const comment = {
 | 
					
						
							|  |  |  | //   modelName: 'comment',
 | 
					
						
							|  |  |  | //   uid: 'comment',
 | 
					
						
							|  |  |  | //   collectionName: 'comments',
 | 
					
						
							|  |  |  | //   attributes: {
 | 
					
						
							|  |  |  | //     article: {
 | 
					
						
							|  |  |  | //       type: 'relation',
 | 
					
						
							|  |  |  | //       relation: 'morphOne',
 | 
					
						
							|  |  |  | //       target: 'article',
 | 
					
						
							|  |  |  | //       morphBy: 'commentable',
 | 
					
						
							|  |  |  | //     },
 | 
					
						
							|  |  |  | //     title: {
 | 
					
						
							|  |  |  | //       type: 'string',
 | 
					
						
							|  |  |  | //     },
 | 
					
						
							|  |  |  | //   },
 | 
					
						
							|  |  |  | // };
 | 
					
						
							| 
									
										
										
										
											2021-07-21 18:14:16 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-07-28 15:32:21 +02:00
										 |  |  | // const videoComment = {
 | 
					
						
							|  |  |  | //   modelName: 'video-comment',
 | 
					
						
							|  |  |  | //   uid: 'video-comment',
 | 
					
						
							|  |  |  | //   collectionName: 'video_comments',
 | 
					
						
							|  |  |  | //   attributes: {
 | 
					
						
							|  |  |  | //     articles: {
 | 
					
						
							|  |  |  | //       type: 'relation',
 | 
					
						
							|  |  |  | //       relation: 'morphMany',
 | 
					
						
							|  |  |  | //       target: 'article',
 | 
					
						
							|  |  |  | //       morphBy: 'commentable',
 | 
					
						
							|  |  |  | //     },
 | 
					
						
							|  |  |  | //     title: {
 | 
					
						
							|  |  |  | //       type: 'string',
 | 
					
						
							|  |  |  | //     },
 | 
					
						
							|  |  |  | //   },
 | 
					
						
							|  |  |  | // };
 | 
					
						
							| 
									
										
										
										
											2021-07-21 18:14:16 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-07-28 15:32:21 +02:00
										 |  |  | // const folder = {
 | 
					
						
							|  |  |  | //   modelName: 'folder',
 | 
					
						
							|  |  |  | //   uid: 'folder',
 | 
					
						
							|  |  |  | //   collectionName: 'folders',
 | 
					
						
							|  |  |  | //   attributes: {
 | 
					
						
							|  |  |  | //     articles: {
 | 
					
						
							|  |  |  | //       type: 'relation',
 | 
					
						
							|  |  |  | //       relation: 'morphMany',
 | 
					
						
							|  |  |  | //       target: 'article',
 | 
					
						
							|  |  |  | //       morphBy: 'reportables',
 | 
					
						
							|  |  |  | //     },
 | 
					
						
							|  |  |  | //   },
 | 
					
						
							|  |  |  | // };
 | 
					
						
							| 
									
										
										
										
											2021-07-21 18:14:16 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-07-28 15:32:21 +02:00
										 |  |  | // module.exports = [article, comment, videoComment, folder];
 |