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
|
subdirs=($(cat "$top_dir"/import_order.txt))
|
9
|
|
10
|
# to reinstall staging tables: rm=1 .../run import
|
11
|
|
12
|
import()
|
13
|
{
|
14
|
begin_target
|
15
|
if remaking; then datasrc_make uninstall; fi
|
16
|
prep_try; if ! pg_schema_exists; then # uses $schema
|
17
|
rethrow
|
18
|
datasrc_make schema
|
19
|
datasrc_make sql/install </dev/null
|
20
|
# </dev/null because for datasources w/o SQL files, cat will try to
|
21
|
# read from stdin
|
22
|
fi; rethrow
|
23
|
fwd_self
|
24
|
}
|
25
|
|
26
|
fi
|