diff --git a/Masa.Dcc.Infrastructure.Domain/Services/InitConfigObjectDomainService.cs b/Masa.Dcc.Infrastructure.Domain/Services/InitConfigObjectDomainService.cs new file mode 100644 index 00000000..5cb323c9 --- /dev/null +++ b/Masa.Dcc.Infrastructure.Domain/Services/InitConfigObjectDomainService.cs @@ -0,0 +1,129 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the Apache License. See LICENSE.txt in the project root for license information. + +namespace Masa.Dcc.Infrastructure.Domain.Services; + +public class InitConfigObjectDomainService( + IDomainEventBus eventBus, + IConfigObjectReleaseRepository configObjectReleaseRepository, + IConfigObjectRepository configObjectRepository, + IPublicConfigRepository publicConfigRepository, + IMultilevelCacheClient memoryCacheClient, + IPmClient pmClient, + IMasaStackConfig masaStackConfig, + ILogger logger, + IUnitOfWork unitOfWork) : DomainService(eventBus) +{ + private readonly IConfigObjectReleaseRepository _configObjectReleaseRepository = configObjectReleaseRepository; + private readonly IConfigObjectRepository _configObjectRepository = configObjectRepository; + private readonly IPublicConfigRepository _publicConfigRepository = publicConfigRepository; + private readonly IMultilevelCacheClient _memoryCacheClient = memoryCacheClient; + private readonly IPmClient _pmClient = pmClient; + private readonly IMasaStackConfig _masaStackConfig = masaStackConfig; + private readonly IUnitOfWork _unitOfWork = unitOfWork; + private readonly ILogger _logger = logger; + + private string EncryptContent(string content) + { + var secret = _masaStackConfig.DccSecret; + + var encryptContent = AesUtils.Encrypt(content, secret, FillType.Left); + return encryptContent; + } + + private async Task AddConfigObjectReleaseAsync(AddConfigObjectReleaseDto dto) + { + var configObject = await _configObjectRepository.FindAsync(configObject => configObject.Id == dto.ConfigObjectId); + if (configObject == null) + throw new Exception($"Config object ConfigObjectId:{dto.ConfigObjectId} does not exist"); + + configObject.AddContent(configObject.Content, configObject.Content); + await _configObjectRepository.UpdateAsync(configObject); + + var configObjectRelease = new ConfigObjectRelease( + dto.ConfigObjectId, + dto.Name, + dto.Comment, + configObject.Content); + await _configObjectReleaseRepository.AddAsync(configObjectRelease); + + //add redis cache + var key = $"{dto.EnvironmentName}-{dto.ClusterName}-{dto.Identity}-{configObject.Name}"; + if (configObject.Encryption) + { + dto.Content = EncryptContent(dto.Content); + } + var releaseContent = new PublishReleaseModel + { + Content = dto.Content, + FormatLabelCode = configObject.FormatLabelCode, + Encryption = configObject.Encryption + }; + await _memoryCacheClient.SetAsync(key.ToLower(), releaseContent); + } + + public async Task InitConfigObjectAsync( + string environmentName, + string clusterName, + string appId, + Dictionary configObjects, + ConfigObjectType configObjectType = ConfigObjectType.App, + bool isEncryption = false) + { + var envs = await _pmClient.EnvironmentService.GetListAsync(); + var env = envs.FirstOrDefault(e => e.Name.ToLower() == environmentName.ToLower()) ?? throw new UserFriendlyException("Environment does not exist"); + var clusters = await _pmClient.ClusterService.GetListByEnvIdAsync(env.Id); + var cluster = clusters.FirstOrDefault(c => c.Name.ToLower() == clusterName.ToLower()) ?? throw new UserFriendlyException("Cluster does not exist"); + + var publicConfig = await _publicConfigRepository.FindAsync(publicConfig => publicConfig.Identity == appId); + if (publicConfig == null) + throw new ArgumentException($"dcc init failed: Identity {appId} is not exists in PublicConfigs"); + + foreach (var configObject in configObjects) + { + var configObjectName = configObject.Key; + string content = configObject.Value; + if (isEncryption) + content = EncryptContent(content); + + var newConfigObject = await _configObjectRepository.FindAsync(x => x.Name == configObjectName && x.Type == configObjectType); + + if (newConfigObject == null) + { + newConfigObject = new ConfigObject( + configObjectName, + "JSON", + configObjectType, + content, + "{}", + encryption: isEncryption); + + newConfigObject.SetConfigObjectType(ConfigObjectType.App); + newConfigObject.SetPublicConfigObject(publicConfig.Id, cluster.EnvironmentClusterId); + + await _configObjectRepository.AddAsync(newConfigObject); + await _unitOfWork.SaveChangesAsync(); + } + + var key = $"{environmentName}-{clusterName}-{appId}-{configObjectName}".ToLower(); + var redisData = await _memoryCacheClient.GetAsync(key); + if (redisData != null) + continue; + + _logger.LogInformation("InitConfigObjectAsync add redis cache key:{Key}", key); + + var releaseModel = new AddConfigObjectReleaseDto + { + Type = ReleaseType.MainRelease, + ConfigObjectId = newConfigObject.Id, + Name = "通过Sdk发布", + EnvironmentName = environmentName, + ClusterName = clusterName, + Identity = appId, + Content = configObject.Value + }; + + await AddConfigObjectReleaseAsync(releaseModel); + } + } +} diff --git a/Masa.Dcc.Infrastructure.Domain/_Imports.cs b/Masa.Dcc.Infrastructure.Domain/_Imports.cs index 66cc9bed..915bfa32 100644 --- a/Masa.Dcc.Infrastructure.Domain/_Imports.cs +++ b/Masa.Dcc.Infrastructure.Domain/_Imports.cs @@ -32,3 +32,4 @@ global using Masa.Dcc.Infrastructure.Repository.Label; global using Masa.Utils.Security.Cryptography; global using Microsoft.EntityFrameworkCore; +global using Microsoft.Extensions.Logging; diff --git a/Masa.Dcc.Infrastructure.EFCore.SqlServer/Masa.Dcc.Infrastructure.EFCore.SqlServer.csproj b/Masa.Dcc.Infrastructure.EFCore.SqlServer/Masa.Dcc.Infrastructure.EFCore.SqlServer.csproj index 5270a30a..1baaecc1 100644 --- a/Masa.Dcc.Infrastructure.EFCore.SqlServer/Masa.Dcc.Infrastructure.EFCore.SqlServer.csproj +++ b/Masa.Dcc.Infrastructure.EFCore.SqlServer/Masa.Dcc.Infrastructure.EFCore.SqlServer.csproj @@ -6,9 +6,9 @@ - + - + all runtime; build; native; contentfiles; analyzers; buildtransitive @@ -23,5 +23,9 @@ PreserveNewest + + + + diff --git a/Masa.Dcc.Infrastructure.EFCore.SqlServer/Migrations/20220425085849_InitCreate.Designer.cs b/Masa.Dcc.Infrastructure.EFCore.SqlServer/Migrations/20220425085849_InitCreate.Designer.cs deleted file mode 100644 index a0b25b18..00000000 --- a/Masa.Dcc.Infrastructure.EFCore.SqlServer/Migrations/20220425085849_InitCreate.Designer.cs +++ /dev/null @@ -1,433 +0,0 @@ -// -using Masa.Dcc.Infrastructure.EFCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Masa.Dcc.Service.Admin.Migrations -{ - [DbContext(typeof(DccDbContext))] - [Migration("20220425085849_InitCreate")] - partial class InitCreate - { - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "6.0.4") - .HasAnnotation("Relational:MaxIdentifierLength", 128); - - SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder, 1L, 1); - - modelBuilder.Entity("Masa.BuildingBlocks.Dispatcher.IntegrationEvents.Logs.IntegrationEventLog", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("Content") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("CreationTime") - .HasColumnType("datetime2"); - - b.Property("EventId") - .HasColumnType("uniqueidentifier"); - - b.Property("EventTypeName") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("ModificationTime") - .HasColumnType("datetime2"); - - b.Property("RowVersion") - .IsRequired() - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b.Property("State") - .HasColumnType("int"); - - b.Property("TimesSent") - .HasColumnType("int"); - - b.Property("TransactionId") - .HasColumnType("uniqueidentifier"); - - b.HasKey("Id"); - - b.HasIndex(new[] { "EventId", "RowVersion" }, "index_eventid_version"); - - b.HasIndex(new[] { "State", "ModificationTime" }, "index_state_modificationtime"); - - b.HasIndex(new[] { "State", "TimesSent", "ModificationTime" }, "index_state_timessent_modificationtime"); - - b.ToTable("IntegrationEventLog", (string)null); - }); - - modelBuilder.Entity("Masa.Dcc.Service.Admin.Domain.App.Aggregates.AppConfigObject", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("AppId") - .HasColumnType("int") - .HasComment("AppId"); - - b.Property("ConfigObjectId") - .HasColumnType("int") - .HasComment("ConfigObjectId"); - - b.Property("CreationTime") - .HasColumnType("datetime2"); - - b.Property("Creator") - .HasColumnType("uniqueidentifier"); - - b.Property("EnvironmentClusterId") - .HasColumnType("int") - .HasComment("EnvironmentClusterId"); - - b.Property("IsDeleted") - .HasColumnType("bit"); - - b.Property("ModificationTime") - .HasColumnType("datetime2"); - - b.Property("Modifier") - .HasColumnType("uniqueidentifier"); - - b.HasKey("Id"); - - b.HasIndex("ConfigObjectId"); - - b.ToTable("AppConfigObjects"); - }); - - modelBuilder.Entity("Masa.Dcc.Service.Admin.Domain.App.Aggregates.AppSecret", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("AppId") - .HasColumnType("int"); - - b.Property("CreationTime") - .HasColumnType("datetime2"); - - b.Property("Creator") - .HasColumnType("uniqueidentifier"); - - b.Property("EncryptionSecret") - .HasColumnType("uniqueidentifier"); - - b.Property("EnvironmentId") - .HasColumnType("int"); - - b.Property("IsDeleted") - .HasColumnType("bit"); - - b.Property("ModificationTime") - .HasColumnType("datetime2"); - - b.Property("Modifier") - .HasColumnType("uniqueidentifier"); - - b.Property("Secret") - .HasColumnType("uniqueidentifier"); - - b.Property("Type") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.ToTable("AppSecrets"); - }); - - modelBuilder.Entity("Masa.Dcc.Service.Admin.Domain.App.Aggregates.ConfigObject", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("CreationTime") - .HasColumnType("datetime2"); - - b.Property("Creator") - .HasColumnType("uniqueidentifier"); - - b.Property("FormatLabelId") - .HasColumnType("int") - .HasComment("Format"); - - b.Property("IsDeleted") - .HasColumnType("bit"); - - b.Property("ModificationTime") - .HasColumnType("datetime2"); - - b.Property("Modifier") - .HasColumnType("uniqueidentifier"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)") - .HasComment("Name"); - - b.Property("RelationConfigObjectId") - .HasColumnType("int") - .HasComment("Relation config object Id"); - - b.Property("TypeLabelId") - .HasColumnType("int") - .HasComment("Type"); - - b.HasKey("Id"); - - b.ToTable("ConfigObjects"); - }); - - modelBuilder.Entity("Masa.Dcc.Service.Admin.Domain.App.Aggregates.ConfigObjectMain", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("ConfigObjectId") - .HasColumnType("int"); - - b.Property("Content") - .IsRequired() - .HasMaxLength(2147483647) - .HasColumnType("ntext"); - - b.Property("CreationTime") - .HasColumnType("datetime2"); - - b.Property("Creator") - .HasColumnType("uniqueidentifier"); - - b.Property("IsDeleted") - .HasColumnType("bit"); - - b.Property("ModificationTime") - .HasColumnType("datetime2"); - - b.Property("Modifier") - .HasColumnType("uniqueidentifier"); - - b.Property("TempContent") - .IsRequired() - .HasColumnType("ntext"); - - b.HasKey("Id"); - - b.HasIndex("ConfigObjectId") - .IsUnique(); - - b.ToTable("ConfigObjectMains"); - }); - - modelBuilder.Entity("Masa.Dcc.Service.Admin.Domain.App.Aggregates.PublicConfig", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("CreationTime") - .HasColumnType("datetime2"); - - b.Property("Creator") - .HasColumnType("uniqueidentifier"); - - b.Property("Description") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("Identity") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("IsDeleted") - .HasColumnType("bit"); - - b.Property("ModificationTime") - .HasColumnType("datetime2"); - - b.Property("Modifier") - .HasColumnType("uniqueidentifier"); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.ToTable("PublicConfigs"); - }); - - modelBuilder.Entity("Masa.Dcc.Service.Admin.Domain.App.Aggregates.PublicConfigObject", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("ConfigObjectId") - .HasColumnType("int"); - - b.Property("CreationTime") - .HasColumnType("datetime2"); - - b.Property("Creator") - .HasColumnType("uniqueidentifier"); - - b.Property("EnvironmentClusterId") - .HasColumnType("int"); - - b.Property("IsDeleted") - .HasColumnType("bit"); - - b.Property("ModificationTime") - .HasColumnType("datetime2"); - - b.Property("Modifier") - .HasColumnType("uniqueidentifier"); - - b.Property("PublicConfigId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("ConfigObjectId"); - - b.HasIndex("PublicConfigId"); - - b.ToTable("PublicConfigObjects"); - }); - - modelBuilder.Entity("Masa.Dcc.Service.Admin.Domain.Label.Aggregates.Label", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("CreationTime") - .HasColumnType("datetime2"); - - b.Property("Creator") - .HasColumnType("uniqueidentifier"); - - b.Property("Description") - .IsRequired() - .HasMaxLength(255) - .HasColumnType("nvarchar(255)") - .HasComment("Description"); - - b.Property("IsDeleted") - .HasColumnType("bit"); - - b.Property("ModificationTime") - .HasColumnType("datetime2"); - - b.Property("Modifier") - .HasColumnType("uniqueidentifier"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)") - .HasComment("Name"); - - b.Property("TypeCode") - .IsRequired() - .HasMaxLength(255) - .HasColumnType("nvarchar(255)") - .HasComment("TypeCode"); - - b.Property("TypeName") - .IsRequired() - .HasMaxLength(255) - .HasColumnType("nvarchar(255)") - .HasComment("TypeName"); - - b.HasKey("Id"); - - b.HasIndex(new[] { "TypeCode", "IsDeleted" }, "IX_TypeCode"); - - b.ToTable("Labels"); - }); - - modelBuilder.Entity("Masa.Dcc.Service.Admin.Domain.App.Aggregates.AppConfigObject", b => - { - b.HasOne("Masa.Dcc.Service.Admin.Domain.App.Aggregates.ConfigObject", "ConfigObject") - .WithMany() - .HasForeignKey("ConfigObjectId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("ConfigObject"); - }); - - modelBuilder.Entity("Masa.Dcc.Service.Admin.Domain.App.Aggregates.ConfigObjectMain", b => - { - b.HasOne("Masa.Dcc.Service.Admin.Domain.App.Aggregates.ConfigObject", "ConfigObject") - .WithOne("ConfigObjectMain") - .HasForeignKey("Masa.Dcc.Service.Admin.Domain.App.Aggregates.ConfigObjectMain", "ConfigObjectId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("ConfigObject"); - }); - - modelBuilder.Entity("Masa.Dcc.Service.Admin.Domain.App.Aggregates.PublicConfigObject", b => - { - b.HasOne("Masa.Dcc.Service.Admin.Domain.App.Aggregates.ConfigObject", "ConfigObject") - .WithMany() - .HasForeignKey("ConfigObjectId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Masa.Dcc.Service.Admin.Domain.App.Aggregates.PublicConfig", "PublicConfig") - .WithMany("PublicConfigObjects") - .HasForeignKey("PublicConfigId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("ConfigObject"); - - b.Navigation("PublicConfig"); - }); - - modelBuilder.Entity("Masa.Dcc.Service.Admin.Domain.App.Aggregates.ConfigObject", b => - { - b.Navigation("ConfigObjectMain"); - }); - - modelBuilder.Entity("Masa.Dcc.Service.Admin.Domain.App.Aggregates.PublicConfig", b => - { - b.Navigation("PublicConfigObjects"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/Masa.Dcc.Infrastructure.EFCore.SqlServer/Migrations/20220427062448_UpdateConfigObject.Designer.cs b/Masa.Dcc.Infrastructure.EFCore.SqlServer/Migrations/20220427062448_UpdateConfigObject.Designer.cs deleted file mode 100644 index fb43b705..00000000 --- a/Masa.Dcc.Infrastructure.EFCore.SqlServer/Migrations/20220427062448_UpdateConfigObject.Designer.cs +++ /dev/null @@ -1,387 +0,0 @@ -// -using Masa.Dcc.Infrastructure.EFCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Masa.Dcc.Service.Admin.Migrations -{ - [DbContext(typeof(DccDbContext))] - [Migration("20220427062448_UpdateConfigObject")] - partial class UpdateConfigObject - { - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "6.0.4") - .HasAnnotation("Relational:MaxIdentifierLength", 128); - - SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder, 1L, 1); - - modelBuilder.Entity("Masa.BuildingBlocks.Dispatcher.IntegrationEvents.Logs.IntegrationEventLog", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("Content") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("CreationTime") - .HasColumnType("datetime2"); - - b.Property("EventId") - .HasColumnType("uniqueidentifier"); - - b.Property("EventTypeName") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("ModificationTime") - .HasColumnType("datetime2"); - - b.Property("RowVersion") - .IsRequired() - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b.Property("State") - .HasColumnType("int"); - - b.Property("TimesSent") - .HasColumnType("int"); - - b.Property("TransactionId") - .HasColumnType("uniqueidentifier"); - - b.HasKey("Id"); - - b.HasIndex(new[] { "EventId", "RowVersion" }, "index_eventid_version"); - - b.HasIndex(new[] { "State", "ModificationTime" }, "index_state_modificationtime"); - - b.HasIndex(new[] { "State", "TimesSent", "ModificationTime" }, "index_state_timessent_modificationtime"); - - b.ToTable("IntegrationEventLog", (string)null); - }); - - modelBuilder.Entity("Masa.Dcc.Service.Admin.Domain.App.Aggregates.AppConfigObject", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("AppId") - .HasColumnType("int") - .HasComment("AppId"); - - b.Property("ConfigObjectId") - .HasColumnType("int") - .HasComment("ConfigObjectId"); - - b.Property("CreationTime") - .HasColumnType("datetime2"); - - b.Property("Creator") - .HasColumnType("uniqueidentifier"); - - b.Property("EnvironmentClusterId") - .HasColumnType("int") - .HasComment("EnvironmentClusterId"); - - b.Property("IsDeleted") - .HasColumnType("bit"); - - b.Property("ModificationTime") - .HasColumnType("datetime2"); - - b.Property("Modifier") - .HasColumnType("uniqueidentifier"); - - b.HasKey("Id"); - - b.HasIndex("ConfigObjectId"); - - b.ToTable("AppConfigObjects"); - }); - - modelBuilder.Entity("Masa.Dcc.Service.Admin.Domain.App.Aggregates.AppSecret", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("AppId") - .HasColumnType("int"); - - b.Property("CreationTime") - .HasColumnType("datetime2"); - - b.Property("Creator") - .HasColumnType("uniqueidentifier"); - - b.Property("EncryptionSecret") - .HasColumnType("uniqueidentifier"); - - b.Property("EnvironmentId") - .HasColumnType("int"); - - b.Property("IsDeleted") - .HasColumnType("bit"); - - b.Property("ModificationTime") - .HasColumnType("datetime2"); - - b.Property("Modifier") - .HasColumnType("uniqueidentifier"); - - b.Property("Secret") - .HasColumnType("uniqueidentifier"); - - b.Property("Type") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.ToTable("AppSecrets"); - }); - - modelBuilder.Entity("Masa.Dcc.Service.Admin.Domain.App.Aggregates.ConfigObject", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("Content") - .IsRequired() - .HasColumnType("ntext"); - - b.Property("CreationTime") - .HasColumnType("datetime2"); - - b.Property("Creator") - .HasColumnType("uniqueidentifier"); - - b.Property("FormatLabelId") - .HasColumnType("int") - .HasComment("Format"); - - b.Property("IsDeleted") - .HasColumnType("bit"); - - b.Property("ModificationTime") - .HasColumnType("datetime2"); - - b.Property("Modifier") - .HasColumnType("uniqueidentifier"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)") - .HasComment("Name"); - - b.Property("RelationConfigObjectId") - .HasColumnType("int") - .HasComment("Relation config object Id"); - - b.Property("TempContent") - .IsRequired() - .HasColumnType("ntext"); - - b.Property("TypeLabelId") - .HasColumnType("int") - .HasComment("Type"); - - b.HasKey("Id"); - - b.ToTable("ConfigObjects"); - }); - - modelBuilder.Entity("Masa.Dcc.Service.Admin.Domain.App.Aggregates.PublicConfig", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("CreationTime") - .HasColumnType("datetime2"); - - b.Property("Creator") - .HasColumnType("uniqueidentifier"); - - b.Property("Description") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("Identity") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("IsDeleted") - .HasColumnType("bit"); - - b.Property("ModificationTime") - .HasColumnType("datetime2"); - - b.Property("Modifier") - .HasColumnType("uniqueidentifier"); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.ToTable("PublicConfigs"); - }); - - modelBuilder.Entity("Masa.Dcc.Service.Admin.Domain.App.Aggregates.PublicConfigObject", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("ConfigObjectId") - .HasColumnType("int"); - - b.Property("CreationTime") - .HasColumnType("datetime2"); - - b.Property("Creator") - .HasColumnType("uniqueidentifier"); - - b.Property("EnvironmentClusterId") - .HasColumnType("int"); - - b.Property("IsDeleted") - .HasColumnType("bit"); - - b.Property("ModificationTime") - .HasColumnType("datetime2"); - - b.Property("Modifier") - .HasColumnType("uniqueidentifier"); - - b.Property("PublicConfigId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("ConfigObjectId"); - - b.HasIndex("PublicConfigId"); - - b.ToTable("PublicConfigObjects"); - }); - - modelBuilder.Entity("Masa.Dcc.Service.Admin.Domain.Label.Aggregates.Label", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("CreationTime") - .HasColumnType("datetime2"); - - b.Property("Creator") - .HasColumnType("uniqueidentifier"); - - b.Property("Description") - .IsRequired() - .HasMaxLength(255) - .HasColumnType("nvarchar(255)") - .HasComment("Description"); - - b.Property("IsDeleted") - .HasColumnType("bit"); - - b.Property("ModificationTime") - .HasColumnType("datetime2"); - - b.Property("Modifier") - .HasColumnType("uniqueidentifier"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)") - .HasComment("Name"); - - b.Property("TypeCode") - .IsRequired() - .HasMaxLength(255) - .HasColumnType("nvarchar(255)") - .HasComment("TypeCode"); - - b.Property("TypeName") - .IsRequired() - .HasMaxLength(255) - .HasColumnType("nvarchar(255)") - .HasComment("TypeName"); - - b.HasKey("Id"); - - b.HasIndex(new[] { "TypeCode", "IsDeleted" }, "IX_TypeCode"); - - b.ToTable("Labels"); - }); - - modelBuilder.Entity("Masa.Dcc.Service.Admin.Domain.App.Aggregates.AppConfigObject", b => - { - b.HasOne("Masa.Dcc.Service.Admin.Domain.App.Aggregates.ConfigObject", "ConfigObject") - .WithMany() - .HasForeignKey("ConfigObjectId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("ConfigObject"); - }); - - modelBuilder.Entity("Masa.Dcc.Service.Admin.Domain.App.Aggregates.PublicConfigObject", b => - { - b.HasOne("Masa.Dcc.Service.Admin.Domain.App.Aggregates.ConfigObject", "ConfigObject") - .WithMany("PublicConfigObjects") - .HasForeignKey("ConfigObjectId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Masa.Dcc.Service.Admin.Domain.App.Aggregates.PublicConfig", "PublicConfig") - .WithMany("PublicConfigObjects") - .HasForeignKey("PublicConfigId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("ConfigObject"); - - b.Navigation("PublicConfig"); - }); - - modelBuilder.Entity("Masa.Dcc.Service.Admin.Domain.App.Aggregates.ConfigObject", b => - { - b.Navigation("PublicConfigObjects"); - }); - - modelBuilder.Entity("Masa.Dcc.Service.Admin.Domain.App.Aggregates.PublicConfig", b => - { - b.Navigation("PublicConfigObjects"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/Masa.Dcc.Infrastructure.EFCore.SqlServer/Migrations/20220427062448_UpdateConfigObject.cs b/Masa.Dcc.Infrastructure.EFCore.SqlServer/Migrations/20220427062448_UpdateConfigObject.cs deleted file mode 100644 index 8304baf5..00000000 --- a/Masa.Dcc.Infrastructure.EFCore.SqlServer/Migrations/20220427062448_UpdateConfigObject.cs +++ /dev/null @@ -1,76 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the Apache License. See LICENSE.txt in the project root for license information. - -using System; -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Masa.Dcc.Service.Admin.Migrations -{ - public partial class UpdateConfigObject : Migration - { - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropTable( - name: "ConfigObjectMains"); - - migrationBuilder.AddColumn( - name: "Content", - table: "ConfigObjects", - type: "ntext", - nullable: false, - defaultValue: ""); - - migrationBuilder.AddColumn( - name: "TempContent", - table: "ConfigObjects", - type: "ntext", - nullable: false, - defaultValue: ""); - } - - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropColumn( - name: "Content", - table: "ConfigObjects"); - - migrationBuilder.DropColumn( - name: "TempContent", - table: "ConfigObjects"); - - migrationBuilder.CreateTable( - name: "ConfigObjectMains", - columns: table => new - { - Id = table.Column(type: "int", nullable: false) - .Annotation("SqlServer:Identity", "1, 1"), - ConfigObjectId = table.Column(type: "int", nullable: false), - Content = table.Column(type: "ntext", maxLength: 2147483647, nullable: false), - CreationTime = table.Column(type: "datetime2", nullable: false), - Creator = table.Column(type: "uniqueidentifier", nullable: false), - IsDeleted = table.Column(type: "bit", nullable: false), - ModificationTime = table.Column(type: "datetime2", nullable: false), - Modifier = table.Column(type: "uniqueidentifier", nullable: false), - TempContent = table.Column(type: "ntext", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_ConfigObjectMains", x => x.Id); - table.ForeignKey( - name: "FK_ConfigObjectMains_ConfigObjects_ConfigObjectId", - column: x => x.ConfigObjectId, - principalTable: "ConfigObjects", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateIndex( - name: "IX_ConfigObjectMains_ConfigObjectId", - table: "ConfigObjectMains", - column: "ConfigObjectId", - unique: true); - } - } -} diff --git a/Masa.Dcc.Infrastructure.EFCore.SqlServer/Migrations/20220427072629_AddConfigObjectRelease.Designer.cs b/Masa.Dcc.Infrastructure.EFCore.SqlServer/Migrations/20220427072629_AddConfigObjectRelease.Designer.cs deleted file mode 100644 index c4508a5e..00000000 --- a/Masa.Dcc.Infrastructure.EFCore.SqlServer/Migrations/20220427072629_AddConfigObjectRelease.Designer.cs +++ /dev/null @@ -1,450 +0,0 @@ -// -using Masa.Dcc.Infrastructure.EFCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Masa.Dcc.Service.Admin.Migrations -{ - [DbContext(typeof(DccDbContext))] - [Migration("20220427072629_AddConfigObjectRelease")] - partial class AddConfigObjectRelease - { - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "6.0.4") - .HasAnnotation("Relational:MaxIdentifierLength", 128); - - SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder, 1L, 1); - - modelBuilder.Entity("Masa.BuildingBlocks.Dispatcher.IntegrationEvents.Logs.IntegrationEventLog", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("Content") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("CreationTime") - .HasColumnType("datetime2"); - - b.Property("EventId") - .HasColumnType("uniqueidentifier"); - - b.Property("EventTypeName") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("ModificationTime") - .HasColumnType("datetime2"); - - b.Property("RowVersion") - .IsRequired() - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b.Property("State") - .HasColumnType("int"); - - b.Property("TimesSent") - .HasColumnType("int"); - - b.Property("TransactionId") - .HasColumnType("uniqueidentifier"); - - b.HasKey("Id"); - - b.HasIndex(new[] { "EventId", "RowVersion" }, "index_eventid_version"); - - b.HasIndex(new[] { "State", "ModificationTime" }, "index_state_modificationtime"); - - b.HasIndex(new[] { "State", "TimesSent", "ModificationTime" }, "index_state_timessent_modificationtime"); - - b.ToTable("IntegrationEventLog", (string)null); - }); - - modelBuilder.Entity("Masa.Dcc.Service.Admin.Domain.App.Aggregates.AppConfigObject", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("AppId") - .HasColumnType("int") - .HasComment("AppId"); - - b.Property("ConfigObjectId") - .HasColumnType("int") - .HasComment("ConfigObjectId"); - - b.Property("CreationTime") - .HasColumnType("datetime2"); - - b.Property("Creator") - .HasColumnType("uniqueidentifier"); - - b.Property("EnvironmentClusterId") - .HasColumnType("int") - .HasComment("EnvironmentClusterId"); - - b.Property("IsDeleted") - .HasColumnType("bit"); - - b.Property("ModificationTime") - .HasColumnType("datetime2"); - - b.Property("Modifier") - .HasColumnType("uniqueidentifier"); - - b.HasKey("Id"); - - b.HasIndex("ConfigObjectId"); - - b.ToTable("AppConfigObjects"); - }); - - modelBuilder.Entity("Masa.Dcc.Service.Admin.Domain.App.Aggregates.AppSecret", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("AppId") - .HasColumnType("int"); - - b.Property("CreationTime") - .HasColumnType("datetime2"); - - b.Property("Creator") - .HasColumnType("uniqueidentifier"); - - b.Property("EncryptionSecret") - .HasColumnType("uniqueidentifier"); - - b.Property("EnvironmentId") - .HasColumnType("int"); - - b.Property("IsDeleted") - .HasColumnType("bit"); - - b.Property("ModificationTime") - .HasColumnType("datetime2"); - - b.Property("Modifier") - .HasColumnType("uniqueidentifier"); - - b.Property("Secret") - .HasColumnType("uniqueidentifier"); - - b.Property("Type") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.ToTable("AppSecrets"); - }); - - modelBuilder.Entity("Masa.Dcc.Service.Admin.Domain.App.Aggregates.ConfigObject", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("Content") - .IsRequired() - .HasColumnType("ntext"); - - b.Property("CreationTime") - .HasColumnType("datetime2"); - - b.Property("Creator") - .HasColumnType("uniqueidentifier"); - - b.Property("FormatLabelId") - .HasColumnType("int") - .HasComment("Format"); - - b.Property("IsDeleted") - .HasColumnType("bit"); - - b.Property("ModificationTime") - .HasColumnType("datetime2"); - - b.Property("Modifier") - .HasColumnType("uniqueidentifier"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)") - .HasComment("Name"); - - b.Property("RelationConfigObjectId") - .HasColumnType("int") - .HasComment("Relation config object Id"); - - b.Property("TempContent") - .IsRequired() - .HasColumnType("ntext"); - - b.Property("TypeLabelId") - .HasColumnType("int") - .HasComment("Type"); - - b.HasKey("Id"); - - b.ToTable("ConfigObjects"); - }); - - modelBuilder.Entity("Masa.Dcc.Service.Admin.Domain.App.Aggregates.ConfigObjectRelease", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("Comment") - .IsRequired() - .HasMaxLength(500) - .HasColumnType("nvarchar(500)") - .HasComment("Comment"); - - b.Property("ConfigObjectId") - .HasColumnType("int") - .HasComment("Config object Id"); - - b.Property("Content") - .IsRequired() - .HasMaxLength(2147483647) - .HasColumnType("ntext") - .HasComment("Content"); - - b.Property("CreationTime") - .HasColumnType("datetime2"); - - b.Property("Creator") - .HasColumnType("uniqueidentifier"); - - b.Property("IsDeleted") - .HasColumnType("bit"); - - b.Property("ModificationTime") - .HasColumnType("datetime2"); - - b.Property("Modifier") - .HasColumnType("uniqueidentifier"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)") - .HasComment("Name"); - - b.Property("RollbackReleaseId") - .HasColumnType("int") - .HasComment("Rollback Release Id"); - - b.Property("Type") - .HasColumnType("tinyint") - .HasComment("Release type"); - - b.Property("Version") - .IsRequired() - .HasColumnType("varchar(20)") - .HasComment("Version, foramt is YYYYMMDDHHmmss"); - - b.HasKey("Id"); - - b.ToTable("ConfigObjectReleases"); - }); - - modelBuilder.Entity("Masa.Dcc.Service.Admin.Domain.App.Aggregates.PublicConfig", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("CreationTime") - .HasColumnType("datetime2"); - - b.Property("Creator") - .HasColumnType("uniqueidentifier"); - - b.Property("Description") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("Identity") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("IsDeleted") - .HasColumnType("bit"); - - b.Property("ModificationTime") - .HasColumnType("datetime2"); - - b.Property("Modifier") - .HasColumnType("uniqueidentifier"); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.ToTable("PublicConfigs"); - }); - - modelBuilder.Entity("Masa.Dcc.Service.Admin.Domain.App.Aggregates.PublicConfigObject", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("ConfigObjectId") - .HasColumnType("int"); - - b.Property("CreationTime") - .HasColumnType("datetime2"); - - b.Property("Creator") - .HasColumnType("uniqueidentifier"); - - b.Property("EnvironmentClusterId") - .HasColumnType("int"); - - b.Property("IsDeleted") - .HasColumnType("bit"); - - b.Property("ModificationTime") - .HasColumnType("datetime2"); - - b.Property("Modifier") - .HasColumnType("uniqueidentifier"); - - b.Property("PublicConfigId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("ConfigObjectId"); - - b.HasIndex("PublicConfigId"); - - b.ToTable("PublicConfigObjects"); - }); - - modelBuilder.Entity("Masa.Dcc.Service.Admin.Domain.Label.Aggregates.Label", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("CreationTime") - .HasColumnType("datetime2"); - - b.Property("Creator") - .HasColumnType("uniqueidentifier"); - - b.Property("Description") - .IsRequired() - .HasMaxLength(255) - .HasColumnType("nvarchar(255)") - .HasComment("Description"); - - b.Property("IsDeleted") - .HasColumnType("bit"); - - b.Property("ModificationTime") - .HasColumnType("datetime2"); - - b.Property("Modifier") - .HasColumnType("uniqueidentifier"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)") - .HasComment("Name"); - - b.Property("TypeCode") - .IsRequired() - .HasMaxLength(255) - .HasColumnType("nvarchar(255)") - .HasComment("TypeCode"); - - b.Property("TypeName") - .IsRequired() - .HasMaxLength(255) - .HasColumnType("nvarchar(255)") - .HasComment("TypeName"); - - b.HasKey("Id"); - - b.HasIndex(new[] { "TypeCode", "IsDeleted" }, "IX_TypeCode"); - - b.ToTable("Labels"); - }); - - modelBuilder.Entity("Masa.Dcc.Service.Admin.Domain.App.Aggregates.AppConfigObject", b => - { - b.HasOne("Masa.Dcc.Service.Admin.Domain.App.Aggregates.ConfigObject", "ConfigObject") - .WithMany() - .HasForeignKey("ConfigObjectId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("ConfigObject"); - }); - - modelBuilder.Entity("Masa.Dcc.Service.Admin.Domain.App.Aggregates.PublicConfigObject", b => - { - b.HasOne("Masa.Dcc.Service.Admin.Domain.App.Aggregates.ConfigObject", "ConfigObject") - .WithMany("PublicConfigObjects") - .HasForeignKey("ConfigObjectId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Masa.Dcc.Service.Admin.Domain.App.Aggregates.PublicConfig", "PublicConfig") - .WithMany("PublicConfigObjects") - .HasForeignKey("PublicConfigId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("ConfigObject"); - - b.Navigation("PublicConfig"); - }); - - modelBuilder.Entity("Masa.Dcc.Service.Admin.Domain.App.Aggregates.ConfigObject", b => - { - b.Navigation("PublicConfigObjects"); - }); - - modelBuilder.Entity("Masa.Dcc.Service.Admin.Domain.App.Aggregates.PublicConfig", b => - { - b.Navigation("PublicConfigObjects"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/Masa.Dcc.Infrastructure.EFCore.SqlServer/Migrations/20220427072629_AddConfigObjectRelease.cs b/Masa.Dcc.Infrastructure.EFCore.SqlServer/Migrations/20220427072629_AddConfigObjectRelease.cs deleted file mode 100644 index 809b219c..00000000 --- a/Masa.Dcc.Infrastructure.EFCore.SqlServer/Migrations/20220427072629_AddConfigObjectRelease.cs +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the Apache License. See LICENSE.txt in the project root for license information. - -using System; -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Masa.Dcc.Service.Admin.Migrations -{ - public partial class AddConfigObjectRelease : Migration - { - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.CreateTable( - name: "ConfigObjectReleases", - columns: table => new - { - Id = table.Column(type: "int", nullable: false) - .Annotation("SqlServer:Identity", "1, 1"), - Type = table.Column(type: "tinyint", nullable: false, comment: "Release type"), - ConfigObjectId = table.Column(type: "int", nullable: false, comment: "Config object Id"), - RollbackReleaseId = table.Column(type: "int", nullable: false, comment: "Rollback Release Id"), - Version = table.Column(type: "varchar(20)", nullable: false, comment: "Version, foramt is YYYYMMDDHHmmss"), - Name = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: false, comment: "Name"), - Comment = table.Column(type: "nvarchar(500)", maxLength: 500, nullable: false, comment: "Comment"), - Content = table.Column(type: "ntext", maxLength: 2147483647, nullable: false, comment: "Content"), - Creator = table.Column(type: "uniqueidentifier", nullable: false), - CreationTime = table.Column(type: "datetime2", nullable: false), - Modifier = table.Column(type: "uniqueidentifier", nullable: false), - ModificationTime = table.Column(type: "datetime2", nullable: false), - IsDeleted = table.Column(type: "bit", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_ConfigObjectReleases", x => x.Id); - }); - } - - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropTable( - name: "ConfigObjectReleases"); - } - } -} diff --git a/Masa.Dcc.Infrastructure.EFCore.SqlServer/Migrations/20220427151055_UpdateConfigObjectType.Designer.cs b/Masa.Dcc.Infrastructure.EFCore.SqlServer/Migrations/20220427151055_UpdateConfigObjectType.Designer.cs deleted file mode 100644 index 0ddcf34c..00000000 --- a/Masa.Dcc.Infrastructure.EFCore.SqlServer/Migrations/20220427151055_UpdateConfigObjectType.Designer.cs +++ /dev/null @@ -1,450 +0,0 @@ -// -using Masa.Dcc.Infrastructure.EFCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Masa.Dcc.Service.Admin.Migrations -{ - [DbContext(typeof(DccDbContext))] - [Migration("20220427151055_UpdateConfigObjectType")] - partial class UpdateConfigObjectType - { - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "6.0.4") - .HasAnnotation("Relational:MaxIdentifierLength", 128); - - SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder, 1L, 1); - - modelBuilder.Entity("Masa.BuildingBlocks.Dispatcher.IntegrationEvents.Logs.IntegrationEventLog", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("Content") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("CreationTime") - .HasColumnType("datetime2"); - - b.Property("EventId") - .HasColumnType("uniqueidentifier"); - - b.Property("EventTypeName") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("ModificationTime") - .HasColumnType("datetime2"); - - b.Property("RowVersion") - .IsRequired() - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b.Property("State") - .HasColumnType("int"); - - b.Property("TimesSent") - .HasColumnType("int"); - - b.Property("TransactionId") - .HasColumnType("uniqueidentifier"); - - b.HasKey("Id"); - - b.HasIndex(new[] { "EventId", "RowVersion" }, "index_eventid_version"); - - b.HasIndex(new[] { "State", "ModificationTime" }, "index_state_modificationtime"); - - b.HasIndex(new[] { "State", "TimesSent", "ModificationTime" }, "index_state_timessent_modificationtime"); - - b.ToTable("IntegrationEventLog", (string)null); - }); - - modelBuilder.Entity("Masa.Dcc.Service.Admin.Domain.App.Aggregates.AppConfigObject", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("AppId") - .HasColumnType("int") - .HasComment("AppId"); - - b.Property("ConfigObjectId") - .HasColumnType("int") - .HasComment("ConfigObjectId"); - - b.Property("CreationTime") - .HasColumnType("datetime2"); - - b.Property("Creator") - .HasColumnType("uniqueidentifier"); - - b.Property("EnvironmentClusterId") - .HasColumnType("int") - .HasComment("EnvironmentClusterId"); - - b.Property("IsDeleted") - .HasColumnType("bit"); - - b.Property("ModificationTime") - .HasColumnType("datetime2"); - - b.Property("Modifier") - .HasColumnType("uniqueidentifier"); - - b.HasKey("Id"); - - b.HasIndex("ConfigObjectId"); - - b.ToTable("AppConfigObjects"); - }); - - modelBuilder.Entity("Masa.Dcc.Service.Admin.Domain.App.Aggregates.AppSecret", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("AppId") - .HasColumnType("int"); - - b.Property("CreationTime") - .HasColumnType("datetime2"); - - b.Property("Creator") - .HasColumnType("uniqueidentifier"); - - b.Property("EncryptionSecret") - .HasColumnType("uniqueidentifier"); - - b.Property("EnvironmentId") - .HasColumnType("int"); - - b.Property("IsDeleted") - .HasColumnType("bit"); - - b.Property("ModificationTime") - .HasColumnType("datetime2"); - - b.Property("Modifier") - .HasColumnType("uniqueidentifier"); - - b.Property("Secret") - .HasColumnType("uniqueidentifier"); - - b.Property("Type") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.ToTable("AppSecrets"); - }); - - modelBuilder.Entity("Masa.Dcc.Service.Admin.Domain.App.Aggregates.ConfigObject", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("Content") - .IsRequired() - .HasColumnType("ntext"); - - b.Property("CreationTime") - .HasColumnType("datetime2"); - - b.Property("Creator") - .HasColumnType("uniqueidentifier"); - - b.Property("FormatLabelId") - .HasColumnType("int") - .HasComment("Format"); - - b.Property("IsDeleted") - .HasColumnType("bit"); - - b.Property("ModificationTime") - .HasColumnType("datetime2"); - - b.Property("Modifier") - .HasColumnType("uniqueidentifier"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)") - .HasComment("Name"); - - b.Property("RelationConfigObjectId") - .HasColumnType("int") - .HasComment("Relation config object Id"); - - b.Property("TempContent") - .IsRequired() - .HasColumnType("ntext"); - - b.Property("Type") - .HasColumnType("int") - .HasComment("Type"); - - b.HasKey("Id"); - - b.ToTable("ConfigObjects"); - }); - - modelBuilder.Entity("Masa.Dcc.Service.Admin.Domain.App.Aggregates.ConfigObjectRelease", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("Comment") - .IsRequired() - .HasMaxLength(500) - .HasColumnType("nvarchar(500)") - .HasComment("Comment"); - - b.Property("ConfigObjectId") - .HasColumnType("int") - .HasComment("Config object Id"); - - b.Property("Content") - .IsRequired() - .HasMaxLength(2147483647) - .HasColumnType("ntext") - .HasComment("Content"); - - b.Property("CreationTime") - .HasColumnType("datetime2"); - - b.Property("Creator") - .HasColumnType("uniqueidentifier"); - - b.Property("IsDeleted") - .HasColumnType("bit"); - - b.Property("ModificationTime") - .HasColumnType("datetime2"); - - b.Property("Modifier") - .HasColumnType("uniqueidentifier"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)") - .HasComment("Name"); - - b.Property("RollbackReleaseId") - .HasColumnType("int") - .HasComment("Rollback Release Id"); - - b.Property("Type") - .HasColumnType("tinyint") - .HasComment("Release type"); - - b.Property("Version") - .IsRequired() - .HasColumnType("varchar(20)") - .HasComment("Version foramt is YYYYMMDDHHmmss"); - - b.HasKey("Id"); - - b.ToTable("ConfigObjectReleases"); - }); - - modelBuilder.Entity("Masa.Dcc.Service.Admin.Domain.App.Aggregates.PublicConfig", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("CreationTime") - .HasColumnType("datetime2"); - - b.Property("Creator") - .HasColumnType("uniqueidentifier"); - - b.Property("Description") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("Identity") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("IsDeleted") - .HasColumnType("bit"); - - b.Property("ModificationTime") - .HasColumnType("datetime2"); - - b.Property("Modifier") - .HasColumnType("uniqueidentifier"); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.ToTable("PublicConfigs"); - }); - - modelBuilder.Entity("Masa.Dcc.Service.Admin.Domain.App.Aggregates.PublicConfigObject", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("ConfigObjectId") - .HasColumnType("int"); - - b.Property("CreationTime") - .HasColumnType("datetime2"); - - b.Property("Creator") - .HasColumnType("uniqueidentifier"); - - b.Property("EnvironmentClusterId") - .HasColumnType("int"); - - b.Property("IsDeleted") - .HasColumnType("bit"); - - b.Property("ModificationTime") - .HasColumnType("datetime2"); - - b.Property("Modifier") - .HasColumnType("uniqueidentifier"); - - b.Property("PublicConfigId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("ConfigObjectId"); - - b.HasIndex("PublicConfigId"); - - b.ToTable("PublicConfigObjects"); - }); - - modelBuilder.Entity("Masa.Dcc.Service.Admin.Domain.Label.Aggregates.Label", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("CreationTime") - .HasColumnType("datetime2"); - - b.Property("Creator") - .HasColumnType("uniqueidentifier"); - - b.Property("Description") - .IsRequired() - .HasMaxLength(255) - .HasColumnType("nvarchar(255)") - .HasComment("Description"); - - b.Property("IsDeleted") - .HasColumnType("bit"); - - b.Property("ModificationTime") - .HasColumnType("datetime2"); - - b.Property("Modifier") - .HasColumnType("uniqueidentifier"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)") - .HasComment("Name"); - - b.Property("TypeCode") - .IsRequired() - .HasMaxLength(255) - .HasColumnType("nvarchar(255)") - .HasComment("TypeCode"); - - b.Property("TypeName") - .IsRequired() - .HasMaxLength(255) - .HasColumnType("nvarchar(255)") - .HasComment("TypeName"); - - b.HasKey("Id"); - - b.HasIndex(new[] { "TypeCode", "IsDeleted" }, "IX_TypeCode"); - - b.ToTable("Labels"); - }); - - modelBuilder.Entity("Masa.Dcc.Service.Admin.Domain.App.Aggregates.AppConfigObject", b => - { - b.HasOne("Masa.Dcc.Service.Admin.Domain.App.Aggregates.ConfigObject", "ConfigObject") - .WithMany() - .HasForeignKey("ConfigObjectId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("ConfigObject"); - }); - - modelBuilder.Entity("Masa.Dcc.Service.Admin.Domain.App.Aggregates.PublicConfigObject", b => - { - b.HasOne("Masa.Dcc.Service.Admin.Domain.App.Aggregates.ConfigObject", "ConfigObject") - .WithMany("PublicConfigObjects") - .HasForeignKey("ConfigObjectId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Masa.Dcc.Service.Admin.Domain.App.Aggregates.PublicConfig", "PublicConfig") - .WithMany("PublicConfigObjects") - .HasForeignKey("PublicConfigId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("ConfigObject"); - - b.Navigation("PublicConfig"); - }); - - modelBuilder.Entity("Masa.Dcc.Service.Admin.Domain.App.Aggregates.ConfigObject", b => - { - b.Navigation("PublicConfigObjects"); - }); - - modelBuilder.Entity("Masa.Dcc.Service.Admin.Domain.App.Aggregates.PublicConfig", b => - { - b.Navigation("PublicConfigObjects"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/Masa.Dcc.Infrastructure.EFCore.SqlServer/Migrations/20220427151055_UpdateConfigObjectType.cs b/Masa.Dcc.Infrastructure.EFCore.SqlServer/Migrations/20220427151055_UpdateConfigObjectType.cs deleted file mode 100644 index c6e99f6b..00000000 --- a/Masa.Dcc.Infrastructure.EFCore.SqlServer/Migrations/20220427151055_UpdateConfigObjectType.cs +++ /dev/null @@ -1,48 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the Apache License. See LICENSE.txt in the project root for license information. - -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Masa.Dcc.Service.Admin.Migrations -{ - public partial class UpdateConfigObjectType : Migration - { - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.RenameColumn( - name: "TypeLabelId", - table: "ConfigObjects", - newName: "Type"); - - migrationBuilder.AlterColumn( - name: "Version", - table: "ConfigObjectReleases", - type: "varchar(20)", - nullable: false, - comment: "Version foramt is YYYYMMDDHHmmss", - oldClrType: typeof(string), - oldType: "varchar(20)", - oldComment: "Version, foramt is YYYYMMDDHHmmss"); - } - - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.RenameColumn( - name: "Type", - table: "ConfigObjects", - newName: "TypeLabelId"); - - migrationBuilder.AlterColumn( - name: "Version", - table: "ConfigObjectReleases", - type: "varchar(20)", - nullable: false, - comment: "Version, foramt is YYYYMMDDHHmmss", - oldClrType: typeof(string), - oldType: "varchar(20)", - oldComment: "Version foramt is YYYYMMDDHHmmss"); - } - } -} diff --git a/Masa.Dcc.Infrastructure.EFCore.SqlServer/Migrations/20220428095529_UpdateConfigObjectReleaseField.Designer.cs b/Masa.Dcc.Infrastructure.EFCore.SqlServer/Migrations/20220428095529_UpdateConfigObjectReleaseField.Designer.cs deleted file mode 100644 index 94f2fb66..00000000 --- a/Masa.Dcc.Infrastructure.EFCore.SqlServer/Migrations/20220428095529_UpdateConfigObjectReleaseField.Designer.cs +++ /dev/null @@ -1,456 +0,0 @@ -// -using Masa.Dcc.Infrastructure.EFCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Masa.Dcc.Service.Admin.Migrations -{ - [DbContext(typeof(DccDbContext))] - [Migration("20220428095529_UpdateConfigObjectReleaseField")] - partial class UpdateConfigObjectReleaseField - { - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "6.0.4") - .HasAnnotation("Relational:MaxIdentifierLength", 128); - - SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder, 1L, 1); - - modelBuilder.Entity("Masa.BuildingBlocks.Dispatcher.IntegrationEvents.Logs.IntegrationEventLog", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("Content") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("CreationTime") - .HasColumnType("datetime2"); - - b.Property("EventId") - .HasColumnType("uniqueidentifier"); - - b.Property("EventTypeName") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("ModificationTime") - .HasColumnType("datetime2"); - - b.Property("RowVersion") - .IsRequired() - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b.Property("State") - .HasColumnType("int"); - - b.Property("TimesSent") - .HasColumnType("int"); - - b.Property("TransactionId") - .HasColumnType("uniqueidentifier"); - - b.HasKey("Id"); - - b.HasIndex(new[] { "EventId", "RowVersion" }, "index_eventid_version"); - - b.HasIndex(new[] { "State", "ModificationTime" }, "index_state_modificationtime"); - - b.HasIndex(new[] { "State", "TimesSent", "ModificationTime" }, "index_state_timessent_modificationtime"); - - b.ToTable("IntegrationEventLog", (string)null); - }); - - modelBuilder.Entity("Masa.Dcc.Service.Admin.Domain.App.Aggregates.AppConfigObject", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("AppId") - .HasColumnType("int") - .HasComment("AppId"); - - b.Property("ConfigObjectId") - .HasColumnType("int") - .HasComment("ConfigObjectId"); - - b.Property("CreationTime") - .HasColumnType("datetime2"); - - b.Property("Creator") - .HasColumnType("uniqueidentifier"); - - b.Property("EnvironmentClusterId") - .HasColumnType("int") - .HasComment("EnvironmentClusterId"); - - b.Property("IsDeleted") - .HasColumnType("bit"); - - b.Property("ModificationTime") - .HasColumnType("datetime2"); - - b.Property("Modifier") - .HasColumnType("uniqueidentifier"); - - b.HasKey("Id"); - - b.HasIndex("ConfigObjectId"); - - b.ToTable("AppConfigObjects"); - }); - - modelBuilder.Entity("Masa.Dcc.Service.Admin.Domain.App.Aggregates.AppSecret", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("AppId") - .HasColumnType("int"); - - b.Property("CreationTime") - .HasColumnType("datetime2"); - - b.Property("Creator") - .HasColumnType("uniqueidentifier"); - - b.Property("EncryptionSecret") - .HasColumnType("uniqueidentifier"); - - b.Property("EnvironmentId") - .HasColumnType("int"); - - b.Property("IsDeleted") - .HasColumnType("bit"); - - b.Property("ModificationTime") - .HasColumnType("datetime2"); - - b.Property("Modifier") - .HasColumnType("uniqueidentifier"); - - b.Property("Secret") - .HasColumnType("uniqueidentifier"); - - b.Property("Type") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.ToTable("AppSecrets"); - }); - - modelBuilder.Entity("Masa.Dcc.Service.Admin.Domain.App.Aggregates.ConfigObject", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("Content") - .IsRequired() - .HasColumnType("ntext"); - - b.Property("CreationTime") - .HasColumnType("datetime2"); - - b.Property("Creator") - .HasColumnType("uniqueidentifier"); - - b.Property("FormatLabelId") - .HasColumnType("int") - .HasComment("Format"); - - b.Property("IsDeleted") - .HasColumnType("bit"); - - b.Property("ModificationTime") - .HasColumnType("datetime2"); - - b.Property("Modifier") - .HasColumnType("uniqueidentifier"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)") - .HasComment("Name"); - - b.Property("RelationConfigObjectId") - .HasColumnType("int") - .HasComment("Relation config object Id"); - - b.Property("TempContent") - .IsRequired() - .HasColumnType("ntext"); - - b.Property("Type") - .HasColumnType("int") - .HasComment("Type"); - - b.HasKey("Id"); - - b.ToTable("ConfigObjects"); - }); - - modelBuilder.Entity("Masa.Dcc.Service.Admin.Domain.App.Aggregates.ConfigObjectRelease", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("Comment") - .IsRequired() - .HasMaxLength(500) - .HasColumnType("nvarchar(500)") - .HasComment("Comment"); - - b.Property("ConfigObjectId") - .HasColumnType("int") - .HasComment("Config object Id"); - - b.Property("Content") - .IsRequired() - .HasMaxLength(2147483647) - .HasColumnType("ntext") - .HasComment("Content"); - - b.Property("CreationTime") - .HasColumnType("datetime2"); - - b.Property("Creator") - .HasColumnType("uniqueidentifier"); - - b.Property("IsDeleted") - .HasColumnType("bit"); - - b.Property("ModificationTime") - .HasColumnType("datetime2"); - - b.Property("Modifier") - .HasColumnType("uniqueidentifier"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)") - .HasComment("Name"); - - b.Property("RollbackFromReleaseId") - .HasColumnType("int") - .HasComment("Rollback From Release Id"); - - b.Property("RollbackToReleaseId") - .HasColumnType("int") - .HasComment("Rollback To Release Id"); - - b.Property("Type") - .HasColumnType("tinyint") - .HasComment("Release type"); - - b.Property("Version") - .IsRequired() - .HasColumnType("varchar(20)") - .HasComment("Version foramt is YYYYMMDDHHmmss"); - - b.HasKey("Id"); - - b.ToTable("ConfigObjectReleases"); - }); - - modelBuilder.Entity("Masa.Dcc.Service.Admin.Domain.App.Aggregates.PublicConfig", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("CreationTime") - .HasColumnType("datetime2"); - - b.Property("Creator") - .HasColumnType("uniqueidentifier"); - - b.Property("Description") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("Identity") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("IsDeleted") - .HasColumnType("bit"); - - b.Property("ModificationTime") - .HasColumnType("datetime2"); - - b.Property("Modifier") - .HasColumnType("uniqueidentifier"); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.ToTable("PublicConfigs"); - }); - - modelBuilder.Entity("Masa.Dcc.Service.Admin.Domain.App.Aggregates.PublicConfigObject", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("ConfigObjectId") - .HasColumnType("int"); - - b.Property("CreationTime") - .HasColumnType("datetime2"); - - b.Property("Creator") - .HasColumnType("uniqueidentifier"); - - b.Property("EnvironmentClusterId") - .HasColumnType("int"); - - b.Property("IsDeleted") - .HasColumnType("bit"); - - b.Property("ModificationTime") - .HasColumnType("datetime2"); - - b.Property("Modifier") - .HasColumnType("uniqueidentifier"); - - b.Property("PublicConfigId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("ConfigObjectId"); - - b.HasIndex("PublicConfigId"); - - b.ToTable("PublicConfigObjects"); - }); - - modelBuilder.Entity("Masa.Dcc.Service.Admin.Domain.Label.Aggregates.Label", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("CreationTime") - .HasColumnType("datetime2"); - - b.Property("Creator") - .HasColumnType("uniqueidentifier"); - - b.Property("Description") - .IsRequired() - .HasMaxLength(255) - .HasColumnType("nvarchar(255)") - .HasComment("Description"); - - b.Property("IsDeleted") - .HasColumnType("bit"); - - b.Property("ModificationTime") - .HasColumnType("datetime2"); - - b.Property("Modifier") - .HasColumnType("uniqueidentifier"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)") - .HasComment("Name"); - - b.Property("TypeCode") - .IsRequired() - .HasMaxLength(255) - .HasColumnType("nvarchar(255)") - .HasComment("TypeCode"); - - b.Property("TypeName") - .IsRequired() - .HasMaxLength(255) - .HasColumnType("nvarchar(255)") - .HasComment("TypeName"); - - b.HasKey("Id"); - - b.HasIndex(new[] { "TypeCode", "IsDeleted" }, "IX_TypeCode"); - - b.ToTable("Labels"); - }); - - modelBuilder.Entity("Masa.Dcc.Service.Admin.Domain.App.Aggregates.AppConfigObject", b => - { - b.HasOne("Masa.Dcc.Service.Admin.Domain.App.Aggregates.ConfigObject", "ConfigObject") - .WithMany("AppConfigObjects") - .HasForeignKey("ConfigObjectId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("ConfigObject"); - }); - - modelBuilder.Entity("Masa.Dcc.Service.Admin.Domain.App.Aggregates.PublicConfigObject", b => - { - b.HasOne("Masa.Dcc.Service.Admin.Domain.App.Aggregates.ConfigObject", "ConfigObject") - .WithMany("PublicConfigObjects") - .HasForeignKey("ConfigObjectId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Masa.Dcc.Service.Admin.Domain.App.Aggregates.PublicConfig", "PublicConfig") - .WithMany("PublicConfigObjects") - .HasForeignKey("PublicConfigId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("ConfigObject"); - - b.Navigation("PublicConfig"); - }); - - modelBuilder.Entity("Masa.Dcc.Service.Admin.Domain.App.Aggregates.ConfigObject", b => - { - b.Navigation("AppConfigObjects"); - - b.Navigation("PublicConfigObjects"); - }); - - modelBuilder.Entity("Masa.Dcc.Service.Admin.Domain.App.Aggregates.PublicConfig", b => - { - b.Navigation("PublicConfigObjects"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/Masa.Dcc.Infrastructure.EFCore.SqlServer/Migrations/20220428095529_UpdateConfigObjectReleaseField.cs b/Masa.Dcc.Infrastructure.EFCore.SqlServer/Migrations/20220428095529_UpdateConfigObjectReleaseField.cs deleted file mode 100644 index 32461e3e..00000000 --- a/Masa.Dcc.Infrastructure.EFCore.SqlServer/Migrations/20220428095529_UpdateConfigObjectReleaseField.cs +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the Apache License. See LICENSE.txt in the project root for license information. - -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Masa.Dcc.Service.Admin.Migrations -{ - public partial class UpdateConfigObjectReleaseField : Migration - { - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropColumn( - name: "RollbackReleaseId", - table: "ConfigObjectReleases"); - - migrationBuilder.AddColumn( - name: "RollbackFromReleaseId", - table: "ConfigObjectReleases", - type: "int", - nullable: false, - defaultValue: 0, - comment: "Rollback From Release Id"); - - migrationBuilder.AddColumn( - name: "RollbackToReleaseId", - table: "ConfigObjectReleases", - type: "int", - nullable: false, - defaultValue: 0, - comment: "Rollback To Release Id"); - } - - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropColumn( - name: "RollbackFromReleaseId", - table: "ConfigObjectReleases"); - - migrationBuilder.DropColumn( - name: "RollbackToReleaseId", - table: "ConfigObjectReleases"); - - migrationBuilder.AddColumn( - name: "RollbackReleaseId", - table: "ConfigObjectReleases", - type: "int", - nullable: false, - defaultValue: 0, - comment: "Rollback Release Id"); - } - } -} diff --git a/Masa.Dcc.Infrastructure.EFCore.SqlServer/Migrations/20220428145639_AddConfigObjectReleaseField.Designer.cs b/Masa.Dcc.Infrastructure.EFCore.SqlServer/Migrations/20220428145639_AddConfigObjectReleaseField.Designer.cs deleted file mode 100644 index bc22cb1e..00000000 --- a/Masa.Dcc.Infrastructure.EFCore.SqlServer/Migrations/20220428145639_AddConfigObjectReleaseField.Designer.cs +++ /dev/null @@ -1,460 +0,0 @@ -// -using Masa.Dcc.Infrastructure.EFCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Masa.Dcc.Service.Admin.Migrations -{ - [DbContext(typeof(DccDbContext))] - [Migration("20220428145639_AddConfigObjectReleaseField")] - partial class AddConfigObjectReleaseField - { - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "6.0.4") - .HasAnnotation("Relational:MaxIdentifierLength", 128); - - SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder, 1L, 1); - - modelBuilder.Entity("Masa.BuildingBlocks.Dispatcher.IntegrationEvents.Logs.IntegrationEventLog", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("Content") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("CreationTime") - .HasColumnType("datetime2"); - - b.Property("EventId") - .HasColumnType("uniqueidentifier"); - - b.Property("EventTypeName") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("ModificationTime") - .HasColumnType("datetime2"); - - b.Property("RowVersion") - .IsRequired() - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b.Property("State") - .HasColumnType("int"); - - b.Property("TimesSent") - .HasColumnType("int"); - - b.Property("TransactionId") - .HasColumnType("uniqueidentifier"); - - b.HasKey("Id"); - - b.HasIndex(new[] { "EventId", "RowVersion" }, "index_eventid_version"); - - b.HasIndex(new[] { "State", "ModificationTime" }, "index_state_modificationtime"); - - b.HasIndex(new[] { "State", "TimesSent", "ModificationTime" }, "index_state_timessent_modificationtime"); - - b.ToTable("IntegrationEventLog", (string)null); - }); - - modelBuilder.Entity("Masa.Dcc.Service.Admin.Domain.App.Aggregates.AppConfigObject", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("AppId") - .HasColumnType("int") - .HasComment("AppId"); - - b.Property("ConfigObjectId") - .HasColumnType("int") - .HasComment("ConfigObjectId"); - - b.Property("CreationTime") - .HasColumnType("datetime2"); - - b.Property("Creator") - .HasColumnType("uniqueidentifier"); - - b.Property("EnvironmentClusterId") - .HasColumnType("int") - .HasComment("EnvironmentClusterId"); - - b.Property("IsDeleted") - .HasColumnType("bit"); - - b.Property("ModificationTime") - .HasColumnType("datetime2"); - - b.Property("Modifier") - .HasColumnType("uniqueidentifier"); - - b.HasKey("Id"); - - b.HasIndex("ConfigObjectId"); - - b.ToTable("AppConfigObjects"); - }); - - modelBuilder.Entity("Masa.Dcc.Service.Admin.Domain.App.Aggregates.AppSecret", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("AppId") - .HasColumnType("int"); - - b.Property("CreationTime") - .HasColumnType("datetime2"); - - b.Property("Creator") - .HasColumnType("uniqueidentifier"); - - b.Property("EncryptionSecret") - .HasColumnType("uniqueidentifier"); - - b.Property("EnvironmentId") - .HasColumnType("int"); - - b.Property("IsDeleted") - .HasColumnType("bit"); - - b.Property("ModificationTime") - .HasColumnType("datetime2"); - - b.Property("Modifier") - .HasColumnType("uniqueidentifier"); - - b.Property("Secret") - .HasColumnType("uniqueidentifier"); - - b.Property("Type") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.ToTable("AppSecrets"); - }); - - modelBuilder.Entity("Masa.Dcc.Service.Admin.Domain.App.Aggregates.ConfigObject", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("Content") - .IsRequired() - .HasColumnType("ntext"); - - b.Property("CreationTime") - .HasColumnType("datetime2"); - - b.Property("Creator") - .HasColumnType("uniqueidentifier"); - - b.Property("FormatLabelId") - .HasColumnType("int") - .HasComment("Format"); - - b.Property("IsDeleted") - .HasColumnType("bit"); - - b.Property("ModificationTime") - .HasColumnType("datetime2"); - - b.Property("Modifier") - .HasColumnType("uniqueidentifier"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)") - .HasComment("Name"); - - b.Property("RelationConfigObjectId") - .HasColumnType("int") - .HasComment("Relation config object Id"); - - b.Property("TempContent") - .IsRequired() - .HasColumnType("ntext"); - - b.Property("Type") - .HasColumnType("int") - .HasComment("Type"); - - b.HasKey("Id"); - - b.ToTable("ConfigObjects"); - }); - - modelBuilder.Entity("Masa.Dcc.Service.Admin.Domain.App.Aggregates.ConfigObjectRelease", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("Comment") - .IsRequired() - .HasMaxLength(500) - .HasColumnType("nvarchar(500)") - .HasComment("Comment"); - - b.Property("ConfigObjectId") - .HasColumnType("int") - .HasComment("Config object Id"); - - b.Property("Content") - .IsRequired() - .HasMaxLength(2147483647) - .HasColumnType("ntext") - .HasComment("Content"); - - b.Property("CreationTime") - .HasColumnType("datetime2"); - - b.Property("Creator") - .HasColumnType("uniqueidentifier"); - - b.Property("IsDeleted") - .HasColumnType("bit"); - - b.Property("IsInvalid") - .HasColumnType("bit") - .HasComment("If it is rolled back, it will be true"); - - b.Property("ModificationTime") - .HasColumnType("datetime2"); - - b.Property("Modifier") - .HasColumnType("uniqueidentifier"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)") - .HasComment("Name"); - - b.Property("RollbackFromReleaseId") - .HasColumnType("int") - .HasComment("Rollback From Release Id"); - - b.Property("RollbackToReleaseId") - .HasColumnType("int") - .HasComment("Rollback To Release Id"); - - b.Property("Type") - .HasColumnType("tinyint") - .HasComment("Release type"); - - b.Property("Version") - .IsRequired() - .HasColumnType("varchar(20)") - .HasComment("Version foramt is YYYYMMDDHHmmss"); - - b.HasKey("Id"); - - b.ToTable("ConfigObjectReleases"); - }); - - modelBuilder.Entity("Masa.Dcc.Service.Admin.Domain.App.Aggregates.PublicConfig", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("CreationTime") - .HasColumnType("datetime2"); - - b.Property("Creator") - .HasColumnType("uniqueidentifier"); - - b.Property("Description") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("Identity") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("IsDeleted") - .HasColumnType("bit"); - - b.Property("ModificationTime") - .HasColumnType("datetime2"); - - b.Property("Modifier") - .HasColumnType("uniqueidentifier"); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.ToTable("PublicConfigs"); - }); - - modelBuilder.Entity("Masa.Dcc.Service.Admin.Domain.App.Aggregates.PublicConfigObject", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("ConfigObjectId") - .HasColumnType("int"); - - b.Property("CreationTime") - .HasColumnType("datetime2"); - - b.Property("Creator") - .HasColumnType("uniqueidentifier"); - - b.Property("EnvironmentClusterId") - .HasColumnType("int"); - - b.Property("IsDeleted") - .HasColumnType("bit"); - - b.Property("ModificationTime") - .HasColumnType("datetime2"); - - b.Property("Modifier") - .HasColumnType("uniqueidentifier"); - - b.Property("PublicConfigId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("ConfigObjectId"); - - b.HasIndex("PublicConfigId"); - - b.ToTable("PublicConfigObjects"); - }); - - modelBuilder.Entity("Masa.Dcc.Service.Admin.Domain.Label.Aggregates.Label", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("CreationTime") - .HasColumnType("datetime2"); - - b.Property("Creator") - .HasColumnType("uniqueidentifier"); - - b.Property("Description") - .IsRequired() - .HasMaxLength(255) - .HasColumnType("nvarchar(255)") - .HasComment("Description"); - - b.Property("IsDeleted") - .HasColumnType("bit"); - - b.Property("ModificationTime") - .HasColumnType("datetime2"); - - b.Property("Modifier") - .HasColumnType("uniqueidentifier"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)") - .HasComment("Name"); - - b.Property("TypeCode") - .IsRequired() - .HasMaxLength(255) - .HasColumnType("nvarchar(255)") - .HasComment("TypeCode"); - - b.Property("TypeName") - .IsRequired() - .HasMaxLength(255) - .HasColumnType("nvarchar(255)") - .HasComment("TypeName"); - - b.HasKey("Id"); - - b.HasIndex(new[] { "TypeCode", "IsDeleted" }, "IX_TypeCode"); - - b.ToTable("Labels"); - }); - - modelBuilder.Entity("Masa.Dcc.Service.Admin.Domain.App.Aggregates.AppConfigObject", b => - { - b.HasOne("Masa.Dcc.Service.Admin.Domain.App.Aggregates.ConfigObject", "ConfigObject") - .WithMany("AppConfigObjects") - .HasForeignKey("ConfigObjectId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("ConfigObject"); - }); - - modelBuilder.Entity("Masa.Dcc.Service.Admin.Domain.App.Aggregates.PublicConfigObject", b => - { - b.HasOne("Masa.Dcc.Service.Admin.Domain.App.Aggregates.ConfigObject", "ConfigObject") - .WithMany("PublicConfigObjects") - .HasForeignKey("ConfigObjectId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Masa.Dcc.Service.Admin.Domain.App.Aggregates.PublicConfig", "PublicConfig") - .WithMany("PublicConfigObjects") - .HasForeignKey("PublicConfigId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("ConfigObject"); - - b.Navigation("PublicConfig"); - }); - - modelBuilder.Entity("Masa.Dcc.Service.Admin.Domain.App.Aggregates.ConfigObject", b => - { - b.Navigation("AppConfigObjects"); - - b.Navigation("PublicConfigObjects"); - }); - - modelBuilder.Entity("Masa.Dcc.Service.Admin.Domain.App.Aggregates.PublicConfig", b => - { - b.Navigation("PublicConfigObjects"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/Masa.Dcc.Infrastructure.EFCore.SqlServer/Migrations/20220428145639_AddConfigObjectReleaseField.cs b/Masa.Dcc.Infrastructure.EFCore.SqlServer/Migrations/20220428145639_AddConfigObjectReleaseField.cs deleted file mode 100644 index a189c4a4..00000000 --- a/Masa.Dcc.Infrastructure.EFCore.SqlServer/Migrations/20220428145639_AddConfigObjectReleaseField.cs +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the Apache License. See LICENSE.txt in the project root for license information. - -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Masa.Dcc.Service.Admin.Migrations -{ - public partial class AddConfigObjectReleaseField : Migration - { - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.AddColumn( - name: "IsInvalid", - table: "ConfigObjectReleases", - type: "bit", - nullable: false, - defaultValue: false, - comment: "If it is rolled back, it will be true"); - } - - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropColumn( - name: "IsInvalid", - table: "ConfigObjectReleases"); - } - } -} diff --git a/Masa.Dcc.Infrastructure.EFCore.SqlServer/Migrations/20220428164222_UpdateConfigObjectReleaseRollbackField.Designer.cs b/Masa.Dcc.Infrastructure.EFCore.SqlServer/Migrations/20220428164222_UpdateConfigObjectReleaseRollbackField.Designer.cs deleted file mode 100644 index a1408034..00000000 --- a/Masa.Dcc.Infrastructure.EFCore.SqlServer/Migrations/20220428164222_UpdateConfigObjectReleaseRollbackField.Designer.cs +++ /dev/null @@ -1,460 +0,0 @@ -// -using Masa.Dcc.Infrastructure.EFCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Masa.Dcc.Service.Admin.Migrations -{ - [DbContext(typeof(DccDbContext))] - [Migration("20220428164222_UpdateConfigObjectReleaseRollbackField")] - partial class UpdateConfigObjectReleaseRollbackField - { - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "6.0.4") - .HasAnnotation("Relational:MaxIdentifierLength", 128); - - SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder, 1L, 1); - - modelBuilder.Entity("Masa.BuildingBlocks.Dispatcher.IntegrationEvents.Logs.IntegrationEventLog", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("Content") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("CreationTime") - .HasColumnType("datetime2"); - - b.Property("EventId") - .HasColumnType("uniqueidentifier"); - - b.Property("EventTypeName") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("ModificationTime") - .HasColumnType("datetime2"); - - b.Property("RowVersion") - .IsRequired() - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b.Property("State") - .HasColumnType("int"); - - b.Property("TimesSent") - .HasColumnType("int"); - - b.Property("TransactionId") - .HasColumnType("uniqueidentifier"); - - b.HasKey("Id"); - - b.HasIndex(new[] { "EventId", "RowVersion" }, "index_eventid_version"); - - b.HasIndex(new[] { "State", "ModificationTime" }, "index_state_modificationtime"); - - b.HasIndex(new[] { "State", "TimesSent", "ModificationTime" }, "index_state_timessent_modificationtime"); - - b.ToTable("IntegrationEventLog", (string)null); - }); - - modelBuilder.Entity("Masa.Dcc.Service.Admin.Domain.App.Aggregates.AppConfigObject", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("AppId") - .HasColumnType("int") - .HasComment("AppId"); - - b.Property("ConfigObjectId") - .HasColumnType("int") - .HasComment("ConfigObjectId"); - - b.Property("CreationTime") - .HasColumnType("datetime2"); - - b.Property("Creator") - .HasColumnType("uniqueidentifier"); - - b.Property("EnvironmentClusterId") - .HasColumnType("int") - .HasComment("EnvironmentClusterId"); - - b.Property("IsDeleted") - .HasColumnType("bit"); - - b.Property("ModificationTime") - .HasColumnType("datetime2"); - - b.Property("Modifier") - .HasColumnType("uniqueidentifier"); - - b.HasKey("Id"); - - b.HasIndex("ConfigObjectId"); - - b.ToTable("AppConfigObjects"); - }); - - modelBuilder.Entity("Masa.Dcc.Service.Admin.Domain.App.Aggregates.AppSecret", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("AppId") - .HasColumnType("int"); - - b.Property("CreationTime") - .HasColumnType("datetime2"); - - b.Property("Creator") - .HasColumnType("uniqueidentifier"); - - b.Property("EncryptionSecret") - .HasColumnType("uniqueidentifier"); - - b.Property("EnvironmentId") - .HasColumnType("int"); - - b.Property("IsDeleted") - .HasColumnType("bit"); - - b.Property("ModificationTime") - .HasColumnType("datetime2"); - - b.Property("Modifier") - .HasColumnType("uniqueidentifier"); - - b.Property("Secret") - .HasColumnType("uniqueidentifier"); - - b.Property("Type") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.ToTable("AppSecrets"); - }); - - modelBuilder.Entity("Masa.Dcc.Service.Admin.Domain.App.Aggregates.ConfigObject", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("Content") - .IsRequired() - .HasColumnType("ntext"); - - b.Property("CreationTime") - .HasColumnType("datetime2"); - - b.Property("Creator") - .HasColumnType("uniqueidentifier"); - - b.Property("FormatLabelId") - .HasColumnType("int") - .HasComment("Format"); - - b.Property("IsDeleted") - .HasColumnType("bit"); - - b.Property("ModificationTime") - .HasColumnType("datetime2"); - - b.Property("Modifier") - .HasColumnType("uniqueidentifier"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)") - .HasComment("Name"); - - b.Property("RelationConfigObjectId") - .HasColumnType("int") - .HasComment("Relation config object Id"); - - b.Property("TempContent") - .IsRequired() - .HasColumnType("ntext"); - - b.Property("Type") - .HasColumnType("int") - .HasComment("Type"); - - b.HasKey("Id"); - - b.ToTable("ConfigObjects"); - }); - - modelBuilder.Entity("Masa.Dcc.Service.Admin.Domain.App.Aggregates.ConfigObjectRelease", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("Comment") - .IsRequired() - .HasMaxLength(500) - .HasColumnType("nvarchar(500)") - .HasComment("Comment"); - - b.Property("ConfigObjectId") - .HasColumnType("int") - .HasComment("Config object Id"); - - b.Property("Content") - .IsRequired() - .HasMaxLength(2147483647) - .HasColumnType("ntext") - .HasComment("Content"); - - b.Property("CreationTime") - .HasColumnType("datetime2"); - - b.Property("Creator") - .HasColumnType("uniqueidentifier"); - - b.Property("FromReleaseId") - .HasColumnType("int") - .HasComment("Rollback From Release Id"); - - b.Property("IsDeleted") - .HasColumnType("bit"); - - b.Property("IsInvalid") - .HasColumnType("bit") - .HasComment("If it is rolled back, it will be true"); - - b.Property("ModificationTime") - .HasColumnType("datetime2"); - - b.Property("Modifier") - .HasColumnType("uniqueidentifier"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)") - .HasComment("Name"); - - b.Property("ToReleaseId") - .HasColumnType("int") - .HasComment("Rollback To Release Id"); - - b.Property("Type") - .HasColumnType("tinyint") - .HasComment("Release type"); - - b.Property("Version") - .IsRequired() - .HasColumnType("varchar(20)") - .HasComment("Version foramt is YYYYMMDDHHmmss"); - - b.HasKey("Id"); - - b.ToTable("ConfigObjectReleases"); - }); - - modelBuilder.Entity("Masa.Dcc.Service.Admin.Domain.App.Aggregates.PublicConfig", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("CreationTime") - .HasColumnType("datetime2"); - - b.Property("Creator") - .HasColumnType("uniqueidentifier"); - - b.Property("Description") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("Identity") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("IsDeleted") - .HasColumnType("bit"); - - b.Property("ModificationTime") - .HasColumnType("datetime2"); - - b.Property("Modifier") - .HasColumnType("uniqueidentifier"); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.ToTable("PublicConfigs"); - }); - - modelBuilder.Entity("Masa.Dcc.Service.Admin.Domain.App.Aggregates.PublicConfigObject", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("ConfigObjectId") - .HasColumnType("int"); - - b.Property("CreationTime") - .HasColumnType("datetime2"); - - b.Property("Creator") - .HasColumnType("uniqueidentifier"); - - b.Property("EnvironmentClusterId") - .HasColumnType("int"); - - b.Property("IsDeleted") - .HasColumnType("bit"); - - b.Property("ModificationTime") - .HasColumnType("datetime2"); - - b.Property("Modifier") - .HasColumnType("uniqueidentifier"); - - b.Property("PublicConfigId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("ConfigObjectId"); - - b.HasIndex("PublicConfigId"); - - b.ToTable("PublicConfigObjects"); - }); - - modelBuilder.Entity("Masa.Dcc.Service.Admin.Domain.Label.Aggregates.Label", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("CreationTime") - .HasColumnType("datetime2"); - - b.Property("Creator") - .HasColumnType("uniqueidentifier"); - - b.Property("Description") - .IsRequired() - .HasMaxLength(255) - .HasColumnType("nvarchar(255)") - .HasComment("Description"); - - b.Property("IsDeleted") - .HasColumnType("bit"); - - b.Property("ModificationTime") - .HasColumnType("datetime2"); - - b.Property("Modifier") - .HasColumnType("uniqueidentifier"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)") - .HasComment("Name"); - - b.Property("TypeCode") - .IsRequired() - .HasMaxLength(255) - .HasColumnType("nvarchar(255)") - .HasComment("TypeCode"); - - b.Property("TypeName") - .IsRequired() - .HasMaxLength(255) - .HasColumnType("nvarchar(255)") - .HasComment("TypeName"); - - b.HasKey("Id"); - - b.HasIndex(new[] { "TypeCode", "IsDeleted" }, "IX_TypeCode"); - - b.ToTable("Labels"); - }); - - modelBuilder.Entity("Masa.Dcc.Service.Admin.Domain.App.Aggregates.AppConfigObject", b => - { - b.HasOne("Masa.Dcc.Service.Admin.Domain.App.Aggregates.ConfigObject", "ConfigObject") - .WithMany("AppConfigObjects") - .HasForeignKey("ConfigObjectId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("ConfigObject"); - }); - - modelBuilder.Entity("Masa.Dcc.Service.Admin.Domain.App.Aggregates.PublicConfigObject", b => - { - b.HasOne("Masa.Dcc.Service.Admin.Domain.App.Aggregates.ConfigObject", "ConfigObject") - .WithMany("PublicConfigObjects") - .HasForeignKey("ConfigObjectId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Masa.Dcc.Service.Admin.Domain.App.Aggregates.PublicConfig", "PublicConfig") - .WithMany("PublicConfigObjects") - .HasForeignKey("PublicConfigId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("ConfigObject"); - - b.Navigation("PublicConfig"); - }); - - modelBuilder.Entity("Masa.Dcc.Service.Admin.Domain.App.Aggregates.ConfigObject", b => - { - b.Navigation("AppConfigObjects"); - - b.Navigation("PublicConfigObjects"); - }); - - modelBuilder.Entity("Masa.Dcc.Service.Admin.Domain.App.Aggregates.PublicConfig", b => - { - b.Navigation("PublicConfigObjects"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/Masa.Dcc.Infrastructure.EFCore.SqlServer/Migrations/20220428164222_UpdateConfigObjectReleaseRollbackField.cs b/Masa.Dcc.Infrastructure.EFCore.SqlServer/Migrations/20220428164222_UpdateConfigObjectReleaseRollbackField.cs deleted file mode 100644 index 40373418..00000000 --- a/Masa.Dcc.Infrastructure.EFCore.SqlServer/Migrations/20220428164222_UpdateConfigObjectReleaseRollbackField.cs +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the Apache License. See LICENSE.txt in the project root for license information. - -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Masa.Dcc.Service.Admin.Migrations -{ - public partial class UpdateConfigObjectReleaseRollbackField : Migration - { - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.RenameColumn( - name: "RollbackToReleaseId", - table: "ConfigObjectReleases", - newName: "ToReleaseId"); - - migrationBuilder.RenameColumn( - name: "RollbackFromReleaseId", - table: "ConfigObjectReleases", - newName: "FromReleaseId"); - } - - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.RenameColumn( - name: "ToReleaseId", - table: "ConfigObjectReleases", - newName: "RollbackToReleaseId"); - - migrationBuilder.RenameColumn( - name: "FromReleaseId", - table: "ConfigObjectReleases", - newName: "RollbackFromReleaseId"); - } - } -} diff --git a/Masa.Dcc.Infrastructure.EFCore.SqlServer/Migrations/20220509084824_AddAppPin.Designer.cs b/Masa.Dcc.Infrastructure.EFCore.SqlServer/Migrations/20220509084824_AddAppPin.Designer.cs deleted file mode 100644 index bdef772b..00000000 --- a/Masa.Dcc.Infrastructure.EFCore.SqlServer/Migrations/20220509084824_AddAppPin.Designer.cs +++ /dev/null @@ -1,508 +0,0 @@ -// -using Masa.Dcc.Infrastructure.EFCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Masa.Dcc.Service.Admin.Migrations -{ - [DbContext(typeof(DccDbContext))] - [Migration("20220509084824_AddAppPin")] - partial class AddAppPin - { - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "6.0.4") - .HasAnnotation("Relational:MaxIdentifierLength", 128); - - SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder, 1L, 1); - - modelBuilder.Entity("Masa.BuildingBlocks.Dispatcher.IntegrationEvents.Logs.IntegrationEventLog", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("Content") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("CreationTime") - .HasColumnType("datetime2"); - - b.Property("EventId") - .HasColumnType("uniqueidentifier"); - - b.Property("EventTypeName") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("ModificationTime") - .HasColumnType("datetime2"); - - b.Property("RowVersion") - .IsRequired() - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b.Property("State") - .HasColumnType("int"); - - b.Property("TimesSent") - .HasColumnType("int"); - - b.Property("TransactionId") - .HasColumnType("uniqueidentifier"); - - b.HasKey("Id"); - - b.HasIndex(new[] { "EventId", "RowVersion" }, "index_eventid_version"); - - b.HasIndex(new[] { "State", "ModificationTime" }, "index_state_modificationtime"); - - b.HasIndex(new[] { "State", "TimesSent", "ModificationTime" }, "index_state_timessent_modificationtime"); - - b.ToTable("IntegrationEventLog", (string)null); - }); - - modelBuilder.Entity("Masa.Dcc.Service.Admin.Domain.App.Aggregates.AppConfigObject", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("AppId") - .HasColumnType("int") - .HasComment("AppId"); - - b.Property("ConfigObjectId") - .HasColumnType("int") - .HasComment("ConfigObjectId"); - - b.Property("CreationTime") - .HasColumnType("datetime2"); - - b.Property("Creator") - .HasColumnType("uniqueidentifier"); - - b.Property("EnvironmentClusterId") - .HasColumnType("int") - .HasComment("EnvironmentClusterId"); - - b.Property("IsDeleted") - .HasColumnType("bit"); - - b.Property("ModificationTime") - .HasColumnType("datetime2"); - - b.Property("Modifier") - .HasColumnType("uniqueidentifier"); - - b.HasKey("Id"); - - b.HasIndex("ConfigObjectId") - .IsUnique(); - - b.ToTable("AppConfigObjects"); - }); - - modelBuilder.Entity("Masa.Dcc.Service.Admin.Domain.App.Aggregates.AppPin", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("AppId") - .HasColumnType("int"); - - b.Property("CreationTime") - .HasColumnType("datetime2"); - - b.Property("Creator") - .HasColumnType("uniqueidentifier"); - - b.Property("IsDeleted") - .HasColumnType("bit"); - - b.Property("ModificationTime") - .HasColumnType("datetime2"); - - b.Property("Modifier") - .HasColumnType("uniqueidentifier"); - - b.HasKey("Id"); - - b.ToTable("AppPin"); - }); - - modelBuilder.Entity("Masa.Dcc.Service.Admin.Domain.App.Aggregates.AppSecret", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("AppId") - .HasColumnType("int"); - - b.Property("CreationTime") - .HasColumnType("datetime2"); - - b.Property("Creator") - .HasColumnType("uniqueidentifier"); - - b.Property("EncryptionSecret") - .HasColumnType("uniqueidentifier"); - - b.Property("EnvironmentId") - .HasColumnType("int"); - - b.Property("IsDeleted") - .HasColumnType("bit"); - - b.Property("ModificationTime") - .HasColumnType("datetime2"); - - b.Property("Modifier") - .HasColumnType("uniqueidentifier"); - - b.Property("Secret") - .HasColumnType("uniqueidentifier"); - - b.Property("Type") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.ToTable("AppSecrets"); - }); - - modelBuilder.Entity("Masa.Dcc.Service.Admin.Domain.App.Aggregates.ConfigObject", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("Content") - .IsRequired() - .HasColumnType("ntext"); - - b.Property("CreationTime") - .HasColumnType("datetime2"); - - b.Property("Creator") - .HasColumnType("uniqueidentifier"); - - b.Property("FormatLabelId") - .HasColumnType("int") - .HasComment("Format"); - - b.Property("IsDeleted") - .HasColumnType("bit"); - - b.Property("ModificationTime") - .HasColumnType("datetime2"); - - b.Property("Modifier") - .HasColumnType("uniqueidentifier"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)") - .HasComment("Name"); - - b.Property("RelationConfigObjectId") - .HasColumnType("int") - .HasComment("Relation config object Id"); - - b.Property("TempContent") - .IsRequired() - .HasColumnType("ntext"); - - b.Property("Type") - .HasColumnType("int") - .HasComment("Type"); - - b.HasKey("Id"); - - b.ToTable("ConfigObjects"); - }); - - modelBuilder.Entity("Masa.Dcc.Service.Admin.Domain.App.Aggregates.ConfigObjectRelease", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("Comment") - .IsRequired() - .HasMaxLength(500) - .HasColumnType("nvarchar(500)") - .HasComment("Comment"); - - b.Property("ConfigObjectId") - .HasColumnType("int") - .HasComment("Config object Id"); - - b.Property("Content") - .IsRequired() - .HasMaxLength(2147483647) - .HasColumnType("ntext") - .HasComment("Content"); - - b.Property("CreationTime") - .HasColumnType("datetime2"); - - b.Property("Creator") - .HasColumnType("uniqueidentifier"); - - b.Property("FromReleaseId") - .HasColumnType("int") - .HasComment("Rollback From Release Id"); - - b.Property("IsDeleted") - .HasColumnType("bit"); - - b.Property("IsInvalid") - .HasColumnType("bit") - .HasComment("If it is rolled back, it will be true"); - - b.Property("ModificationTime") - .HasColumnType("datetime2"); - - b.Property("Modifier") - .HasColumnType("uniqueidentifier"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)") - .HasComment("Name"); - - b.Property("ToReleaseId") - .HasColumnType("int") - .HasComment("Rollback To Release Id"); - - b.Property("Type") - .HasColumnType("tinyint") - .HasComment("Release type"); - - b.Property("Version") - .IsRequired() - .HasColumnType("varchar(20)") - .HasComment("Version foramt is yyyyMMddHHmmss"); - - b.HasKey("Id"); - - b.HasIndex("ConfigObjectId"); - - b.ToTable("ConfigObjectReleases"); - }); - - modelBuilder.Entity("Masa.Dcc.Service.Admin.Domain.App.Aggregates.PublicConfig", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("CreationTime") - .HasColumnType("datetime2"); - - b.Property("Creator") - .HasColumnType("uniqueidentifier"); - - b.Property("Description") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("Identity") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("IsDeleted") - .HasColumnType("bit"); - - b.Property("ModificationTime") - .HasColumnType("datetime2"); - - b.Property("Modifier") - .HasColumnType("uniqueidentifier"); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.ToTable("PublicConfigs"); - }); - - modelBuilder.Entity("Masa.Dcc.Service.Admin.Domain.App.Aggregates.PublicConfigObject", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("ConfigObjectId") - .HasColumnType("int"); - - b.Property("CreationTime") - .HasColumnType("datetime2"); - - b.Property("Creator") - .HasColumnType("uniqueidentifier"); - - b.Property("EnvironmentClusterId") - .HasColumnType("int"); - - b.Property("IsDeleted") - .HasColumnType("bit"); - - b.Property("ModificationTime") - .HasColumnType("datetime2"); - - b.Property("Modifier") - .HasColumnType("uniqueidentifier"); - - b.Property("PublicConfigId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("ConfigObjectId") - .IsUnique(); - - b.HasIndex("PublicConfigId"); - - b.ToTable("PublicConfigObjects"); - }); - - modelBuilder.Entity("Masa.Dcc.Service.Admin.Domain.Label.Aggregates.Label", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("CreationTime") - .HasColumnType("datetime2"); - - b.Property("Creator") - .HasColumnType("uniqueidentifier"); - - b.Property("Description") - .IsRequired() - .HasMaxLength(255) - .HasColumnType("nvarchar(255)") - .HasComment("Description"); - - b.Property("IsDeleted") - .HasColumnType("bit"); - - b.Property("ModificationTime") - .HasColumnType("datetime2"); - - b.Property("Modifier") - .HasColumnType("uniqueidentifier"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)") - .HasComment("Name"); - - b.Property("TypeCode") - .IsRequired() - .HasMaxLength(255) - .HasColumnType("nvarchar(255)") - .HasComment("TypeCode"); - - b.Property("TypeName") - .IsRequired() - .HasMaxLength(255) - .HasColumnType("nvarchar(255)") - .HasComment("TypeName"); - - b.HasKey("Id"); - - b.HasIndex(new[] { "TypeCode", "IsDeleted" }, "IX_TypeCode"); - - b.ToTable("Labels"); - }); - - modelBuilder.Entity("Masa.Dcc.Service.Admin.Domain.App.Aggregates.AppConfigObject", b => - { - b.HasOne("Masa.Dcc.Service.Admin.Domain.App.Aggregates.ConfigObject", "ConfigObject") - .WithOne("AppConfigObject") - .HasForeignKey("Masa.Dcc.Service.Admin.Domain.App.Aggregates.AppConfigObject", "ConfigObjectId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("ConfigObject"); - }); - - modelBuilder.Entity("Masa.Dcc.Service.Admin.Domain.App.Aggregates.ConfigObjectRelease", b => - { - b.HasOne("Masa.Dcc.Service.Admin.Domain.App.Aggregates.ConfigObject", null) - .WithMany("ConfigObjectRelease") - .HasForeignKey("ConfigObjectId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Masa.Dcc.Service.Admin.Domain.App.Aggregates.PublicConfigObject", b => - { - b.HasOne("Masa.Dcc.Service.Admin.Domain.App.Aggregates.ConfigObject", "ConfigObject") - .WithOne("PublicConfigObject") - .HasForeignKey("Masa.Dcc.Service.Admin.Domain.App.Aggregates.PublicConfigObject", "ConfigObjectId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Masa.Dcc.Service.Admin.Domain.App.Aggregates.PublicConfig", "PublicConfig") - .WithMany("PublicConfigObjects") - .HasForeignKey("PublicConfigId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("ConfigObject"); - - b.Navigation("PublicConfig"); - }); - - modelBuilder.Entity("Masa.Dcc.Service.Admin.Domain.App.Aggregates.ConfigObject", b => - { - b.Navigation("AppConfigObject") - .IsRequired(); - - b.Navigation("ConfigObjectRelease"); - - b.Navigation("PublicConfigObject") - .IsRequired(); - }); - - modelBuilder.Entity("Masa.Dcc.Service.Admin.Domain.App.Aggregates.PublicConfig", b => - { - b.Navigation("PublicConfigObjects"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/Masa.Dcc.Infrastructure.EFCore.SqlServer/Migrations/20220509084824_AddAppPin.cs b/Masa.Dcc.Infrastructure.EFCore.SqlServer/Migrations/20220509084824_AddAppPin.cs deleted file mode 100644 index 1046c7bd..00000000 --- a/Masa.Dcc.Infrastructure.EFCore.SqlServer/Migrations/20220509084824_AddAppPin.cs +++ /dev/null @@ -1,116 +0,0 @@ -using System; -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Masa.Dcc.Service.Admin.Migrations -{ - public partial class AddAppPin : Migration - { - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropIndex( - name: "IX_PublicConfigObjects_ConfigObjectId", - table: "PublicConfigObjects"); - - migrationBuilder.DropIndex( - name: "IX_AppConfigObjects_ConfigObjectId", - table: "AppConfigObjects"); - - migrationBuilder.AlterColumn( - name: "Version", - table: "ConfigObjectReleases", - type: "varchar(20)", - nullable: false, - comment: "Version foramt is yyyyMMddHHmmss", - oldClrType: typeof(string), - oldType: "varchar(20)", - oldComment: "Version foramt is YYYYMMDDHHmmss"); - - migrationBuilder.CreateTable( - name: "AppPin", - columns: table => new - { - Id = table.Column(type: "int", nullable: false) - .Annotation("SqlServer:Identity", "1, 1"), - AppId = table.Column(type: "int", nullable: false), - Creator = table.Column(type: "uniqueidentifier", nullable: false), - CreationTime = table.Column(type: "datetime2", nullable: false), - Modifier = table.Column(type: "uniqueidentifier", nullable: false), - ModificationTime = table.Column(type: "datetime2", nullable: false), - IsDeleted = table.Column(type: "bit", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_AppPin", x => x.Id); - }); - - migrationBuilder.CreateIndex( - name: "IX_PublicConfigObjects_ConfigObjectId", - table: "PublicConfigObjects", - column: "ConfigObjectId", - unique: true); - - migrationBuilder.CreateIndex( - name: "IX_ConfigObjectReleases_ConfigObjectId", - table: "ConfigObjectReleases", - column: "ConfigObjectId"); - - migrationBuilder.CreateIndex( - name: "IX_AppConfigObjects_ConfigObjectId", - table: "AppConfigObjects", - column: "ConfigObjectId", - unique: true); - - migrationBuilder.AddForeignKey( - name: "FK_ConfigObjectReleases_ConfigObjects_ConfigObjectId", - table: "ConfigObjectReleases", - column: "ConfigObjectId", - principalTable: "ConfigObjects", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - } - - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropForeignKey( - name: "FK_ConfigObjectReleases_ConfigObjects_ConfigObjectId", - table: "ConfigObjectReleases"); - - migrationBuilder.DropTable( - name: "AppPin"); - - migrationBuilder.DropIndex( - name: "IX_PublicConfigObjects_ConfigObjectId", - table: "PublicConfigObjects"); - - migrationBuilder.DropIndex( - name: "IX_ConfigObjectReleases_ConfigObjectId", - table: "ConfigObjectReleases"); - - migrationBuilder.DropIndex( - name: "IX_AppConfigObjects_ConfigObjectId", - table: "AppConfigObjects"); - - migrationBuilder.AlterColumn( - name: "Version", - table: "ConfigObjectReleases", - type: "varchar(20)", - nullable: false, - comment: "Version foramt is YYYYMMDDHHmmss", - oldClrType: typeof(string), - oldType: "varchar(20)", - oldComment: "Version foramt is yyyyMMddHHmmss"); - - migrationBuilder.CreateIndex( - name: "IX_PublicConfigObjects_ConfigObjectId", - table: "PublicConfigObjects", - column: "ConfigObjectId"); - - migrationBuilder.CreateIndex( - name: "IX_AppConfigObjects_ConfigObjectId", - table: "AppConfigObjects", - column: "ConfigObjectId"); - } - } -} diff --git a/Masa.Dcc.Infrastructure.EFCore.SqlServer/Migrations/20220511100747_AddBizConfig.Designer.cs b/Masa.Dcc.Infrastructure.EFCore.SqlServer/Migrations/20220511100747_AddBizConfig.Designer.cs deleted file mode 100644 index dfc03ca7..00000000 --- a/Masa.Dcc.Infrastructure.EFCore.SqlServer/Migrations/20220511100747_AddBizConfig.Designer.cs +++ /dev/null @@ -1,613 +0,0 @@ -// -using Masa.Dcc.Infrastructure.EFCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Masa.Dcc.Service.Admin.Migrations -{ - [DbContext(typeof(DccDbContext))] - [Migration("20220511100747_AddBizConfig")] - partial class AddBizConfig - { - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "6.0.4") - .HasAnnotation("Relational:MaxIdentifierLength", 128); - - SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder, 1L, 1); - - modelBuilder.Entity("Masa.BuildingBlocks.Dispatcher.IntegrationEvents.Logs.IntegrationEventLog", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("Content") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("CreationTime") - .HasColumnType("datetime2"); - - b.Property("EventId") - .HasColumnType("uniqueidentifier"); - - b.Property("EventTypeName") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("ModificationTime") - .HasColumnType("datetime2"); - - b.Property("RowVersion") - .IsRequired() - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b.Property("State") - .HasColumnType("int"); - - b.Property("TimesSent") - .HasColumnType("int"); - - b.Property("TransactionId") - .HasColumnType("uniqueidentifier"); - - b.HasKey("Id"); - - b.HasIndex(new[] { "EventId", "RowVersion" }, "index_eventid_version"); - - b.HasIndex(new[] { "State", "ModificationTime" }, "index_state_modificationtime"); - - b.HasIndex(new[] { "State", "TimesSent", "ModificationTime" }, "index_state_timessent_modificationtime"); - - b.ToTable("IntegrationEventLog", (string)null); - }); - - modelBuilder.Entity("Masa.Dcc.Service.Admin.Domain.App.Aggregates.AppConfigObject", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("AppId") - .HasColumnType("int") - .HasComment("AppId"); - - b.Property("ConfigObjectId") - .HasColumnType("int") - .HasComment("ConfigObjectId"); - - b.Property("CreationTime") - .HasColumnType("datetime2"); - - b.Property("Creator") - .HasColumnType("uniqueidentifier"); - - b.Property("EnvironmentClusterId") - .HasColumnType("int") - .HasComment("EnvironmentClusterId"); - - b.Property("IsDeleted") - .HasColumnType("bit"); - - b.Property("ModificationTime") - .HasColumnType("datetime2"); - - b.Property("Modifier") - .HasColumnType("uniqueidentifier"); - - b.HasKey("Id"); - - b.HasIndex("ConfigObjectId") - .IsUnique(); - - b.ToTable("AppConfigObjects"); - }); - - modelBuilder.Entity("Masa.Dcc.Service.Admin.Domain.App.Aggregates.AppPin", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("AppId") - .HasColumnType("int"); - - b.Property("CreationTime") - .HasColumnType("datetime2"); - - b.Property("Creator") - .HasColumnType("uniqueidentifier"); - - b.Property("IsDeleted") - .HasColumnType("bit"); - - b.Property("ModificationTime") - .HasColumnType("datetime2"); - - b.Property("Modifier") - .HasColumnType("uniqueidentifier"); - - b.HasKey("Id"); - - b.ToTable("AppPin"); - }); - - modelBuilder.Entity("Masa.Dcc.Service.Admin.Domain.App.Aggregates.AppSecret", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("AppId") - .HasColumnType("int"); - - b.Property("CreationTime") - .HasColumnType("datetime2"); - - b.Property("Creator") - .HasColumnType("uniqueidentifier"); - - b.Property("EncryptionSecret") - .HasColumnType("uniqueidentifier"); - - b.Property("EnvironmentId") - .HasColumnType("int"); - - b.Property("IsDeleted") - .HasColumnType("bit"); - - b.Property("ModificationTime") - .HasColumnType("datetime2"); - - b.Property("Modifier") - .HasColumnType("uniqueidentifier"); - - b.Property("Secret") - .HasColumnType("uniqueidentifier"); - - b.Property("Type") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.ToTable("AppSecrets"); - }); - - modelBuilder.Entity("Masa.Dcc.Service.Admin.Domain.App.Aggregates.BizConfig", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("CreationTime") - .HasColumnType("datetime2"); - - b.Property("Creator") - .HasColumnType("uniqueidentifier"); - - b.Property("Identity") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("IsDeleted") - .HasColumnType("bit"); - - b.Property("ModificationTime") - .HasColumnType("datetime2"); - - b.Property("Modifier") - .HasColumnType("uniqueidentifier"); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.ToTable("BizConfigs"); - }); - - modelBuilder.Entity("Masa.Dcc.Service.Admin.Domain.App.Aggregates.BizConfigObject", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("BizConfigId") - .HasColumnType("int"); - - b.Property("ConfigObjectId") - .HasColumnType("int"); - - b.Property("CreationTime") - .HasColumnType("datetime2"); - - b.Property("Creator") - .HasColumnType("uniqueidentifier"); - - b.Property("EnvironmentClusterId") - .HasColumnType("int"); - - b.Property("IsDeleted") - .HasColumnType("bit"); - - b.Property("ModificationTime") - .HasColumnType("datetime2"); - - b.Property("Modifier") - .HasColumnType("uniqueidentifier"); - - b.HasKey("Id"); - - b.HasIndex("BizConfigId"); - - b.HasIndex("ConfigObjectId") - .IsUnique(); - - b.ToTable("BizConfigObjects"); - }); - - modelBuilder.Entity("Masa.Dcc.Service.Admin.Domain.App.Aggregates.ConfigObject", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("Content") - .IsRequired() - .HasColumnType("ntext"); - - b.Property("CreationTime") - .HasColumnType("datetime2"); - - b.Property("Creator") - .HasColumnType("uniqueidentifier"); - - b.Property("FormatLabelId") - .HasColumnType("int") - .HasComment("Format"); - - b.Property("IsDeleted") - .HasColumnType("bit"); - - b.Property("ModificationTime") - .HasColumnType("datetime2"); - - b.Property("Modifier") - .HasColumnType("uniqueidentifier"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)") - .HasComment("Name"); - - b.Property("RelationConfigObjectId") - .HasColumnType("int") - .HasComment("Relation config object Id"); - - b.Property("TempContent") - .IsRequired() - .HasColumnType("ntext"); - - b.Property("Type") - .HasColumnType("int") - .HasComment("Type"); - - b.HasKey("Id"); - - b.ToTable("ConfigObjects"); - }); - - modelBuilder.Entity("Masa.Dcc.Service.Admin.Domain.App.Aggregates.ConfigObjectRelease", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("Comment") - .IsRequired() - .HasMaxLength(500) - .HasColumnType("nvarchar(500)") - .HasComment("Comment"); - - b.Property("ConfigObjectId") - .HasColumnType("int") - .HasComment("Config object Id"); - - b.Property("Content") - .IsRequired() - .HasMaxLength(2147483647) - .HasColumnType("ntext") - .HasComment("Content"); - - b.Property("CreationTime") - .HasColumnType("datetime2"); - - b.Property("Creator") - .HasColumnType("uniqueidentifier"); - - b.Property("FromReleaseId") - .HasColumnType("int") - .HasComment("Rollback From Release Id"); - - b.Property("IsDeleted") - .HasColumnType("bit"); - - b.Property("IsInvalid") - .HasColumnType("bit") - .HasComment("If it is rolled back, it will be true"); - - b.Property("ModificationTime") - .HasColumnType("datetime2"); - - b.Property("Modifier") - .HasColumnType("uniqueidentifier"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)") - .HasComment("Name"); - - b.Property("ToReleaseId") - .HasColumnType("int") - .HasComment("Rollback To Release Id"); - - b.Property("Type") - .HasColumnType("tinyint") - .HasComment("Release type"); - - b.Property("Version") - .IsRequired() - .HasColumnType("varchar(20)") - .HasComment("Version foramt is yyyyMMddHHmmss"); - - b.HasKey("Id"); - - b.HasIndex("ConfigObjectId"); - - b.ToTable("ConfigObjectReleases"); - }); - - modelBuilder.Entity("Masa.Dcc.Service.Admin.Domain.App.Aggregates.PublicConfig", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("CreationTime") - .HasColumnType("datetime2"); - - b.Property("Creator") - .HasColumnType("uniqueidentifier"); - - b.Property("Description") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("Identity") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("IsDeleted") - .HasColumnType("bit"); - - b.Property("ModificationTime") - .HasColumnType("datetime2"); - - b.Property("Modifier") - .HasColumnType("uniqueidentifier"); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.ToTable("PublicConfigs"); - }); - - modelBuilder.Entity("Masa.Dcc.Service.Admin.Domain.App.Aggregates.PublicConfigObject", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("ConfigObjectId") - .HasColumnType("int"); - - b.Property("CreationTime") - .HasColumnType("datetime2"); - - b.Property("Creator") - .HasColumnType("uniqueidentifier"); - - b.Property("EnvironmentClusterId") - .HasColumnType("int"); - - b.Property("IsDeleted") - .HasColumnType("bit"); - - b.Property("ModificationTime") - .HasColumnType("datetime2"); - - b.Property("Modifier") - .HasColumnType("uniqueidentifier"); - - b.Property("PublicConfigId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("ConfigObjectId") - .IsUnique(); - - b.HasIndex("PublicConfigId"); - - b.ToTable("PublicConfigObjects"); - }); - - modelBuilder.Entity("Masa.Dcc.Service.Admin.Domain.Label.Aggregates.Label", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("CreationTime") - .HasColumnType("datetime2"); - - b.Property("Creator") - .HasColumnType("uniqueidentifier"); - - b.Property("Description") - .IsRequired() - .HasMaxLength(255) - .HasColumnType("nvarchar(255)") - .HasComment("Description"); - - b.Property("IsDeleted") - .HasColumnType("bit"); - - b.Property("ModificationTime") - .HasColumnType("datetime2"); - - b.Property("Modifier") - .HasColumnType("uniqueidentifier"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)") - .HasComment("Name"); - - b.Property("TypeCode") - .IsRequired() - .HasMaxLength(255) - .HasColumnType("nvarchar(255)") - .HasComment("TypeCode"); - - b.Property("TypeName") - .IsRequired() - .HasMaxLength(255) - .HasColumnType("nvarchar(255)") - .HasComment("TypeName"); - - b.HasKey("Id"); - - b.HasIndex(new[] { "TypeCode", "IsDeleted" }, "IX_TypeCode"); - - b.ToTable("Labels"); - }); - - modelBuilder.Entity("Masa.Dcc.Service.Admin.Domain.App.Aggregates.AppConfigObject", b => - { - b.HasOne("Masa.Dcc.Service.Admin.Domain.App.Aggregates.ConfigObject", "ConfigObject") - .WithOne("AppConfigObject") - .HasForeignKey("Masa.Dcc.Service.Admin.Domain.App.Aggregates.AppConfigObject", "ConfigObjectId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("ConfigObject"); - }); - - modelBuilder.Entity("Masa.Dcc.Service.Admin.Domain.App.Aggregates.BizConfigObject", b => - { - b.HasOne("Masa.Dcc.Service.Admin.Domain.App.Aggregates.BizConfig", "BizConfig") - .WithMany("BizConfigObjects") - .HasForeignKey("BizConfigId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Masa.Dcc.Service.Admin.Domain.App.Aggregates.ConfigObject", "ConfigObject") - .WithOne("BizConfigObject") - .HasForeignKey("Masa.Dcc.Service.Admin.Domain.App.Aggregates.BizConfigObject", "ConfigObjectId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("BizConfig"); - - b.Navigation("ConfigObject"); - }); - - modelBuilder.Entity("Masa.Dcc.Service.Admin.Domain.App.Aggregates.ConfigObjectRelease", b => - { - b.HasOne("Masa.Dcc.Service.Admin.Domain.App.Aggregates.ConfigObject", null) - .WithMany("ConfigObjectRelease") - .HasForeignKey("ConfigObjectId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Masa.Dcc.Service.Admin.Domain.App.Aggregates.PublicConfigObject", b => - { - b.HasOne("Masa.Dcc.Service.Admin.Domain.App.Aggregates.ConfigObject", "ConfigObject") - .WithOne("PublicConfigObject") - .HasForeignKey("Masa.Dcc.Service.Admin.Domain.App.Aggregates.PublicConfigObject", "ConfigObjectId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Masa.Dcc.Service.Admin.Domain.App.Aggregates.PublicConfig", "PublicConfig") - .WithMany("PublicConfigObjects") - .HasForeignKey("PublicConfigId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("ConfigObject"); - - b.Navigation("PublicConfig"); - }); - - modelBuilder.Entity("Masa.Dcc.Service.Admin.Domain.App.Aggregates.BizConfig", b => - { - b.Navigation("BizConfigObjects"); - }); - - modelBuilder.Entity("Masa.Dcc.Service.Admin.Domain.App.Aggregates.ConfigObject", b => - { - b.Navigation("AppConfigObject") - .IsRequired(); - - b.Navigation("BizConfigObject") - .IsRequired(); - - b.Navigation("ConfigObjectRelease"); - - b.Navigation("PublicConfigObject") - .IsRequired(); - }); - - modelBuilder.Entity("Masa.Dcc.Service.Admin.Domain.App.Aggregates.PublicConfig", b => - { - b.Navigation("PublicConfigObjects"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/Masa.Dcc.Infrastructure.EFCore.SqlServer/Migrations/20220511100747_AddBizConfig.cs b/Masa.Dcc.Infrastructure.EFCore.SqlServer/Migrations/20220511100747_AddBizConfig.cs deleted file mode 100644 index bb9253aa..00000000 --- a/Masa.Dcc.Infrastructure.EFCore.SqlServer/Migrations/20220511100747_AddBizConfig.cs +++ /dev/null @@ -1,84 +0,0 @@ -using System; -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Masa.Dcc.Service.Admin.Migrations -{ - public partial class AddBizConfig : Migration - { - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.CreateTable( - name: "BizConfigs", - columns: table => new - { - Id = table.Column(type: "int", nullable: false) - .Annotation("SqlServer:Identity", "1, 1"), - Name = table.Column(type: "nvarchar(max)", nullable: false), - Identity = table.Column(type: "nvarchar(max)", nullable: false), - Creator = table.Column(type: "uniqueidentifier", nullable: false), - CreationTime = table.Column(type: "datetime2", nullable: false), - Modifier = table.Column(type: "uniqueidentifier", nullable: false), - ModificationTime = table.Column(type: "datetime2", nullable: false), - IsDeleted = table.Column(type: "bit", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_BizConfigs", x => x.Id); - }); - - migrationBuilder.CreateTable( - name: "BizConfigObjects", - columns: table => new - { - Id = table.Column(type: "int", nullable: false) - .Annotation("SqlServer:Identity", "1, 1"), - BizConfigId = table.Column(type: "int", nullable: false), - ConfigObjectId = table.Column(type: "int", nullable: false), - EnvironmentClusterId = table.Column(type: "int", nullable: false), - Creator = table.Column(type: "uniqueidentifier", nullable: false), - CreationTime = table.Column(type: "datetime2", nullable: false), - Modifier = table.Column(type: "uniqueidentifier", nullable: false), - ModificationTime = table.Column(type: "datetime2", nullable: false), - IsDeleted = table.Column(type: "bit", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_BizConfigObjects", x => x.Id); - table.ForeignKey( - name: "FK_BizConfigObjects_BizConfigs_BizConfigId", - column: x => x.BizConfigId, - principalTable: "BizConfigs", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - table.ForeignKey( - name: "FK_BizConfigObjects_ConfigObjects_ConfigObjectId", - column: x => x.ConfigObjectId, - principalTable: "ConfigObjects", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateIndex( - name: "IX_BizConfigObjects_BizConfigId", - table: "BizConfigObjects", - column: "BizConfigId"); - - migrationBuilder.CreateIndex( - name: "IX_BizConfigObjects_ConfigObjectId", - table: "BizConfigObjects", - column: "ConfigObjectId", - unique: true); - } - - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropTable( - name: "BizConfigObjects"); - - migrationBuilder.DropTable( - name: "BizConfigs"); - } - } -} diff --git a/Masa.Dcc.Infrastructure.EFCore.SqlServer/Migrations/20220515093911_AddLabelCode.Designer.cs b/Masa.Dcc.Infrastructure.EFCore.SqlServer/Migrations/20220515093911_AddLabelCode.Designer.cs deleted file mode 100644 index fd14d009..00000000 --- a/Masa.Dcc.Infrastructure.EFCore.SqlServer/Migrations/20220515093911_AddLabelCode.Designer.cs +++ /dev/null @@ -1,621 +0,0 @@ -// -using Masa.Dcc.Infrastructure.EFCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Masa.Dcc.Service.Admin.Migrations -{ - [DbContext(typeof(DccDbContext))] - [Migration("20220515093911_AddLabelCode")] - partial class AddLabelCode - { - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "6.0.4") - .HasAnnotation("Relational:MaxIdentifierLength", 128); - - SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder, 1L, 1); - - modelBuilder.Entity("Masa.BuildingBlocks.Dispatcher.IntegrationEvents.Logs.IntegrationEventLog", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("Content") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("CreationTime") - .HasColumnType("datetime2"); - - b.Property("EventId") - .HasColumnType("uniqueidentifier"); - - b.Property("EventTypeName") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("ModificationTime") - .HasColumnType("datetime2"); - - b.Property("RowVersion") - .IsRequired() - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b.Property("State") - .HasColumnType("int"); - - b.Property("TimesSent") - .HasColumnType("int"); - - b.Property("TransactionId") - .HasColumnType("uniqueidentifier"); - - b.HasKey("Id"); - - b.HasIndex(new[] { "EventId", "RowVersion" }, "index_eventid_version"); - - b.HasIndex(new[] { "State", "ModificationTime" }, "index_state_modificationtime"); - - b.HasIndex(new[] { "State", "TimesSent", "ModificationTime" }, "index_state_timessent_modificationtime"); - - b.ToTable("IntegrationEventLog", (string)null); - }); - - modelBuilder.Entity("Masa.Dcc.Service.Admin.Domain.App.Aggregates.AppConfigObject", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("AppId") - .HasColumnType("int") - .HasComment("AppId"); - - b.Property("ConfigObjectId") - .HasColumnType("int") - .HasComment("ConfigObjectId"); - - b.Property("CreationTime") - .HasColumnType("datetime2"); - - b.Property("Creator") - .HasColumnType("uniqueidentifier"); - - b.Property("EnvironmentClusterId") - .HasColumnType("int") - .HasComment("EnvironmentClusterId"); - - b.Property("IsDeleted") - .HasColumnType("bit"); - - b.Property("ModificationTime") - .HasColumnType("datetime2"); - - b.Property("Modifier") - .HasColumnType("uniqueidentifier"); - - b.HasKey("Id"); - - b.HasIndex("ConfigObjectId") - .IsUnique(); - - b.ToTable("AppConfigObjects"); - }); - - modelBuilder.Entity("Masa.Dcc.Service.Admin.Domain.App.Aggregates.AppPin", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("AppId") - .HasColumnType("int"); - - b.Property("CreationTime") - .HasColumnType("datetime2"); - - b.Property("Creator") - .HasColumnType("uniqueidentifier"); - - b.Property("IsDeleted") - .HasColumnType("bit"); - - b.Property("ModificationTime") - .HasColumnType("datetime2"); - - b.Property("Modifier") - .HasColumnType("uniqueidentifier"); - - b.HasKey("Id"); - - b.ToTable("AppPin"); - }); - - modelBuilder.Entity("Masa.Dcc.Service.Admin.Domain.App.Aggregates.AppSecret", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("AppId") - .HasColumnType("int"); - - b.Property("CreationTime") - .HasColumnType("datetime2"); - - b.Property("Creator") - .HasColumnType("uniqueidentifier"); - - b.Property("EncryptionSecret") - .HasColumnType("uniqueidentifier"); - - b.Property("EnvironmentId") - .HasColumnType("int"); - - b.Property("IsDeleted") - .HasColumnType("bit"); - - b.Property("ModificationTime") - .HasColumnType("datetime2"); - - b.Property("Modifier") - .HasColumnType("uniqueidentifier"); - - b.Property("Secret") - .HasColumnType("uniqueidentifier"); - - b.Property("Type") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.ToTable("AppSecrets"); - }); - - modelBuilder.Entity("Masa.Dcc.Service.Admin.Domain.App.Aggregates.BizConfig", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("CreationTime") - .HasColumnType("datetime2"); - - b.Property("Creator") - .HasColumnType("uniqueidentifier"); - - b.Property("Identity") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("IsDeleted") - .HasColumnType("bit"); - - b.Property("ModificationTime") - .HasColumnType("datetime2"); - - b.Property("Modifier") - .HasColumnType("uniqueidentifier"); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.ToTable("BizConfigs"); - }); - - modelBuilder.Entity("Masa.Dcc.Service.Admin.Domain.App.Aggregates.BizConfigObject", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("BizConfigId") - .HasColumnType("int"); - - b.Property("ConfigObjectId") - .HasColumnType("int"); - - b.Property("CreationTime") - .HasColumnType("datetime2"); - - b.Property("Creator") - .HasColumnType("uniqueidentifier"); - - b.Property("EnvironmentClusterId") - .HasColumnType("int"); - - b.Property("IsDeleted") - .HasColumnType("bit"); - - b.Property("ModificationTime") - .HasColumnType("datetime2"); - - b.Property("Modifier") - .HasColumnType("uniqueidentifier"); - - b.HasKey("Id"); - - b.HasIndex("BizConfigId"); - - b.HasIndex("ConfigObjectId") - .IsUnique(); - - b.ToTable("BizConfigObjects"); - }); - - modelBuilder.Entity("Masa.Dcc.Service.Admin.Domain.App.Aggregates.ConfigObject", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("Content") - .IsRequired() - .HasColumnType("ntext"); - - b.Property("CreationTime") - .HasColumnType("datetime2"); - - b.Property("Creator") - .HasColumnType("uniqueidentifier"); - - b.Property("FormatLabelCode") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)") - .HasComment("Format"); - - b.Property("IsDeleted") - .HasColumnType("bit"); - - b.Property("ModificationTime") - .HasColumnType("datetime2"); - - b.Property("Modifier") - .HasColumnType("uniqueidentifier"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)") - .HasComment("Name"); - - b.Property("RelationConfigObjectId") - .HasColumnType("int") - .HasComment("Relation config object Id"); - - b.Property("TempContent") - .IsRequired() - .HasColumnType("ntext"); - - b.Property("Type") - .HasColumnType("int") - .HasComment("Type"); - - b.HasKey("Id"); - - b.ToTable("ConfigObjects"); - }); - - modelBuilder.Entity("Masa.Dcc.Service.Admin.Domain.App.Aggregates.ConfigObjectRelease", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("Comment") - .IsRequired() - .HasMaxLength(500) - .HasColumnType("nvarchar(500)") - .HasComment("Comment"); - - b.Property("ConfigObjectId") - .HasColumnType("int") - .HasComment("Config object Id"); - - b.Property("Content") - .IsRequired() - .HasMaxLength(2147483647) - .HasColumnType("ntext") - .HasComment("Content"); - - b.Property("CreationTime") - .HasColumnType("datetime2"); - - b.Property("Creator") - .HasColumnType("uniqueidentifier"); - - b.Property("FromReleaseId") - .HasColumnType("int") - .HasComment("Rollback From Release Id"); - - b.Property("IsDeleted") - .HasColumnType("bit"); - - b.Property("IsInvalid") - .HasColumnType("bit") - .HasComment("If it is rolled back, it will be true"); - - b.Property("ModificationTime") - .HasColumnType("datetime2"); - - b.Property("Modifier") - .HasColumnType("uniqueidentifier"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)") - .HasComment("Name"); - - b.Property("ToReleaseId") - .HasColumnType("int") - .HasComment("Rollback To Release Id"); - - b.Property("Type") - .HasColumnType("tinyint") - .HasComment("Release type"); - - b.Property("Version") - .IsRequired() - .HasColumnType("varchar(20)") - .HasComment("Version foramt is yyyyMMddHHmmss"); - - b.HasKey("Id"); - - b.HasIndex("ConfigObjectId"); - - b.ToTable("ConfigObjectReleases"); - }); - - modelBuilder.Entity("Masa.Dcc.Service.Admin.Domain.App.Aggregates.PublicConfig", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("CreationTime") - .HasColumnType("datetime2"); - - b.Property("Creator") - .HasColumnType("uniqueidentifier"); - - b.Property("Description") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("Identity") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("IsDeleted") - .HasColumnType("bit"); - - b.Property("ModificationTime") - .HasColumnType("datetime2"); - - b.Property("Modifier") - .HasColumnType("uniqueidentifier"); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.ToTable("PublicConfigs"); - }); - - modelBuilder.Entity("Masa.Dcc.Service.Admin.Domain.App.Aggregates.PublicConfigObject", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("ConfigObjectId") - .HasColumnType("int"); - - b.Property("CreationTime") - .HasColumnType("datetime2"); - - b.Property("Creator") - .HasColumnType("uniqueidentifier"); - - b.Property("EnvironmentClusterId") - .HasColumnType("int"); - - b.Property("IsDeleted") - .HasColumnType("bit"); - - b.Property("ModificationTime") - .HasColumnType("datetime2"); - - b.Property("Modifier") - .HasColumnType("uniqueidentifier"); - - b.Property("PublicConfigId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("ConfigObjectId") - .IsUnique(); - - b.HasIndex("PublicConfigId"); - - b.ToTable("PublicConfigObjects"); - }); - - modelBuilder.Entity("Masa.Dcc.Service.Admin.Domain.Label.Aggregates.Label", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("Code") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)") - .HasComment("Code"); - - b.Property("CreationTime") - .HasColumnType("datetime2"); - - b.Property("Creator") - .HasColumnType("uniqueidentifier"); - - b.Property("Description") - .IsRequired() - .HasMaxLength(255) - .HasColumnType("nvarchar(255)") - .HasComment("Description"); - - b.Property("IsDeleted") - .HasColumnType("bit"); - - b.Property("ModificationTime") - .HasColumnType("datetime2"); - - b.Property("Modifier") - .HasColumnType("uniqueidentifier"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)") - .HasComment("Name"); - - b.Property("TypeCode") - .IsRequired() - .HasMaxLength(255) - .HasColumnType("nvarchar(255)") - .HasComment("TypeCode"); - - b.Property("TypeName") - .IsRequired() - .HasMaxLength(255) - .HasColumnType("nvarchar(255)") - .HasComment("TypeName"); - - b.HasKey("Id"); - - b.HasIndex(new[] { "TypeCode", "IsDeleted" }, "IX_TypeCode"); - - b.ToTable("Labels"); - }); - - modelBuilder.Entity("Masa.Dcc.Service.Admin.Domain.App.Aggregates.AppConfigObject", b => - { - b.HasOne("Masa.Dcc.Service.Admin.Domain.App.Aggregates.ConfigObject", "ConfigObject") - .WithOne("AppConfigObject") - .HasForeignKey("Masa.Dcc.Service.Admin.Domain.App.Aggregates.AppConfigObject", "ConfigObjectId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("ConfigObject"); - }); - - modelBuilder.Entity("Masa.Dcc.Service.Admin.Domain.App.Aggregates.BizConfigObject", b => - { - b.HasOne("Masa.Dcc.Service.Admin.Domain.App.Aggregates.BizConfig", "BizConfig") - .WithMany("BizConfigObjects") - .HasForeignKey("BizConfigId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Masa.Dcc.Service.Admin.Domain.App.Aggregates.ConfigObject", "ConfigObject") - .WithOne("BizConfigObject") - .HasForeignKey("Masa.Dcc.Service.Admin.Domain.App.Aggregates.BizConfigObject", "ConfigObjectId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("BizConfig"); - - b.Navigation("ConfigObject"); - }); - - modelBuilder.Entity("Masa.Dcc.Service.Admin.Domain.App.Aggregates.ConfigObjectRelease", b => - { - b.HasOne("Masa.Dcc.Service.Admin.Domain.App.Aggregates.ConfigObject", null) - .WithMany("ConfigObjectRelease") - .HasForeignKey("ConfigObjectId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Masa.Dcc.Service.Admin.Domain.App.Aggregates.PublicConfigObject", b => - { - b.HasOne("Masa.Dcc.Service.Admin.Domain.App.Aggregates.ConfigObject", "ConfigObject") - .WithOne("PublicConfigObject") - .HasForeignKey("Masa.Dcc.Service.Admin.Domain.App.Aggregates.PublicConfigObject", "ConfigObjectId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Masa.Dcc.Service.Admin.Domain.App.Aggregates.PublicConfig", "PublicConfig") - .WithMany("PublicConfigObjects") - .HasForeignKey("PublicConfigId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("ConfigObject"); - - b.Navigation("PublicConfig"); - }); - - modelBuilder.Entity("Masa.Dcc.Service.Admin.Domain.App.Aggregates.BizConfig", b => - { - b.Navigation("BizConfigObjects"); - }); - - modelBuilder.Entity("Masa.Dcc.Service.Admin.Domain.App.Aggregates.ConfigObject", b => - { - b.Navigation("AppConfigObject") - .IsRequired(); - - b.Navigation("BizConfigObject") - .IsRequired(); - - b.Navigation("ConfigObjectRelease"); - - b.Navigation("PublicConfigObject") - .IsRequired(); - }); - - modelBuilder.Entity("Masa.Dcc.Service.Admin.Domain.App.Aggregates.PublicConfig", b => - { - b.Navigation("PublicConfigObjects"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/Masa.Dcc.Infrastructure.EFCore.SqlServer/Migrations/20220515093911_AddLabelCode.cs b/Masa.Dcc.Infrastructure.EFCore.SqlServer/Migrations/20220515093911_AddLabelCode.cs deleted file mode 100644 index 8f50a3b2..00000000 --- a/Masa.Dcc.Infrastructure.EFCore.SqlServer/Migrations/20220515093911_AddLabelCode.cs +++ /dev/null @@ -1,53 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Masa.Dcc.Service.Admin.Migrations -{ - public partial class AddLabelCode : Migration - { - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropColumn( - name: "FormatLabelId", - table: "ConfigObjects"); - - migrationBuilder.AddColumn( - name: "Code", - table: "Labels", - type: "nvarchar(100)", - maxLength: 100, - nullable: false, - defaultValue: "", - comment: "Code"); - - migrationBuilder.AddColumn( - name: "FormatLabelCode", - table: "ConfigObjects", - type: "nvarchar(100)", - maxLength: 100, - nullable: false, - defaultValue: "", - comment: "Format"); - } - - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropColumn( - name: "Code", - table: "Labels"); - - migrationBuilder.DropColumn( - name: "FormatLabelCode", - table: "ConfigObjects"); - - migrationBuilder.AddColumn( - name: "FormatLabelId", - table: "ConfigObjects", - type: "int", - nullable: false, - defaultValue: 0, - comment: "Format"); - } - } -} diff --git a/Masa.Dcc.Infrastructure.EFCore.SqlServer/Migrations/20220609095708_AddFromRelation.Designer.cs b/Masa.Dcc.Infrastructure.EFCore.SqlServer/Migrations/20220609095708_AddFromRelation.Designer.cs deleted file mode 100644 index 85150b8a..00000000 --- a/Masa.Dcc.Infrastructure.EFCore.SqlServer/Migrations/20220609095708_AddFromRelation.Designer.cs +++ /dev/null @@ -1,624 +0,0 @@ -// -using Masa.Dcc.Infrastructure.EFCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Masa.Dcc.Service.Admin.Migrations -{ - [DbContext(typeof(DccDbContext))] - [Migration("20220609095708_AddFromRelation")] - partial class AddFromRelation - { - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "6.0.4") - .HasAnnotation("Relational:MaxIdentifierLength", 128); - - SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder, 1L, 1); - - modelBuilder.Entity("Masa.BuildingBlocks.Dispatcher.IntegrationEvents.Logs.IntegrationEventLog", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("Content") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("CreationTime") - .HasColumnType("datetime2"); - - b.Property("EventId") - .HasColumnType("uniqueidentifier"); - - b.Property("EventTypeName") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("ModificationTime") - .HasColumnType("datetime2"); - - b.Property("RowVersion") - .IsRequired() - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b.Property("State") - .HasColumnType("int"); - - b.Property("TimesSent") - .HasColumnType("int"); - - b.Property("TransactionId") - .HasColumnType("uniqueidentifier"); - - b.HasKey("Id"); - - b.HasIndex(new[] { "EventId", "RowVersion" }, "index_eventid_version"); - - b.HasIndex(new[] { "State", "ModificationTime" }, "index_state_modificationtime"); - - b.HasIndex(new[] { "State", "TimesSent", "ModificationTime" }, "index_state_timessent_modificationtime"); - - b.ToTable("IntegrationEventLog", (string)null); - }); - - modelBuilder.Entity("Masa.Dcc.Service.Admin.Domain.App.Aggregates.AppConfigObject", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("AppId") - .HasColumnType("int") - .HasComment("AppId"); - - b.Property("ConfigObjectId") - .HasColumnType("int") - .HasComment("ConfigObjectId"); - - b.Property("CreationTime") - .HasColumnType("datetime2"); - - b.Property("Creator") - .HasColumnType("uniqueidentifier"); - - b.Property("EnvironmentClusterId") - .HasColumnType("int") - .HasComment("EnvironmentClusterId"); - - b.Property("IsDeleted") - .HasColumnType("bit"); - - b.Property("ModificationTime") - .HasColumnType("datetime2"); - - b.Property("Modifier") - .HasColumnType("uniqueidentifier"); - - b.HasKey("Id"); - - b.HasIndex("ConfigObjectId") - .IsUnique(); - - b.ToTable("AppConfigObjects"); - }); - - modelBuilder.Entity("Masa.Dcc.Service.Admin.Domain.App.Aggregates.AppPin", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("AppId") - .HasColumnType("int"); - - b.Property("CreationTime") - .HasColumnType("datetime2"); - - b.Property("Creator") - .HasColumnType("uniqueidentifier"); - - b.Property("IsDeleted") - .HasColumnType("bit"); - - b.Property("ModificationTime") - .HasColumnType("datetime2"); - - b.Property("Modifier") - .HasColumnType("uniqueidentifier"); - - b.HasKey("Id"); - - b.ToTable("AppPin"); - }); - - modelBuilder.Entity("Masa.Dcc.Service.Admin.Domain.App.Aggregates.AppSecret", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("AppId") - .HasColumnType("int"); - - b.Property("CreationTime") - .HasColumnType("datetime2"); - - b.Property("Creator") - .HasColumnType("uniqueidentifier"); - - b.Property("EncryptionSecret") - .HasColumnType("uniqueidentifier"); - - b.Property("EnvironmentId") - .HasColumnType("int"); - - b.Property("IsDeleted") - .HasColumnType("bit"); - - b.Property("ModificationTime") - .HasColumnType("datetime2"); - - b.Property("Modifier") - .HasColumnType("uniqueidentifier"); - - b.Property("Secret") - .HasColumnType("uniqueidentifier"); - - b.Property("Type") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.ToTable("AppSecrets"); - }); - - modelBuilder.Entity("Masa.Dcc.Service.Admin.Domain.App.Aggregates.BizConfig", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("CreationTime") - .HasColumnType("datetime2"); - - b.Property("Creator") - .HasColumnType("uniqueidentifier"); - - b.Property("Identity") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("IsDeleted") - .HasColumnType("bit"); - - b.Property("ModificationTime") - .HasColumnType("datetime2"); - - b.Property("Modifier") - .HasColumnType("uniqueidentifier"); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.ToTable("BizConfigs"); - }); - - modelBuilder.Entity("Masa.Dcc.Service.Admin.Domain.App.Aggregates.BizConfigObject", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("BizConfigId") - .HasColumnType("int"); - - b.Property("ConfigObjectId") - .HasColumnType("int"); - - b.Property("CreationTime") - .HasColumnType("datetime2"); - - b.Property("Creator") - .HasColumnType("uniqueidentifier"); - - b.Property("EnvironmentClusterId") - .HasColumnType("int"); - - b.Property("IsDeleted") - .HasColumnType("bit"); - - b.Property("ModificationTime") - .HasColumnType("datetime2"); - - b.Property("Modifier") - .HasColumnType("uniqueidentifier"); - - b.HasKey("Id"); - - b.HasIndex("BizConfigId"); - - b.HasIndex("ConfigObjectId") - .IsUnique(); - - b.ToTable("BizConfigObjects"); - }); - - modelBuilder.Entity("Masa.Dcc.Service.Admin.Domain.App.Aggregates.ConfigObject", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("Content") - .IsRequired() - .HasColumnType("ntext"); - - b.Property("CreationTime") - .HasColumnType("datetime2"); - - b.Property("Creator") - .HasColumnType("uniqueidentifier"); - - b.Property("FormatLabelCode") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)") - .HasComment("Format"); - - b.Property("FromRelation") - .HasColumnType("bit"); - - b.Property("IsDeleted") - .HasColumnType("bit"); - - b.Property("ModificationTime") - .HasColumnType("datetime2"); - - b.Property("Modifier") - .HasColumnType("uniqueidentifier"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)") - .HasComment("Name"); - - b.Property("RelationConfigObjectId") - .HasColumnType("int") - .HasComment("Relation config object Id"); - - b.Property("TempContent") - .IsRequired() - .HasColumnType("ntext"); - - b.Property("Type") - .HasColumnType("int") - .HasComment("Type"); - - b.HasKey("Id"); - - b.ToTable("ConfigObjects"); - }); - - modelBuilder.Entity("Masa.Dcc.Service.Admin.Domain.App.Aggregates.ConfigObjectRelease", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("Comment") - .IsRequired() - .HasMaxLength(500) - .HasColumnType("nvarchar(500)") - .HasComment("Comment"); - - b.Property("ConfigObjectId") - .HasColumnType("int") - .HasComment("Config object Id"); - - b.Property("Content") - .IsRequired() - .HasMaxLength(2147483647) - .HasColumnType("ntext") - .HasComment("Content"); - - b.Property("CreationTime") - .HasColumnType("datetime2"); - - b.Property("Creator") - .HasColumnType("uniqueidentifier"); - - b.Property("FromReleaseId") - .HasColumnType("int") - .HasComment("Rollback From Release Id"); - - b.Property("IsDeleted") - .HasColumnType("bit"); - - b.Property("IsInvalid") - .HasColumnType("bit") - .HasComment("If it is rolled back, it will be true"); - - b.Property("ModificationTime") - .HasColumnType("datetime2"); - - b.Property("Modifier") - .HasColumnType("uniqueidentifier"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)") - .HasComment("Name"); - - b.Property("ToReleaseId") - .HasColumnType("int") - .HasComment("Rollback To Release Id"); - - b.Property("Type") - .HasColumnType("tinyint") - .HasComment("Release type"); - - b.Property("Version") - .IsRequired() - .HasColumnType("varchar(20)") - .HasComment("Version foramt is yyyyMMddHHmmss"); - - b.HasKey("Id"); - - b.HasIndex("ConfigObjectId"); - - b.ToTable("ConfigObjectReleases"); - }); - - modelBuilder.Entity("Masa.Dcc.Service.Admin.Domain.App.Aggregates.PublicConfig", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("CreationTime") - .HasColumnType("datetime2"); - - b.Property("Creator") - .HasColumnType("uniqueidentifier"); - - b.Property("Description") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("Identity") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("IsDeleted") - .HasColumnType("bit"); - - b.Property("ModificationTime") - .HasColumnType("datetime2"); - - b.Property("Modifier") - .HasColumnType("uniqueidentifier"); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.ToTable("PublicConfigs"); - }); - - modelBuilder.Entity("Masa.Dcc.Service.Admin.Domain.App.Aggregates.PublicConfigObject", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("ConfigObjectId") - .HasColumnType("int"); - - b.Property("CreationTime") - .HasColumnType("datetime2"); - - b.Property("Creator") - .HasColumnType("uniqueidentifier"); - - b.Property("EnvironmentClusterId") - .HasColumnType("int"); - - b.Property("IsDeleted") - .HasColumnType("bit"); - - b.Property("ModificationTime") - .HasColumnType("datetime2"); - - b.Property("Modifier") - .HasColumnType("uniqueidentifier"); - - b.Property("PublicConfigId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("ConfigObjectId") - .IsUnique(); - - b.HasIndex("PublicConfigId"); - - b.ToTable("PublicConfigObjects"); - }); - - modelBuilder.Entity("Masa.Dcc.Service.Admin.Domain.Label.Aggregates.Label", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("Code") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)") - .HasComment("Code"); - - b.Property("CreationTime") - .HasColumnType("datetime2"); - - b.Property("Creator") - .HasColumnType("uniqueidentifier"); - - b.Property("Description") - .IsRequired() - .HasMaxLength(255) - .HasColumnType("nvarchar(255)") - .HasComment("Description"); - - b.Property("IsDeleted") - .HasColumnType("bit"); - - b.Property("ModificationTime") - .HasColumnType("datetime2"); - - b.Property("Modifier") - .HasColumnType("uniqueidentifier"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)") - .HasComment("Name"); - - b.Property("TypeCode") - .IsRequired() - .HasMaxLength(255) - .HasColumnType("nvarchar(255)") - .HasComment("TypeCode"); - - b.Property("TypeName") - .IsRequired() - .HasMaxLength(255) - .HasColumnType("nvarchar(255)") - .HasComment("TypeName"); - - b.HasKey("Id"); - - b.HasIndex(new[] { "TypeCode", "IsDeleted" }, "IX_TypeCode"); - - b.ToTable("Labels"); - }); - - modelBuilder.Entity("Masa.Dcc.Service.Admin.Domain.App.Aggregates.AppConfigObject", b => - { - b.HasOne("Masa.Dcc.Service.Admin.Domain.App.Aggregates.ConfigObject", "ConfigObject") - .WithOne("AppConfigObject") - .HasForeignKey("Masa.Dcc.Service.Admin.Domain.App.Aggregates.AppConfigObject", "ConfigObjectId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("ConfigObject"); - }); - - modelBuilder.Entity("Masa.Dcc.Service.Admin.Domain.App.Aggregates.BizConfigObject", b => - { - b.HasOne("Masa.Dcc.Service.Admin.Domain.App.Aggregates.BizConfig", "BizConfig") - .WithMany("BizConfigObjects") - .HasForeignKey("BizConfigId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Masa.Dcc.Service.Admin.Domain.App.Aggregates.ConfigObject", "ConfigObject") - .WithOne("BizConfigObject") - .HasForeignKey("Masa.Dcc.Service.Admin.Domain.App.Aggregates.BizConfigObject", "ConfigObjectId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("BizConfig"); - - b.Navigation("ConfigObject"); - }); - - modelBuilder.Entity("Masa.Dcc.Service.Admin.Domain.App.Aggregates.ConfigObjectRelease", b => - { - b.HasOne("Masa.Dcc.Service.Admin.Domain.App.Aggregates.ConfigObject", null) - .WithMany("ConfigObjectRelease") - .HasForeignKey("ConfigObjectId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Masa.Dcc.Service.Admin.Domain.App.Aggregates.PublicConfigObject", b => - { - b.HasOne("Masa.Dcc.Service.Admin.Domain.App.Aggregates.ConfigObject", "ConfigObject") - .WithOne("PublicConfigObject") - .HasForeignKey("Masa.Dcc.Service.Admin.Domain.App.Aggregates.PublicConfigObject", "ConfigObjectId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Masa.Dcc.Service.Admin.Domain.App.Aggregates.PublicConfig", "PublicConfig") - .WithMany("PublicConfigObjects") - .HasForeignKey("PublicConfigId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("ConfigObject"); - - b.Navigation("PublicConfig"); - }); - - modelBuilder.Entity("Masa.Dcc.Service.Admin.Domain.App.Aggregates.BizConfig", b => - { - b.Navigation("BizConfigObjects"); - }); - - modelBuilder.Entity("Masa.Dcc.Service.Admin.Domain.App.Aggregates.ConfigObject", b => - { - b.Navigation("AppConfigObject") - .IsRequired(); - - b.Navigation("BizConfigObject") - .IsRequired(); - - b.Navigation("ConfigObjectRelease"); - - b.Navigation("PublicConfigObject") - .IsRequired(); - }); - - modelBuilder.Entity("Masa.Dcc.Service.Admin.Domain.App.Aggregates.PublicConfig", b => - { - b.Navigation("PublicConfigObjects"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/Masa.Dcc.Infrastructure.EFCore.SqlServer/Migrations/20220609095708_AddFromRelation.cs b/Masa.Dcc.Infrastructure.EFCore.SqlServer/Migrations/20220609095708_AddFromRelation.cs deleted file mode 100644 index be473d63..00000000 --- a/Masa.Dcc.Infrastructure.EFCore.SqlServer/Migrations/20220609095708_AddFromRelation.cs +++ /dev/null @@ -1,26 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Masa.Dcc.Service.Admin.Migrations -{ - public partial class AddFromRelation : Migration - { - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.AddColumn( - name: "FromRelation", - table: "ConfigObjects", - type: "bit", - nullable: false, - defaultValue: false); - } - - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropColumn( - name: "FromRelation", - table: "ConfigObjects"); - } - } -} diff --git a/Masa.Dcc.Infrastructure.EFCore.SqlServer/Migrations/20221114064033_AddEncryption.Designer.cs b/Masa.Dcc.Infrastructure.EFCore.SqlServer/Migrations/20221114064033_AddEncryption.Designer.cs deleted file mode 100644 index 3d9d515a..00000000 --- a/Masa.Dcc.Infrastructure.EFCore.SqlServer/Migrations/20221114064033_AddEncryption.Designer.cs +++ /dev/null @@ -1,625 +0,0 @@ -// -using Masa.Dcc.Infrastructure.EFCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Masa.Dcc.Service.Admin.Migrations -{ - [DbContext(typeof(DccDbContext))] - [Migration("20221114064033_AddEncryption")] - partial class AddEncryption - { - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "6.0.4") - .HasAnnotation("Relational:MaxIdentifierLength", 128); - - SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder, 1L, 1); - - modelBuilder.Entity("Masa.BuildingBlocks.Dispatcher.IntegrationEvents.Logs.IntegrationEventLog", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("Content") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("CreationTime") - .HasColumnType("datetime2"); - - b.Property("EventId") - .HasColumnType("uniqueidentifier"); - - b.Property("EventTypeName") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("ModificationTime") - .HasColumnType("datetime2"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .IsRequired() - .HasMaxLength(36) - .HasColumnType("nvarchar(36)") - .HasColumnName("RowVersion"); - - b.Property("State") - .HasColumnType("int"); - - b.Property("TimesSent") - .HasColumnType("int"); - - b.Property("TransactionId") - .HasColumnType("uniqueidentifier"); - - b.HasKey("Id"); - - b.HasIndex(new[] { "EventId", "RowVersion" }, "IX_EventId_Version"); - - b.HasIndex(new[] { "State", "ModificationTime" }, "IX_State_MTime"); - - b.HasIndex(new[] { "State", "TimesSent", "ModificationTime" }, "IX_State_TimesSent_MTime"); - - b.ToTable("IntegrationEventLog", (string)null); - }); - - modelBuilder.Entity("Masa.Dcc.Service.Admin.Domain.App.Aggregates.AppConfigObject", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("AppId") - .HasColumnType("int") - .HasComment("AppId"); - - b.Property("ConfigObjectId") - .HasColumnType("int") - .HasComment("ConfigObjectId"); - - b.Property("CreationTime") - .HasColumnType("datetime2"); - - b.Property("Creator") - .HasColumnType("uniqueidentifier"); - - b.Property("EnvironmentClusterId") - .HasColumnType("int") - .HasComment("EnvironmentClusterId"); - - b.Property("IsDeleted") - .HasColumnType("bit"); - - b.Property("ModificationTime") - .HasColumnType("datetime2"); - - b.Property("Modifier") - .HasColumnType("uniqueidentifier"); - - b.HasKey("Id"); - - b.HasIndex("ConfigObjectId") - .IsUnique(); - - b.ToTable("AppConfigObjects"); - }); - - modelBuilder.Entity("Masa.Dcc.Service.Admin.Domain.App.Aggregates.AppPin", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("AppId") - .HasColumnType("int"); - - b.Property("CreationTime") - .HasColumnType("datetime2"); - - b.Property("Creator") - .HasColumnType("uniqueidentifier"); - - b.Property("IsDeleted") - .HasColumnType("bit"); - - b.Property("ModificationTime") - .HasColumnType("datetime2"); - - b.Property("Modifier") - .HasColumnType("uniqueidentifier"); - - b.HasKey("Id"); - - b.ToTable("AppPin"); - }); - - modelBuilder.Entity("Masa.Dcc.Service.Admin.Domain.App.Aggregates.AppSecret", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("AppId") - .HasColumnType("int"); - - b.Property("CreationTime") - .HasColumnType("datetime2"); - - b.Property("Creator") - .HasColumnType("uniqueidentifier"); - - b.Property("EncryptionSecret") - .HasColumnType("uniqueidentifier"); - - b.Property("EnvironmentId") - .HasColumnType("int"); - - b.Property("IsDeleted") - .HasColumnType("bit"); - - b.Property("ModificationTime") - .HasColumnType("datetime2"); - - b.Property("Modifier") - .HasColumnType("uniqueidentifier"); - - b.Property("Secret") - .HasColumnType("uniqueidentifier"); - - b.Property("Type") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.ToTable("AppSecrets"); - }); - - modelBuilder.Entity("Masa.Dcc.Service.Admin.Domain.App.Aggregates.BizConfig", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("CreationTime") - .HasColumnType("datetime2"); - - b.Property("Creator") - .HasColumnType("uniqueidentifier"); - - b.Property("Identity") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("IsDeleted") - .HasColumnType("bit"); - - b.Property("ModificationTime") - .HasColumnType("datetime2"); - - b.Property("Modifier") - .HasColumnType("uniqueidentifier"); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.ToTable("BizConfigs"); - }); - - modelBuilder.Entity("Masa.Dcc.Service.Admin.Domain.App.Aggregates.BizConfigObject", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("BizConfigId") - .HasColumnType("int"); - - b.Property("ConfigObjectId") - .HasColumnType("int"); - - b.Property("CreationTime") - .HasColumnType("datetime2"); - - b.Property("Creator") - .HasColumnType("uniqueidentifier"); - - b.Property("EnvironmentClusterId") - .HasColumnType("int"); - - b.Property("IsDeleted") - .HasColumnType("bit"); - - b.Property("ModificationTime") - .HasColumnType("datetime2"); - - b.Property("Modifier") - .HasColumnType("uniqueidentifier"); - - b.HasKey("Id"); - - b.HasIndex("BizConfigId"); - - b.HasIndex("ConfigObjectId") - .IsUnique(); - - b.ToTable("BizConfigObjects"); - }); - - modelBuilder.Entity("Masa.Dcc.Service.Admin.Domain.App.Aggregates.ConfigObject", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("Content") - .IsRequired() - .HasColumnType("ntext"); - - b.Property("CreationTime") - .HasColumnType("datetime2"); - - b.Property("Creator") - .HasColumnType("uniqueidentifier"); - - b.Property("Encryption") - .HasColumnType("bit"); - - b.Property("FormatLabelCode") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)") - .HasComment("Format"); - - b.Property("FromRelation") - .HasColumnType("bit"); - - b.Property("IsDeleted") - .HasColumnType("bit"); - - b.Property("ModificationTime") - .HasColumnType("datetime2"); - - b.Property("Modifier") - .HasColumnType("uniqueidentifier"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)") - .HasComment("Name"); - - b.Property("RelationConfigObjectId") - .HasColumnType("int") - .HasComment("Relation config object Id"); - - b.Property("TempContent") - .IsRequired() - .HasColumnType("ntext"); - - b.Property("Type") - .HasColumnType("int") - .HasComment("Type"); - - b.HasKey("Id"); - - b.ToTable("ConfigObjects"); - }); - - modelBuilder.Entity("Masa.Dcc.Service.Admin.Domain.App.Aggregates.ConfigObjectRelease", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("Comment") - .IsRequired() - .HasMaxLength(500) - .HasColumnType("nvarchar(500)") - .HasComment("Comment"); - - b.Property("ConfigObjectId") - .HasColumnType("int") - .HasComment("Config object Id"); - - b.Property("Content") - .IsRequired() - .HasMaxLength(2147483647) - .HasColumnType("ntext") - .HasComment("Content"); - - b.Property("CreationTime") - .HasColumnType("datetime2"); - - b.Property("Creator") - .HasColumnType("uniqueidentifier"); - - b.Property("FromReleaseId") - .HasColumnType("int") - .HasComment("Rollback From Release Id"); - - b.Property("IsDeleted") - .HasColumnType("bit"); - - b.Property("IsInvalid") - .HasColumnType("bit") - .HasComment("If it is rolled back, it will be true"); - - b.Property("ModificationTime") - .HasColumnType("datetime2"); - - b.Property("Modifier") - .HasColumnType("uniqueidentifier"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)") - .HasComment("Name"); - - b.Property("Type") - .HasColumnType("tinyint") - .HasComment("Release type"); - - b.Property("Version") - .IsRequired() - .HasColumnType("varchar(20)") - .HasComment("Version foramt is yyyyMMddHHmmss"); - - b.HasKey("Id"); - - b.HasIndex("ConfigObjectId"); - - b.ToTable("ConfigObjectReleases"); - }); - - modelBuilder.Entity("Masa.Dcc.Service.Admin.Domain.App.Aggregates.PublicConfig", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("CreationTime") - .HasColumnType("datetime2"); - - b.Property("Creator") - .HasColumnType("uniqueidentifier"); - - b.Property("Description") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("Identity") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("IsDeleted") - .HasColumnType("bit"); - - b.Property("ModificationTime") - .HasColumnType("datetime2"); - - b.Property("Modifier") - .HasColumnType("uniqueidentifier"); - - b.Property("Name") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.ToTable("PublicConfigs"); - }); - - modelBuilder.Entity("Masa.Dcc.Service.Admin.Domain.App.Aggregates.PublicConfigObject", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("ConfigObjectId") - .HasColumnType("int"); - - b.Property("CreationTime") - .HasColumnType("datetime2"); - - b.Property("Creator") - .HasColumnType("uniqueidentifier"); - - b.Property("EnvironmentClusterId") - .HasColumnType("int"); - - b.Property("IsDeleted") - .HasColumnType("bit"); - - b.Property("ModificationTime") - .HasColumnType("datetime2"); - - b.Property("Modifier") - .HasColumnType("uniqueidentifier"); - - b.Property("PublicConfigId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("ConfigObjectId") - .IsUnique(); - - b.HasIndex("PublicConfigId"); - - b.ToTable("PublicConfigObjects"); - }); - - modelBuilder.Entity("Masa.Dcc.Service.Admin.Domain.Label.Aggregates.Label", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("Code") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)") - .HasComment("Code"); - - b.Property("CreationTime") - .HasColumnType("datetime2"); - - b.Property("Creator") - .HasColumnType("uniqueidentifier"); - - b.Property("Description") - .IsRequired() - .HasMaxLength(255) - .HasColumnType("nvarchar(255)") - .HasComment("Description"); - - b.Property("IsDeleted") - .HasColumnType("bit"); - - b.Property("ModificationTime") - .HasColumnType("datetime2"); - - b.Property("Modifier") - .HasColumnType("uniqueidentifier"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)") - .HasComment("Name"); - - b.Property("TypeCode") - .IsRequired() - .HasMaxLength(255) - .HasColumnType("nvarchar(255)") - .HasComment("TypeCode"); - - b.Property("TypeName") - .IsRequired() - .HasMaxLength(255) - .HasColumnType("nvarchar(255)") - .HasComment("TypeName"); - - b.HasKey("Id"); - - b.HasIndex(new[] { "TypeCode", "IsDeleted" }, "IX_TypeCode"); - - b.ToTable("Labels"); - }); - - modelBuilder.Entity("Masa.Dcc.Service.Admin.Domain.App.Aggregates.AppConfigObject", b => - { - b.HasOne("Masa.Dcc.Service.Admin.Domain.App.Aggregates.ConfigObject", "ConfigObject") - .WithOne("AppConfigObject") - .HasForeignKey("Masa.Dcc.Service.Admin.Domain.App.Aggregates.AppConfigObject", "ConfigObjectId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("ConfigObject"); - }); - - modelBuilder.Entity("Masa.Dcc.Service.Admin.Domain.App.Aggregates.BizConfigObject", b => - { - b.HasOne("Masa.Dcc.Service.Admin.Domain.App.Aggregates.BizConfig", "BizConfig") - .WithMany("BizConfigObjects") - .HasForeignKey("BizConfigId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Masa.Dcc.Service.Admin.Domain.App.Aggregates.ConfigObject", "ConfigObject") - .WithOne("BizConfigObject") - .HasForeignKey("Masa.Dcc.Service.Admin.Domain.App.Aggregates.BizConfigObject", "ConfigObjectId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("BizConfig"); - - b.Navigation("ConfigObject"); - }); - - modelBuilder.Entity("Masa.Dcc.Service.Admin.Domain.App.Aggregates.ConfigObjectRelease", b => - { - b.HasOne("Masa.Dcc.Service.Admin.Domain.App.Aggregates.ConfigObject", null) - .WithMany("ConfigObjectRelease") - .HasForeignKey("ConfigObjectId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Masa.Dcc.Service.Admin.Domain.App.Aggregates.PublicConfigObject", b => - { - b.HasOne("Masa.Dcc.Service.Admin.Domain.App.Aggregates.ConfigObject", "ConfigObject") - .WithOne("PublicConfigObject") - .HasForeignKey("Masa.Dcc.Service.Admin.Domain.App.Aggregates.PublicConfigObject", "ConfigObjectId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Masa.Dcc.Service.Admin.Domain.App.Aggregates.PublicConfig", "PublicConfig") - .WithMany("PublicConfigObjects") - .HasForeignKey("PublicConfigId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("ConfigObject"); - - b.Navigation("PublicConfig"); - }); - - modelBuilder.Entity("Masa.Dcc.Service.Admin.Domain.App.Aggregates.BizConfig", b => - { - b.Navigation("BizConfigObjects"); - }); - - modelBuilder.Entity("Masa.Dcc.Service.Admin.Domain.App.Aggregates.ConfigObject", b => - { - b.Navigation("AppConfigObject") - .IsRequired(); - - b.Navigation("BizConfigObject") - .IsRequired(); - - b.Navigation("ConfigObjectRelease"); - - b.Navigation("PublicConfigObject") - .IsRequired(); - }); - - modelBuilder.Entity("Masa.Dcc.Service.Admin.Domain.App.Aggregates.PublicConfig", b => - { - b.Navigation("PublicConfigObjects"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/Masa.Dcc.Infrastructure.EFCore.SqlServer/Migrations/20221114064033_AddEncryption.cs b/Masa.Dcc.Infrastructure.EFCore.SqlServer/Migrations/20221114064033_AddEncryption.cs deleted file mode 100644 index a08057df..00000000 --- a/Masa.Dcc.Infrastructure.EFCore.SqlServer/Migrations/20221114064033_AddEncryption.cs +++ /dev/null @@ -1,68 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Masa.Dcc.Service.Admin.Migrations -{ - public partial class AddEncryption : Migration - { - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropColumn( - name: "ToReleaseId", - table: "ConfigObjectReleases"); - - migrationBuilder.RenameIndex( - name: "index_state_timessent_modificationtime", - table: "IntegrationEventLog", - newName: "IX_State_TimesSent_MTime"); - - migrationBuilder.RenameIndex( - name: "index_state_modificationtime", - table: "IntegrationEventLog", - newName: "IX_State_MTime"); - - migrationBuilder.RenameIndex( - name: "index_eventid_version", - table: "IntegrationEventLog", - newName: "IX_EventId_Version"); - - migrationBuilder.AddColumn( - name: "Encryption", - table: "ConfigObjects", - type: "bit", - nullable: false, - defaultValue: false); - } - - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropColumn( - name: "Encryption", - table: "ConfigObjects"); - - migrationBuilder.RenameIndex( - name: "IX_State_TimesSent_MTime", - table: "IntegrationEventLog", - newName: "index_state_timessent_modificationtime"); - - migrationBuilder.RenameIndex( - name: "IX_State_MTime", - table: "IntegrationEventLog", - newName: "index_state_modificationtime"); - - migrationBuilder.RenameIndex( - name: "IX_EventId_Version", - table: "IntegrationEventLog", - newName: "index_eventid_version"); - - migrationBuilder.AddColumn( - name: "ToReleaseId", - table: "ConfigObjectReleases", - type: "int", - nullable: false, - defaultValue: 0, - comment: "Rollback To Release Id"); - } - } -} diff --git a/Masa.Dcc.Infrastructure.EFCore.SqlServer/Migrations/20230518035332_ExpandContent.cs b/Masa.Dcc.Infrastructure.EFCore.SqlServer/Migrations/20230518035332_ExpandContent.cs deleted file mode 100644 index 156a0c19..00000000 --- a/Masa.Dcc.Infrastructure.EFCore.SqlServer/Migrations/20230518035332_ExpandContent.cs +++ /dev/null @@ -1,118 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Masa.Dcc.Service.Admin.Migrations -{ - public partial class ExpandContent : Migration - { - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.AlterColumn( - name: "EnvironmentClusterId", - table: "PublicConfigObjects", - type: "int", - nullable: false, - comment: "EnvironmentClusterId", - oldClrType: typeof(int), - oldType: "int"); - - migrationBuilder.AlterColumn( - name: "ConfigObjectId", - table: "PublicConfigObjects", - type: "int", - nullable: false, - comment: "ConfigObjectId", - oldClrType: typeof(int), - oldType: "int"); - - migrationBuilder.AddColumn( - name: "ExpandContent", - table: "IntegrationEventLog", - type: "nvarchar(max)", - nullable: false, - defaultValue: ""); - - migrationBuilder.AlterColumn( - name: "Version", - table: "ConfigObjectReleases", - type: "varchar(20)", - nullable: false, - comment: "Version format is yyyyMMddHHmmss", - oldClrType: typeof(string), - oldType: "varchar(20)", - oldComment: "Version foramt is yyyyMMddHHmmss"); - - migrationBuilder.AlterColumn( - name: "EnvironmentClusterId", - table: "BizConfigObjects", - type: "int", - nullable: false, - comment: "EnvironmentClusterId", - oldClrType: typeof(int), - oldType: "int"); - - migrationBuilder.AlterColumn( - name: "ConfigObjectId", - table: "BizConfigObjects", - type: "int", - nullable: false, - comment: "ConfigObjectId", - oldClrType: typeof(int), - oldType: "int"); - } - - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropColumn( - name: "ExpandContent", - table: "IntegrationEventLog"); - - migrationBuilder.AlterColumn( - name: "EnvironmentClusterId", - table: "PublicConfigObjects", - type: "int", - nullable: false, - oldClrType: typeof(int), - oldType: "int", - oldComment: "EnvironmentClusterId"); - - migrationBuilder.AlterColumn( - name: "ConfigObjectId", - table: "PublicConfigObjects", - type: "int", - nullable: false, - oldClrType: typeof(int), - oldType: "int", - oldComment: "ConfigObjectId"); - - migrationBuilder.AlterColumn( - name: "Version", - table: "ConfigObjectReleases", - type: "varchar(20)", - nullable: false, - comment: "Version foramt is yyyyMMddHHmmss", - oldClrType: typeof(string), - oldType: "varchar(20)", - oldComment: "Version format is yyyyMMddHHmmss"); - - migrationBuilder.AlterColumn( - name: "EnvironmentClusterId", - table: "BizConfigObjects", - type: "int", - nullable: false, - oldClrType: typeof(int), - oldType: "int", - oldComment: "EnvironmentClusterId"); - - migrationBuilder.AlterColumn( - name: "ConfigObjectId", - table: "BizConfigObjects", - type: "int", - nullable: false, - oldClrType: typeof(int), - oldType: "int", - oldComment: "ConfigObjectId"); - } - } -} diff --git a/Masa.Dcc.Infrastructure.EFCore.SqlServer/Migrations/20230518035332_ExpandContent.Designer.cs b/Masa.Dcc.Infrastructure.EFCore.SqlServer/Migrations/20250902040244_ReInit.Designer.cs similarity index 77% rename from Masa.Dcc.Infrastructure.EFCore.SqlServer/Migrations/20230518035332_ExpandContent.Designer.cs rename to Masa.Dcc.Infrastructure.EFCore.SqlServer/Migrations/20250902040244_ReInit.Designer.cs index 9eebe75d..8fa5870a 100644 --- a/Masa.Dcc.Infrastructure.EFCore.SqlServer/Migrations/20230518035332_ExpandContent.Designer.cs +++ b/Masa.Dcc.Infrastructure.EFCore.SqlServer/Migrations/20250902040244_ReInit.Designer.cs @@ -1,86 +1,37 @@ // +using System; using Masa.Dcc.Infrastructure.EFCore; +using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Metadata; using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; #nullable disable -namespace Masa.Dcc.Service.Admin.Migrations +namespace Masa.Dcc.Infrastructure.EFCore.SqlServer.Migrations { [DbContext(typeof(DccDbContext))] - [Migration("20230518035332_ExpandContent")] - partial class ExpandContent + [Migration("20250902040244_ReInit")] + partial class ReInit { + /// protected override void BuildTargetModel(ModelBuilder modelBuilder) { #pragma warning disable 612, 618 modelBuilder - .HasAnnotation("ProductVersion", "6.0.7") + .HasAnnotation("ProductVersion", "8.0.0") .HasAnnotation("Relational:MaxIdentifierLength", 128); - SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder, 1L, 1); + SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder); - modelBuilder.Entity("Masa.BuildingBlocks.Dispatcher.IntegrationEvents.Logs.IntegrationEventLog", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("Content") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("CreationTime") - .HasColumnType("datetime2"); - - b.Property("EventId") - .HasColumnType("uniqueidentifier"); - - b.Property("EventTypeName") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("ExpandContent") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("ModificationTime") - .HasColumnType("datetime2"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .IsRequired() - .HasMaxLength(36) - .HasColumnType("nvarchar(36)") - .HasColumnName("RowVersion"); - - b.Property("State") - .HasColumnType("int"); - - b.Property("TimesSent") - .HasColumnType("int"); - - b.Property("TransactionId") - .HasColumnType("uniqueidentifier"); - - b.HasKey("Id"); - - b.HasIndex(new[] { "EventId", "RowVersion" }, "IX_EventId_Version"); - - b.HasIndex(new[] { "State", "ModificationTime" }, "IX_State_MTime"); - - b.HasIndex(new[] { "State", "TimesSent", "ModificationTime" }, "IX_State_TimesSent_MTime"); - - b.ToTable("IntegrationEventLog", (string)null); - }); - - modelBuilder.Entity("Masa.Dcc.Service.Admin.Domain.App.Aggregates.AppConfigObject", b => + modelBuilder.Entity("Masa.Dcc.Infrastructure.Domain.Shared.AppConfigObject", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("int"); - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); b.Property("AppId") .HasColumnType("int") @@ -117,13 +68,13 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) b.ToTable("AppConfigObjects"); }); - modelBuilder.Entity("Masa.Dcc.Service.Admin.Domain.App.Aggregates.AppPin", b => + modelBuilder.Entity("Masa.Dcc.Infrastructure.Domain.Shared.AppPin", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("int"); - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); b.Property("AppId") .HasColumnType("int"); @@ -148,13 +99,13 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) b.ToTable("AppPin"); }); - modelBuilder.Entity("Masa.Dcc.Service.Admin.Domain.App.Aggregates.AppSecret", b => + modelBuilder.Entity("Masa.Dcc.Infrastructure.Domain.Shared.AppSecret", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("int"); - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); b.Property("AppId") .HasColumnType("int"); @@ -191,13 +142,13 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) b.ToTable("AppSecrets"); }); - modelBuilder.Entity("Masa.Dcc.Service.Admin.Domain.App.Aggregates.BizConfig", b => + modelBuilder.Entity("Masa.Dcc.Infrastructure.Domain.Shared.BizConfig", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("int"); - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); b.Property("CreationTime") .HasColumnType("datetime2"); @@ -227,13 +178,13 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) b.ToTable("BizConfigs"); }); - modelBuilder.Entity("Masa.Dcc.Service.Admin.Domain.App.Aggregates.BizConfigObject", b => + modelBuilder.Entity("Masa.Dcc.Infrastructure.Domain.Shared.BizConfigObject", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("int"); - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); b.Property("BizConfigId") .HasColumnType("int"); @@ -271,13 +222,13 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) b.ToTable("BizConfigObjects"); }); - modelBuilder.Entity("Masa.Dcc.Service.Admin.Domain.App.Aggregates.ConfigObject", b => + modelBuilder.Entity("Masa.Dcc.Infrastructure.Domain.Shared.ConfigObject", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("int"); - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); b.Property("Content") .IsRequired() @@ -333,13 +284,13 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) b.ToTable("ConfigObjects"); }); - modelBuilder.Entity("Masa.Dcc.Service.Admin.Domain.App.Aggregates.ConfigObjectRelease", b => + modelBuilder.Entity("Masa.Dcc.Infrastructure.Domain.Shared.ConfigObjectRelease", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("int"); - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); b.Property("Comment") .IsRequired() @@ -402,13 +353,19 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) b.ToTable("ConfigObjectReleases"); }); - modelBuilder.Entity("Masa.Dcc.Service.Admin.Domain.App.Aggregates.PublicConfig", b => + modelBuilder.Entity("Masa.Dcc.Infrastructure.Domain.Shared.Label", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("int"); - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("Code") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("nvarchar(100)") + .HasComment("Code"); b.Property("CreationTime") .HasColumnType("datetime2"); @@ -418,11 +375,9 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) b.Property("Description") .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("Identity") - .IsRequired() - .HasColumnType("nvarchar(max)"); + .HasMaxLength(255) + .HasColumnType("nvarchar(255)") + .HasComment("Description"); b.Property("IsDeleted") .HasColumnType("bit"); @@ -435,24 +390,36 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) b.Property("Name") .IsRequired() - .HasColumnType("nvarchar(max)"); + .HasMaxLength(100) + .HasColumnType("nvarchar(100)") + .HasComment("Name"); + + b.Property("TypeCode") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("nvarchar(255)") + .HasComment("TypeCode"); + + b.Property("TypeName") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("nvarchar(255)") + .HasComment("TypeName"); b.HasKey("Id"); - b.ToTable("PublicConfigs"); + b.HasIndex(new[] { "TypeCode", "IsDeleted" }, "IX_TypeCode"); + + b.ToTable("Labels"); }); - modelBuilder.Entity("Masa.Dcc.Service.Admin.Domain.App.Aggregates.PublicConfigObject", b => + modelBuilder.Entity("Masa.Dcc.Infrastructure.Domain.Shared.PublicConfig", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("int"); - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("ConfigObjectId") - .HasColumnType("int") - .HasComment("ConfigObjectId"); + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); b.Property("CreationTime") .HasColumnType("datetime2"); @@ -460,9 +427,13 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) b.Property("Creator") .HasColumnType("uniqueidentifier"); - b.Property("EnvironmentClusterId") - .HasColumnType("int") - .HasComment("EnvironmentClusterId"); + b.Property("Description") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("Identity") + .IsRequired() + .HasColumnType("nvarchar(max)"); b.Property("IsDeleted") .HasColumnType("bit"); @@ -473,32 +444,26 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) b.Property("Modifier") .HasColumnType("uniqueidentifier"); - b.Property("PublicConfigId") - .HasColumnType("int"); + b.Property("Name") + .IsRequired() + .HasColumnType("nvarchar(max)"); b.HasKey("Id"); - b.HasIndex("ConfigObjectId") - .IsUnique(); - - b.HasIndex("PublicConfigId"); - - b.ToTable("PublicConfigObjects"); + b.ToTable("PublicConfigs"); }); - modelBuilder.Entity("Masa.Dcc.Service.Admin.Domain.Label.Aggregates.Label", b => + modelBuilder.Entity("Masa.Dcc.Infrastructure.Domain.Shared.PublicConfigObject", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("int"); - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - b.Property("Code") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)") - .HasComment("Code"); + b.Property("ConfigObjectId") + .HasColumnType("int") + .HasComment("ConfigObjectId"); b.Property("CreationTime") .HasColumnType("datetime2"); @@ -506,11 +471,9 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) b.Property("Creator") .HasColumnType("uniqueidentifier"); - b.Property("Description") - .IsRequired() - .HasMaxLength(255) - .HasColumnType("nvarchar(255)") - .HasComment("Description"); + b.Property("EnvironmentClusterId") + .HasColumnType("int") + .HasComment("EnvironmentClusterId"); b.Property("IsDeleted") .HasColumnType("bit"); @@ -521,53 +484,41 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) b.Property("Modifier") .HasColumnType("uniqueidentifier"); - b.Property("Name") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)") - .HasComment("Name"); - - b.Property("TypeCode") - .IsRequired() - .HasMaxLength(255) - .HasColumnType("nvarchar(255)") - .HasComment("TypeCode"); - - b.Property("TypeName") - .IsRequired() - .HasMaxLength(255) - .HasColumnType("nvarchar(255)") - .HasComment("TypeName"); + b.Property("PublicConfigId") + .HasColumnType("int"); b.HasKey("Id"); - b.HasIndex(new[] { "TypeCode", "IsDeleted" }, "IX_TypeCode"); + b.HasIndex("ConfigObjectId") + .IsUnique(); - b.ToTable("Labels"); + b.HasIndex("PublicConfigId"); + + b.ToTable("PublicConfigObjects"); }); - modelBuilder.Entity("Masa.Dcc.Service.Admin.Domain.App.Aggregates.AppConfigObject", b => + modelBuilder.Entity("Masa.Dcc.Infrastructure.Domain.Shared.AppConfigObject", b => { - b.HasOne("Masa.Dcc.Service.Admin.Domain.App.Aggregates.ConfigObject", "ConfigObject") + b.HasOne("Masa.Dcc.Infrastructure.Domain.Shared.ConfigObject", "ConfigObject") .WithOne("AppConfigObject") - .HasForeignKey("Masa.Dcc.Service.Admin.Domain.App.Aggregates.AppConfigObject", "ConfigObjectId") + .HasForeignKey("Masa.Dcc.Infrastructure.Domain.Shared.AppConfigObject", "ConfigObjectId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.Navigation("ConfigObject"); }); - modelBuilder.Entity("Masa.Dcc.Service.Admin.Domain.App.Aggregates.BizConfigObject", b => + modelBuilder.Entity("Masa.Dcc.Infrastructure.Domain.Shared.BizConfigObject", b => { - b.HasOne("Masa.Dcc.Service.Admin.Domain.App.Aggregates.BizConfig", "BizConfig") + b.HasOne("Masa.Dcc.Infrastructure.Domain.Shared.BizConfig", "BizConfig") .WithMany("BizConfigObjects") .HasForeignKey("BizConfigId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); - b.HasOne("Masa.Dcc.Service.Admin.Domain.App.Aggregates.ConfigObject", "ConfigObject") + b.HasOne("Masa.Dcc.Infrastructure.Domain.Shared.ConfigObject", "ConfigObject") .WithOne("BizConfigObject") - .HasForeignKey("Masa.Dcc.Service.Admin.Domain.App.Aggregates.BizConfigObject", "ConfigObjectId") + .HasForeignKey("Masa.Dcc.Infrastructure.Domain.Shared.BizConfigObject", "ConfigObjectId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); @@ -576,24 +527,24 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) b.Navigation("ConfigObject"); }); - modelBuilder.Entity("Masa.Dcc.Service.Admin.Domain.App.Aggregates.ConfigObjectRelease", b => + modelBuilder.Entity("Masa.Dcc.Infrastructure.Domain.Shared.ConfigObjectRelease", b => { - b.HasOne("Masa.Dcc.Service.Admin.Domain.App.Aggregates.ConfigObject", null) + b.HasOne("Masa.Dcc.Infrastructure.Domain.Shared.ConfigObject", null) .WithMany("ConfigObjectRelease") .HasForeignKey("ConfigObjectId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); }); - modelBuilder.Entity("Masa.Dcc.Service.Admin.Domain.App.Aggregates.PublicConfigObject", b => + modelBuilder.Entity("Masa.Dcc.Infrastructure.Domain.Shared.PublicConfigObject", b => { - b.HasOne("Masa.Dcc.Service.Admin.Domain.App.Aggregates.ConfigObject", "ConfigObject") + b.HasOne("Masa.Dcc.Infrastructure.Domain.Shared.ConfigObject", "ConfigObject") .WithOne("PublicConfigObject") - .HasForeignKey("Masa.Dcc.Service.Admin.Domain.App.Aggregates.PublicConfigObject", "ConfigObjectId") + .HasForeignKey("Masa.Dcc.Infrastructure.Domain.Shared.PublicConfigObject", "ConfigObjectId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); - b.HasOne("Masa.Dcc.Service.Admin.Domain.App.Aggregates.PublicConfig", "PublicConfig") + b.HasOne("Masa.Dcc.Infrastructure.Domain.Shared.PublicConfig", "PublicConfig") .WithMany("PublicConfigObjects") .HasForeignKey("PublicConfigId") .OnDelete(DeleteBehavior.Cascade) @@ -604,12 +555,12 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) b.Navigation("PublicConfig"); }); - modelBuilder.Entity("Masa.Dcc.Service.Admin.Domain.App.Aggregates.BizConfig", b => + modelBuilder.Entity("Masa.Dcc.Infrastructure.Domain.Shared.BizConfig", b => { b.Navigation("BizConfigObjects"); }); - modelBuilder.Entity("Masa.Dcc.Service.Admin.Domain.App.Aggregates.ConfigObject", b => + modelBuilder.Entity("Masa.Dcc.Infrastructure.Domain.Shared.ConfigObject", b => { b.Navigation("AppConfigObject") .IsRequired(); @@ -623,7 +574,7 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) .IsRequired(); }); - modelBuilder.Entity("Masa.Dcc.Service.Admin.Domain.App.Aggregates.PublicConfig", b => + modelBuilder.Entity("Masa.Dcc.Infrastructure.Domain.Shared.PublicConfig", b => { b.Navigation("PublicConfigObjects"); }); diff --git a/Masa.Dcc.Infrastructure.EFCore.SqlServer/Migrations/20220425085849_InitCreate.cs b/Masa.Dcc.Infrastructure.EFCore.SqlServer/Migrations/20250902040244_ReInit.cs similarity index 65% rename from Masa.Dcc.Infrastructure.EFCore.SqlServer/Migrations/20220425085849_InitCreate.cs rename to Masa.Dcc.Infrastructure.EFCore.SqlServer/Migrations/20250902040244_ReInit.cs index 108c7613..6fca8014 100644 --- a/Masa.Dcc.Infrastructure.EFCore.SqlServer/Migrations/20220425085849_InitCreate.cs +++ b/Masa.Dcc.Infrastructure.EFCore.SqlServer/Migrations/20250902040244_ReInit.cs @@ -1,17 +1,34 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the Apache License. See LICENSE.txt in the project root for license information. - -using System; +using System; using Microsoft.EntityFrameworkCore.Migrations; #nullable disable -namespace Masa.Dcc.Service.Admin.Migrations +namespace Masa.Dcc.Infrastructure.EFCore.SqlServer.Migrations { - public partial class InitCreate : Migration + /// + public partial class ReInit : Migration { + /// protected override void Up(MigrationBuilder migrationBuilder) { + migrationBuilder.CreateTable( + name: "AppPin", + columns: table => new + { + Id = table.Column(type: "int", nullable: false) + .Annotation("SqlServer:Identity", "1, 1"), + AppId = table.Column(type: "int", nullable: false), + Creator = table.Column(type: "uniqueidentifier", nullable: false), + CreationTime = table.Column(type: "datetime2", nullable: false), + Modifier = table.Column(type: "uniqueidentifier", nullable: false), + ModificationTime = table.Column(type: "datetime2", nullable: false), + IsDeleted = table.Column(type: "bit", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_AppPin", x => x.Id); + }); + migrationBuilder.CreateTable( name: "AppSecrets", columns: table => new @@ -35,15 +52,13 @@ protected override void Up(MigrationBuilder migrationBuilder) }); migrationBuilder.CreateTable( - name: "ConfigObjects", + name: "BizConfigs", columns: table => new { Id = table.Column(type: "int", nullable: false) .Annotation("SqlServer:Identity", "1, 1"), - Name = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: false, comment: "Name"), - FormatLabelId = table.Column(type: "int", nullable: false, comment: "Format"), - TypeLabelId = table.Column(type: "int", nullable: false, comment: "Type"), - RelationConfigObjectId = table.Column(type: "int", nullable: false, comment: "Relation config object Id"), + Name = table.Column(type: "nvarchar(max)", nullable: false), + Identity = table.Column(type: "nvarchar(max)", nullable: false), Creator = table.Column(type: "uniqueidentifier", nullable: false), CreationTime = table.Column(type: "datetime2", nullable: false), Modifier = table.Column(type: "uniqueidentifier", nullable: false), @@ -52,27 +67,32 @@ protected override void Up(MigrationBuilder migrationBuilder) }, constraints: table => { - table.PrimaryKey("PK_ConfigObjects", x => x.Id); + table.PrimaryKey("PK_BizConfigs", x => x.Id); }); migrationBuilder.CreateTable( - name: "IntegrationEventLog", + name: "ConfigObjects", columns: table => new { - Id = table.Column(type: "uniqueidentifier", nullable: false), - EventId = table.Column(type: "uniqueidentifier", nullable: false), - EventTypeName = table.Column(type: "nvarchar(max)", nullable: false), - State = table.Column(type: "int", nullable: false), - TimesSent = table.Column(type: "int", nullable: false), + Id = table.Column(type: "int", nullable: false) + .Annotation("SqlServer:Identity", "1, 1"), + Name = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: false, comment: "Name"), + FormatLabelCode = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: false, comment: "Format"), + Type = table.Column(type: "int", nullable: false, comment: "Type"), + Encryption = table.Column(type: "bit", nullable: false), + Content = table.Column(type: "ntext", nullable: false), + TempContent = table.Column(type: "ntext", nullable: false), + RelationConfigObjectId = table.Column(type: "int", nullable: false, comment: "Relation config object Id"), + FromRelation = table.Column(type: "bit", nullable: false), + Creator = table.Column(type: "uniqueidentifier", nullable: false), CreationTime = table.Column(type: "datetime2", nullable: false), + Modifier = table.Column(type: "uniqueidentifier", nullable: false), ModificationTime = table.Column(type: "datetime2", nullable: false), - Content = table.Column(type: "nvarchar(max)", nullable: false), - TransactionId = table.Column(type: "uniqueidentifier", nullable: false), - RowVersion = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false) + IsDeleted = table.Column(type: "bit", nullable: false) }, constraints: table => { - table.PrimaryKey("PK_IntegrationEventLog", x => x.Id); + table.PrimaryKey("PK_ConfigObjects", x => x.Id); }); migrationBuilder.CreateTable( @@ -81,6 +101,7 @@ protected override void Up(MigrationBuilder migrationBuilder) { Id = table.Column(type: "int", nullable: false) .Annotation("SqlServer:Identity", "1, 1"), + Code = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: false, comment: "Code"), Name = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: false, comment: "Name"), TypeCode = table.Column(type: "nvarchar(255)", maxLength: 255, nullable: false, comment: "TypeCode"), TypeName = table.Column(type: "nvarchar(255)", maxLength: 255, nullable: false, comment: "TypeName"), @@ -122,14 +143,14 @@ protected override void Up(MigrationBuilder migrationBuilder) { Id = table.Column(type: "int", nullable: false) .Annotation("SqlServer:Identity", "1, 1"), - EnvironmentClusterId = table.Column(type: "int", nullable: false, comment: "EnvironmentClusterId"), AppId = table.Column(type: "int", nullable: false, comment: "AppId"), - ConfigObjectId = table.Column(type: "int", nullable: false, comment: "ConfigObjectId"), Creator = table.Column(type: "uniqueidentifier", nullable: false), CreationTime = table.Column(type: "datetime2", nullable: false), Modifier = table.Column(type: "uniqueidentifier", nullable: false), ModificationTime = table.Column(type: "datetime2", nullable: false), - IsDeleted = table.Column(type: "bit", nullable: false) + IsDeleted = table.Column(type: "bit", nullable: false), + ConfigObjectId = table.Column(type: "int", nullable: false, comment: "ConfigObjectId"), + EnvironmentClusterId = table.Column(type: "int", nullable: false, comment: "EnvironmentClusterId") }, constraints: table => { @@ -143,14 +164,51 @@ protected override void Up(MigrationBuilder migrationBuilder) }); migrationBuilder.CreateTable( - name: "ConfigObjectMains", + name: "BizConfigObjects", columns: table => new { Id = table.Column(type: "int", nullable: false) .Annotation("SqlServer:Identity", "1, 1"), - ConfigObjectId = table.Column(type: "int", nullable: false), - Content = table.Column(type: "ntext", maxLength: 2147483647, nullable: false), - TempContent = table.Column(type: "ntext", nullable: false), + BizConfigId = table.Column(type: "int", nullable: false), + Creator = table.Column(type: "uniqueidentifier", nullable: false), + CreationTime = table.Column(type: "datetime2", nullable: false), + Modifier = table.Column(type: "uniqueidentifier", nullable: false), + ModificationTime = table.Column(type: "datetime2", nullable: false), + IsDeleted = table.Column(type: "bit", nullable: false), + ConfigObjectId = table.Column(type: "int", nullable: false, comment: "ConfigObjectId"), + EnvironmentClusterId = table.Column(type: "int", nullable: false, comment: "EnvironmentClusterId") + }, + constraints: table => + { + table.PrimaryKey("PK_BizConfigObjects", x => x.Id); + table.ForeignKey( + name: "FK_BizConfigObjects_BizConfigs_BizConfigId", + column: x => x.BizConfigId, + principalTable: "BizConfigs", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + table.ForeignKey( + name: "FK_BizConfigObjects_ConfigObjects_ConfigObjectId", + column: x => x.ConfigObjectId, + principalTable: "ConfigObjects", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "ConfigObjectReleases", + columns: table => new + { + Id = table.Column(type: "int", nullable: false) + .Annotation("SqlServer:Identity", "1, 1"), + Type = table.Column(type: "tinyint", nullable: false, comment: "Release type"), + ConfigObjectId = table.Column(type: "int", nullable: false, comment: "Config object Id"), + FromReleaseId = table.Column(type: "int", nullable: false, comment: "Rollback From Release Id"), + IsInvalid = table.Column(type: "bit", nullable: false, comment: "If it is rolled back, it will be true"), + Version = table.Column(type: "varchar(20)", nullable: false, comment: "Version format is yyyyMMddHHmmss"), + Name = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: false, comment: "Name"), + Comment = table.Column(type: "nvarchar(500)", maxLength: 500, nullable: false, comment: "Comment"), + Content = table.Column(type: "ntext", maxLength: 2147483647, nullable: false, comment: "Content"), Creator = table.Column(type: "uniqueidentifier", nullable: false), CreationTime = table.Column(type: "datetime2", nullable: false), Modifier = table.Column(type: "uniqueidentifier", nullable: false), @@ -159,9 +217,9 @@ protected override void Up(MigrationBuilder migrationBuilder) }, constraints: table => { - table.PrimaryKey("PK_ConfigObjectMains", x => x.Id); + table.PrimaryKey("PK_ConfigObjectReleases", x => x.Id); table.ForeignKey( - name: "FK_ConfigObjectMains_ConfigObjects_ConfigObjectId", + name: "FK_ConfigObjectReleases_ConfigObjects_ConfigObjectId", column: x => x.ConfigObjectId, principalTable: "ConfigObjects", principalColumn: "Id", @@ -175,13 +233,13 @@ protected override void Up(MigrationBuilder migrationBuilder) Id = table.Column(type: "int", nullable: false) .Annotation("SqlServer:Identity", "1, 1"), PublicConfigId = table.Column(type: "int", nullable: false), - ConfigObjectId = table.Column(type: "int", nullable: false), - EnvironmentClusterId = table.Column(type: "int", nullable: false), Creator = table.Column(type: "uniqueidentifier", nullable: false), CreationTime = table.Column(type: "datetime2", nullable: false), Modifier = table.Column(type: "uniqueidentifier", nullable: false), ModificationTime = table.Column(type: "datetime2", nullable: false), - IsDeleted = table.Column(type: "bit", nullable: false) + IsDeleted = table.Column(type: "bit", nullable: false), + ConfigObjectId = table.Column(type: "int", nullable: false, comment: "ConfigObjectId"), + EnvironmentClusterId = table.Column(type: "int", nullable: false, comment: "EnvironmentClusterId") }, constraints: table => { @@ -203,28 +261,24 @@ protected override void Up(MigrationBuilder migrationBuilder) migrationBuilder.CreateIndex( name: "IX_AppConfigObjects_ConfigObjectId", table: "AppConfigObjects", - column: "ConfigObjectId"); - - migrationBuilder.CreateIndex( - name: "IX_ConfigObjectMains_ConfigObjectId", - table: "ConfigObjectMains", column: "ConfigObjectId", unique: true); migrationBuilder.CreateIndex( - name: "index_eventid_version", - table: "IntegrationEventLog", - columns: new[] { "EventId", "RowVersion" }); + name: "IX_BizConfigObjects_BizConfigId", + table: "BizConfigObjects", + column: "BizConfigId"); migrationBuilder.CreateIndex( - name: "index_state_modificationtime", - table: "IntegrationEventLog", - columns: new[] { "State", "ModificationTime" }); + name: "IX_BizConfigObjects_ConfigObjectId", + table: "BizConfigObjects", + column: "ConfigObjectId", + unique: true); migrationBuilder.CreateIndex( - name: "index_state_timessent_modificationtime", - table: "IntegrationEventLog", - columns: new[] { "State", "TimesSent", "ModificationTime" }); + name: "IX_ConfigObjectReleases_ConfigObjectId", + table: "ConfigObjectReleases", + column: "ConfigObjectId"); migrationBuilder.CreateIndex( name: "IX_TypeCode", @@ -234,7 +288,8 @@ protected override void Up(MigrationBuilder migrationBuilder) migrationBuilder.CreateIndex( name: "IX_PublicConfigObjects_ConfigObjectId", table: "PublicConfigObjects", - column: "ConfigObjectId"); + column: "ConfigObjectId", + unique: true); migrationBuilder.CreateIndex( name: "IX_PublicConfigObjects_PublicConfigId", @@ -242,19 +297,23 @@ protected override void Up(MigrationBuilder migrationBuilder) column: "PublicConfigId"); } + /// protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropTable( name: "AppConfigObjects"); + migrationBuilder.DropTable( + name: "AppPin"); + migrationBuilder.DropTable( name: "AppSecrets"); migrationBuilder.DropTable( - name: "ConfigObjectMains"); + name: "BizConfigObjects"); migrationBuilder.DropTable( - name: "IntegrationEventLog"); + name: "ConfigObjectReleases"); migrationBuilder.DropTable( name: "Labels"); @@ -262,6 +321,9 @@ protected override void Down(MigrationBuilder migrationBuilder) migrationBuilder.DropTable( name: "PublicConfigObjects"); + migrationBuilder.DropTable( + name: "BizConfigs"); + migrationBuilder.DropTable( name: "ConfigObjects"); diff --git a/Masa.Dcc.Infrastructure.EFCore.SqlServer/Migrations/DccDbContextModelSnapshot.cs b/Masa.Dcc.Infrastructure.EFCore.SqlServer/Migrations/DccDbContextModelSnapshot.cs index 9e6de458..6aaf3a23 100644 --- a/Masa.Dcc.Infrastructure.EFCore.SqlServer/Migrations/DccDbContextModelSnapshot.cs +++ b/Masa.Dcc.Infrastructure.EFCore.SqlServer/Migrations/DccDbContextModelSnapshot.cs @@ -1,10 +1,14 @@ // +using System; using Masa.Dcc.Infrastructure.EFCore; +using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; #nullable disable -namespace Masa.Dcc.Service.Admin.Migrations +namespace Masa.Dcc.Infrastructure.EFCore.SqlServer.Migrations { [DbContext(typeof(DccDbContext))] partial class DccDbContextModelSnapshot : ModelSnapshot @@ -13,72 +17,18 @@ protected override void BuildModel(ModelBuilder modelBuilder) { #pragma warning disable 612, 618 modelBuilder - .HasAnnotation("ProductVersion", "6.0.7") + .HasAnnotation("ProductVersion", "8.0.0") .HasAnnotation("Relational:MaxIdentifierLength", 128); - SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder, 1L, 1); + SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder); - modelBuilder.Entity("Masa.BuildingBlocks.Dispatcher.IntegrationEvents.Logs.IntegrationEventLog", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("Content") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("CreationTime") - .HasColumnType("datetime2"); - - b.Property("EventId") - .HasColumnType("uniqueidentifier"); - - b.Property("EventTypeName") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("ExpandContent") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("ModificationTime") - .HasColumnType("datetime2"); - - b.Property("RowVersion") - .IsConcurrencyToken() - .IsRequired() - .HasMaxLength(36) - .HasColumnType("nvarchar(36)") - .HasColumnName("RowVersion"); - - b.Property("State") - .HasColumnType("int"); - - b.Property("TimesSent") - .HasColumnType("int"); - - b.Property("TransactionId") - .HasColumnType("uniqueidentifier"); - - b.HasKey("Id"); - - b.HasIndex(new[] { "EventId", "RowVersion" }, "IX_EventId_Version"); - - b.HasIndex(new[] { "State", "ModificationTime" }, "IX_State_MTime"); - - b.HasIndex(new[] { "State", "TimesSent", "ModificationTime" }, "IX_State_TimesSent_MTime"); - - b.ToTable("IntegrationEventLog", (string)null); - }); - - modelBuilder.Entity("Masa.Dcc.Service.Admin.Domain.App.Aggregates.AppConfigObject", b => + modelBuilder.Entity("Masa.Dcc.Infrastructure.Domain.Shared.AppConfigObject", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("int"); - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); b.Property("AppId") .HasColumnType("int") @@ -115,13 +65,13 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.ToTable("AppConfigObjects"); }); - modelBuilder.Entity("Masa.Dcc.Service.Admin.Domain.App.Aggregates.AppPin", b => + modelBuilder.Entity("Masa.Dcc.Infrastructure.Domain.Shared.AppPin", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("int"); - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); b.Property("AppId") .HasColumnType("int"); @@ -146,13 +96,13 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.ToTable("AppPin"); }); - modelBuilder.Entity("Masa.Dcc.Service.Admin.Domain.App.Aggregates.AppSecret", b => + modelBuilder.Entity("Masa.Dcc.Infrastructure.Domain.Shared.AppSecret", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("int"); - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); b.Property("AppId") .HasColumnType("int"); @@ -189,13 +139,13 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.ToTable("AppSecrets"); }); - modelBuilder.Entity("Masa.Dcc.Service.Admin.Domain.App.Aggregates.BizConfig", b => + modelBuilder.Entity("Masa.Dcc.Infrastructure.Domain.Shared.BizConfig", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("int"); - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); b.Property("CreationTime") .HasColumnType("datetime2"); @@ -225,13 +175,13 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.ToTable("BizConfigs"); }); - modelBuilder.Entity("Masa.Dcc.Service.Admin.Domain.App.Aggregates.BizConfigObject", b => + modelBuilder.Entity("Masa.Dcc.Infrastructure.Domain.Shared.BizConfigObject", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("int"); - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); b.Property("BizConfigId") .HasColumnType("int"); @@ -269,13 +219,13 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.ToTable("BizConfigObjects"); }); - modelBuilder.Entity("Masa.Dcc.Service.Admin.Domain.App.Aggregates.ConfigObject", b => + modelBuilder.Entity("Masa.Dcc.Infrastructure.Domain.Shared.ConfigObject", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("int"); - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); b.Property("Content") .IsRequired() @@ -331,13 +281,13 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.ToTable("ConfigObjects"); }); - modelBuilder.Entity("Masa.Dcc.Service.Admin.Domain.App.Aggregates.ConfigObjectRelease", b => + modelBuilder.Entity("Masa.Dcc.Infrastructure.Domain.Shared.ConfigObjectRelease", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("int"); - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); b.Property("Comment") .IsRequired() @@ -400,13 +350,19 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.ToTable("ConfigObjectReleases"); }); - modelBuilder.Entity("Masa.Dcc.Service.Admin.Domain.App.Aggregates.PublicConfig", b => + modelBuilder.Entity("Masa.Dcc.Infrastructure.Domain.Shared.Label", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("int"); - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("Code") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("nvarchar(100)") + .HasComment("Code"); b.Property("CreationTime") .HasColumnType("datetime2"); @@ -416,11 +372,9 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.Property("Description") .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("Identity") - .IsRequired() - .HasColumnType("nvarchar(max)"); + .HasMaxLength(255) + .HasColumnType("nvarchar(255)") + .HasComment("Description"); b.Property("IsDeleted") .HasColumnType("bit"); @@ -433,24 +387,36 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.Property("Name") .IsRequired() - .HasColumnType("nvarchar(max)"); + .HasMaxLength(100) + .HasColumnType("nvarchar(100)") + .HasComment("Name"); + + b.Property("TypeCode") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("nvarchar(255)") + .HasComment("TypeCode"); + + b.Property("TypeName") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("nvarchar(255)") + .HasComment("TypeName"); b.HasKey("Id"); - b.ToTable("PublicConfigs"); + b.HasIndex(new[] { "TypeCode", "IsDeleted" }, "IX_TypeCode"); + + b.ToTable("Labels"); }); - modelBuilder.Entity("Masa.Dcc.Service.Admin.Domain.App.Aggregates.PublicConfigObject", b => + modelBuilder.Entity("Masa.Dcc.Infrastructure.Domain.Shared.PublicConfig", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("int"); - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("ConfigObjectId") - .HasColumnType("int") - .HasComment("ConfigObjectId"); + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); b.Property("CreationTime") .HasColumnType("datetime2"); @@ -458,9 +424,13 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.Property("Creator") .HasColumnType("uniqueidentifier"); - b.Property("EnvironmentClusterId") - .HasColumnType("int") - .HasComment("EnvironmentClusterId"); + b.Property("Description") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("Identity") + .IsRequired() + .HasColumnType("nvarchar(max)"); b.Property("IsDeleted") .HasColumnType("bit"); @@ -471,32 +441,26 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.Property("Modifier") .HasColumnType("uniqueidentifier"); - b.Property("PublicConfigId") - .HasColumnType("int"); + b.Property("Name") + .IsRequired() + .HasColumnType("nvarchar(max)"); b.HasKey("Id"); - b.HasIndex("ConfigObjectId") - .IsUnique(); - - b.HasIndex("PublicConfigId"); - - b.ToTable("PublicConfigObjects"); + b.ToTable("PublicConfigs"); }); - modelBuilder.Entity("Masa.Dcc.Service.Admin.Domain.Label.Aggregates.Label", b => + modelBuilder.Entity("Masa.Dcc.Infrastructure.Domain.Shared.PublicConfigObject", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("int"); - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - b.Property("Code") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)") - .HasComment("Code"); + b.Property("ConfigObjectId") + .HasColumnType("int") + .HasComment("ConfigObjectId"); b.Property("CreationTime") .HasColumnType("datetime2"); @@ -504,11 +468,9 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.Property("Creator") .HasColumnType("uniqueidentifier"); - b.Property("Description") - .IsRequired() - .HasMaxLength(255) - .HasColumnType("nvarchar(255)") - .HasComment("Description"); + b.Property("EnvironmentClusterId") + .HasColumnType("int") + .HasComment("EnvironmentClusterId"); b.Property("IsDeleted") .HasColumnType("bit"); @@ -519,53 +481,41 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.Property("Modifier") .HasColumnType("uniqueidentifier"); - b.Property("Name") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)") - .HasComment("Name"); - - b.Property("TypeCode") - .IsRequired() - .HasMaxLength(255) - .HasColumnType("nvarchar(255)") - .HasComment("TypeCode"); - - b.Property("TypeName") - .IsRequired() - .HasMaxLength(255) - .HasColumnType("nvarchar(255)") - .HasComment("TypeName"); + b.Property("PublicConfigId") + .HasColumnType("int"); b.HasKey("Id"); - b.HasIndex(new[] { "TypeCode", "IsDeleted" }, "IX_TypeCode"); + b.HasIndex("ConfigObjectId") + .IsUnique(); - b.ToTable("Labels"); + b.HasIndex("PublicConfigId"); + + b.ToTable("PublicConfigObjects"); }); - modelBuilder.Entity("Masa.Dcc.Service.Admin.Domain.App.Aggregates.AppConfigObject", b => + modelBuilder.Entity("Masa.Dcc.Infrastructure.Domain.Shared.AppConfigObject", b => { - b.HasOne("Masa.Dcc.Service.Admin.Domain.App.Aggregates.ConfigObject", "ConfigObject") + b.HasOne("Masa.Dcc.Infrastructure.Domain.Shared.ConfigObject", "ConfigObject") .WithOne("AppConfigObject") - .HasForeignKey("Masa.Dcc.Service.Admin.Domain.App.Aggregates.AppConfigObject", "ConfigObjectId") + .HasForeignKey("Masa.Dcc.Infrastructure.Domain.Shared.AppConfigObject", "ConfigObjectId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.Navigation("ConfigObject"); }); - modelBuilder.Entity("Masa.Dcc.Service.Admin.Domain.App.Aggregates.BizConfigObject", b => + modelBuilder.Entity("Masa.Dcc.Infrastructure.Domain.Shared.BizConfigObject", b => { - b.HasOne("Masa.Dcc.Service.Admin.Domain.App.Aggregates.BizConfig", "BizConfig") + b.HasOne("Masa.Dcc.Infrastructure.Domain.Shared.BizConfig", "BizConfig") .WithMany("BizConfigObjects") .HasForeignKey("BizConfigId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); - b.HasOne("Masa.Dcc.Service.Admin.Domain.App.Aggregates.ConfigObject", "ConfigObject") + b.HasOne("Masa.Dcc.Infrastructure.Domain.Shared.ConfigObject", "ConfigObject") .WithOne("BizConfigObject") - .HasForeignKey("Masa.Dcc.Service.Admin.Domain.App.Aggregates.BizConfigObject", "ConfigObjectId") + .HasForeignKey("Masa.Dcc.Infrastructure.Domain.Shared.BizConfigObject", "ConfigObjectId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); @@ -574,24 +524,24 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.Navigation("ConfigObject"); }); - modelBuilder.Entity("Masa.Dcc.Service.Admin.Domain.App.Aggregates.ConfigObjectRelease", b => + modelBuilder.Entity("Masa.Dcc.Infrastructure.Domain.Shared.ConfigObjectRelease", b => { - b.HasOne("Masa.Dcc.Service.Admin.Domain.App.Aggregates.ConfigObject", null) + b.HasOne("Masa.Dcc.Infrastructure.Domain.Shared.ConfigObject", null) .WithMany("ConfigObjectRelease") .HasForeignKey("ConfigObjectId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); }); - modelBuilder.Entity("Masa.Dcc.Service.Admin.Domain.App.Aggregates.PublicConfigObject", b => + modelBuilder.Entity("Masa.Dcc.Infrastructure.Domain.Shared.PublicConfigObject", b => { - b.HasOne("Masa.Dcc.Service.Admin.Domain.App.Aggregates.ConfigObject", "ConfigObject") + b.HasOne("Masa.Dcc.Infrastructure.Domain.Shared.ConfigObject", "ConfigObject") .WithOne("PublicConfigObject") - .HasForeignKey("Masa.Dcc.Service.Admin.Domain.App.Aggregates.PublicConfigObject", "ConfigObjectId") + .HasForeignKey("Masa.Dcc.Infrastructure.Domain.Shared.PublicConfigObject", "ConfigObjectId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); - b.HasOne("Masa.Dcc.Service.Admin.Domain.App.Aggregates.PublicConfig", "PublicConfig") + b.HasOne("Masa.Dcc.Infrastructure.Domain.Shared.PublicConfig", "PublicConfig") .WithMany("PublicConfigObjects") .HasForeignKey("PublicConfigId") .OnDelete(DeleteBehavior.Cascade) @@ -602,12 +552,12 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.Navigation("PublicConfig"); }); - modelBuilder.Entity("Masa.Dcc.Service.Admin.Domain.App.Aggregates.BizConfig", b => + modelBuilder.Entity("Masa.Dcc.Infrastructure.Domain.Shared.BizConfig", b => { b.Navigation("BizConfigObjects"); }); - modelBuilder.Entity("Masa.Dcc.Service.Admin.Domain.App.Aggregates.ConfigObject", b => + modelBuilder.Entity("Masa.Dcc.Infrastructure.Domain.Shared.ConfigObject", b => { b.Navigation("AppConfigObject") .IsRequired(); @@ -621,7 +571,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) .IsRequired(); }); - modelBuilder.Entity("Masa.Dcc.Service.Admin.Domain.App.Aggregates.PublicConfig", b => + modelBuilder.Entity("Masa.Dcc.Infrastructure.Domain.Shared.PublicConfig", b => { b.Navigation("PublicConfigObjects"); }); diff --git a/Masa.Dcc.Infrastructure.EFCore/DccDbContext.cs b/Masa.Dcc.Infrastructure.EFCore/DccDbContext.cs index 050a69c6..a1dbf907 100644 --- a/Masa.Dcc.Infrastructure.EFCore/DccDbContext.cs +++ b/Masa.Dcc.Infrastructure.EFCore/DccDbContext.cs @@ -19,7 +19,7 @@ public static void RegistAssembly(Assembly assembly) protected override void OnModelCreatingExecuting(ModelBuilder builder) { - builder.ApplyConfigurationsFromAssembly(Assembly); + builder.ApplyConfigurationsFromAssembly(Assembly); base.OnModelCreatingExecuting(builder); } } diff --git a/src/Services/Masa.Dcc.Service/Infrastructure/SeedData.cs b/src/Services/Masa.Dcc.Service/Infrastructure/SeedData.cs index fca5e11e..821e2400 100644 --- a/src/Services/Masa.Dcc.Service/Infrastructure/SeedData.cs +++ b/src/Services/Masa.Dcc.Service/Infrastructure/SeedData.cs @@ -1,16 +1,32 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the Apache License. See LICENSE.txt in the project root for license information. +using System.Text.Encodings.Web; + namespace Masa.Dcc.Service.Admin.Infrastructure; -public static class IHostExtensions +internal static class IHostExtensions { + static readonly Dictionary dicConfigFiles = new() + { + { "$public.AliyunPhoneNumberLogin","$public.AliyunPhoneNumberLogin.json"}, + {"$public.Email","$public.Email.json"}, + {"$public.Sms","$public.Sms.json"}, + {"$public.Cdn","$public.Cdn.json"}, + {"$public.WhiteListOptions","$public.WhiteListOptions.json"}, + {"$public.i18n.en-us","$public.i18n.en-us.json"}, + {"$public.i18n.zh-cn","$public.i18n.zh-cn.json"}, + }; + public static async Task SeedDataAsync(this WebApplicationBuilder builder) { var services = builder.Services.BuildServiceProvider().CreateScope().ServiceProvider; var context = services.GetRequiredService(); + + await MigrateAsync(context); + var labelDomainService = services.GetRequiredService(); - var configObjectDomainService = services.GetRequiredService(); + var configObjectDomainService = services.GetRequiredService(); var unitOfWork = services.GetRequiredService(); var env = services.GetRequiredService(); var contentRootPath = env.ContentRootPath; @@ -22,27 +38,23 @@ public static async Task SeedDataAsync(this WebApplicationBuilder builder) var auditUser = new IdentityUser() { Id = masaConfig.GetDefaultUserId().ToString(), UserName = system }; var userSetterHandle = userSetter!.Change(auditUser); - await MigrateAsync(context); - unitOfWork.UseTransaction = false; + var configs = GetConfigMap(builder.Services); await InitDccDataAsync(context, labelDomainService); - await InitPublicConfigAsync(context, masaConfig, contentRootPath, pmClient, configObjectDomainService); + await InitPublicConfigAsync(context, masaConfig, contentRootPath, pmClient, configObjectDomainService, configs); userSetterHandle.Dispose(); } private static async Task MigrateAsync(DccDbContext context) { - if (context.Database.GetPendingMigrations().Any()) - { - await context.Database.MigrateAsync(); - } + await context.Database.MigrateAsync(); } private static async Task InitDccDataAsync(DccDbContext context, LabelDomainService labelDomainService) { - if (!context.Set