arnaucube
arnaucube/hermez-nodePublic Self-hosted repository
hermez-node/db/l2db/migrations/001_init.sql
db/l2db/migrations/001_init.sqlRaw
 1-- +migrate Up
 2CREATE TABLE tx_pool (
 3    tx_id BYTEA PRIMARY KEY,
 4    from_idx BIGINT NOT NULL,
 5    to_idx BIGINT NOT NULL,
 6    to_eth_addr BYTEA NOT NULL,
 7    to_bjj BYTEA NOT NULL,
 8    token_id INT NOT NULL,
 9    amount BYTEA NOT NULL,
10    fee SMALLINT NOT NULL,
11    nonce BIGINT NOT NULL,
12    state CHAR(4) NOT NULL,
13    batch_num BIGINT,
14    rq_from_idx BIGINT,
15    rq_to_idx BIGINT,
16    rq_to_eth_addr BYTEA,
17    rq_to_bjj BYTEA,
18    rq_token_id INT,
19    rq_amount BYTEA,
20    rq_fee SMALLINT,
21    rq_nonce BIGINT,
22    signature BYTEA NOT NULL,
23    timestamp TIMESTAMP WITHOUT TIME ZONE NOT NULL,
24    absolute_fee NUMERIC,
25    absolute_fee_update TIMESTAMP WITHOUT TIME ZONE,
26    tx_type VARCHAR(40) NOT NULL
27);
28
29CREATE TABLE account_creation_auth (
30    eth_addr BYTEA PRIMARY KEY,
31    bjj BYTEA NOT NULL,
32    account_creation_auth_sig BYTEA NOT NULL,
33    timestamp TIMESTAMP WITHOUT TIME ZONE NOT NULL
34);
35
36-- +migrate Down
37DROP TABLE account_creation_auth;
38DROP TABLE tx_pool;