-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #422 from shawakash/client_set
feat: adds a connections table to store the the blockchain connections data
- Loading branch information
Showing
19 changed files
with
4,863 additions
and
557 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
backend/hasura/hasura/metadata/databases/default/tables/public_connections.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
table: | ||
name: connections | ||
schema: public | ||
configuration: | ||
column_config: | ||
btc_network: | ||
custom_name: btcNetwork | ||
client_id: | ||
custom_name: clientId | ||
client_settings_id: | ||
custom_name: clientSettingsId | ||
created_at: | ||
custom_name: createdAt | ||
eth_network: | ||
custom_name: ethNetwork | ||
sol_network: | ||
custom_name: solNetwork | ||
updated_at: | ||
custom_name: updatedAt | ||
custom_column_names: | ||
btc_network: btcNetwork | ||
client_id: clientId | ||
client_settings_id: clientSettingsId | ||
created_at: createdAt | ||
eth_network: ethNetwork | ||
sol_network: solNetwork | ||
updated_at: updatedAt | ||
custom_root_fields: {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
.../1713453773148_alter_table_public_client_settings_alter_column_prefered_explorer/down.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
ALTER TABLE "public"."client_settings" ALTER COLUMN "prefered_explorer" drop default; |
1 change: 1 addition & 0 deletions
1
...lt/1713453773148_alter_table_public_client_settings_alter_column_prefered_explorer/up.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
alter table "public"."client_settings" alter column "prefered_explorer" set default 'solscan'; |
5 changes: 5 additions & 0 deletions
5
.../hasura/migrations/default/1713453797648_set_fk_public_client_settings_client_id/down.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
alter table "public"."client_settings" drop constraint "client_settings_client_id_fkey", | ||
add constraint "client_settings_client_id_fkey" | ||
foreign key ("client_id") | ||
references "public"."client" | ||
("id") on update no action on delete no action; |
5 changes: 5 additions & 0 deletions
5
...ra/hasura/migrations/default/1713453797648_set_fk_public_client_settings_client_id/up.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
alter table "public"."client_settings" drop constraint "client_settings_client_id_fkey", | ||
add constraint "client_settings_client_id_fkey" | ||
foreign key ("client_id") | ||
references "public"."client" | ||
("id") on update set default on delete no action; |
1 change: 1 addition & 0 deletions
1
...d/hasura/hasura/migrations/default/1713456154428_create_table_public_connections/down.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
DROP TABLE "public"."connections"; |
18 changes: 18 additions & 0 deletions
18
...end/hasura/hasura/migrations/default/1713456154428_create_table_public_connections/up.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
CREATE TABLE "public"."connections" ("id" uuid NOT NULL DEFAULT gen_random_uuid(), "client_id" uuid NOT NULL, "sol_network" text NOT NULL DEFAULT 'devnet', "eth_network" text NOT NULL DEFAULT 'sepolia', "btc_network" text NOT NULL, "client_settings_id" uuid NOT NULL, "created_at" timestamptz NOT NULL DEFAULT now(), "updated_at" timestamptz NOT NULL DEFAULT now(), PRIMARY KEY ("id") , FOREIGN KEY ("client_id") REFERENCES "public"."client"("id") ON UPDATE no action ON DELETE no action, FOREIGN KEY ("client_settings_id") REFERENCES "public"."client_settings"("id") ON UPDATE no action ON DELETE no action, UNIQUE ("id"), UNIQUE ("client_settings_id"), UNIQUE ("client_id"));COMMENT ON TABLE "public"."connections" IS E'blockchains connections metadata'; | ||
CREATE OR REPLACE FUNCTION "public"."set_current_timestamp_updated_at"() | ||
RETURNS TRIGGER AS $$ | ||
DECLARE | ||
_new record; | ||
BEGIN | ||
_new := NEW; | ||
_new."updated_at" = NOW(); | ||
RETURN _new; | ||
END; | ||
$$ LANGUAGE plpgsql; | ||
CREATE TRIGGER "set_public_connections_updated_at" | ||
BEFORE UPDATE ON "public"."connections" | ||
FOR EACH ROW | ||
EXECUTE PROCEDURE "public"."set_current_timestamp_updated_at"(); | ||
COMMENT ON TRIGGER "set_public_connections_updated_at" ON "public"."connections" | ||
IS 'trigger to set value of column "updated_at" to current timestamp on row update'; | ||
CREATE EXTENSION IF NOT EXISTS pgcrypto; |
1 change: 1 addition & 0 deletions
1
...ns/default/1713456247122_alter_table_public_connections_alter_column_btc_network/down.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
ALTER TABLE "public"."connections" ALTER COLUMN "btc_network" drop default; |
1 change: 1 addition & 0 deletions
1
...ions/default/1713456247122_alter_table_public_connections_alter_column_btc_network/up.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
alter table "public"."connections" alter column "btc_network" set default 'testnet'; |
5 changes: 5 additions & 0 deletions
5
...sura/hasura/migrations/default/1713456290163_set_fk_public_connections_client_id/down.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
alter table "public"."connections" drop constraint "connections_client_id_fkey", | ||
add constraint "connections_client_id_fkey" | ||
foreign key ("client_id") | ||
references "public"."client" | ||
("id") on update no action on delete no action; |
5 changes: 5 additions & 0 deletions
5
...hasura/hasura/migrations/default/1713456290163_set_fk_public_connections_client_id/up.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
alter table "public"."connections" drop constraint "connections_client_id_fkey", | ||
add constraint "connections_client_id_fkey" | ||
foreign key ("client_id") | ||
references "public"."client" | ||
("id") on update set default on delete no action; |
5 changes: 5 additions & 0 deletions
5
...ra/migrations/default/1713456294404_set_fk_public_connections_client_settings_id/down.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
alter table "public"."connections" drop constraint "connections_client_settings_id_fkey", | ||
add constraint "connections_client_settings_id_fkey" | ||
foreign key ("client_settings_id") | ||
references "public"."client_settings" | ||
("id") on update no action on delete no action; |
5 changes: 5 additions & 0 deletions
5
...sura/migrations/default/1713456294404_set_fk_public_connections_client_settings_id/up.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
alter table "public"."connections" drop constraint "connections_client_settings_id_fkey", | ||
add constraint "connections_client_settings_id_fkey" | ||
foreign key ("client_settings_id") | ||
references "public"."client_settings" | ||
("id") on update set default on delete no action; |
Oops, something went wrong.