Project

General

Profile

1
#!/bin/bash -e
2
# syncs validations queries with the DB
3
. "$(dirname "${BASH_SOURCE[0]}")"/file.pg.sql.run
4

    
5
if self_not_included; then
6

    
7
func_override export___schema.pg.sql.run
8
export_() # usage: rm=1 .../file.run export_ # resulting export is idempotent
9
{
10
	echo_func
11
	#need explicit schema so matching tables from other schemas are not included
12
	export___schema.pg.sql.run --table="\"$schema\"._[[:alpha:]]+_\d*" "$@"
13
	# make export idempotent
14
	in_place "$top_file" sed 's/CREATE VIEW/CREATE OR REPLACE VIEW/g'
15
}
16

    
17
fi
(16-16/17)