Skip to content

Commit

Permalink
feat: add table eligible_deals (#485)
Browse files Browse the repository at this point in the history
* feat: add table `eligible_deals`

Signed-off-by: Miroslav Bajtoš <[email protected]>

* fixup! add 10k eligible deals to seed the new table

Signed-off-by: Miroslav Bajtoš <[email protected]>

* Update migrations/062.do.eligible-deals.sql

Co-authored-by: Julian Gruber <[email protected]>

* fixup! reformat SQL comment

Signed-off-by: Miroslav Bajtoš <[email protected]>

---------

Signed-off-by: Miroslav Bajtoš <[email protected]>
Co-authored-by: Julian Gruber <[email protected]>
  • Loading branch information
bajtos and juliangruber authored Jan 9, 2025
1 parent 65616e7 commit aaa852b
Show file tree
Hide file tree
Showing 2 changed files with 10,024 additions and 0 deletions.
18 changes: 18 additions & 0 deletions migrations/062.do.eligible-deals.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
-- After the seed migration `063.do.eligible-deals-seed.sql`,
-- this table's content will be managed by
-- https://github.com/filecoin-station/fil-deal-ingester
CREATE TABLE eligible_deals (
miner_id TEXT NOT NULL,
client_id TEXT NOT NULL,
piece_cid TEXT NOT NULL,
piece_size BIGINT NOT NULL,
payload_cid TEXT NOT NULL,
expires_at TIMESTAMPTZ NOT NULL,

sourced_from_f05_state BOOLEAN NOT NULL DEFAULT TRUE,

PRIMARY KEY (miner_id, client_id, piece_cid, piece_size)
);

CREATE INDEX eligible_deals_miner_id ON eligible_deals (miner_id);
CREATE INDEX eligible_deals_client_id ON eligible_deals (client_id);
Loading

0 comments on commit aaa852b

Please sign in to comment.