kaspad/apiserver/migrations/000002_create_parent_blocks_table.up.sql
Ori Newman ae25ec2e6b [NOD-303] Implement get transaction by id for api server (#391)
* [NOD-303] Implement get transaction by id for api server

* [NOD-303] Make routeParamTxID a constant

* [NOD-303] Change database is not current error.

* [NOD-303] Add ID to TransactionInput and TransactionOutput models

* [NOD-303] Change transactions_outputs table name to transaction_outputs and transactions_inputs to transaction_inputs

* [NOD-303] Add json annotations to transaction response types

* [NOD-303] Split server package

* [NOD-303] Add GetTransactionByHashHandler

* [NOD-303] Add comments to exported functions and variables

* [NOD-303] Put response types in a separate file

* [NOD-303] Rename functions
2019-09-03 15:54:59 +03:00

13 lines
424 B
SQL

CREATE TABLE `parent_blocks`
(
`block_id` BIGINT UNSIGNED NOT NULL,
`parent_block_id` BIGINT UNSIGNED NOT NULL,
PRIMARY KEY (`block_id`, `parent_block_id`),
CONSTRAINT `fk_parent_blocks_block_id`
FOREIGN KEY (`block_id`)
REFERENCES `blocks` (`id`),
CONSTRAINT `fk_parent_blocks_parent_block_id`
FOREIGN KEY (`parent_block_id`)
REFERENCES `blocks` (`id`)
);