web3-proxy/migration/first_draft.sql

46 lines
1015 B
MySQL
Raw Normal View History

2022-07-26 07:53:38 +03:00
CREATE TABLE users (
id SERIAL PRIMARY KEY,
2022-08-03 03:27:26 +03:00
primary_chain INT,
2022-07-26 07:53:38 +03:00
primary_address VARCHAR(42),
description VARCHAR(255),
email VARCHAR(320),
)
2022-07-26 07:58:37 +03:00
-- TODO: foreign keys
2022-07-26 07:53:38 +03:00
-- TODO: how should we store addresses?
-- TODO: creation time?
-- TODO: permissions. likely similar to infura
CREATE TABLE secondary_users (
id SERIAL PRIMARY KEY,
users_id BIGINT,
secondary_address VARCHAR(42),
2022-08-03 03:27:26 +03:00
secondary_chain INT,
2022-07-26 07:53:38 +03:00
description VARCHAR,
email VARCHAR(320),
)
-- TODO: creation time?
CREATE TABLE blocklist (
id SERIAL PRIMARY KEY,
blocked_address VARCHAR,
chain INT,
reason TEXT,
)
2022-07-26 07:58:37 +03:00
-- TODO: foreign keys
2022-07-26 07:53:38 +03:00
-- TODO: index on api_key
-- TODO: what size for api_key
-- TODO: track active with a timestamp?
-- TODO: creation time?
-- TODO: requests_per_second INT,
-- TODO: requests_per_day INT,
-- TODO: more security features. likely similar to infura
CREATE TABLE user_keys (
id SERIAL PRIMARY KEY,
users_id BIGINT,
api_key VARCHAR,
description VARCHAR,
private_txs BOOLEAN,
active BOOLEAN,
)