tachybase_todo/packages/database/examples/tables/users.ts

34 lines
522 B
TypeScript
Raw Normal View History

2020-10-24 15:34:43 +08:00
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;