Check if transactions table has to be created and fix logging transactions.
This commit is contained in:
@@ -30,7 +30,7 @@ public record DatabaseHelper(PlayerShops plugin, DatabaseManager databaseManager
|
|||||||
if (!databaseManager().hasTable("shops"))
|
if (!databaseManager().hasTable("shops"))
|
||||||
createShopTable();
|
createShopTable();
|
||||||
|
|
||||||
if (databaseManager().hasTable("transactions"))
|
if (!databaseManager().hasTable("transactions"))
|
||||||
createTransactionsTable();
|
createTransactionsTable();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -196,7 +196,7 @@ public record DatabaseHelper(PlayerShops plugin, DatabaseManager databaseManager
|
|||||||
* Log a transaction with a shop
|
* Log a transaction with a shop
|
||||||
*/
|
*/
|
||||||
public void logTransaction(Player player, PlayerShop shop, int orders) {
|
public void logTransaction(Player player, PlayerShop shop, int orders) {
|
||||||
String query = "INSERT INTO transaction (shop_id, actor_name, actor_uuid, server, action, time, price, amount, item) " +
|
String query = "INSERT INTO transactions (shop_id, actor_name, actor_uuid, server, action, time, price, amount, item) " +
|
||||||
"VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)";
|
"VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)";
|
||||||
databaseManager().addDatabaseQuery(
|
databaseManager().addDatabaseQuery(
|
||||||
new DatabaseQuery(query, new DatabaseQuery.DatabaseTask() {
|
new DatabaseQuery(query, new DatabaseQuery.DatabaseTask() {
|
||||||
|
|||||||
Reference in New Issue
Block a user