mirror of
https://github.com/immich-app/immich.git
synced 2025-01-09 21:36:46 +01:00
4478e524f8
* refactor: auth device => sessions * chore: open api
29 lines
680 B
TypeScript
29 lines
680 B
TypeScript
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;
|
|
}
|