From a3dbf07b699bc65b58a24364ad6a173a8a370299 Mon Sep 17 00:00:00 2001 From: jejolare Date: Thu, 26 Sep 2024 18:23:50 +0700 Subject: [PATCH] update timestamp type --- server/schemes/AltBlock.ts | 4 ++-- server/schemes/Block.ts | 4 ++-- server/schemes/Pool.ts | 4 ++-- server/schemes/Transaction.ts | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/server/schemes/AltBlock.ts b/server/schemes/AltBlock.ts index fbd72a5..df9765c 100644 --- a/server/schemes/AltBlock.ts +++ b/server/schemes/AltBlock.ts @@ -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 }, diff --git a/server/schemes/Block.ts b/server/schemes/Block.ts index d665bae..f724cb8 100644 --- a/server/schemes/Block.ts +++ b/server/schemes/Block.ts @@ -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 }, diff --git a/server/schemes/Pool.ts b/server/schemes/Pool.ts index 6031f86..130bd0e 100644 --- a/server/schemes/Pool.ts +++ b/server/schemes/Pool.ts @@ -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, diff --git a/server/schemes/Transaction.ts b/server/schemes/Transaction.ts index 75e76ba..2191a18 100644 --- a/server/schemes/Transaction.ts +++ b/server/schemes/Transaction.ts @@ -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 } }, {