abp core迁移sqlite

项目名称 April

  1. EF层

    install-package Microsoft.EntityFrameworkCore.Sqlite
    
  2. Host

     "ConnectionStrings": {
     "Default": "Server=localhost; Database=AprilDb; Trusted_Connection=True;",
     "SqliteCnn": "Data Source=AprilDb.db;"
     },
    
  3. Core层AprilConsts.cs

    //public const string ConnectionStringName = "Default";
    public const string ConnectionStringName = "SqliteCnn";
    
  4. EF层AprilDbContextConfigurer.cs,UseSqlServer改为UseSqlite

  5. 删除EF层下的Migrations文件夹,执行

    add-migration init
    update-database
    
  6. EF层AprilEntityFrameworkModule.cs的PreInitialize()

    //sqlite不支持多线程事务
    Configuration.UnitOfWork.IsTransactional = false;
    

你可能感兴趣的:(abp core迁移sqlite)