Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
Your Name committed Jan 5, 2024
1 parent e65ac66 commit af732a9
Showing 1 changed file with 0 additions and 19 deletions.
19 changes: 0 additions & 19 deletions types/dbtables/auto_create_table.go
Original file line number Diff line number Diff line change
@@ -1,34 +1,15 @@
package dbtables

import (
"github.com/yzimhao/trading_engine/utils/app"
"xorm.io/xorm"
)

func AutoCreateTable(db *xorm.Session, bean any) error {
table := db.Engine().TableName(bean)

app.Logger.Debugf("auto create table_name: %s", table)

if !Exist(db, table) {
if err := db.Engine().Sync2(bean); err != nil {
return err
}

// err := db.CreateTable(bean)
// if err != nil {
// return err
// }

// err = db.CreateIndexes(bean)
// if err != nil {
// return err
// }

// err = db.CreateUniques(bean)
// if err != nil {
// return err
// }
}
return nil
}

0 comments on commit af732a9

Please sign in to comment.