storj/satellite/satellitedb/dbx/satellitedb.dbx.sqlite3.sql
Bill Thorp 342dc857f5 rollup query (#1056)
* implemention notes

* more notes

* starting rollup query

* not working yet

* fixed build

* fixed cfg bug

* change context cancelled errs to debugs

* using byte hours for at rest tally

* revert changes to go.mod

* comment fixes

* prevent double recording tallies in rollup

* linting

* stop leaking dbx

* nodeid changes

* fix build
2019-01-16 14:30:33 -05:00

82 lines
2.1 KiB
SQL

-- AUTOGENERATED BY gopkg.in/spacemonkeygo/dbx.v1
-- DO NOT EDIT
CREATE TABLE accounting_raws (
id INTEGER NOT NULL,
node_id BLOB NOT NULL,
interval_end_time TIMESTAMP NOT NULL,
data_total REAL NOT NULL,
data_type INTEGER NOT NULL,
created_at TIMESTAMP NOT NULL,
PRIMARY KEY ( id )
);
CREATE TABLE accounting_rollups (
id INTEGER NOT NULL,
node_id BLOB NOT NULL,
start_time TIMESTAMP NOT NULL,
put_total INTEGER NOT NULL,
get_total INTEGER NOT NULL,
get_audit_total INTEGER NOT NULL,
get_repair_total INTEGER NOT NULL,
put_repair_total INTEGER NOT NULL,
at_rest_total REAL NOT NULL,
PRIMARY KEY ( id )
);
CREATE TABLE accounting_timestamps (
name TEXT NOT NULL,
value TIMESTAMP NOT NULL,
PRIMARY KEY ( name )
);
CREATE TABLE bwagreements (
signature BLOB NOT NULL,
serialnum TEXT NOT NULL,
data BLOB NOT NULL,
created_at TIMESTAMP NOT NULL,
expires_at TIMESTAMP NOT NULL,
PRIMARY KEY ( signature ),
UNIQUE ( serialnum )
);
CREATE TABLE injuredsegments (
id INTEGER NOT NULL,
info BLOB NOT NULL,
PRIMARY KEY ( id )
);
CREATE TABLE irreparabledbs (
segmentpath BLOB NOT NULL,
segmentdetail BLOB NOT NULL,
pieces_lost_count INTEGER NOT NULL,
seg_damaged_unix_sec INTEGER NOT NULL,
repair_attempt_count INTEGER NOT NULL,
PRIMARY KEY ( segmentpath )
);
CREATE TABLE nodes (
id BLOB NOT NULL,
audit_success_count INTEGER NOT NULL,
total_audit_count INTEGER NOT NULL,
audit_success_ratio REAL NOT NULL,
uptime_success_count INTEGER NOT NULL,
total_uptime_count INTEGER NOT NULL,
uptime_ratio REAL NOT NULL,
created_at TIMESTAMP NOT NULL,
updated_at TIMESTAMP NOT NULL,
PRIMARY KEY ( id )
);
CREATE TABLE overlay_cache_nodes (
node_id BLOB NOT NULL,
node_type INTEGER NOT NULL,
address TEXT NOT NULL,
protocol INTEGER NOT NULL,
operator_email TEXT NOT NULL,
operator_wallet TEXT NOT NULL,
free_bandwidth INTEGER NOT NULL,
free_disk INTEGER NOT NULL,
latency_90 INTEGER NOT NULL,
audit_success_ratio REAL NOT NULL,
audit_uptime_ratio REAL NOT NULL,
audit_count INTEGER NOT NULL,
audit_success_count INTEGER NOT NULL,
uptime_count INTEGER NOT NULL,
uptime_success_count INTEGER NOT NULL,
PRIMARY KEY ( node_id ),
UNIQUE ( node_id )
);