Skip to content

Commit

Permalink
feat: db schema to store data fetched from contracts
Browse files Browse the repository at this point in the history
  • Loading branch information
agparadiso committed Dec 14, 2023
1 parent 71e1a79 commit 8718c46
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
17 changes: 17 additions & 0 deletions core/store/migrate/migrations/0215_functions_subscriptions.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
-- +goose Up
-- +goose StatementBegin
CREATE TABLE functions_subscriptions(
subscription_id bigint PRIMARY KEY,
owner_address bytea CHECK (octet_length(owner_address) = 20) NOT NULL,
balance bigint,
blocked_balance bigint,
proposed_owner bytea,
consumers bytea[],
flags bytea
);
-- +goose StatementEnd

-- +goose Down
-- +goose StatementBegin
DROP TABLE IF EXISTS functions_subscriptions;
-- +goose StatementEnd
11 changes: 11 additions & 0 deletions core/store/migrate/migrations/0216_functions_allowlist.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
-- +goose Up
-- +goose StatementBegin
CREATE TABLE functions_allowlist(
allowed_address bytea CHECK (octet_length(allowed_address) = 20) PRIMARY KEY
);
-- +goose StatementEnd

-- +goose Down
-- +goose StatementBegin
DROP TABLE IF EXISTS functions_allowlist;
-- +goose StatementEnd

0 comments on commit 8718c46

Please sign in to comment.