chore(server) Add user FK to album entity (#1569)

This commit is contained in:
Alex
2023-02-06 20:47:06 -06:00
committed by GitHub
parent ac39ebddc0
commit 3cc4af5947
14 changed files with 173 additions and 96 deletions

View File

@@ -1,7 +1,16 @@
import { Column, CreateDateColumn, Entity, OneToMany, PrimaryGeneratedColumn, UpdateDateColumn } from 'typeorm';
import {
Column,
CreateDateColumn,
Entity,
ManyToOne,
OneToMany,
PrimaryGeneratedColumn,
UpdateDateColumn,
} from 'typeorm';
import { AssetAlbumEntity } from './asset-album.entity';
import { SharedLinkEntity } from './shared-link.entity';
import { UserAlbumEntity } from './user-album.entity';
import { UserEntity } from './user.entity';
@Entity('albums')
export class AlbumEntity {
@@ -11,6 +20,9 @@ export class AlbumEntity {
@Column()
ownerId!: string;
@ManyToOne(() => UserEntity)
owner!: UserEntity;
@Column({ default: 'Untitled Album' })
albumName!: string;