nocobase/packages/database/examples/tables/posts.ts

28 lines
425 B
TypeScript
Raw Normal View History

2020-10-24 07:34:43 +00:00
import { TableOptions } from '../../src';
export default {
name: 'posts',
fields: [
{
type: 'string',
name: 'title',
},
{
type: 'text',
length: 'long',
name: 'content',
},
{
type: 'belongsTo',
name: 'user',
},
{
type: 'belongsToMany',
name: 'tags',
},
{
type: 'hasMany',
name: 'comments'
},
],
} as TableOptions;