Skip to content

Commit

Permalink
feat: Add indexer_log_entries indexes to hasura migrations (#238)
Browse files Browse the repository at this point in the history
  • Loading branch information
morgsmccauley authored Sep 27, 2023
1 parent 4682e05 commit b80842f
Showing 1 changed file with 7 additions and 0 deletions.
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");

0 comments on commit b80842f

Please sign in to comment.