refactor: remove options from one-to-many relations because it is not necessary

This commit is contained in:
Xymorot 2019-11-24 18:23:16 +01:00
parent 34bd46d376
commit 0ac84df449
4 changed files with 4 additions and 22 deletions

View File

@ -18,10 +18,7 @@ export function MultiNamed<T extends Constructor>(BaseClass: T = null, multiName
@Column()
public nameCanonical: string;
@OneToMany(multiNameClass, (multiName: IMultiName) => multiName.multiNamed, {
onDelete: 'CASCADE',
onUpdate: 'CASCADE',
})
@OneToMany(multiNameClass, (multiName: IMultiName) => multiName.multiNamed)
public multiNames: Promise<IMultiName[]>;
}

View File

@ -12,12 +12,7 @@ import { Tag } from './tag';
export class Book extends Rateable(MultiNamed(BaseEntity, 'BookMultiName')) {
@OneToMany(
() => Copy,
(copy: Copy) => copy.original,
{
nullable: false,
onDelete: 'CASCADE',
onUpdate: 'CASCADE',
}
(copy: Copy) => copy.original
)
public copies: Promise<Copy[]>;

View File

@ -25,12 +25,7 @@ export class Copy extends Rateable(BaseEntity) {
@OneToMany(
() => CopyType,
(copyType: CopyType) => copyType.copy,
{
nullable: false,
onDelete: 'CASCADE',
onUpdate: 'CASCADE',
}
(copyType: CopyType) => copyType.copy
)
public types: Promise<CopyType[]>;

View File

@ -7,12 +7,7 @@ import { Source } from './source';
export class Site extends MultiNamed(BaseEntity, 'SiteMultiName') {
@OneToMany(
() => Source,
(source: Source) => source.site,
{
nullable: false,
onDelete: 'CASCADE',
onUpdate: 'CASCADE',
}
(source: Source) => source.site
)
public sources: Promise<Source[]>;
}