Browse Source
Merge pull request #79 from colinin/3.1
add entity-framework core quick migration script
pull/81/head
cKey
5 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with
52 additions and
0 deletions
README.en.md
README.md
aspnet-core/services/start-apigateway-admin.bat
aspnet-core/services/start-auth-server.bat
aspnet-core/services/start-backend-admin.bat
aspnet-core/services/start-messages.bat
aspnet-core/services/start-platform.bat
build/build-aspnetcore-ef-update.ps1
@ -233,6 +233,12 @@ VUE_APP_CLIENT_SECRET = '1q2w3e*'
```
### Initializes appsettings.json
In directory ** ./aspnet-core/configuration** ,Copy the given settings file to your own project directory (only if you are cloning the repository for the first time)
Make sure the configuration file is the same as the connection configuration of your development environment middleware, such as RabbitMQ, MySql, Redis, and so on
### EntityFramework migration
Please switch to the service project startup directory and execute the **dotnet EF ** command for database migration
@ -247,6 +253,8 @@ dotnet ef database update
```
- You can also use quick migration script files: ** ./build/build-aspnetcore-ef-update.ps1**
### Initializes the apigateway database
@ -242,6 +242,12 @@ VUE_APP_CLIENT_SECRET = '1q2w3e*'
```
### 初始化 appsettings.json
当前所有启动项目配置存储在 ** ./aspnet-core/configuration** 目录,请按照给定的项目名称复制到自己的项目目录(仅在您第一次克隆此仓库是这样做)
确保配置文件与您的开发环境中间件的连接配置相同,例如RabbitMQ、MySql、Redis等
### EntityFramework 迁移
请切换到服务项目启动目录, 执行 **dotnet ef** 命令进行数据库迁移
@ -255,6 +261,8 @@ dotnet ef database update
```
- 也可以使用快速迁移脚本文件: ** ./build/build-aspnetcore-ef-update.ps1**
### 初始化网关数据库
@ -9,6 +9,7 @@ cd .\apigateway\LINGYUN.ApiGateway.HttpApi.Host
if '%1 ' equ '--publish' goto publish
if '%1 ' equ '--run' goto run
if '%1 ' equ '--restore' goto restore
if '%1 ' equ '--ef-u' goto efu
if '%1 ' equ '' goto run
@ -23,4 +24,8 @@ exit
: restore
dotnet restore
exit
: efu
dotnet ef database update
exit
@ -9,6 +9,7 @@ cd .\account\AuthServer.Host
if '%1 ' equ '--publish' goto publish
if '%1 ' equ '--run' goto run
if '%1 ' equ '--restore' goto restore
if '%1 ' equ '--ef-u' goto efu
if '%1 ' equ '' goto run
exit
@ -23,4 +24,8 @@ exit
: restore
dotnet restore
exit
: efu
dotnet ef database update
exit
@ -9,6 +9,7 @@ cd .\admin\LINGYUN.BackendAdminApp.Host
if '%1 ' equ '--publish' goto publish
if '%1 ' equ '--run' goto run
if '%1 ' equ '--restore' goto restore
if '%1 ' equ '--ef-u' goto efu
if '%1 ' equ '' goto run
exit
@ -23,4 +24,8 @@ exit
: restore
dotnet restore
exit
: efu
dotnet ef database update
exit
@ -9,6 +9,7 @@ cd .\messages\LINGYUN.Abp.MessageService.HttpApi.Host
if '%1 ' equ '--publish' goto publish
if '%1 ' equ '--run' goto run
if '%1 ' equ '--restore' goto restore
if '%1 ' equ '--ef-u' goto efu
if '%1 ' equ '' goto run
exit
@ -23,4 +24,8 @@ exit
: restore
dotnet restore
exit
: efu
dotnet ef database update
exit
@ -9,6 +9,7 @@ cd .\platform\LINGYUN.Platform.HttpApi.Host
if '%1 ' equ '--publish' goto publish
if '%1 ' equ '--run' goto run
if '%1 ' equ '--restore' goto restore
if '%1 ' equ '--ef-u' goto efu
if '%1 ' equ '' goto run
exit
@ -23,4 +24,8 @@ exit
: restore
dotnet restore
exit
: efu
dotnet ef databse update
exit
@ -0,0 +1,11 @@
. " ./build-aspnetcore-common.ps1 "
# Build all solutions
foreach ( $batchCommandPath in $batchCommandPaths ) {
$file = [io.fileinfo] $batchCommandPath ;
Write-Host $file . DirectoryName
Set-Location $file . DirectoryName
CMD / c $file . Name - -ef -u -Wait
}
Set-Location $rootFolder