update timestamp type

This commit is contained in:
jejolare 2024-09-26 18:23:50 +07:00
parent 8caba34d89
commit a3dbf07b69
4 changed files with 8 additions and 8 deletions

View file

@ -4,7 +4,7 @@ import sequelize from "../database/sequelize";
class AltBlock extends Model {
declare readonly id: number;
declare height: number;
declare timestamp: Date;
declare timestamp: BigInt;
declare actual_timestamp: BigInt;
declare size: BigInt;
declare hash: string;
@ -33,7 +33,7 @@ AltBlock.init(
{
id: { type: DataTypes.INTEGER, primaryKey: true, autoIncrement: true },
height: { type: DataTypes.INTEGER, allowNull: false },
timestamp: { type: DataTypes.DATE, allowNull: false },
timestamp: { type: DataTypes.BIGINT, allowNull: false },
actual_timestamp: { type: DataTypes.BIGINT, allowNull: true },
size: { type: DataTypes.BIGINT, allowNull: true },
hash: { type: DataTypes.STRING, allowNull: true },

View file

@ -20,7 +20,7 @@ class Block extends Model {
declare prev_id: string;
declare summary_reward: string;
declare this_block_fee_median: string;
declare timestamp: Date;
declare timestamp: BigInt;
declare total_fee: string;
declare total_txs_size: string;
declare tr_count: string;
@ -56,7 +56,7 @@ Block.init(
prev_id: { type: DataTypes.STRING, allowNull: true },
summary_reward: { type: DataTypes.TEXT, allowNull: true },
this_block_fee_median: { type: DataTypes.TEXT, allowNull: true },
timestamp: { type: DataTypes.DATE, allowNull: true },
timestamp: { type: DataTypes.BIGINT, allowNull: true },
total_fee: { type: DataTypes.TEXT, allowNull: true },
total_txs_size: { type: DataTypes.TEXT, allowNull: true },
tr_count: { type: DataTypes.TEXT, allowNull: true },

View file

@ -6,7 +6,7 @@ class Pool extends Model {
declare blob_size: number;
declare fee: number;
declare tx_id: string;
declare timestamp: Date;
declare timestamp: BigInt;
declare readonly createdAt: Date;
declare readonly updatedAt: Date;
@ -18,7 +18,7 @@ Pool.init(
blob_size: { type: DataTypes.INTEGER, allowNull: true },
fee: { type: DataTypes.DOUBLE, allowNull: true },
tx_id: { type: DataTypes.STRING, allowNull: true },
timestamp: { type: DataTypes.DATE, allowNull: true }
timestamp: { type: DataTypes.BIGINT, allowNull: true }
},
{
sequelize,

View file

@ -13,7 +13,7 @@ class Transaction extends Model {
declare ins: string;
declare outs: string;
declare pub_key: string;
declare timestamp: Date;
declare timestamp: BigInt;
declare attachments: string;
@ -36,7 +36,7 @@ Transaction.init(
ins: { type: DataTypes.TEXT, allowNull: true },
outs: { type: DataTypes.TEXT, allowNull: true },
pub_key: { type: DataTypes.TEXT, allowNull: true },
timestamp: { type: DataTypes.DATE, allowNull: true },
timestamp: { type: DataTypes.BIGINT, allowNull: true },
attachments: { type: DataTypes.TEXT, allowNull: true }
},
{