Browse Source

Db table prefix revision for the identity module #1429

pull/1904/head
Halil İbrahim Kalkan 7 years ago
parent
commit
cc8fd28e5d
  1. 11
      modules/background-jobs/src/Volo.Abp.BackgroundJobs.Domain/Volo/Abp/BackgroundJobs/BackgroundJobsConsts.cs
  2. 13
      modules/background-jobs/src/Volo.Abp.BackgroundJobs.Domain/Volo/Abp/BackgroundJobs/BackgroundJobsDbProperties.cs
  3. 12
      modules/background-jobs/src/Volo.Abp.BackgroundJobs.EntityFrameworkCore/Volo/Abp/BackgroundJobs/EntityFrameworkCore/BackgroundJobsDbContext.cs
  4. 5
      modules/background-jobs/src/Volo.Abp.BackgroundJobs.EntityFrameworkCore/Volo/Abp/BackgroundJobs/EntityFrameworkCore/BackgroundJobsDbContextModelCreatingExtensions.cs
  5. 4
      modules/background-jobs/src/Volo.Abp.BackgroundJobs.EntityFrameworkCore/Volo/Abp/BackgroundJobs/EntityFrameworkCore/BackgroundJobsModelBuilderConfigurationOptions.cs
  6. 2
      modules/background-jobs/src/Volo.Abp.BackgroundJobs.EntityFrameworkCore/Volo/Abp/BackgroundJobs/EntityFrameworkCore/IBackgroundJobsDbContext.cs
  7. 9
      modules/background-jobs/src/Volo.Abp.BackgroundJobs.MongoDB/Volo/Abp/BackgroundJobs/MongoDB/BackgroundJobsMongoDbContext.cs
  8. 4
      modules/background-jobs/src/Volo.Abp.BackgroundJobs.MongoDB/Volo/Abp/BackgroundJobs/MongoDB/BackgroundJobsMongoDbContextExtensions.cs
  9. 4
      modules/background-jobs/src/Volo.Abp.BackgroundJobs.MongoDB/Volo/Abp/BackgroundJobs/MongoDB/BackgroundJobsMongoModelBuilderConfigurationOptions.cs
  10. 2
      modules/background-jobs/src/Volo.Abp.BackgroundJobs.MongoDB/Volo/Abp/BackgroundJobs/MongoDB/IBackgroundJobsMongoDbContext.cs

11
modules/background-jobs/src/Volo.Abp.BackgroundJobs.Domain/Volo/Abp/BackgroundJobs/BackgroundJobsConsts.cs

@ -1,11 +0,0 @@
namespace Volo.Abp.BackgroundJobs
{
public static class BackgroundJobsConsts
{
public const string DefaultDbTablePrefix = "Abp";
public const string DefaultDbSchema = null;
public const string ConnectionStringName = "AbpBackgroundJobs";
}
}

13
modules/background-jobs/src/Volo.Abp.BackgroundJobs.Domain/Volo/Abp/BackgroundJobs/BackgroundJobsDbProperties.cs

@ -0,0 +1,13 @@
using Volo.Abp.Data;
namespace Volo.Abp.BackgroundJobs
{
public static class BackgroundJobsDbProperties
{
public static string DbTablePrefix { get; } = AbpCommonDbProperties.DbTablePrefix;
public static string DbSchema { get; } = AbpCommonDbProperties.DbSchema;
public const string ConnectionStringName = "AbpBackgroundJobs";
}
}

12
modules/background-jobs/src/Volo.Abp.BackgroundJobs.EntityFrameworkCore/Volo/Abp/BackgroundJobs/EntityFrameworkCore/BackgroundJobsDbContext.cs

@ -4,13 +4,9 @@ using Volo.Abp.EntityFrameworkCore;
namespace Volo.Abp.BackgroundJobs.EntityFrameworkCore namespace Volo.Abp.BackgroundJobs.EntityFrameworkCore
{ {
[ConnectionStringName(BackgroundJobsConsts.ConnectionStringName)] [ConnectionStringName(BackgroundJobsDbProperties.ConnectionStringName)]
public class BackgroundJobsDbContext : AbpDbContext<BackgroundJobsDbContext>, IBackgroundJobsDbContext public class BackgroundJobsDbContext : AbpDbContext<BackgroundJobsDbContext>, IBackgroundJobsDbContext
{ {
public static string TablePrefix { get; set; } = BackgroundJobsConsts.DefaultDbTablePrefix;
public static string Schema { get; set; } = BackgroundJobsConsts.DefaultDbSchema;
public DbSet<BackgroundJobRecord> BackgroundJobs { get; set; } public DbSet<BackgroundJobRecord> BackgroundJobs { get; set; }
public BackgroundJobsDbContext(DbContextOptions<BackgroundJobsDbContext> options) public BackgroundJobsDbContext(DbContextOptions<BackgroundJobsDbContext> options)
@ -23,11 +19,7 @@ namespace Volo.Abp.BackgroundJobs.EntityFrameworkCore
{ {
base.OnModelCreating(builder); base.OnModelCreating(builder);
builder.ConfigureBackgroundJobs(options => builder.ConfigureBackgroundJobs();
{
options.TablePrefix = TablePrefix;
options.Schema = Schema;
});
} }
} }
} }

5
modules/background-jobs/src/Volo.Abp.BackgroundJobs.EntityFrameworkCore/Volo/Abp/BackgroundJobs/EntityFrameworkCore/BackgroundJobsDbContextModelCreatingExtensions.cs

@ -12,7 +12,10 @@ namespace Volo.Abp.BackgroundJobs.EntityFrameworkCore
{ {
Check.NotNull(builder, nameof(builder)); Check.NotNull(builder, nameof(builder));
var options = new BackgroundJobsModelBuilderConfigurationOptions(); var options = new BackgroundJobsModelBuilderConfigurationOptions(
BackgroundJobsDbProperties.DbTablePrefix,
BackgroundJobsDbProperties.DbSchema
);
optionsAction?.Invoke(options); optionsAction?.Invoke(options);

4
modules/background-jobs/src/Volo.Abp.BackgroundJobs.EntityFrameworkCore/Volo/Abp/BackgroundJobs/EntityFrameworkCore/BackgroundJobsModelBuilderConfigurationOptions.cs

@ -6,8 +6,8 @@ namespace Volo.Abp.BackgroundJobs.EntityFrameworkCore
public class BackgroundJobsModelBuilderConfigurationOptions : ModelBuilderConfigurationOptions public class BackgroundJobsModelBuilderConfigurationOptions : ModelBuilderConfigurationOptions
{ {
public BackgroundJobsModelBuilderConfigurationOptions( public BackgroundJobsModelBuilderConfigurationOptions(
[NotNull] string tablePrefix = BackgroundJobsConsts.DefaultDbTablePrefix, [NotNull] string tablePrefix = "",
[CanBeNull] string schema = BackgroundJobsConsts.DefaultDbSchema) [CanBeNull] string schema = null)
: base( : base(
tablePrefix, tablePrefix,
schema) schema)

2
modules/background-jobs/src/Volo.Abp.BackgroundJobs.EntityFrameworkCore/Volo/Abp/BackgroundJobs/EntityFrameworkCore/IBackgroundJobsDbContext.cs

@ -4,7 +4,7 @@ using Volo.Abp.EntityFrameworkCore;
namespace Volo.Abp.BackgroundJobs.EntityFrameworkCore namespace Volo.Abp.BackgroundJobs.EntityFrameworkCore
{ {
[ConnectionStringName(BackgroundJobsConsts.ConnectionStringName)] [ConnectionStringName(BackgroundJobsDbProperties.ConnectionStringName)]
public interface IBackgroundJobsDbContext : IEfCoreDbContext public interface IBackgroundJobsDbContext : IEfCoreDbContext
{ {
DbSet<BackgroundJobRecord> BackgroundJobs { get; } DbSet<BackgroundJobRecord> BackgroundJobs { get; }

9
modules/background-jobs/src/Volo.Abp.BackgroundJobs.MongoDB/Volo/Abp/BackgroundJobs/MongoDB/BackgroundJobsMongoDbContext.cs

@ -4,21 +4,16 @@ using Volo.Abp.MongoDB;
namespace Volo.Abp.BackgroundJobs.MongoDB namespace Volo.Abp.BackgroundJobs.MongoDB
{ {
[ConnectionStringName(BackgroundJobsConsts.ConnectionStringName)] [ConnectionStringName(BackgroundJobsDbProperties.ConnectionStringName)]
public class BackgroundJobsMongoDbContext : AbpMongoDbContext, IBackgroundJobsMongoDbContext public class BackgroundJobsMongoDbContext : AbpMongoDbContext, IBackgroundJobsMongoDbContext
{ {
public static string CollectionPrefix { get; set; } = BackgroundJobsConsts.DefaultDbTablePrefix;
public IMongoCollection<BackgroundJobRecord> BackgroundJobs { get; set; } public IMongoCollection<BackgroundJobRecord> BackgroundJobs { get; set; }
protected override void CreateModel(IMongoModelBuilder modelBuilder) protected override void CreateModel(IMongoModelBuilder modelBuilder)
{ {
base.CreateModel(modelBuilder); base.CreateModel(modelBuilder);
modelBuilder.ConfigureBackgroundJobs(options => modelBuilder.ConfigureBackgroundJobs();
{
options.CollectionPrefix = CollectionPrefix;
});
} }
} }
} }

4
modules/background-jobs/src/Volo.Abp.BackgroundJobs.MongoDB/Volo/Abp/BackgroundJobs/MongoDB/BackgroundJobsMongoDbContextExtensions.cs

@ -11,7 +11,9 @@ namespace Volo.Abp.BackgroundJobs.MongoDB
{ {
Check.NotNull(builder, nameof(builder)); Check.NotNull(builder, nameof(builder));
var options = new BackgroundJobsMongoModelBuilderConfigurationOptions(); var options = new BackgroundJobsMongoModelBuilderConfigurationOptions(
BackgroundJobsDbProperties.DbTablePrefix
);
optionsAction?.Invoke(options); optionsAction?.Invoke(options);

4
modules/background-jobs/src/Volo.Abp.BackgroundJobs.MongoDB/Volo/Abp/BackgroundJobs/MongoDB/BackgroundJobsMongoModelBuilderConfigurationOptions.cs

@ -6,8 +6,8 @@ namespace Volo.Abp.BackgroundJobs.MongoDB
public class BackgroundJobsMongoModelBuilderConfigurationOptions : MongoModelBuilderConfigurationOptions public class BackgroundJobsMongoModelBuilderConfigurationOptions : MongoModelBuilderConfigurationOptions
{ {
public BackgroundJobsMongoModelBuilderConfigurationOptions( public BackgroundJobsMongoModelBuilderConfigurationOptions(
[NotNull] string tablePrefix = BackgroundJobsConsts.DefaultDbTablePrefix) [NotNull] string collectionPrefix = "")
: base(tablePrefix) : base(collectionPrefix)
{ {
} }
} }

2
modules/background-jobs/src/Volo.Abp.BackgroundJobs.MongoDB/Volo/Abp/BackgroundJobs/MongoDB/IBackgroundJobsMongoDbContext.cs

@ -4,7 +4,7 @@ using Volo.Abp.MongoDB;
namespace Volo.Abp.BackgroundJobs.MongoDB namespace Volo.Abp.BackgroundJobs.MongoDB
{ {
[ConnectionStringName(BackgroundJobsConsts.ConnectionStringName)] [ConnectionStringName(BackgroundJobsDbProperties.ConnectionStringName)]
public interface IBackgroundJobsMongoDbContext : IAbpMongoDbContext public interface IBackgroundJobsMongoDbContext : IAbpMongoDbContext
{ {
IMongoCollection<BackgroundJobRecord> BackgroundJobs { get; } IMongoCollection<BackgroundJobRecord> BackgroundJobs { get; }

Loading…
Cancel
Save