sdec-brasil / old-dashboard

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

Table: asset_address_balance #13

Closed tloriato closed 5 years ago

tloriato commented 5 years ago

Reference #6

Original Abe:

DROP TABLE IF EXISTS `asset_address_balance`;

CREATE TABLE `asset_address_balance` (
  `asset_id` decimal(10,0) NOT NULL,
  `pubkey_id` decimal(26,0) NOT NULL,
  `balance` decimal(30,0) NOT NULL,
  PRIMARY KEY (`asset_id`,`pubkey_id`),
  KEY `pubkey_id` (`pubkey_id`),
  CONSTRAINT `asset_address_balance_ibfk_1` FOREIGN KEY (`asset_id`) REFERENCES `asset` (`asset_id`),
  CONSTRAINT `asset_address_balance_ibfk_2` FOREIGN KEY (`pubkey_id`) REFERENCES `pubkey` (`pubkey_id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

Sequelize:

CREATE TABLE `asset_address_balance` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `asset_id` double NOT NULL,
  `pubkey_id` double NOT NULL,
  `balance` double NOT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  PRIMARY KEY (`id`),
  KEY `asset_id` (`asset_id`),
  KEY `pubkey_id` (`pubkey_id`),
  CONSTRAINT `asset_address_balance_ibfk_1` FOREIGN KEY (`asset_id`) REFERENCES `asset` (`asset_id`),
  CONSTRAINT `asset_address_balance_ibfk_2` FOREIGN KEY (`pubkey_id`) REFERENCES `pubkey` (`pubkey_id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;