diff --git a/db/migrations/00018_ethHeaderCidByBlockNumber.sql b/db/migrations/00018_ethHeaderCidByBlockNumber.sql new file mode 100644 index 0000000..2f448e5 --- /dev/null +++ b/db/migrations/00018_ethHeaderCidByBlockNumber.sql @@ -0,0 +1,11 @@ +-- +goose Up +CREATE FUNCTION "ethHeaderCidByBlockNumber"(n bigint) returns SETOF eth.header_cids + stable + language sql +as +$$ +SELECT * FROM eth.header_cids WHERE block_number=$1 ORDER BY id +$$; + +-- +goose Down +DROP FUNCTION "ethHeaderCidByBlockNumber"(bigint); \ No newline at end of file