Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tapdb/universe: fix universe event logging for grouped assets #348

Merged
merged 1 commit into from
Jun 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 10 additions & 6 deletions tapdb/sqlc/queries/universe.sql
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,11 @@ SELECT * FROM universe_servers;

-- name: InsertNewSyncEvent :exec
WITH root_asset_id AS (
SELECT id
FROM universe_roots
WHERE asset_id = @asset_id
SELECT leaves.universe_root_id AS id
FROM universe_leaves leaves
JOIN genesis_info_view gen
ON leaves.asset_genesis_id = gen.gen_asset_id
WHERE gen.asset_id = @asset_id
)
INSERT INTO universe_events (
event_type, universe_root_id, event_time
Expand All @@ -99,9 +101,11 @@ INSERT INTO universe_events (

-- name: InsertNewProofEvent :exec
WITH root_asset_id AS (
SELECT id
FROM universe_roots
WHERE asset_id = @asset_id
SELECT leaves.universe_root_id AS id
FROM universe_leaves leaves
JOIN genesis_info_view gen
ON leaves.asset_genesis_id = gen.gen_asset_id
WHERE gen.asset_id = @asset_id
)
INSERT INTO universe_events (
event_type, universe_root_id, event_time
Expand Down
16 changes: 10 additions & 6 deletions tapdb/sqlc/universe.sql.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.