Setup TypeORM

This commit is contained in:
Philipinho
2023-08-04 16:26:43 +01:00
parent 11018ea976
commit cebad0e0a5
23 changed files with 1018 additions and 70 deletions
@@ -0,0 +1,49 @@
import {
Column,
CreateDateColumn,
Entity,
PrimaryGeneratedColumn,
UpdateDateColumn,
} from 'typeorm';
@Entity('users')
export class User {
@PrimaryGeneratedColumn('uuid')
id: string;
@Column()
name: string;
@Column({ unique: true })
email: string;
@Column({ nullable: true })
emailVerifiedAt: Date;
@Column()
password: string;
@Column({ nullable: true })
avatar_url: string;
@Column({ nullable: true })
locale: string;
@Column({ nullable: true })
timezone: string;
@Column({ type: 'jsonb', nullable: true })
settings: any;
@Column({ nullable: true })
lastLoginAt: Date;
@Column({ nullable: true })
lastLoginIp: string;
@CreateDateColumn()
createdAt: Date;
@UpdateDateColumn()
updatedAt: Date;
}