Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
buqiyuan committed Feb 15, 2024
1 parent 584dfd0 commit bc780b7
Show file tree
Hide file tree
Showing 10 changed files with 188 additions and 116 deletions.
6 changes: 3 additions & 3 deletions .env.development
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ SWAGGER_PATH = api-docs
SWAGGER_VERSION = 1.0

# db
DB_HOST = 127.0.0.1
DB_PORT = 13307
DB_HOST = roundhouse.proxy.rlwy.net
DB_PORT = 41854
DB_DATABASE = nest_admin
DB_USERNAME = root
DB_PASSWORD = root
DB_PASSWORD = d6bf1c6fEhgh6AF14ba1dcFeh353DD63
DB_SYNCHRONIZE = true
DB_LOGGING = ["error"]

Expand Down
16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,22 @@ pnpm dev
pnpm build
```

## 数据库迁移

1. 更新数据库(或初始化数据)
```bash
pnpm migration:run
```
2. 生成迁移
```bash
pnpm migration:generate
```
3. 回滚到最后一次更新
```bash
pnpm migration:revert
```
详细请参考[官方文档](https://typeorm.io/migrations)

### 系统截图

![](https://s1.ax1x.com/2021/12/11/oTi1nf.png)
Expand Down
11 changes: 6 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@
"test:watch": "jest --watch",
"doc": "compodoc -p tsconfig.json -s",
"gen-env-types": "npx tsx scripts/genEnvTypes.ts",
"typeorm": "NODE_ENV=development typeorm -d ./dist/config/database.config.js",
"migration:create": "typeorm migration:create",
"migration:generate": "typeorm -- migration:generate",
"migration:run": "typeorm -- migration:run",
"migration:revert": "typeorm -- migration:revert",
"typeorm": "npm run build && NODE_ENV=development typeorm-ts-node-esm -d ./dist/config/database.config.js",
"migration:create": "npm run typeorm migration:create ./src/migrations/initData",
"migration:generate": "npm run typeorm migration:generate ./src/migrations/update-table_$(echo $npm_package_version | sed 's/\\./_/g')",
"migration:run": "npm run typeorm -- migration:run",
"migration:revert": "npm run typeorm -- migration:revert",
"cleanlog": "rimraf logs",
"docker:build:dev": "docker compose --env-file .env --env-file .env.development up --build",
"docker:build": "docker compose --env-file .env --env-file .env.production up --build",
Expand Down Expand Up @@ -77,6 +77,7 @@
"cron": "^3.1.6",
"cron-parser": "^4.9.0",
"crypto-js": "^4.2.0",
"date-fns": "^3.3.1",
"dayjs": "^1.11.10",
"dotenv": "16.4.4",
"handlebars": "^4.7.8",
Expand Down
Loading

0 comments on commit bc780b7

Please sign in to comment.