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

34 lines
522 B
TypeScript

import { TableOptions } from '../../src';
export default {
name: 'users',
fields: [
{
type: 'string',
name: 'username',
unique: true,
},
{
type: 'string',
name: 'password',
// index: true,
},
{
type: 'string',
name: 'openid',
index: true,
},
{
type: 'hasOne',
name: 'profile',
},
{
type: 'hasMany',
name: 'posts',
},
{
type: 'hasMany',
name: 'comments',
}
],
} as TableOptions;