广告平台(总站长使用)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

21 lines
466 B

  1. #!/bin/bash
  2. # 使用方法, 直接执行该脚本更新所有表, cmd_db.sh 表名, 如 ./cmd_db.sh tableName
  3. Table=*
  4. TName=""
  5. if [ "$1" ] ;then
  6. Table=$1
  7. TName="^$1$"
  8. fi
  9. BasePath="./"
  10. DBUSER="root"
  11. DBPSW="Fnuo123com@"
  12. DBNAME="fnuoos_test1"
  13. DBHOST="119.23.182.117"
  14. DBPORT="3306"
  15. rm -rf $BasePath/app/db/model/$Table.go && \
  16. xorm reverse mysql "$DBUSER:$DBPSW@tcp($DBHOST:$DBPORT)/$DBNAME?charset=utf8" $BasePath/etc/db_tpl $BasePath/app/db/model/ $TName