Revision 4413
Added by Aaron Marcuse-Kubitza over 12 years ago
inputs/input.Makefile | ||
---|---|---|
164 | 164 |
|
165 | 165 |
##### Staging tables installation |
166 | 166 |
|
167 |
install: _always schema $(allTables:%=%/install) ; |
|
167 |
dbExports := $(wildcard *.sql) |
|
168 |
allInstalls := $(dbExports) $(allTables) |
|
168 | 169 |
|
170 |
install: _always schema $(allInstalls:%=%/install) ; |
|
171 |
|
|
169 | 172 |
uninstall: _always rm_schema ; |
170 | 173 |
# rm_schema will also drop all staging tables |
171 | 174 |
|
... | ... | |
178 | 181 |
rm_schema: _always |
179 | 182 |
echo 'DROP SCHEMA IF EXISTS "$(datasrc)" CASCADE;'|$(psqlAsBien) |
180 | 183 |
|
184 |
# Must come before %/install to override it |
|
185 |
%.sql/install: %.sql _always |
|
186 |
($(inDatasrc); grep -vF 'SET search_path' $<)|"time" $(psqlAsBien) |
|
187 |
|
|
181 | 188 |
# For staging tables which are derived by joining together other staging tables. |
182 | 189 |
%/install %/header.csv: %/create.sql _always |
183 | 190 |
($(inDatasrc); echo 'CREATE TABLE "$*" AS'; cat $<; echo ';'; \ |
Also available in: Unified diff
input.Makefile: Staging tables installation: Support installing a DB export directly into the staging schema, without needing to first export it as CSVs