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