Skip to content

Instantly share code, notes, and snippets.

@saurabhpati
Created February 19, 2019 15:29
Show Gist options
  • Save saurabhpati/65c89d9a0d8bb3abee34853b840eba70 to your computer and use it in GitHub Desktop.
Save saurabhpati/65c89d9a0d8bb3abee34853b840eba70 to your computer and use it in GitHub Desktop.
User Entity
import { PrimaryGeneratedColumn, Column, Entity, OneToMany, ManyToMany } from 'typeorm';
@Entity()
export class User {
@PrimaryGeneratedColumn()
id: number;
@Column({ length: 128 })
firstName: string;
@Column({ length: 128 })
lastName: string;
@Column({ length: 128 })
email: string;
@Column({ length: 64 })
username: string;
@Column({ length: 64 })
password: string;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment