-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinitial.bat
More file actions
43 lines (38 loc) · 864 Bytes
/
initial.bat
File metadata and controls
43 lines (38 loc) · 864 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
@echo off
cd /d %~dp0
set role=equiptr
set PGDATABASE=wyzx
set SCHEMA=%role%
set PGPORT=5432
set PGHOST=localhost
set PGUSER=
set PGPATH=d:\program files\postgresql\9.5\bin
set PGPASSWORD=
set PASSWORD=equip678
set PYPATH=c:\users\xuehz\pywithdj
set path=%PYPATH%;%pypath%\scripts;%PGPATH%;%PATH%
call backup.bat
call :create_role_SCHEMA
rem call :migrate_database
if "%errorlevel%" NEQ "0" (
goto :end
)
if exist "createview.sql" (
psql -f createview.sql
)
call restore.bat
goto :end
:create_role_SCHEMA
set PGUSER=postgres
set PGPASSWORD=POSTGRES
:call create.bat
goto :eof
:migrate_database
set PGUSER=%role%
set PGPASSWORD=%PASSWORD%
copy /Y equipmgr\migrations\__init__.pyc equipmgr\migrations.pyc>nul 2>nul
del /s /q equipmgr\migrations\*
copy /Y equipmgr\migrations.pyc equipmgr\migrations\__init__.pyc>nul 2>nul
call migrate.bat
goto :eof
:end