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.
36 lines
1.3 KiB
36 lines
1.3 KiB
using LINGYUN.Abp.Data.DbMigrator;
|
|
using Microsoft.Extensions.Logging;
|
|
using System;
|
|
using System.Threading.Tasks;
|
|
using Volo.Abp.Data;
|
|
using Volo.Abp.DependencyInjection;
|
|
using Volo.Abp.DistributedLocking;
|
|
using Volo.Abp.EventBus.Distributed;
|
|
using Volo.Abp.MultiTenancy;
|
|
using Volo.Abp.Uow;
|
|
|
|
namespace LINGYUN.Abp.MicroService.AdminService;
|
|
public class AdminServiceDbMigrationService : EfCoreRuntimeDbMigratorBase<AdminServiceMigrationsDbContext>, ITransientDependency
|
|
{
|
|
protected AdminServiceDataSeeder DataSeeder { get; }
|
|
public AdminServiceDbMigrationService(
|
|
ICurrentTenant currentTenant,
|
|
IUnitOfWorkManager unitOfWorkManager,
|
|
IServiceProvider serviceProvider,
|
|
IAbpDistributedLock abpDistributedLock,
|
|
IDistributedEventBus distributedEventBus,
|
|
ILoggerFactory loggerFactory,
|
|
AdminServiceDataSeeder dataSeeder)
|
|
: base(
|
|
ConnectionStringNameAttribute.GetConnStringName<AdminServiceMigrationsDbContext>(),
|
|
unitOfWorkManager, serviceProvider, currentTenant, abpDistributedLock, distributedEventBus, loggerFactory)
|
|
{
|
|
DataSeeder = dataSeeder;
|
|
}
|
|
|
|
protected async override Task SeedAsync()
|
|
{
|
|
// DbMigrator迁移数据种子
|
|
await DataSeeder.SeedAsync(new DataSeedContext());
|
|
}
|
|
}
|
|
|