蛋蛋星球 后台端
25개 이상의 토픽을 선택하실 수 없습니다. Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

cmd_db.sh 466 B

1 개월 전
123456789101112131415161718192021
  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