sdec-brasil / old-dashboard

Painel de Controle Público do SDEC
MIT License
3 stars 0 forks source link

Table: block #15

Closed tloriato closed 5 years ago

tloriato commented 5 years ago

Reference #6

Original Abe:

DROP TABLE IF EXISTS `block`;

CREATE TABLE `block` (
  `block_id` decimal(14,0) NOT NULL,
  `block_hash` binary(32) NOT NULL,
  `block_version` decimal(10,0) DEFAULT NULL,
  `block_hashMerkleRoot` binary(32) DEFAULT NULL,
  `block_nTime` decimal(20,0) DEFAULT NULL,
  `block_nBits` decimal(10,0) DEFAULT NULL,
  `block_nNonce` decimal(10,0) DEFAULT NULL,
  `block_height` decimal(14,0) DEFAULT NULL,
  `prev_block_id` decimal(14,0) DEFAULT NULL,
  `search_block_id` decimal(14,0) DEFAULT NULL,
  `block_chain_work` binary(38) DEFAULT NULL,
  `block_value_in` decimal(30,0) DEFAULT NULL,
  `block_value_out` decimal(30,0) DEFAULT NULL,
  `block_total_satoshis` decimal(26,0) DEFAULT NULL,
  `block_total_seconds` decimal(20,0) DEFAULT NULL,
  `block_satoshi_seconds` decimal(28,0) DEFAULT NULL,
  `block_total_ss` decimal(28,0) DEFAULT NULL,
  `block_num_tx` decimal(10,0) NOT NULL,
  `block_ss_destroyed` decimal(28,0) DEFAULT NULL,
  PRIMARY KEY (`block_id`),
  UNIQUE KEY `block_hash` (`block_hash`),
  KEY `prev_block_id` (`prev_block_id`),
  KEY `search_block_id` (`search_block_id`),
  CONSTRAINT `block_ibfk_1` FOREIGN KEY (`prev_block_id`) REFERENCES `block` (`block_id`),
  CONSTRAINT `block_ibfk_2` FOREIGN KEY (`search_block_id`) REFERENCES `block` (`block_id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

Sequelize:

DROP TABLE IF EXISTS `block`;

CREATE TABLE `block` (
  `block_id` double NOT NULL,
  `block_hash` blob NOT NULL,
  `block_version` double DEFAULT NULL,
  `block_hash_merkle_root` blob,
  `block_n_time` double DEFAULT NULL,
  `block_n_bits` double DEFAULT NULL,
  `block_n_nonce` double DEFAULT NULL,
  `block_height` double DEFAULT NULL,
  `prev_block_id` double DEFAULT NULL,
  `search_block_id` double DEFAULT NULL,
  `block_chain_work` blob,
  `block_value_in` double DEFAULT NULL,
  `block_value_out` double DEFAULT NULL,
  `block_total_satoshis` double DEFAULT NULL,
  `block_total_seconds` double DEFAULT NULL,
  `block_satoshi_seconds` double DEFAULT NULL,
  `block_total_ss` double DEFAULT NULL,
  `block_num_tx` double NOT NULL,
  `block_ss_destroyed` double DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  PRIMARY KEY (`block_id`),
  KEY `prev_block_id` (`prev_block_id`),
  KEY `search_block_id` (`search_block_id`),
  CONSTRAINT `block_ibfk_1` FOREIGN KEY (`prev_block_id`) REFERENCES `block` (`block_id`),
  CONSTRAINT `block_ibfk_2` FOREIGN KEY (`search_block_id`) REFERENCES `block` (`block_id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;