您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

recreate_project_tables.sh 642B

1234567891011121314151617181920
  1. #!/usr/bin/env bash
  2. # For dropping and recreating all tables of a specified shop
  3. if [ $# -ne 1 ]
  4. then
  5. printf "Please specify a project folder\n"
  6. exit 1
  7. fi
  8. PROJECT_FOLDER=`basename $1`
  9. MANAGE_COMMAND=$PROJECT_FOLDER/manage.py
  10. if [ ! -f $MANAGE_COMMAND ]
  11. then
  12. printf "$MANAGE_COMMAND cannot be found\n"
  13. fi
  14. echo "Recreating all tables in $PROJECT_FOLDER"
  15. echo "Dropping tables"
  16. $MANAGE_COMMAND sqlclear customer promotions analytics payment reviews offer shipping order basket partner address catalogue datacash | \
  17. awk 'BEGIN {print "set foreign_key_checks=0;"} {print $0}' | \
  18. $MANAGE_COMMAND dbshell && \
  19. $MANAGE_COMMAND syncdb