mirror of
https://github.com/AppleDash/SaneEconomy.git
synced 2025-02-16 19:51:23 +01:00
Add logged field to table with timestamp info
This give people some insights regarding when something happened, it also adds the possibility to make a history log for server admins to show on profile pages at there websites, if they want to.
This commit is contained in:
parent
692f1439d2
commit
20299a4b2e
@ -46,7 +46,7 @@ public class TransactionLoggerMySQL implements TransactionLogger {
|
||||
|
||||
private void createTables() {
|
||||
try (Connection conn = dbConn.openConnection()) {
|
||||
PreparedStatement ps = conn.prepareStatement(String.format("CREATE TABLE IF NOT EXISTS `%s` (`source` VARCHAR(128), `destination` VARCHAR(128), `amount` DECIMAL(18, 2), `reason` VARCHAR(128))", dbConn.getTable("transaction_logs")));
|
||||
PreparedStatement ps = conn.prepareStatement(String.format("CREATE TABLE IF NOT EXISTS `test` (`source` VARCHAR(128), `destination` VARCHAR(128), `amount` DECIMAL(18, 2), `reason` VARCHAR(128), `logged` TIMESTAMP NOT NULL default CURRENT_TIMESTAMP)", dbConn.getTable("transaction_logs")));
|
||||
ps.executeUpdate();
|
||||
} catch (SQLException e) {
|
||||
throw new RuntimeException("Failed to create transaction logger tables", e);
|
||||
|
Loading…
Reference in New Issue
Block a user