Activities of "Leonardo.Willrich"

Perfect, it is working fine.

Hi @maliming. Yes, I have seed the database in my local environment (develpment) with localhost:44307. And then I have just copied the same database to the test environement with a different url.

@liangshiwei, is there a way to just run an update in the database? Do I have access to the table/field to be updated?

Hi.

I've sorted out the issue. The problem is that the both MigrationService were calling the method to seed the database. I have removed from the first service that was being called and left only in the latest one. Thus, after all tables created, it will run the seeds and if the table is empty then it will populate that as per the method implementation.

Do you have any example of that? What do you mean by create manually? Should I change the service for the original DbContext? Is there some attribute for the class such as [DBContextAttribute.DbContext()]?

Just as additional information, I've created a new MigrationService and implemented that. But, I still don't know how to distinguish the SeedContributor in each method. It is still calling the same class in both services.

He is my new Service being instanced and calling MigrateAsync.

public async Task StartAsync(CancellationToken cancellationToken)
        {
            using (var application = AbpApplicationFactory.Create<AvalancheOCPDbMigratorModule>(options =>
                {
                    options.UseAutofac();
                    options.Services.AddLogging(c => c.AddSerilog());
                }))
                {
                    application.Initialize();

                    await application
                        .ServiceProvider
                        .GetRequiredService<AvalancheOCPDbMigrationService>()
                        .MigrateAsync();

                    await application
                        .ServiceProvider
                        .GetRequiredService<AORDbMigrationService>()
                        .MigrateAsync();

                application.Shutdown();

                    _hostApplicationLifetime.StopApplication();
                }

        }

The problem is in the highlighted line. It is bringing all SeedContributor classes created.

public AORDbMigrationService(
            IDataSeeder dataSeeder,
            IEnumerable<IAORDbSchemaMigrator> dbSchemaMigrators,
            ITenantRepository tenantRepository,
            ICurrentTenant currentTenant)
        {
            _dataSeeder = dataSeeder; // -->> Return all list with all SeedContributor, and not the only one that is suppose to be for the DBContext
            _dbSchemaMigrators = dbSchemaMigrators;
            _tenantRepository = tenantRepository;
            _currentTenant = currentTenant;

            Logger = NullLogger<AORDbMigrationService>.Instance;
        }
Showing 141 to 145 of 145 entries
Made with ❤️ on ABP v8.2.0-preview Updated on March 25, 2024, 15:11