-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinit_db_simple.bat
More file actions
39 lines (34 loc) · 1.68 KB
/
init_db_simple.bat
File metadata and controls
39 lines (34 loc) · 1.68 KB
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
@echo off
chcp 65001 >nul
echo ============================================
echo WMS数据库初始化
echo ============================================
set PGPASSWORD=123456
set PSQL=D:\Program Files\PostgreSQL\17\bin\psql.exe
echo.
echo 1. 删除旧数据库(如果存在)...
"%PSQL%" -U postgres -c "DROP DATABASE IF EXISTS wms_db;"
echo.
echo 2. 创建新数据库...
"%PSQL%" -U postgres -c "CREATE DATABASE wms_db WITH OWNER = postgres ENCODING = 'UTF8';"
echo.
echo 3. 导入表结构和数据...
"%PSQL%" -U postgres -d wms_db -f D:\WMS\database\schema\01_basic_data.sql
"%PSQL%" -U postgres -d wms_db -f D:\WMS\database\schema\02_inventory.sql
"%PSQL%" -U postgres -d wms_db -f D:\WMS\database\schema\03_inbound.sql
"%PSQL%" -U postgres -d wms_db -f D:\WMS\database\schema\04_outbound.sql
"%PSQL%" -U postgres -d wms_db -f D:\WMS\database\schema\05_stocktaking_transfer.sql
"%PSQL%" -U postgres -d wms_db -f D:\WMS\database\schema\06_system_finance.sql
"%PSQL%" -U postgres -d wms_db -f D:\WMS\database\schema\07_kit_management.sql
"%PSQL%" -U postgres -d wms_db -f D:\WMS\database\schema\09_return.sql
"%PSQL%" -U postgres -d wms_db -f D:\WMS\database\schema\10_damage.sql
"%PSQL%" -U postgres -d wms_db -f D:\WMS\database\schema\02_inventory_enhancement.sql
"%PSQL%" -U postgres -d wms_db -f D:\WMS\database\schema\03_asn_module.sql
"%PSQL%" -U postgres -d wms_db -f D:\WMS\database\schema\04_index_optimization.sql
"%PSQL%" -U postgres -d wms_db -f D:\WMS\database\schema\05_billing_module.sql
"%PSQL%" -U postgres -d wms_db -f D:\WMS\database\data\init_data.sql
echo.
echo ============================================
echo 数据库初始化完成!
echo ============================================
pause