From d708dca108dcbfe3d67dfe90c27de9cdb41184a6 Mon Sep 17 00:00:00 2001 From: Linnea Gräf Date: Sat, 7 Dec 2024 00:50:33 +0100 Subject: feat: Add SQLITE database entry logging --- src/main/kotlin/moe/nea/ledger/database/DBLogEntry.kt | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 src/main/kotlin/moe/nea/ledger/database/DBLogEntry.kt (limited to 'src/main/kotlin/moe/nea/ledger/database/DBLogEntry.kt') diff --git a/src/main/kotlin/moe/nea/ledger/database/DBLogEntry.kt b/src/main/kotlin/moe/nea/ledger/database/DBLogEntry.kt new file mode 100644 index 0000000..77ac215 --- /dev/null +++ b/src/main/kotlin/moe/nea/ledger/database/DBLogEntry.kt @@ -0,0 +1,19 @@ +package moe.nea.ledger.database + +import moe.nea.ledger.ItemChange +import moe.nea.ledger.ItemId +import moe.nea.ledger.TransactionType + +object DBLogEntry : Table("LogEntry") { + val transactionId = column("transactionId", DBUlid) + val type = column("type", DBEnum()) + val profileId = column("profileId", DBUuid) + val playerId = column("playerId", DBUuid) +} + +object DBItemEntry : Table("ItemEntry") { + val transactionId = column("transactionId", DBUlid) // TODO: add foreign keys + val mode = column("mode", DBEnum()) + val itemId = column("item", DBString.mapped(ItemId::string, ::ItemId)) + val size = column("size", DBDouble) +} -- cgit