-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
events-collector: events-collector-server: add dimension table schema…
…s & migrations
- Loading branch information
Showing
9 changed files
with
185 additions
and
0 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
11 changes: 11 additions & 0 deletions
11
events-collector/migrations/2024-09-11-044625_create_wallets/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,11 @@ | ||
-- This file should undo anything in `up.sql` | ||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
DROP TABLE IF EXISTS "wallets"; |
19 changes: 19 additions & 0 deletions
19
events-collector/migrations/2024-09-11-044625_create_wallets/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,19 @@ | ||
-- Your SQL goes here | ||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
CREATE TABLE "wallets"( | ||
"wallet_id" UUID NOT NULL PRIMARY KEY, | ||
"created_at" TIMESTAMP NOT NULL, | ||
"last_updated_at" TIMESTAMP NOT NULL, | ||
"is_protocol_wallet" BOOL NOT NULL, | ||
"is_relayer_wallet" BOOL NOT NULL, | ||
"is_quoter_wallet" BOOL NOT NULL | ||
); | ||
|
12 changes: 12 additions & 0 deletions
12
events-collector/migrations/2024-09-11-045200_create_balances/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,12 @@ | ||
-- This file should undo anything in `up.sql` | ||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
DROP TABLE IF EXISTS "balances"; |
20 changes: 20 additions & 0 deletions
20
events-collector/migrations/2024-09-11-045200_create_balances/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,20 @@ | ||
-- Your SQL goes here | ||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
CREATE TABLE "balances"( | ||
"wallet_id" UUID NOT NULL, | ||
"mint" TEXT NOT NULL, | ||
"amount" NUMERIC NOT NULL, | ||
"relayer_fee" NUMERIC NOT NULL, | ||
"protocol_fee" NUMERIC NOT NULL, | ||
PRIMARY KEY("wallet_id", "mint") | ||
); | ||
|
13 changes: 13 additions & 0 deletions
13
events-collector/migrations/2024-09-11-045833_create_orders/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,13 @@ | ||
-- This file should undo anything in `up.sql` | ||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
DROP TABLE IF EXISTS "orders"; |
26 changes: 26 additions & 0 deletions
26
events-collector/migrations/2024-09-11-045833_create_orders/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,26 @@ | ||
-- Your SQL goes here | ||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
CREATE TABLE "orders"( | ||
"order_id" UUID NOT NULL PRIMARY KEY, | ||
"wallet_id" UUID NOT NULL, | ||
"base_mint" TEXT NOT NULL, | ||
"quote_mint" TEXT NOT NULL, | ||
"is_sell" BOOL NOT NULL, | ||
"amount" NUMERIC NOT NULL, | ||
"amount_filled" NUMERIC NOT NULL, | ||
"created_at" TIMESTAMP NOT NULL, | ||
"last_updated_at" TIMESTAMP NOT NULL, | ||
"last_filled_at" TIMESTAMP NOT NULL, | ||
"ts" TIMESTAMP NOT NULL | ||
); | ||
|
14 changes: 14 additions & 0 deletions
14
events-collector/migrations/2024-09-11-050357_create_assets/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,14 @@ | ||
-- This file should undo anything in `up.sql` | ||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
DROP TABLE IF EXISTS "assets"; |
20 changes: 20 additions & 0 deletions
20
events-collector/migrations/2024-09-11-050357_create_assets/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,20 @@ | ||
-- Your SQL goes here | ||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
CREATE TABLE "assets"( | ||
"mint" TEXT NOT NULL PRIMARY KEY, | ||
"ticker" TEXT NOT NULL, | ||
"name" TEXT NOT NULL, | ||
"decimals" INT4 NOT NULL | ||
); | ||
|