File tree Expand file tree Collapse file tree 3 files changed +7
-15
lines changed Expand file tree Collapse file tree 3 files changed +7
-15
lines changed Original file line number Diff line number Diff line change @@ -23,8 +23,6 @@ if [ ! -z "$RUN_MIGRATIONS" ]; then
23
23
if [ -n " $CFGOV_PROD_DB_LOCATION " ] || [ -n " $DB_DUMP_FILE " ] || [ -n " $DB_DUMP_URL " ]; then
24
24
echo " Running refresh-data.sh... $DB_DUMP_FILE "
25
25
./refresh-data.sh " $DB_DUMP_FILE "
26
- echo " Create the cache table..."
27
- ./cfgov/manage.py createcachetable
28
26
29
27
# refresh-data.sh runs migrations and rebuilds index,
30
28
# unset vars to prevent further action
Original file line number Diff line number Diff line change 12
12
# Import Data
13
13
import_data (){
14
14
echo ' Running Django migrations...'
15
- ./cfgov/manage.py migrate
15
+ ./cfgov/manage.py migrate --noinput
16
16
echo ' Creating any necessary Django database cache tables...'
17
17
./cfgov/manage.py createcachetable
18
18
echo ' Running initial_data script to configure Wagtail admin...'
Original file line number Diff line number Diff line change @@ -55,21 +55,14 @@ check_data() {
55
55
refresh_data () {
56
56
echo ' Importing refresh db'
57
57
gunzip < " $refresh_dump_name " | cfgov/manage.py dbshell > /dev/null
58
- SCHEMA=" $( gunzip -c $refresh_dump_name | grep -m 1 ' CREATE SCHEMA' | sed ' s/CREATE SCHEMA \(.*\);$/\1/' ) "
59
- PGUSER=" ${PGUSER:- cfpb} "
60
- if [ " ${PGUSER} " != " ${SCHEMA} " ]; then
61
- echo " Adjusting schema name to match username..."
62
- echo " DROP SCHEMA IF EXISTS \" ${PGUSER} \" CASCADE; \
63
- ALTER SCHEMA \" ${SCHEMA} \" RENAME TO \" ${PGUSER} \" " | psql > /dev/null 2>&1
64
- fi
65
- echo ' Running any necessary migrations'
66
- ./cfgov/manage.py migrate --noinput --fake-initial
67
- echo ' Setting up initial data'
68
- ./cfgov/manage.py runscript initial_data
58
+ }
59
+
60
+ initial_data () {
61
+ ./initial-data.sh
69
62
}
70
63
71
64
update_index () {
72
- source ./index.sh
65
+ source ./index.sh
73
66
}
74
67
75
68
get_data () {
108
101
get_data
109
102
check_data
110
103
refresh_data
104
+ initial_data
111
105
112
106
if [[ $noindex -ne 1 ]]; then
113
107
update_index
You can’t perform that action at this time.
0 commit comments