@mvx/cli
Version:
53 lines (35 loc) • 851 B
text/typescript
import { Entity, Column, ManyToOne, PrimaryGeneratedColumn, OneToMany } from 'typeorm';
()
export class Role {
('uuid')
id: string;
()
name: string;
(type => User, user => user.role)
users: User[]
}
()
export class User {
constructor() {
}
('uuid')
id: string;
()
name: string;
({
unique: true
})
account: string;
()
password: string;
({ nullable: true, length: 50 })
email: string;
({ nullable: true, length: 50 })
phone: string;
({ type: 'boolean', nullable: true })
gender: boolean;
({ type: 'int', nullable: true })
age: number;
(type => Role, role => role.users)
role: Role;
}