ipld-eth-server/db/migrations/20180823160858_create_token_allowance_table.up.sql

11 lines
407 B
SQL

CREATE TABLE token_allowance (
id SERIAL,
block_id INTEGER NOT NULL,
allowance DECIMAL NOT NULL,
token_address CHARACTER VARYING(66) NOT NULL,
token_holder_address CHARACTER VARYING(66) NOT NULL,
token_spender_address CHARACTER VARYING(66) NOT NULL,
CONSTRAINT blocks_fk FOREIGN KEY (block_id)
REFERENCES blocks (id)
ON DELETE CASCADE
)