From de5a89c3c196fba8a1b3a3e159b753f659daf97a Mon Sep 17 00:00:00 2001 From: trkhoi Date: Fri, 1 Dec 2023 14:11:47 +0700 Subject: [PATCH] fix: add fields moniker default --- .../schemas/20231201140808-add_address_native_token.sql | 7 +++++++ pkg/model/offchain_tip_bot_token.go | 2 ++ 2 files changed, 9 insertions(+) create mode 100644 migrations/schemas/20231201140808-add_address_native_token.sql diff --git a/migrations/schemas/20231201140808-add_address_native_token.sql b/migrations/schemas/20231201140808-add_address_native_token.sql new file mode 100644 index 00000000..2d9d400f --- /dev/null +++ b/migrations/schemas/20231201140808-add_address_native_token.sql @@ -0,0 +1,7 @@ + +-- +migrate Up +alter table offchain_tip_bot_tokens add column address text; +alter table offchain_tip_bot_tokens add column is_native boolean default false; +-- +migrate Down +alter table offchain_tip_bot_tokens drop column address; +alter table offchain_tip_bot_tokens drop column is_native; diff --git a/pkg/model/offchain_tip_bot_token.go b/pkg/model/offchain_tip_bot_token.go index 8c69a9a3..bc6c38e2 100644 --- a/pkg/model/offchain_tip_bot_token.go +++ b/pkg/model/offchain_tip_bot_token.go @@ -21,6 +21,8 @@ type OffchainTipBotToken struct { ServiceFee float64 `json:"service_fee"` TokenPrice float64 `json:"token_price" gorm:"-"` ChainId string `json:"chain_id"` + Address string `json:"address"` + IsNative bool `json:"is_native"` } func (OffchainTipBotToken) TableName() string {