-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdbdump.sh
More file actions
executable file
·109 lines (94 loc) · 2.19 KB
/
dbdump.sh
File metadata and controls
executable file
·109 lines (94 loc) · 2.19 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
#!/bin/sh
#
# Platform name
#
PLATFORM_NAME=`uname -s`
if [ "$PLATFORM_NAME" = "" ]
then
echo "Unable to access "uname" executable! Terminating."
exit 1
fi
#
# Platform type
#
case "$PLATFORM_NAME" in
"Darwin") PLATFORM_TYPE=Darwin
;;
"Mac OS") PLATFORM_TYPE=Darwin
;;
*Windows*) PLATFORM_TYPE=Dos
;;
*winnt*) PLATFORM_TYPE=Dos
;;
*) echo "Unsupported platform ($PLATFORM_NAME)! Terminating."
exit 1
;;
esac
#
# System directories
#
if [ "$PLATFORM_TYPE" = "Darwin" ]
then
SYSTEM_LIBRARY_DIR=/System/Library
LOCAL_LIBRARY_DIR=/Library
SYSTEM_DEVELOPER_DIR=/Developer
else
if [ "$NEXT_ROOT" = "" ]
then
echo "NEXT_ROOT environment variable is not set! Terminating."
exit 1
fi
SYSTEM_LIBRARY_DIR=$NEXT_ROOT/Library
LOCAL_LIBRARY_DIR=$NEXT_ROOT/Local/Library
SYSTEM_DEVELOPER_DIR=$NEXT_ROOT/Developer
fi
#
# Essential directories
#
SLWJ=$SYSTEM_LIBRARY_DIR/WebObjects/JavaApplications
LFJR=$LOCAL_LIBRARY_DIR/Frameworks/JavaBusinessLogic.framework/Resources
DEJD=$SYSTEM_DEVELOPER_DIR/Examples/JavaWebObjects/DatabaseSetup
#
# Location of executable, pause disabled
#
if [ "$PLATFORM_TYPE" = "Dos" ]
then
eoutil=$SLWJ/javaeoutil.woa/javaeoutil.cmd
nonstop="-WONoPause YES"
else
eoutil=$SLWJ/javaeoutil.woa/javaeoutil
nonstop=""
fi
#
# Schema drop disabled for new databases
#
#drop="-schemaDrop tables primaryKeySupport"
drop=""
#
# List of names
#
names="Movies Rentals"
for name in $names
do
#
# Locations of model and plist
#
model=$LFJR/$name.eomodeld
plist=$DEJD/$name.plist
#
# Locations of models for model groups
#
if [ "$name" = "Movies" ]
then
models=$model
fi
if [ "$name" = "Rentals" ]
then
models="$LFJR/Movies.eomodeld $model"
fi
#
# Run
#
echo Loading schema and data for $model, please wait...
$eoutil dump $model -source plist $plist -dest database $drop -schemaCreate tables primaryKeySupport foreignKeyConstraints -force -modelGroup $models $nonstop -WODebuggingEnabled TRUE -EOAdaptorDebugEnabled FALSE
done