home *** CD-ROM | disk | FTP | other *** search
/ OpenStep (Enterprise) / OpenStepENTCD.toast / OEDEV / EODEV.Z / drop_database < prev    next >
Encoding:
Text File  |  1996-08-24  |  1.6 KB  |  56 lines

  1. #!/bin/sh
  2.  
  3. #
  4. # Loop through arguments and set initial values
  5. #
  6. while test $# -gt 0
  7. do
  8.     case $1 in
  9.     -#)
  10.         set -x;;
  11.     esac
  12.     shift
  13. done    
  14.  
  15. #
  16. # NEXT_EOUTIL_PATH should only be set for debugging purposes by Next
  17. # Developers Setting this environment variable in customer sites will cause
  18. # this installation to fail.
  19. #
  20. masterDir=${NEXT_ROOT}/NextDeveloper/Examples/EnterpriseObjects
  21. EOUTIL=${NEXT_EOUTIL_PATH-${NEXT_ROOT}/NextDeveloper/Examples/EnterpriseObjects/DatabaseSetUp/eoutil}
  22.  
  23. #
  24. # Get the current working directory and verify that we're in the right place
  25. #
  26. exepath=`echo $0`
  27. basename=`basename $exepath`
  28. currDir=`echo $exepath | sed -e s,$basename\$,, | sed -e s,/\$,,`
  29. if test ! -z "$currDir"; then
  30.     cd $currDir
  31. fi
  32. currDir=`pwd`
  33.  
  34. if test ! -d ../BusinessLogic -o ! -f MovieData.plist; then
  35.     echo ""
  36.     echo "You must be in the 'DatabaseSetUp' directory of the *copied*"
  37.     echo "examples directory in order to run this script, please cd to that"
  38.     echo "directory and execute this script again."
  39.     exit 1;
  40. fi
  41.     
  42. if test $"currDir" = $"masterDir/DatabaseSetUp"; then
  43.     echo ""
  44.     echo "Cannot drop data from $masterDir. Please copy the examples and cd to"
  45.     echo "the copied directory. Configure the examples by running configure_examples"
  46.     echo "and execute this script again."
  47.     exit 1
  48. fi
  49.  
  50. echo Removing schema and data for Movies database, please wait...
  51. ${EOUTIL} dump ../BusinessLogic/Movies.eomodeld -dest database -schemaDrop -force
  52.  
  53. echo Removing schema and data for Rentals database, please wait...
  54. ${EOUTIL} dump ../BusinessLogic/Rentals.eomodeld -dest database -schemaDrop -force
  55.  
  56.