sequelize#Optional TypeScript Examples

The following examples show how to use sequelize#Optional. 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: applicant-model.ts    From endbot with MIT License 6 votes vote down vote up
@Table({ underscored: true })
export class ApplicantModel
	extends Model<ApplicantAttributes, Optional<ApplicantAttributes, "applicant_id">>
	implements ApplicantAttributes
{
	@Default(defaultID)
	@PrimaryKey
	@Column(STRING)
	applicant_id!: Snowflake;

	@Column
	profile_picture!: string;

	@Column
	discriminator!: string;

	@Column
	name!: string;

	@HasMany(() => TicketModel)
	tickets!: TicketModel[];
}
Example #2
Source File: ticket-model.ts    From endbot with MIT License 6 votes vote down vote up
@Table({ underscored: true })
export class TicketModel
	extends Model<TicketAttributes, Optional<TicketAttributes, "status" | "round" | "applicant_id">>
	implements TicketAttributes
{
	@Default(TicketStatus.PENDING)
	@Column(INTEGER)
	status!: TicketStatus;

	@PrimaryKey
	@AutoIncrement
	@Column
	round!: number;

	@Column
	channel_id!: string;

	@ForeignKey(() => ApplicantModel)
	@Default(defaultID)
	@PrimaryKey
	@Column(STRING)
	applicant_id!: string;

	@BelongsTo(() => ApplicantModel)
	applicant!: ApplicantModel;
}