fix(admin): resolve incorrect crypto balance calculation fallback displaying fiat amount
This commit is contained in:
25
reset_merchants.js
Normal file
25
reset_merchants.js
Normal file
@@ -0,0 +1,25 @@
|
||||
const { Client } = require('pg');
|
||||
|
||||
async function resetMerchants() {
|
||||
const client = new Client({ connectionString: process.env.DATABASE_URL });
|
||||
try {
|
||||
await client.connect();
|
||||
|
||||
console.log("Bağlantı başarılı. Firmaları ve ilişkili verieri siliyorum...");
|
||||
|
||||
// Önce merchant bakiyelerini silelim (foreign key hatası almamak için)
|
||||
await client.query('DELETE FROM merchant_balances');
|
||||
console.log("Firma kripto bakiyeleri (merchant_balances) sıfırlandı.");
|
||||
|
||||
// Firmaları sil
|
||||
const res = await client.query('DELETE FROM merchants');
|
||||
console.log(`Başarıyla ${res.rowCount} firma (merchant) silindi.`);
|
||||
|
||||
} catch (err) {
|
||||
console.error("Hata oluştu:", err);
|
||||
} finally {
|
||||
await client.end();
|
||||
}
|
||||
}
|
||||
|
||||
resetMerchants();
|
||||
Reference in New Issue
Block a user