这是基于vue-vben-admin 模板适用于abp vNext的前端管理项目
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
i2nets d1ccd2b2d4 feat(print-designer): add EF Core persistence and migrations 6 days ago
..
Migrations feat(print-designer): add EF Core persistence and migrations 6 days ago
LINGYUN.Abp.MicroService.AllInOne.EntityFrameworkCore.SqlServer.csproj feat(approval-flow): integrate approval flow into AllInOne and gateway 4 weeks ago
README.en.md refactor(allinone): Rename the single application to LINGYUN.Abp.MicroService.AllInOne 1 month ago
README.md refactor(allinone): Rename the single application to LINGYUN.Abp.MicroService.AllInOne 1 month ago
SingleMigrationsDbContextFactory.cs refactor(allinone): Rename the single application to LINGYUN.Abp.MicroService.AllInOne 1 month ago
SingleMigrationsEntityFrameworkCoreSqlServerModule.cs feat(approval-flow): integrate approval flow into AllInOne and gateway 4 weeks ago

README.md

SQL Server 数据库迁移指南

本指南将帮助您使用迁移脚本来管理 SQL Server 数据库的迁移操作。

前置条件

  1. 确保已安装 .NET Core SDK
  2. 确保已安装 Entity Framework Core 工具
    dotnet tool install --global dotnet-ef
    
  3. 确保已正确配置 SQL Server 连接字符串

使用说明

1. 创建新的迁移

  1. 在 aspnet-core/migrations 目录下运行迁移脚本:

    # 使用中文版本
    .\Migrate.ps1
    
    # 或使用英文版本
    .\MigrateEn.ps1
    
  2. 在菜单中选择 SQL Server 数据库上下文:

    [3] LINGYUN.Abp.MicroService.AllInOne.EntityFrameworkCore.SqlServer
    
  3. 输入迁移名称(可选):

    • 直接回车将使用默认名称:AddNewMigration_yyyyMMdd_HHmmss
    • 或输入自定义名称,如:AddNewFeature

2. 生成 SQL 脚本

在创建迁移后,脚本会询问是否需要生成 SQL 脚本:

  1. 选择是否生成 SQL 脚本 (Y/N)
  2. 如果选择 Y,将提供以下选项:
    • [A] - 生成所有迁移的 SQL 脚本
    • [L] - 仅生成最新迁移的 SQL 脚本
    • [0-9] - 从指定的迁移版本开始生成

生成的 SQL 脚本将保存在:

aspnet-core/InitSql/LINGYUN.Abp.MicroService.AllInOne.EntityFrameworkCore.SqlServer/

3. 应用迁移

生成的 SQL 脚本可以通过以下方式应用到数据库:

  1. 使用 SQL Server Management Studio 或其他 SQL Server 客户端工具执行 SQL 脚本
  2. 或使用命令行:
    sqlcmd -S your_server -d your_database -i your_script.sql