Project

General

Profile

1 9590 aaronmk
#!/bin/bash -e
2 12696 aaronmk
auto_fwd=1
3 10759 aaronmk
. "$(dirname "${BASH_SOURCE[0]}")"/in_datasrc_dir.run
4 10760 aaronmk
.rel import.run
5 9590 aaronmk
6
if self_not_included; then
7
8 12701 aaronmk
subdirs=($(cat "$top_dir"/import_order.txt))
9 9962 aaronmk
10 12774 aaronmk
# to reinstall staging tables: rm=1 .../run import
11
12 9962 aaronmk
import()
13
{
14 12779 aaronmk
	begin_target
15 11872 aaronmk
	if remaking; then datasrc_make uninstall; fi
16 12773 aaronmk
	prep_try; if ! pg_schema_exists; then # uses $schema
17
		rethrow
18 11875 aaronmk
		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 12773 aaronmk
	fi; rethrow
23 12698 aaronmk
	fwd_self
24 9962 aaronmk
}
25
26 9590 aaronmk
fi