1
0

profile-asset.entity.ts 554 B

12345678910111213141516171819
  1. import { DeepPartial } from '@vendure/common/lib/shared-types';
  2. import { Asset, VendureEntity } from '@vendure/core';
  3. import { Entity, JoinColumn, ManyToOne, OneToOne } from 'typeorm';
  4. import { Profile } from './profile.entity';
  5. @Entity()
  6. export class ProfileAsset extends VendureEntity {
  7. constructor(input?: DeepPartial<ProfileAsset>) {
  8. super(input);
  9. }
  10. @OneToOne(() => Asset, { eager: true, onDelete: 'CASCADE' })
  11. @JoinColumn()
  12. asset: Asset;
  13. @ManyToOne(() => Profile, { onDelete: 'CASCADE' })
  14. profile: Profile;
  15. }