# GNUmed database system bootstrapping config file
#-------------------------------------------------
# license: GPL v2 or later
# author: Karsten Hilbert@gmx.net

#----------------------------------
[installation]
interactive = yes

keep temp files = no

description = $description$
This will update an existing GNUmed version 6
database to the version 7 schema. It does not do
any harm to the data contained within.

The existing database is cloned first. The copy is
then modified. The original database remains unchanged.
$description$

bundles = $bundles$
v6-v7-static
v6-v7-dynamic
$bundles$

#----------------------------------
[bundle v6-v7-static]
database alias = gnumed_v7
minimum postgresql version = 8.1
schema base directory = ../sql/v6-v7/static/
schema = $schema$
ref-form_tables.sql
$schema$

#----------------------------------
[bundle v6-v7-dynamic]
database alias = gnumed_v7
minimum postgresql version = 8.1
schema base directory = ../sql/v6-v7/dynamic/
schema = $schema$
cfg-cfg_str_array.sql
cfg-cfg_string.sql
cfg-report_query.sql
ref-form_tables.sql
clin-allergy.sql
clin-v_pat_allergies.sql
blobs-v_doc_med.sql
blobs-v_doc_desc.sql
blobs-v_obj4doc_no_data.sql
blobs-v_reviewed_doc_objects.sql
blobs-v_latest_mugshot.sql
clin-v_narrative4search.sql
clin-v_emr_journal.sql
clin-form_instances.sql
dem-v_provider_inbox.sql
dem-dob_is_in_range.sql
i18n-translations.sql
$schema$

#----------------------------------
[database gnumed_v7]
name = gnumed_v7
drop target database = 1
target version = v7
transfer users = 1
source database = gnumed_v6
source version = v6
audit disable = 1
schema base directory = ../sql/v6-v7/
schema = $schema$
$schema$

superuser schema = $superuser schema$
$superuser schema$

upgrade plausibility checks = $upgrade plausibility checks$
identities::::select count(1) from dem.identity
select count(1) from dem.identity
names::::select count(1) from dem.names
select count(1) from dem.names
addresses::::select count(1) from dem.address
select count(1) from dem.address
episodes::::select count(1) from clin.episode
select count(1) from clin.episode
encounters::::select count(1) from clin.encounter
select count(1) from clin.encounter
issues::::select count(1) from clin.health_issue
select count(1) from clin.health_issue
documents::::select count(1) from blobs.doc_med
select count(1) from blobs.doc_med
pages::::select count(1) from blobs.doc_obj
select count(1) from blobs.doc_obj
allergies::::select count(1) from clin.allergy
select count(1) from clin.allergy
$upgrade plausibility checks$


script base directory = ../sql/v6-v7/python/
data import scripts = $data import scripts$
import-form-templates.py
$data import scripts$

#----------------------------------
[cluster]
host name = 
port = 5432
maintenance database = template1
schema base directory = ../sql/v6-v7/
schema = $schema$
$schema$

#----------------------------------
# these really shouldn't be changed
#----------------------------------
[GnuMed defaults]

groups = $groups$
$groups$

#----------------------------------
