Entity mapping
Let's map our user entity to a database table.
@Entity()
export class User {
@PrimaryGeneratedColumn()
id: number;
@Column()
name: string;
@Column({ unique: true })
email: string;
@Column({ unique: true })
phone: string;
@Column()
password: string;
}Last updated