Skip to content

Commit

Permalink
create tables in right order
Browse files Browse the repository at this point in the history
  • Loading branch information
frrist committed Aug 26, 2020
1 parent f650f17 commit 291e4e4
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 13 deletions.
15 changes: 15 additions & 0 deletions cmd/lotus-chainwatch/processor/market.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,21 @@ create table if not exists market_deal_states
);
create table if not exists minerid_dealid_sectorid
(
deal_id bigint not null
constraint sectors_sector_ids_id_fk
references market_deal_proposals(deal_id),
sector_id bigint not null,
miner_id text not null,
foreign key (sector_id, miner_id) references sector_precommit_info(sector_id, miner_id),
constraint miner_sector_deal_ids_pk
primary key (miner_id, sector_id, deal_id)
);
`); err != nil {
return err
}
Expand Down
13 changes: 0 additions & 13 deletions cmd/lotus-chainwatch/processor/miner.go
Original file line number Diff line number Diff line change
Expand Up @@ -130,19 +130,6 @@ create table if not exists miner_sector_events
primary key (sector_id, event, miner_id, state_root)
);
create table if not exists minerid_dealid_sectorid
(
deal_id bigint not null
constraint sectors_sector_ids_id_fk
references market_deal_proposals(deal_id),
sector_id bigint not null,
miner_id text not null,
foreign key (sector_id, miner_id) references sector_precommit_info(sector_id, miner_id),
constraint miner_sector_deal_ids_pk
primary key (miner_id, sector_id, deal_id)
);
`); err != nil {
return err
Expand Down

0 comments on commit 291e4e4

Please sign in to comment.