nocobase/packages/database/examples/tables/posts.ts
2020-10-24 15:34:43 +08:00

28 lines
425 B
TypeScript

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;