mirror of
https://github.com/NoFxAiOS/nofx.git
synced 2026-07-16 01:06:59 +08:00
feat: add strategy publish settings and reorder navigation
- Add is_public and config_visible fields to Strategy type - Add PublishSettingsEditor component for strategy studio - Enable GORM AutoMigrate to add new columns - Reorder nav: Market → Config → Dashboard → Strategy → Leaderboard → Arena → Backtest → FAQ - Rename Live to Leaderboard, Debate Arena to Arena
This commit is contained in:
@@ -172,14 +172,7 @@ func NewStrategyStore(db *gorm.DB) *StrategyStore {
|
||||
}
|
||||
|
||||
func (s *StrategyStore) initTables() error {
|
||||
// For PostgreSQL with existing table, skip AutoMigrate
|
||||
if s.db.Dialector.Name() == "postgres" {
|
||||
var tableExists int64
|
||||
s.db.Raw(`SELECT COUNT(*) FROM information_schema.tables WHERE table_name = 'strategies'`).Scan(&tableExists)
|
||||
if tableExists > 0 {
|
||||
return nil
|
||||
}
|
||||
}
|
||||
// AutoMigrate will add missing columns without dropping existing data
|
||||
return s.db.AutoMigrate(&Strategy{})
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user