Browse Source

Move migrate p script de recriação de bancos postgres

pull/1914/head
Marcio Mazza 7 years ago
parent
commit
acc9cbe262
  1. 5
      sapl/legacy/scripts/migra_um_db.sh
  2. 5
      sapl/legacy/scripts/recria_um_db_postgres.sh

5
sapl/legacy/scripts/migra_um_db.sh

@ -32,11 +32,6 @@ if [ $# -ge 2 ]; then
echo "O banco legado foi restaurado" |& tee -a $LOG
echo >> $LOG
echo "--- DJANGO MIGRATE ---" | tee -a $LOG
echo >> $LOG
DATABASE_NAME=$1 ./manage.py migrate --settings sapl.legacy_migration_settings
echo >> $LOG
echo "--- MIGRACAO ---" | tee -a $LOG
echo >> $LOG
DATABASE_NAME=$1 ./manage.py migracao_25_31 --force --dados --settings sapl.legacy_migration_settings 2>&1 | tee -a $LOG

5
sapl/legacy/scripts/recria_um_db_postgres.sh

@ -4,3 +4,8 @@
echo "Database $1"
sudo -u postgres psql -c "drop DATABASE if exists $1"
sudo -u postgres psql -c "CREATE DATABASE $1 WITH OWNER = sapl ENCODING = 'UTF8' TABLESPACE = pg_default LC_COLLATE = 'pt_BR.UTF-8' LC_CTYPE = 'pt_BR.UTF-8' CONNECTION LIMIT = -1 TEMPLATE template0;"
echo "--- DJANGO MIGRATE ---" | tee -a $LOG
DATABASE_NAME=$1 ./manage.py migrate --settings sapl.legacy_migration_settings

Loading…
Cancel
Save