[19e22f]: dist / restore / restore-standard.sh  Maximize  Restore  History

Download this file

59 lines (50 with data), 820 Bytes

 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
#!/bin/bash
# bbou@ac-toulouse;fr
# 25/11/2013
db=$1
dbtype=standard
modules="wn legacy vn bnc sumo xwn glf ilfwn logs"
function process()
{
if [ ! -e "$1" ];then
return
fi
echo "process $2"
}
function dbexists()
{
return 0
}
function deletedb()
{
echo "delete ${db}"
}
function createdb()
{
echo "create ${db}"
}
echo "restoring ${db}"
#database
if [ ! -z ${dbdelete} ]; then
deletedb
fi
if ! dbexists; then
createdb
fi
# module tables
for m in ${modules}; do
sql=${dbtype}-${m}-schema.sql
process ${sql} schema ${db}
done
for m in ${modules}; do
sql=${dbtype}-${m}-data.sql
process ${sql} data ${db}
done
for m in ${modules}; do
sql=${dbtype}-${m}-constrain.sql
process ${sql} constrain ${db} --force
done
for m in ${modules}; do
sql=${dbtype}-${m}-views.sql
process ${sql} views ${db}
done

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks