typeorm#JoinColumn TypeScript Examples

The following examples show how to use typeorm#JoinColumn. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: Guild.ts    From fosscord-server with GNU Affero General Public License v3.0 6 votes vote down vote up
// * commented out -> use owner instead
	// application id of the guild creator if it is bot-created
	// @Column({ nullable: true })
	// application?: string;

	@JoinColumn({ name: "ban_ids" })
	@OneToMany(() => Ban, (ban: Ban) => ban.guild, {
		cascade: true,
		orphanedRowAction: "delete",
	})
	bans: Ban[];
Example #2
Source File: VulnerabilityStatusDeploymentType.ts    From barista with Apache License 2.0 6 votes vote down vote up
/**
   * The ProjectScanStatus
   */
  @ApiProperty({ type: type => ProjectScanStatusType })
  @ManyToOne(type => ProjectScanStatusType, { eager: true })
  @JoinColumn({
    name: 'project_scan_status_type_code',
    referencedColumnName: 'code',
  })
  projectScanStatus: ProjectScanStatusType;
Example #3
Source File: ParticipationCertificate.ts    From backend with MIT License 5 votes vote down vote up
@ManyToOne((type) => Pupil)
    @JoinColumn()
    pupil: Pupil;
Example #4
Source File: CashSplit.ts    From cashcash-desktop with MIT License 5 votes vote down vote up
@ManyToOne((type) => CashAccount, (cashAccount) => cashAccount.cashSplitList)
    @JoinColumn({ name: 'accountId', referencedColumnName: 'id' })
    account: CashAccount;
Example #5
Source File: user.model.ts    From nest_transact with MIT License 5 votes vote down vote up
@ApiModelPropertyOptional({
    type: () => Purse,
  })
  @OneToOne(() => Purse, purse => purse.user)
  @JoinColumn()
  defaultPurse?: Purse;
Example #6
Source File: Content.ts    From Typescript_TypeORM with Apache License 2.0 5 votes vote down vote up
@OneToOne(type => Lesson, content => Content, { eager: true, cascade: true })
  @JoinColumn()
  lesson: Lesson;
Example #7
Source File: site-applications.entity.ts    From aqualink-app with MIT License 5 votes vote down vote up
@OneToOne(() => Site, { onDelete: 'CASCADE' })
  @JoinColumn()
  site: Site;
Example #8
Source File: branch.entity.ts    From typeorm-query-builder-wrapper with MIT License 5 votes vote down vote up
@OneToOne(() => User)
  @JoinColumn({ name: 'user_id', referencedColumnName: 'id' })
  user: User;
Example #9
Source File: Feed.ts    From vsinder with Apache License 2.0 5 votes vote down vote up
@OneToOne(() => User, {
    primary: true,
    onDelete: "CASCADE",
  })
  @JoinColumn({ name: "ownerId" })
  owner: Promise<User>;
Example #10
Source File: View.ts    From vsinder-api with Apache License 2.0 5 votes vote down vote up
@ManyToOne(() => User, (u) => u.views, {
    primary: true,
    onDelete: "CASCADE",
  })
  @JoinColumn({ name: "viewerId" })
  viewer: Promise<User>;
Example #11
Source File: ChatRoom.entity.ts    From bouncecode-cms with GNU General Public License v3.0 5 votes vote down vote up
@OneToOne(
    type => ChatMessageEntity,
    message => message.lastMessage,
  )
  @JoinColumn()
  lastMessage: ChatMessageEntity;
Example #12
Source File: scan-task.ts    From crossfeed with Creative Commons Zero v1.0 Universal 5 votes vote down vote up
@ManyToOne((type) => Scan, (scan) => scan.scanTasks, {
    onDelete: 'SET NULL',
    onUpdate: 'CASCADE'
  })
  @JoinColumn()
  scan: Scan;
Example #13
Source File: Image.ts    From NextLevelWeek with MIT License 5 votes vote down vote up
@ManyToOne(() => Orphanage, orphanage => orphanage.images)
    @JoinColumn({ name: 'orphanage_id' })
    orphanage: Orphanage;
Example #14
Source File: CertificateOfConduct.ts    From backend with MIT License 5 votes vote down vote up
@OneToOne((type) => Student, (student) => student.certificateOfConduct, {
        eager: true
    })
    @JoinColumn()
    student: Student;
Example #15
Source File: Application.ts    From fosscord-server with GNU Affero General Public License v3.0 5 votes vote down vote up
@JoinColumn({ name: "guild_id" })
	@ManyToOne(() => Guild)
	guild: Guild;
Example #16
Source File: CartItem.ts    From typeorm-uml with MIT License 5 votes vote down vote up
@ManyToOne( () => Product, ( product ) => product.cartItems, {
		onDelete: 'RESTRICT',
		onUpdate: 'RESTRICT',
	} )
	@JoinColumn( [ { name: 'productId', referencedColumnName: 'id' } ] )
	product: Product;
Example #17
Source File: ProjectCoachingScreening.ts    From backend with MIT License 5 votes vote down vote up
@ManyToOne((type) => Screener, (screener) => screener.screenings, {
        eager: true
    })
    @JoinColumn()
    screener: Screener;
Example #18
Source File: Cart.ts    From typeorm-uml with MIT License 5 votes vote down vote up
@ManyToOne( () => User, ( user ) => user.carts, {
		onDelete: 'RESTRICT',
		onUpdate: 'RESTRICT',
	} )
	@JoinColumn( [ { name: 'userId', referencedColumnName: 'id' } ] )
	user: User;