mirror of
https://github.com/immich-app/immich.git
synced 2025-06-03 05:34:32 -04:00
* infra: make api-key primary key column a UUID * infra: move ManyToMany relations in album entity, make ownerId ManyToOne --------- Co-authored-by: Alex Tran <alex.tran1502@gmail.com>
27 lines
554 B
TypeScript
27 lines
554 B
TypeScript
import { Column, CreateDateColumn, Entity, ManyToOne, PrimaryGeneratedColumn, UpdateDateColumn } from 'typeorm';
|
|
import { UserEntity } from './user.entity';
|
|
|
|
@Entity('api_keys')
|
|
export class APIKeyEntity {
|
|
@PrimaryGeneratedColumn('uuid')
|
|
id!: string;
|
|
|
|
@Column()
|
|
name!: string;
|
|
|
|
@Column({ select: false })
|
|
key?: string;
|
|
|
|
@ManyToOne(() => UserEntity)
|
|
user?: UserEntity;
|
|
|
|
@Column()
|
|
userId!: string;
|
|
|
|
@CreateDateColumn({ type: 'timestamptz' })
|
|
createdAt!: string;
|
|
|
|
@UpdateDateColumn({ type: 'timestamptz' })
|
|
updatedAt!: string;
|
|
}
|