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:
tinkle-community
2026-01-03 00:52:11 +08:00
parent 7df8197542
commit cc726adb57
6 changed files with 263 additions and 15 deletions

View File

@@ -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{})
}