Files
scroll/database/migrate/migrations/00007_transaction.sql
2023-04-03 20:10:13 +08:00

27 lines
687 B
SQL

-- +goose Up
-- +goose StatementBegin
create table transaction
(
id VARCHAR NOT NULL,
tx_hash VARCHAR NOT NULL,
sender VARCHAR NOT NULL,
nonce BIGINT NOT NULL,
target VARCHAR DEFAULT '',
value VARCHAR NOT NULL,
data BYTEA DEFAULT NULL,
created_time TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP
);
create unique index transaction_id_uindex
on transaction (id);
create unique index transaction_tx_hash_uindex
on transaction (tx_hash);
-- +goose StatementEnd
-- +goose Down
-- +goose StatementBegin
drop table if exists transaction;
-- +goose StatementEnd