File tree Expand file tree Collapse file tree 2 files changed +11
-8
lines changed
Expand file tree Collapse file tree 2 files changed +11
-8
lines changed Original file line number Diff line number Diff line change @@ -90,7 +90,7 @@ Run the SQL scripts shipped with each release to keep your schema up to date.
9090 POSTGRES_HOST=localhost
9191 POSTGRES_PORT=5432
9292 POSTGRES_DB=nexent
93- POSTGRES_USER=postgres
93+ POSTGRES_USER=root
9494 POSTGRES_PASSWORD=your_password
9595 ` ` `
9696
@@ -100,8 +100,8 @@ Run the SQL scripts shipped with each release to keep your schema up to date.
100100 # Example: If today is November 6th and your last update was on October 20th,
101101 # and there are two new files 1030-update.sql and 1105-update.sql,
102102 # execute the following commands (please replace the placeholders with your actual values)
103- docker exec -i nexent-postgresql psql -U { YOUR_POSTGRES_USER} -d { YOUR_POSTGRES_DB} < ./sql/1030-update.sql
104- docker exec -i nexent-postgresql psql -U { YOUR_POSTGRES_USER} -d { YOUR_POSTGRES_DB} < ./sql/1105-update.sql
103+ docker exec -i nexent-postgresql psql -U [ YOUR_POSTGRES_USER] -d [ YOUR_POSTGRES_DB] < ./sql/1030-update.sql
104+ docker exec -i nexent-postgresql psql -U [ YOUR_POSTGRES_USER] -d [ YOUR_POSTGRES_DB] < ./sql/1105-update.sql
105105 ` ` `
106106
107107 Execute the scripts in chronological order based on your deployment date.
@@ -124,7 +124,7 @@ Run the SQL scripts shipped with each release to keep your schema up to date.
124124> - Create a backup before running migrations:
125125>
126126> ` ` ` bash
127- > docker exec -i nexent-postgres pg_dump -U { YOUR_POSTGRES_USER} { YOUR_POSTGRES_DB} > backup_$( date +%F) .sql
127+ > docker exec -i nexent-postgres pg_dump -U [ YOUR_POSTGRES_USER] [ YOUR_POSTGRES_DB] > backup_$( date +%F) .sql
128128> ` ` `
129129
130130---
Original file line number Diff line number Diff line change @@ -91,15 +91,18 @@ bash deploy.sh
9191 POSTGRES_HOST=localhost
9292 POSTGRES_PORT=5432
9393 POSTGRES_DB=nexent
94- POSTGRES_USER=postgres
94+ POSTGRES_USER=root
9595 POSTGRES_PASSWORD=your_password
9696 ` ` `
9797
98983. 通过容器执行 SQL 脚本(示例):
9999
100100 ` ` ` bash
101- docker exec -i nexent-postgresql psql -U {POSTGRES_USER} -d {POSTGRES_DB} < ./sql/2025-10-30-update.sql
102- docker exec -i nexent-postgresql psql -U {POSTGRES_USER} -d {POSTGRES_DB} < ./sql/2025-11-05-update.sql
101+ # 假如现在是11月6日,上次更新版本的时间是10月20日
102+ # 此时新增了1030-update.sql和1105-update.sql两个文件
103+ # 我们需要执行以下命令(请注意替换占位符中的变量)
104+ docker exec -i nexent-postgresql psql -U [YOUR_POSTGRES_USER] -d [YOUR_POSTGRES_DB] < ./sql/1030-update.sql
105+ docker exec -i nexent-postgresql psql -U [YOUR_POSTGRES_USER] -d [YOUR_POSTGRES_DB] < ./sql/1105-update.sql
103106 ` ` `
104107
105108 请根据自己的部署时间,按时间顺序执行对应脚本。
@@ -122,7 +125,7 @@ bash deploy.sh
122125> - 执行前建议先备份:
123126>
124127> ` ` ` bash
125- > docker exec -i nexent-postgres pg_dump -U {POSTGRES_USER} {POSTGRES_DB} > backup_$( date +%F) .sql
128+ > docker exec -i nexent-postgres pg_dump -U [YOUR_POSTGRES_USER] [YOUR_POSTGRES_DB] > backup_$( date +%F) .sql
126129> ` ` `
127130
128131---
You can’t perform that action at this time.
0 commit comments