-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathschema.sql
53 lines (46 loc) · 2.28 KB
/
schema.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
-- db-default-privileges
alter default privileges for role sui_archive in schema sui_${sui_network}${sui_shard} grant select on tables to hasura;
alter default privileges for role sui_archive in schema sui_${sui_network}${sui_shard} grant select on tables to superset;
alter default privileges for role sui_archive in schema sui_${sui_network}${sui_shard} grant select on tables to metabase;
alter default privileges for role sui_archive in schema sui_${sui_network}${sui_shard} grant select on tables to redash_sui;
alter default privileges for role sui_archive in schema sui_${sui_network}${sui_shard} grant select on tables to graphile;
set search_path to sui_${sui_network}${sui_shard};
-- drop table if exists Event cascade;
create table if not exists Event
(
txDigest text,
eventSeq int,
timestamp timestamp,
packageId text,
transactionModule text,
sender text,
type text,
parsedJson jsonb,
bcs text,
primary key (txDigest, eventSeq)
);
create index on Event (txDigest);
create index on Event (timestamp);
create index on Event (packageId);
create index on Event (transactionModule);
create index on Event (sender);
create index on Event (type);
comment on table Event is 'SuiEvent';
comment on column Event.txDigest is 'Transaction digest';
comment on column Event.eventSeq is 'Event sequence';
comment on column Event.timestamp is 'Event time';
comment on column Event.packageId is 'Move package where this event was emitted';
comment on column Event.transactionModule is 'Move module where this event was emitted';
comment on column Event.sender is 'Sender Sui address';
comment on column Event.type is 'Move event type';
comment on column Event.parsedJson is 'Parsed json value of the event';
comment on column Event.bcs is 'Base 58 encoded bcs bytes of the move event';
-- comment on table TransferObjectEvent is E'@omit';
-- comment on table DeleteObjectEvent is E'@omit';
-- comment on table NewObjectEvent is E'@omit';
-- comment on table CoinBalanceChangeEvent is E'@omit';
-- comment on table MoveEvent is E'@omit';
-- comment on table MutateObjectEvent is E'@omit';
-- comment on table PublishEvent is E'@omit';
comment on table events is E'@omit';
comment on table addresses is E'@omit';