Skip to content

Commit

Permalink
Address assorted review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
alnoki committed Oct 2, 2023
1 parent 48c0d25 commit 66df051
Show file tree
Hide file tree
Showing 8 changed files with 27 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,13 @@
DROP TRIGGER change_order_size_events_trigger ON change_order_size_events;
DROP FUNCTION notify_change_order_size_event;
DROP TABLE change_order_size_events;
DROP VIEW api.change_order_size_events;


DROP TRIGGER place_market_order_events_trigger ON place_market_order_events;
DROP FUNCTION notify_place_market_order_event;
DROP TABLE place_market_order_events;
DROP VIEW api.place_market_order_events;


DROP TRIGGER place_swap_order_events_trigger ON place_swap_order_events;
DROP FUNCTION notify_place_swap_order_event;
DROP TABLE place_swap_order_events;
DROP VIEW api.place_swap_order_events;
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
-- Table drop generated via diesel migration generate --diff-schema
-- View drop generated manually
-- Table drop generated via diesel migration generate --diff-schema.
-- View drops generated manually.
DROP TABLE IF EXISTS "market_account_handles";
DROP VIEW api.market_account_handles;

-- Old view drops that should've been in prior migrations.
DROP VIEW api.change_order_size_events;
DROP VIEW api.place_market_order_events;
DROP VIEW api.place_swap_order_events;
Original file line number Diff line number Diff line change
@@ -1,9 +1,19 @@
-- Table generated via diesel migration generate --diff-schema
-- View generated manually
-- Table generated via diesel migration generate --diff-schema.
-- Views generated manually.
CREATE TABLE "market_account_handles"(
"user" VARCHAR(70) NOT NULL PRIMARY KEY,
"handle" VARCHAR(70) NOT NULL
);

CREATE VIEW api.market_account_handles AS SELECT * FROM market_account_handles;
GRANT SELECT ON api.market_account_handles TO web_anon;
GRANT SELECT ON api.market_account_handles TO web_anon;

-- Missing views that should've been in prior migrations
CREATE VIEW api.change_order_size_events AS SELECT * FROM change_order_size_events;
GRANT SELECT ON api.change_order_size_events TO web_anon;

CREATE VIEW api.place_market_order_events AS SELECT * FROM place_market_order_events;
GRANT SELECT ON api.place_market_order_events TO web_anon;

CREATE VIEW api.place_swap_order_events AS SELECT * FROM place_swap_order_events;
GRANT SELECT ON api.place_swap_order_events TO web_anon;
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
-- Table drop generated via diesel migration generate --diff-schema
-- View drops generated manually
-- Table drop generated via diesel migration generate --diff-schema.
-- View drops generated manually.
DROP TABLE IF EXISTS "balance_updates_by_handle";
DROP VIEW api.balance_updates_by_handle;
DROP VIEW api.balance_updates;
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
-- Table generated via diesel migration generate --diff-schema
-- View generated manually
-- Table generated via diesel migration generate --diff-schema.
-- Views generated manually.
CREATE TABLE "balance_updates_by_handle"(
"txn_version" NUMERIC NOT NULL,
"handle" VARCHAR(70) NOT NULL,
Expand Down
1 change: 1 addition & 0 deletions src/rust/dbv2/src/models.rs
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ pub struct CancelOrderEvent {
pub struct MarketAccountHandle {
pub user: String,
pub handle: String,
pub creation_time: DateTime<Utc>,
}

#[derive(Clone, Debug, Queryable, Selectable, Insertable)]
Expand Down
1 change: 1 addition & 0 deletions src/rust/dbv2/src/schema.rs
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@ diesel::table! {
user -> Varchar,
#[max_length = 70]
handle -> Varchar,
creation_time -> Timestamptz,
}
}

Expand Down

0 comments on commit 66df051

Please sign in to comment.