feat: 全面更新抽离版本号
This commit is contained in:
@@ -1,13 +0,0 @@
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Volo.Abp.Data;
|
||||
using Volo.Abp.EntityFrameworkCore;
|
||||
using Volo.Abp.MultiTenancy;
|
||||
|
||||
namespace Volo.Abp.SettingManagement.EntityFrameworkCore;
|
||||
|
||||
[IgnoreMultiTenancy]
|
||||
[ConnectionStringName(AbpSettingManagementDbProperties.ConnectionStringName)]
|
||||
public interface ISettingManagementDbContext : IEfCoreDbContext
|
||||
{
|
||||
DbSet<Setting> Settings { get; }
|
||||
}
|
||||
@@ -1,26 +0,0 @@
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Volo.Abp.Data;
|
||||
using Volo.Abp.EntityFrameworkCore;
|
||||
using Volo.Abp.MultiTenancy;
|
||||
|
||||
namespace Volo.Abp.SettingManagement.EntityFrameworkCore;
|
||||
|
||||
[IgnoreMultiTenancy]
|
||||
[ConnectionStringName(AbpSettingManagementDbProperties.ConnectionStringName)]
|
||||
public class SettingManagementDbContext : AbpDbContext<SettingManagementDbContext>, ISettingManagementDbContext
|
||||
{
|
||||
public DbSet<Setting> Settings { get; set; }
|
||||
|
||||
public SettingManagementDbContext(DbContextOptions<SettingManagementDbContext> options)
|
||||
: base(options)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
protected override void OnModelCreating(ModelBuilder builder)
|
||||
{
|
||||
base.OnModelCreating(builder);
|
||||
|
||||
builder.ConfigureSettingManagement();
|
||||
}
|
||||
}
|
||||
@@ -1,41 +0,0 @@
|
||||
using JetBrains.Annotations;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Volo.Abp.EntityFrameworkCore.Modeling;
|
||||
|
||||
namespace Volo.Abp.SettingManagement.EntityFrameworkCore;
|
||||
|
||||
public static class SettingManagementDbContextModelBuilderExtensions
|
||||
{
|
||||
//TODO: Instead of getting parameters, get a action of SettingManagementModelBuilderConfigurationOptions like other modules
|
||||
public static void ConfigureSettingManagement(
|
||||
[NotNull] this ModelBuilder builder)
|
||||
{
|
||||
Check.NotNull(builder, nameof(builder));
|
||||
|
||||
if (builder.IsTenantOnlyDatabase())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
builder.Entity<Setting>(b =>
|
||||
{
|
||||
b.ToTable(AbpSettingManagementDbProperties.DbTablePrefix + "Settings", AbpSettingManagementDbProperties.DbSchema);
|
||||
|
||||
b.ConfigureByConvention();
|
||||
|
||||
b.Property(x => x.Name).HasMaxLength(SettingConsts.MaxNameLength).IsRequired();
|
||||
|
||||
if (builder.IsUsingOracle()) { SettingConsts.MaxValueLengthValue = 2000; }
|
||||
b.Property(x => x.Value).HasMaxLength(SettingConsts.MaxValueLengthValue).IsRequired();
|
||||
|
||||
b.Property(x => x.ProviderName).HasMaxLength(SettingConsts.MaxProviderNameLength);
|
||||
b.Property(x => x.ProviderKey).HasMaxLength(SettingConsts.MaxProviderKeyLength);
|
||||
|
||||
b.HasIndex(x => new { x.Name, x.ProviderName, x.ProviderKey }).IsUnique(true);
|
||||
|
||||
b.ApplyObjectExtensionMappings();
|
||||
});
|
||||
|
||||
builder.TryConfigureObjectExtensions<SettingManagementDbContext>();
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<Import Project="..\..\..\common.props" />
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
|
||||
Reference in New Issue
Block a user