mirror of
https://github.com/immich-app/immich.git
synced 2025-01-24 04:32:45 +01:00
27 lines
548 B
TypeScript
27 lines
548 B
TypeScript
|
import { Column, CreateDateColumn, Entity, ManyToOne, PrimaryGeneratedColumn, UpdateDateColumn } from 'typeorm';
|
||
|
import { UserEntity } from './user.entity';
|
||
|
|
||
|
@Entity('api_keys')
|
||
|
export class APIKeyEntity {
|
||
|
@PrimaryGeneratedColumn()
|
||
|
id!: number;
|
||
|
|
||
|
@Column()
|
||
|
name!: string;
|
||
|
|
||
|
@Column({ select: false })
|
||
|
key?: string;
|
||
|
|
||
|
@Column()
|
||
|
userId!: string;
|
||
|
|
||
|
@ManyToOne(() => UserEntity)
|
||
|
user?: UserEntity;
|
||
|
|
||
|
@CreateDateColumn({ type: 'timestamptz' })
|
||
|
createdAt!: string;
|
||
|
|
||
|
@UpdateDateColumn({ type: 'timestamptz' })
|
||
|
updatedAt!: string;
|
||
|
}
|