Skip to content

Commit

Permalink
[deploy]: 调整
Browse files Browse the repository at this point in the history
  • Loading branch information
linlinjava committed Jul 5, 2018
1 parent 32ea87b commit dc39ab3
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 2 deletions.
3 changes: 2 additions & 1 deletion deploy/bin/reset.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ fi

cd /home/ubuntu/deploy/litemall-db
cat litemall_schema.sql > db.sql
cat litemall.sql >> db.sql
cat litemall_table.sql >> db.sql
cat litemall_data.sql >> db.sql
mysql -h localhost -u $ROOT -p$PASSWORD < db.sql
rm db.sql

Expand Down
3 changes: 2 additions & 1 deletion deploy/util/upload.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ tar -zcvf ./deploy/litemall-admin/dist.tar -C ./litemall-admin/dist .

# 复制数据库
cp -f ./litemall-db/sql/litemall_schema.sql ./deploy/litemall-db/litemall_schema.sql
cp -f ./litemall-db/sql/litemall.sql ./deploy/litemall-db/litemall.sql
cp -f ./litemall-db/sql/litemall_table.sql ./deploy/litemall-db/litemall_table.sql
cp -f ./litemall-db/sql/litemall_data.sql ./deploy/litemall-db/litemall_data.sql

# 上传云主机
scp -i $ID_RSA -r ./deploy $REMOTE:/home/ubuntu/
21 changes: 21 additions & 0 deletions litemall-db/sql/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
这里的数据库由三个sql文件组成:

1. litemall_schema.sql

作用是创建空数据库、创建用户、设置访问权限。

开发者开发测试阶段可以使用,但是部署生产阶段一定要注意修改这里的默认用户名和密码。

2. litemall_table.sql

作用是创建数据库表,但是没有创建任何数据。

因此,开发者可以在部署生产阶段直接使用。

3. litemall_data.sql

作用是创建测试数据。

这里的测试数据来自开源项目[nideshop-mini-program](https://github.com/tumobi/nideshop-mini-program)

开发者开发测试阶段可以使用,但是部署开发阶段应该使用自己的数据。

0 comments on commit dc39ab3

Please sign in to comment.