1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
import { Entity, Column, PrimaryGeneratedColumn } from 'typeorm'; @Entity() export class User { @PrimaryGeneratedColumn() id: number; @Column({ unique: true, nullable: false }) email: string; @Column({ nullable: false }) name: string; @Column({ nullable: false }) password_hash: string; }