Skip to content

Commit

Permalink
Merge pull request #74 from flashburst/chore/cleanup
Browse files Browse the repository at this point in the history
Updated core.transactions and remove unused code
  • Loading branch information
rudolfnep authored Jun 19, 2024
2 parents a6fe86f + 02f63ad commit 54fc499
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 95 deletions.
50 changes: 2 additions & 48 deletions build/db.sql
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,6 @@ END
$$
LANGUAGE plpgsql;

CREATE TABLE core.locks
(
namespace text NOT NULL PRIMARY KEY,
started_on integer NOT NULL DEFAULT(extract(epoch FROM NOW() AT TIME ZONE 'UTC'))
);

CREATE TABLE core.transactions
(
Expand All @@ -84,6 +79,8 @@ CREATE TABLE core.transactions
transaction_stablecoin_amount uint256,
transaction_npm_amount uint256,
gas_price uint256,
log_index integer,
interface_name text,
event_name text,
coupon_code text,
ck text,
Expand Down Expand Up @@ -7305,49 +7302,6 @@ ON meta.locks (LOWER(project_id));

-- SELECT * FROM meta.locks;

CREATE TABLE IF NOT EXISTS meta.progress_tracker
(
project_id text PRIMARY KEY NOT NULL,
synced_upto_block_number integer,
synced_upto_log_index integer
);

CREATE UNIQUE INDEX IF NOT EXISTS progress_tracker_project_id_uix
ON meta.progress_tracker (LOWER(project_id));

CREATE OR REPLACE FUNCTION meta.update_progress
(
_project_id text,
_block_number integer,
_log_index integer
)
RETURNS void
AS
$$
BEGIN
INSERT INTO meta.progress_tracker
(
project_id,
synced_upto_block_number,
synced_upto_log_index
)
VALUES
(
_project_id,
_block_number,
_log_index
)
ON CONFLICT (project_id)
DO UPDATE
SET
synced_upto_block_number = _block_number,
synced_upto_log_index = _log_index;
END
$$
LANGUAGE plpgsql;

-- SELECT * FROM meta.progress_tracker;

GRANT USAGE ON SCHEMA vault TO readonlyuser;
GRANT USAGE ON SCHEMA ve TO readonlyuser;
GRANT USAGE ON SCHEMA strategy TO readonlyuser;
Expand Down
42 changes: 0 additions & 42 deletions sql/base/_meta/03-progress-tracker.sql

This file was deleted.

7 changes: 2 additions & 5 deletions sql/rds.sql
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,6 @@ END
$$
LANGUAGE plpgsql;

CREATE TABLE core.locks
(
namespace text NOT NULL PRIMARY KEY,
started_on integer NOT NULL DEFAULT(extract(epoch FROM NOW() AT TIME ZONE 'UTC'))
);

CREATE TABLE core.transactions
(
Expand All @@ -84,6 +79,8 @@ CREATE TABLE core.transactions
transaction_stablecoin_amount uint256,
transaction_npm_amount uint256,
gas_price uint256,
log_index integer,
interface_name text,
event_name text,
coupon_code text,
ck text,
Expand Down

0 comments on commit 54fc499

Please sign in to comment.