fix bug
This commit is contained in:
@@ -5,7 +5,7 @@ import (
|
||||
)
|
||||
|
||||
// LastDaily 股票日线数据
|
||||
type LastDaily struct {
|
||||
type StockDaily struct {
|
||||
ID uint `gorm:"primarykey;autoIncrement" json:"id"`
|
||||
TsCode string `gorm:"type:varchar(20);not null;index:idx_ts_code;comment:股票代码" json:"ts_code"`
|
||||
TradeDate string `gorm:"type:date;not null;index:idx_trade_date;comment:交易日期" json:"trade_date"`
|
||||
@@ -21,10 +21,10 @@ type LastDaily struct {
|
||||
}
|
||||
|
||||
func init() {
|
||||
database.AppendMigrate(&LastDaily{})
|
||||
database.AppendMigrate(&StockDaily{})
|
||||
}
|
||||
|
||||
// TableName 指定表名
|
||||
func (LastDaily) TableName() string {
|
||||
return "last_daily"
|
||||
func (StockDaily) TableName() string {
|
||||
return "stock_daily"
|
||||
}
|
||||
@@ -4,8 +4,8 @@ import (
|
||||
"git.apinb.com/bsm-sdk/core/database"
|
||||
)
|
||||
|
||||
// LastIndicator 股票日线数据模型
|
||||
type LastIndicator struct {
|
||||
// StockIndicator 股票日线数据模型
|
||||
type StockIndicator struct {
|
||||
ID uint `gorm:"primarykey;autoIncrement"`
|
||||
TsCode string `gorm:"type:varchar(20);not null;comment:TS股票代码;index:idx_ts_code"`
|
||||
TradeDate string `gorm:"type:date;not null;comment:交易日期;index:idx_trade_date;index:idx_ts_trade,priority:2"`
|
||||
@@ -28,10 +28,10 @@ type LastIndicator struct {
|
||||
}
|
||||
|
||||
func init() {
|
||||
database.AppendMigrate(&LastIndicator{})
|
||||
database.AppendMigrate(&StockIndicator{})
|
||||
}
|
||||
|
||||
// TableName 设置表名
|
||||
func (LastIndicator) TableName() string {
|
||||
return "last_indicator"
|
||||
func (StockIndicator) TableName() string {
|
||||
return "stock_indicator"
|
||||
}
|
||||
Reference in New Issue
Block a user