1
|
#!/bin/bash -e
|
2
|
auto_fwd=1
|
3
|
. "$(dirname "${BASH_SOURCE[0]}")"/in_datasrc_dir.run
|
4
|
.rel import.run
|
5
|
|
6
|
if self_not_included; then
|
7
|
|
8
|
table_subdirs=($(cat "$top_dir"/import_order.txt))
|
9
|
subdirs=("${table_subdirs[@]}")
|
10
|
|
11
|
postprocess()
|
12
|
{
|
13
|
echo_func
|
14
|
local subdirs=("${table_subdirs[@]}")
|
15
|
fwd "$FUNCNAME" "$@"
|
16
|
}
|
17
|
|
18
|
import()
|
19
|
{
|
20
|
echo_func; set_make_vars
|
21
|
if remaking; then datasrc_make uninstall; fi
|
22
|
if ! pg_schema_exists; then # uses $schema
|
23
|
datasrc_make schema
|
24
|
datasrc_make sql/install </dev/null
|
25
|
# </dev/null because for datasources w/o SQL files, cat will try to
|
26
|
# read from stdin
|
27
|
fi
|
28
|
fwd "$FUNCNAME" "$@"
|
29
|
}
|
30
|
|
31
|
fi
|