2024-03-10 16:41:42 +00:00
|
|
|
package models
|
|
|
|
|
|
|
|
import (
|
|
|
|
"time"
|
|
|
|
|
2024-03-11 11:50:07 +00:00
|
|
|
"github.com/shopspring/decimal"
|
|
|
|
|
2024-03-10 16:41:42 +00:00
|
|
|
"gorm.io/gorm"
|
2024-03-10 17:58:45 +00:00
|
|
|
"gorm.io/gorm/schema"
|
2024-03-10 16:41:42 +00:00
|
|
|
)
|
|
|
|
|
2024-03-10 17:58:45 +00:00
|
|
|
var _ schema.Tabler = (*SCPriceHistory)(nil)
|
|
|
|
|
2024-03-10 16:41:42 +00:00
|
|
|
func init() {
|
|
|
|
registerModel(&SCPriceHistory{})
|
|
|
|
}
|
|
|
|
|
|
|
|
type SCPriceHistory struct {
|
|
|
|
gorm.Model
|
2024-03-11 11:50:07 +00:00
|
|
|
CreatedAt time.Time `gorm:"index:idx_rate"`
|
2024-03-11 11:57:09 +00:00
|
|
|
Rate decimal.Decimal `gorm:"type:DECIMAL(30,20);index:idx_rate"`
|
2024-03-10 16:41:42 +00:00
|
|
|
}
|
2024-03-10 17:58:45 +00:00
|
|
|
|
|
|
|
func (SCPriceHistory) TableName() string {
|
|
|
|
return "sc_price_history"
|
|
|
|
}
|