forked from forbole/callisto
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path01-auth.sql
More file actions
34 lines (29 loc) · 1.06 KB
/
01-auth.sql
File metadata and controls
34 lines (29 loc) · 1.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
CREATE TABLE account
(
address TEXT NOT NULL PRIMARY KEY
);
/* ---- Moved from bank.sql for vesting account usage ---- */
CREATE TYPE COIN AS
(
denom TEXT,
amount TEXT
);
/* ---- AUTH/ VESTING ACCOUNT ---- */
CREATE TABLE vesting_account
(
id SERIAL PRIMARY KEY NOT NULL,
type TEXT NOT NULL,
address TEXT NOT NULL REFERENCES account (address),
original_vesting COIN[] NOT NULL DEFAULT '{}',
end_time TIMESTAMP WITHOUT TIME ZONE NOT NULL,
start_time TIMESTAMP WITHOUT TIME ZONE
);
/* ---- start_time can be empty on DelayedVestingAccount ---- */
CREATE UNIQUE INDEX vesting_account_address_idx ON vesting_account (address);
CREATE TABLE vesting_period
(
vesting_account_id BIGINT NOT NULL REFERENCES vesting_account (id),
period_order BIGINT NOT NULL,
length BIGINT NOT NULL,
amount COIN[] NOT NULL DEFAULT '{}'
);