99 lines
1.8 KiB
JavaScript
99 lines
1.8 KiB
JavaScript
// Directus collection definitions and seed data
|
|
// This file documents the CMS schema that needs to be configured
|
|
|
|
const COLLECTIONS = {
|
|
restaurants: {
|
|
name: 'restaurants',
|
|
fields: [
|
|
{
|
|
field: 'id',
|
|
type: 'uuid',
|
|
primary: true,
|
|
},
|
|
{
|
|
field: 'name',
|
|
type: 'string',
|
|
required: true,
|
|
},
|
|
{
|
|
field: 'description',
|
|
type: 'text',
|
|
},
|
|
{
|
|
field: 'cuisine_type',
|
|
type: 'string',
|
|
example: 'Italian',
|
|
},
|
|
{
|
|
field: 'website_url',
|
|
type: 'string',
|
|
},
|
|
{
|
|
field: 'phone',
|
|
type: 'string',
|
|
},
|
|
{
|
|
field: 'image_id',
|
|
type: 'uuid',
|
|
relation: 'one_to_one',
|
|
relatedCollection: 'directus_files',
|
|
},
|
|
{
|
|
field: 'status',
|
|
type: 'string',
|
|
default: 'published',
|
|
},
|
|
],
|
|
},
|
|
|
|
attractions: {
|
|
name: 'attractions',
|
|
fields: [
|
|
{
|
|
field: 'id',
|
|
type: 'uuid',
|
|
primary: true,
|
|
},
|
|
{
|
|
field: 'name',
|
|
type: 'string',
|
|
required: true,
|
|
},
|
|
{
|
|
field: 'description',
|
|
type: 'text',
|
|
},
|
|
{
|
|
field: 'category',
|
|
type: 'string',
|
|
example: 'Museum',
|
|
},
|
|
{
|
|
field: 'distance_km',
|
|
type: 'float',
|
|
},
|
|
{
|
|
field: 'image_id',
|
|
type: 'uuid',
|
|
relation: 'one_to_one',
|
|
relatedCollection: 'directus_files',
|
|
},
|
|
{
|
|
field: 'website_url',
|
|
type: 'string',
|
|
},
|
|
{
|
|
field: 'hours',
|
|
type: 'text',
|
|
},
|
|
{
|
|
field: 'status',
|
|
type: 'string',
|
|
default: 'published',
|
|
},
|
|
],
|
|
},
|
|
};
|
|
|
|
export default COLLECTIONS;
|