You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
18 lines
629 B
Makefile
18 lines
629 B
Makefile
2 years ago
|
SCRIPTS = $(CURDIR)/scripts
|
||
|
ENV_LOCAL = $(CURDIR)/.pgenv_local
|
||
|
ENV_REMOTE = $(CURDIR)/.pgenv_remote
|
||
|
MAIN = $(SCRIPTS)/create_tables.sql
|
||
|
IMPORT = $(SCRIPTS)/insert_data.sql
|
||
|
SHELL := /usr/bin/env bash
|
||
|
|
||
|
all:
|
||
|
@echo "Error: Please specify remote or local target!"
|
||
|
|
||
|
remote:
|
||
|
source $(ENV_REMOTE) && psql -h $${PGHOST} -d $${PGDATABASE} -U $${PGUSER} -f $(MAIN)
|
||
|
source $(ENV_REMOTE) && psql -h $${PGHOST} -d $${PGDATABASE} -U $${PGUSER} -f $(IMPORT)
|
||
|
|
||
|
local:
|
||
|
source $(ENV_LOCAL) && psql -h $${PGHOST} -d $${PGDATABASE} -U $${PGUSER} -f $(MAIN)
|
||
|
source $(ENV_LOCAL) && psql -h $${PGHOST} -d $${PGDATABASE} -U $${PGUSER} -f $(IMPORT)
|