From c15061dee6c775139079f44bb676168e3e24fe12 Mon Sep 17 00:00:00 2001 From: prathamesh0 Date: Fri, 4 Feb 2022 15:03:23 +0530 Subject: [PATCH] Move table for watched addresses to eth_meta schema --- db/migrations/00017_create_eth_meta_schema.sql | 5 +++++ ...l => 00018_create_watched_addresses_table.sql} | 4 ++-- schema.sql | 15 +++++++++++---- 3 files changed, 18 insertions(+), 6 deletions(-) create mode 100644 db/migrations/00017_create_eth_meta_schema.sql rename db/migrations/{00017_create_watched_addresses_table.sql => 00018_create_watched_addresses_table.sql} (73%) diff --git a/db/migrations/00017_create_eth_meta_schema.sql b/db/migrations/00017_create_eth_meta_schema.sql new file mode 100644 index 0000000..448cc91 --- /dev/null +++ b/db/migrations/00017_create_eth_meta_schema.sql @@ -0,0 +1,5 @@ +-- +goose Up +CREATE SCHEMA eth_meta; + +-- +goose Down +DROP SCHEMA eth_meta; diff --git a/db/migrations/00017_create_watched_addresses_table.sql b/db/migrations/00018_create_watched_addresses_table.sql similarity index 73% rename from db/migrations/00017_create_watched_addresses_table.sql rename to db/migrations/00018_create_watched_addresses_table.sql index 2a2e24e..a8f009f 100644 --- a/db/migrations/00017_create_watched_addresses_table.sql +++ b/db/migrations/00018_create_watched_addresses_table.sql @@ -1,5 +1,5 @@ -- +goose Up -CREATE TABLE eth.watched_addresses ( +CREATE TABLE eth_meta.watched_addresses ( address VARCHAR(66) PRIMARY KEY, created_at BIGINT NOT NULL, watched_at BIGINT NOT NULL, @@ -7,4 +7,4 @@ CREATE TABLE eth.watched_addresses ( ); -- +goose Down -DROP TABLE eth.watched_addresses; +DROP TABLE eth_meta.watched_addresses; diff --git a/schema.sql b/schema.sql index b0f9fd6..8b62114 100644 --- a/schema.sql +++ b/schema.sql @@ -23,6 +23,13 @@ SET row_security = off; CREATE SCHEMA eth; +-- +-- Name: eth_meta; Type: SCHEMA; Schema: -; Owner: - +-- + +CREATE SCHEMA eth_meta; + + SET default_tablespace = ''; -- @@ -553,10 +560,10 @@ ALTER SEQUENCE eth.uncle_cids_id_seq OWNED BY eth.uncle_cids.id; -- --- Name: watched_addresses; Type: TABLE; Schema: eth; Owner: - +-- Name: watched_addresses; Type: TABLE; Schema: eth_meta; Owner: - -- -CREATE TABLE eth.watched_addresses ( +CREATE TABLE eth_meta.watched_addresses ( address character varying(66) NOT NULL, created_at bigint NOT NULL, watched_at bigint NOT NULL, @@ -876,10 +883,10 @@ ALTER TABLE ONLY eth.uncle_cids -- --- Name: watched_addresses watched_addresses_pkey; Type: CONSTRAINT; Schema: eth; Owner: - +-- Name: watched_addresses watched_addresses_pkey; Type: CONSTRAINT; Schema: eth_meta; Owner: - -- -ALTER TABLE ONLY eth.watched_addresses +ALTER TABLE ONLY eth_meta.watched_addresses ADD CONSTRAINT watched_addresses_pkey PRIMARY KEY (address);