summaryrefslogtreecommitdiff
path: root/src/db.hrl
blob: 309f8e1dabcefaef97a22e0b81925497b0a594c1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
%%% Copyright (c) 2014, NORDUnet A/S.
%%% See LICENSE for licensing information.

%% @doc What's stored in the database.
%% 'index' is the primary key, 'entryhash' and 'mtlhash' are also
%% indexed, see init_tables/1.
%% NOTE: Don't change anything here without also fixing
%% select_index/2, which depends on the order of fields.
%% NOTE2: This record has creeped into case matches in plop. This will
%% change, but for now, don't change this record without looking
%% carefully almost everywhere.
-record(plop, {
          index :: non_neg_integer(),           % Primary key.
          entryhash :: binary(),     % Hash over #plop_entry{} in mtl.
          mtlhash :: binary(),       % Merkle Tree Leaf hash.
          mtl :: mtl(),              % Merkle Tree Leaf.
          extra_data :: binary(),    % Data not part of mtl.
          spt :: spt()               % Signed Plop Timestamp.
         }).
-type plop() :: #plop{}.