Making order_id (BTCPay invoice id) unique in the database.

This commit is contained in:
softsimon
2020-10-13 10:10:46 +07:00
parent 55646b5732
commit 4c203631db
2 changed files with 3 additions and 1 deletions

View File

@@ -105,7 +105,7 @@ class Donations {
private async $addDonationToDatabase(btcPaid: number, handle: string, orderId: string, imageUrl: string): Promise<void> {
try {
const connection = await DB.pool.getConnection();
const query = `INSERT INTO donations(added, amount, handle, order_id, imageUrl) VALUES (NOW(), ?, ?, ?, ?)`;
const query = `INSERT IGNORE INTO donations(added, amount, handle, order_id, imageUrl) VALUES (NOW(), ?, ?, ?, ?)`;
const params: (string | number)[] = [
btcPaid,
handle,