Skip to content

Commit

Permalink
fix(db): Fix primary key constraint errors
Browse files Browse the repository at this point in the history
  • Loading branch information
Marco Crespi committed Dec 3, 2019
1 parent 7b33c08 commit a4e9427
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/framework/services/DatabaseService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -696,7 +696,13 @@ export class DatabaseService {
// Leave
// ---------
public async saveLeave(leave: Partial<Leave>) {
const res = await this.insertOrUpdate(TABLE.leaves, ['guildId', 'memberId', 'joinId'], [], [leave], l => l.guildId);
const res = await this.insertOrUpdate(
TABLE.leaves,
['guildId', 'memberId', 'joinId'],
['joinId'],
[leave],
l => l.guildId
);
return res[0].insertId;
}
public async getLeavesPerDay(guildId: string, from: Date, to: Date) {
Expand Down

0 comments on commit a4e9427

Please sign in to comment.