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

feat: Add indexer_log_entries indexes to hasura migrations #238

Merged
merged 1 commit into from
Sep 27, 2023
Merged
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
7 changes: 7 additions & 0 deletions hasura/migrations/default/1691364619300_init/up.sql
Original file line number Diff line number Diff line change
@@ -1,18 +1,25 @@
SET check_function_bodies = false;

CREATE TABLE public.indexer_log_entries (
id uuid DEFAULT gen_random_uuid() NOT NULL,
function_name text NOT NULL,
block_height numeric NOT NULL,
"timestamp" timestamp without time zone DEFAULT CURRENT_TIMESTAMP,
message text
);

CREATE TABLE public.indexer_state (
function_name character varying NOT NULL,
current_block_height numeric(21,0) NOT NULL,
status text,
current_historical_block_height numeric(21,0)
);

ALTER TABLE ONLY public.indexer_log_entries
ADD CONSTRAINT indexer_log_entries_pkey PRIMARY KEY (id);

ALTER TABLE ONLY public.indexer_state
ADD CONSTRAINT indexer_state_pkey PRIMARY KEY (function_name);

CREATE INDEX idx_function_name ON indexer_log_entries(function_name);
CREATE INDEX idx_timestamp ON indexer_log_entries("timestamp");