create-express-typescript-application
Version:
Create a new lightweight Express application with TypeScript
16 lines (11 loc) • 387 B
text/typescript
import { Entity, PrimaryGeneratedColumn, Column, OneToMany, BaseEntity } from "typeorm";
import { Role } from './role';
({ name: 'user' })
export class User extends BaseEntity {
()
id: number;
({ unique: true })
email: string;
(() => Role, (role: Role) => role.user, { onDelete: 'CASCADE' })
roles: Role[];
}