Skip to content

Commit

Permalink
Use z prefix
Browse files Browse the repository at this point in the history
  • Loading branch information
akrambek committed Dec 18, 2024
1 parent 74edc57 commit c070c40
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ A Stream creates the topic and CRUD APIs to produce and fetch data.
*/

-- A table to store user data
CREATE TABLE streampay_users(
CREATE ZTABLE streampay_users(
id VARCHAR,
name VARCHAR,
username VARCHAR,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ CREATE STREAM streampay_commands(
zilla_timestamp TIMESTAMP
);

CREATE MATERIALIZED VIEW IF NOT EXISTS streampay_replies AS
CREATE ZVIEW IF NOT EXISTS streampay_replies AS
SELECT '400' AS status, encode(zilla_correlation_id, 'escape') AS correlation_id from streampay_commands where type NOT IN ('SendPayment', 'RequestPayment', 'RejectRequest')
UNION
SELECT '200' AS status, encode(zilla_correlation_id, 'escape') AS correlation_id from streampay_commands where type IN ('SendPayment', 'RequestPayment', 'RejectRequest');
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ CREATE VIEW all_user_transactions AS
FROM
user_transactions;

CREATE MATERIALIZED VIEW streampay_balances AS
CREATE ZVIEW streampay_balances AS
SELECT
user_id,
SUM(net_amount) AS balance
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
-- create_activities

CREATE MATERIALIZED VIEW streampay_activities AS
CREATE ZVIEW streampay_activities AS
SELECT
generate_unique_id()::varchar AS id,
'PaymentSent' AS eventName,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ CREATE VIEW status_updates AS
sc.type IN ('SendPayment', 'RejectRequest')
AND (sc.request_id IS NOT NULL AND sc.request_id <> '');

CREATE MATERIALIZED VIEW streampay_payment_requests AS
CREATE ZVIEW streampay_payment_requests AS
SELECT
rp.id,
rp.from_user_id,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
CREATE FUNCTION assess_fraud(varchar, varchar, double precision) RETURNS struct<summary varchar, risk varchar>
LANGUAGE python AS 'assess_fraud';

CREATE MATERIALIZED VIEW streampay_payment_risk_assessment AS
CREATE ZVIEW streampay_payment_risk_assessment AS
SELECT
ar.id,
ar.to_user_id_identity,
Expand Down

0 comments on commit c070c40

Please sign in to comment.