Open
Description
I'm not getting a way to remove an association between these two models below:
@Table
class Ticket extends Model {
@PrimaryKey
@AutoIncrement
@Column
id: number;
@ForeignKey(() => Queue)
@Column
queueId: number;
@BelongsTo(() => Queue)
queue: Queue;
}
@Table
class Queue extends Model {
@PrimaryKey
@AutoIncrement
@Column
id: number;
}
To associate a Queue to a Ticket I do the following:
const queueId = 1;
await Ticket.findByPk(ticket.id).then(async ticket => {
await ticket.update({
queueId
});
ticket.reload();
});
Any ideas on how to remove this association?
Originally posted by @engmsilva in #774 (comment)
Metadata
Metadata
Assignees
Labels
No labels