actually add the files

This commit is contained in:
Bryan Stitt 2022-07-26 00:38:32 +00:00
parent 4ec10e7a98
commit c685ec41b8
6 changed files with 56 additions and 0 deletions

1
.env Normal file

@ -0,0 +1 @@
DATABASE_URL=mysql://root:dev_web3_proxy@127.0.0.1:3306/web3_proxy

5
diesel.toml Normal file

@ -0,0 +1,5 @@
# For documentation on how to configure this file,
# see diesel.rs/guides/configuring-diesel-cli
[print_schema]
file = "src/schema.rs"

5
web3-proxy/diesel.toml Normal file

@ -0,0 +1,5 @@
# For documentation on how to configure this file,
# see diesel.rs/guides/configuring-diesel-cli
[print_schema]
file = "src/schema.rs"

@ -0,0 +1,4 @@
DROP TABLE users;
DROP TABLE secondary_users;
DROP TABLE blocklist;
DROP TABLE user_keys;

@ -0,0 +1,41 @@
CREATE TABLE users (
id SERIAL PRIMARY KEY,
primary_address VARCHAR NOT NULL,
chain INT NOT NULL,
description VARCHAR,
email VARCHAR DEFAULT NULL,
)
CREATE TABLE secondary_users (
id SERIAL PRIMARY KEY,
-- TODO: foreign key
user_id INT,
-- TODO: how should we store addresses?
secondary_address VARCHAR NOT NULL,
chain INT NOT NULL,
description VARCHAR,
-- TODO: creation time?
-- TODO: permissions. likely similar to infura
)
CREATE TABLE blocklist (
id SERIAL PRIMARY KEY,
-- TODO: creation time?
blocked_address VARCHAR NOT NULL,
chain INT NOT NULL,
reason TEXT,
)
CREATE TABLE user_keys (
id SERIAL PRIMARY KEY,
-- TODO: foreign key
user_id BIGINT,
api_key VARCHAR,
name VARCHAR,
private_txs BOOLEAN,
active BOOLEAN,
-- TODO: creation time?
-- TODO: requests_per_second INT,
-- TODO: requests_per_day INT,
-- TODO: more security features. likely similar to infura
)