2018-09-05 00:40:14 +02:00
|
|
|
const getterMethods = {
|
|
|
|
// Add as needed, prefix all methods with `generated`
|
|
|
|
}
|
|
|
|
|
|
|
|
export default (sequelize, {
|
2018-10-08 19:14:31 +02:00
|
|
|
BOOLEAN,
|
|
|
|
DATE,
|
|
|
|
DECIMAL,
|
|
|
|
INTEGER,
|
|
|
|
STRING,
|
|
|
|
TEXT,
|
2018-09-05 00:40:14 +02:00
|
|
|
}) => sequelize.define(
|
|
|
|
'block',
|
|
|
|
{
|
|
|
|
id: {
|
|
|
|
primaryKey: true,
|
|
|
|
type: INTEGER,
|
|
|
|
set() { },
|
|
|
|
},
|
|
|
|
bits: {
|
|
|
|
type: STRING,
|
|
|
|
set() { },
|
|
|
|
},
|
|
|
|
chainwork: {
|
|
|
|
type: STRING,
|
|
|
|
set() { },
|
|
|
|
},
|
|
|
|
confirmations: {
|
|
|
|
type: STRING,
|
|
|
|
set() { },
|
|
|
|
},
|
|
|
|
difficulty: {
|
|
|
|
type: STRING,
|
|
|
|
set() { },
|
|
|
|
},
|
|
|
|
hash: {
|
|
|
|
type: STRING,
|
|
|
|
set() { },
|
|
|
|
},
|
|
|
|
height: {
|
|
|
|
type: STRING,
|
|
|
|
set() { },
|
|
|
|
},
|
|
|
|
merkle_root: {
|
|
|
|
type: STRING,
|
|
|
|
set() { },
|
|
|
|
},
|
|
|
|
name_claim_root: {
|
|
|
|
type: STRING,
|
|
|
|
set() { },
|
|
|
|
},
|
|
|
|
nonce: {
|
|
|
|
type: STRING,
|
|
|
|
set() { },
|
|
|
|
},
|
|
|
|
previous_block_hash: {
|
|
|
|
type: STRING,
|
|
|
|
set() { },
|
|
|
|
},
|
|
|
|
next_block_hash: {
|
|
|
|
type: STRING,
|
|
|
|
set() { },
|
|
|
|
},
|
|
|
|
block_size: {
|
|
|
|
type: STRING,
|
|
|
|
set() { },
|
|
|
|
},
|
|
|
|
block_time: {
|
|
|
|
type: STRING,
|
|
|
|
set() { },
|
|
|
|
},
|
|
|
|
version: {
|
|
|
|
type: STRING,
|
|
|
|
set() { },
|
|
|
|
},
|
|
|
|
version_hex: {
|
|
|
|
type: STRING,
|
|
|
|
set() { },
|
|
|
|
},
|
|
|
|
transaction_hashes: {
|
|
|
|
type: STRING,
|
|
|
|
set() { },
|
|
|
|
},
|
|
|
|
transactions_processed: {
|
|
|
|
type: STRING,
|
|
|
|
set() { },
|
|
|
|
},
|
|
|
|
created_at: {
|
2018-10-08 19:14:31 +02:00
|
|
|
type: DATE(6),
|
2018-09-05 00:40:14 +02:00
|
|
|
set() { },
|
|
|
|
},
|
|
|
|
modified_at: {
|
2018-10-08 19:14:31 +02:00
|
|
|
type: DATE(6),
|
2018-09-05 00:40:14 +02:00
|
|
|
set() { },
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
freezeTableName: true,
|
2018-09-26 03:20:59 +02:00
|
|
|
//getterMethods,
|
2018-09-05 00:40:14 +02:00
|
|
|
timestamps: false, // don't use default timestamps columns
|
|
|
|
}
|
|
|
|
);
|