storj/satellite/satellitedb/dbx/accounting.dbx
Egon Elbre e4914e9b7a satellite/satellitedb/dbx: document accounting tables
Change-Id: I94478892a37623882d306a811e272f51865e48dd
2023-02-24 16:04:29 +02:00

22 lines
602 B
Plaintext

// accounting_timestamps saves the last time an process completed.
model accounting_timestamps (
key name
// name is one of "LastAtRestTally", "LastBandwidthTally" or "LastRollup".
// See the details in satellite/accounting/common.go for their meaning.
field name text
// value is the last time that the specific event completed.
field value timestamp ( updatable )
)
create accounting_timestamps ( noreturn, replace )
update accounting_timestamps (
where accounting_timestamps.name = ?
noreturn
)
read scalar (
select accounting_timestamps.value
where accounting_timestamps.name = ?
)