import { UserEntity } from 'src/entities/user.entity'; import { Column, CreateDateColumn, Entity, ManyToOne, PrimaryGeneratedColumn, UpdateDateColumn } from 'typeorm'; @Entity('sessions') export class SessionEntity { @PrimaryGeneratedColumn('uuid') id!: string; @Column({ select: false }) token!: string; @Column() userId!: string; @ManyToOne(() => UserEntity, { onUpdate: 'CASCADE', onDelete: 'CASCADE' }) user!: UserEntity; @CreateDateColumn({ type: 'timestamptz' }) createdAt!: Date; @UpdateDateColumn({ type: 'timestamptz' }) updatedAt!: Date; @Column({ default: '' }) deviceType!: string; @Column({ default: '' }) deviceOS!: string; }