-
Notifications
You must be signed in to change notification settings - Fork 1
/
init.sql
96 lines (86 loc) · 2.15 KB
/
init.sql
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
create schema ans3;
create table ans3.block
(
id serial,
height bigint,
block_hash text,
previous_hash text,
timestamp bigint,
created bigint DEFAULT EXTRACT(EPOCH FROM CURRENT_TIMESTAMP)::BIGINT,
constraint height_pk
unique (height)
);
create table ans3.ans_nft_owner
(
id bigserial,
name_hash text not null,
address text not null,
block_height bigint,
transaction_id text,
transition_id text,
constraint name_hash_pk
unique (name_hash)
);
create index name_address_index
on ans3.ans_nft_owner (address);
create table ans3.ans_name
(
id bigserial,
name_hash text not null,
transfer_key text,
parent text,
name text not null,
full_name text not null,
resolver text,
block_height bigint,
transaction_id text,
transition_id text,
constraint name_hash_pk2
unique (name_hash)
);
create table ans3.ans_primary_name
(
id bigserial,
address text not null,
name_hash text not null,
block_height bigint,
transaction_id text,
transition_id text,
constraint primary_name_address_pk
unique (address)
);
create table ans3.ans_resolver
(
id bigserial,
name_hash text not null,
category text not null,
version integer default 0 not null,
name text not null,
block_height bigint,
transaction_id text,
transition_id text,
constraint ans_resolver_pk
unique (name_hash, category, version)
);
create table ans3.ans_name_version
(
id bigserial,
name_hash text not null,
version integer default 0 not null,
block_height bigint,
transaction_id text,
transition_id text,
constraint version_name_hash_pk
unique (name_hash)
);
create table ans3.domain_credits
(
id bigserial,
transfer_key text not null,
amount bigint default 0 not null,
block_height bigint,
transaction_id text,
transition_id text,
constraint transfer_key_pk
unique (transfer_key)
);