Skip to content

Commit

Permalink
feat: db changes
Browse files Browse the repository at this point in the history
  • Loading branch information
JordyRo1 committed Oct 12, 2023
1 parent 3e45b62 commit a38c34a
Show file tree
Hide file tree
Showing 10 changed files with 150 additions and 141 deletions.
68 changes: 23 additions & 45 deletions Cargo.lock

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

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ edition = "2021"
axum = { version = "0.6", features = ["macros", "multipart"] }
axum-macros = "0.3"
chrono = "0.4"
bigdecimal = "0.2"
bigdecimal = "0.4.1"
num-bigint = "0.4"
diesel = { version = "2.1.0", features = ["postgres" , "numeric", "chrono","uuid", "serde_json"] }
diesel-async = { version = "0.4.1", features = [
Expand All @@ -29,4 +29,4 @@ deadpool = { version = "0.9.3", features = ["managed"] }
futures = "0.3.28"
prometheus = "0.13.3"
lazy_static = "1.4.0"
hyper = "0.14.27"
hyper = "0.14.27"
19 changes: 0 additions & 19 deletions migrations/2023-10-05-193438_create_posts/up.sql

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
-- This file should undo anything in `up.sql`
DROP TABLE IF EXISTS public.storage;
DROP TABLE IF EXISTS public.future_entry;
37 changes: 37 additions & 0 deletions migrations/2023-10-11-230102_create_posts/up.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
-- Your SQL goes here
CREATE TABLE IF NOT EXISTS public.future_entry
(
network character varying(255) COLLATE pg_catalog."default",
pair_id character varying(255) COLLATE pg_catalog."default",
data_id character varying(255) COLLATE pg_catalog."default",
block_hash character varying(255) COLLATE pg_catalog."default",
block_number bigint,
block_timestamp timestamp without time zone,
transaction_hash character varying(255) COLLATE pg_catalog."default",
price numeric,
"timestamp" timestamp without time zone,
publisher character varying(255) COLLATE pg_catalog."default",
source character varying(255) COLLATE pg_catalog."default",
volume numeric,
expiration_timestamp timestamp without time zone,
_cursor bigint
)

TABLESPACE pg_default;

ALTER TABLE IF EXISTS public.future_entry
OWNER to postgres;

REVOKE ALL ON TABLE public.future_entry FROM indexed_data_read_only;

GRANT SELECT ON TABLE public.future_entry TO indexed_data_read_only;

GRANT ALL ON TABLE public.future_entry TO postgres;
-- Index: future_entry_pair_id_publisher_source_timestamp_index

-- DROP INDEX IF EXISTS public.future_entry_pair_id_publisher_source_timestamp_index;

CREATE INDEX IF NOT EXISTS future_entry_pair_id_publisher_source_timestamp_index
ON public.future_entry USING btree
(pair_id COLLATE pg_catalog."default" ASC NULLS LAST, publisher COLLATE pg_catalog."default" ASC NULLS LAST, source COLLATE pg_catalog."default" ASC NULLS LAST, "timestamp" ASC NULLS LAST)
TABLESPACE pg_default;
Loading

0 comments on commit a38c34a

Please sign in to comment.