replace existing migrations with new migration
This commit is contained in:
Родитель
c9350ae46b
Коммит
f2ffc38f92
|
@ -66,8 +66,8 @@
|
|||
<Reference Include="EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\EntityFramework.6.4.0\lib\net45\EntityFramework.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="EntityFramework.DynamicFilters, Version=3.1.1.0, Culture=neutral, PublicKeyToken=59b66d028979105b, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\EntityFramework.DynamicFilters.3.1.1\lib\net40\EntityFramework.DynamicFilters.dll</HintPath>
|
||||
<Reference Include="EntityFramework.DynamicFilters, Version=3.1.0.0, Culture=neutral, PublicKeyToken=59b66d028979105b, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\EntityFramework.DynamicFilters.3.1.0\lib\net40\EntityFramework.DynamicFilters.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="EntityFramework.SqlServer, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\EntityFramework.6.4.0\lib\net45\EntityFramework.SqlServer.dll</HintPath>
|
||||
|
@ -216,32 +216,12 @@
|
|||
<Reference Include="WindowsBase" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Migrations\201605251608407_Upgraded_To_Module_Zero_0_9_1_1.cs" />
|
||||
<Compile Include="Migrations\201605251608407_Upgraded_To_Module_Zero_0_9_1_1.Designer.cs">
|
||||
<DependentUpon>201605251608407_Upgraded_To_Module_Zero_0_9_1_1.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Migrations\201802061405552_Upgraded_To_ABP_3_4.cs" />
|
||||
<Compile Include="Migrations\201802061405552_Upgraded_To_ABP_3_4.Designer.cs">
|
||||
<DependentUpon>201802061405552_Upgraded_To_ABP_3_4.cs</DependentUpon>
|
||||
<Compile Include="Migrations\201912100827426_Ugraded_To_Abp_5_1_0.cs" />
|
||||
<Compile Include="Migrations\201912100827426_Ugraded_To_Abp_5_1_0.designer.cs">
|
||||
<DependentUpon>201912100827426_Ugraded_To_Abp_5_1_0.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="SampleBlogDbContext.cs" />
|
||||
<Compile Include="AbpSampleBlogEntityFrameworkModule.cs" />
|
||||
<Compile Include="Migrations\201507141034315_Added_Initial_Blog_Entities.cs" />
|
||||
<Compile Include="Migrations\201507141034315_Added_Initial_Blog_Entities.Designer.cs">
|
||||
<DependentUpon>201507141034315_Added_Initial_Blog_Entities.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Migrations\201507141104288_Renamed_Tables.cs" />
|
||||
<Compile Include="Migrations\201507141104288_Renamed_Tables.Designer.cs">
|
||||
<DependentUpon>201507141104288_Renamed_Tables.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Migrations\201511230918198_Upgrade_ModuleZero_0_7_4_1.cs" />
|
||||
<Compile Include="Migrations\201511230918198_Upgrade_ModuleZero_0_7_4_1.Designer.cs">
|
||||
<DependentUpon>201511230918198_Upgrade_ModuleZero_0_7_4_1.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Migrations\201602171451570_Upgraded_To_Module_Zero_0_8.cs" />
|
||||
<Compile Include="Migrations\201602171451570_Upgraded_To_Module_Zero_0_8.Designer.cs">
|
||||
<DependentUpon>201602171451570_Upgraded_To_Module_Zero_0_8.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Migrations\Configuration.cs" />
|
||||
<Compile Include="Migrations\SeedData\BlogTestDataBuilder.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
|
@ -259,27 +239,12 @@
|
|||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Include="Migrations\201507141034315_Added_Initial_Blog_Entities.resx">
|
||||
<DependentUpon>201507141034315_Added_Initial_Blog_Entities.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Migrations\201507141104288_Renamed_Tables.resx">
|
||||
<DependentUpon>201507141104288_Renamed_Tables.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Migrations\201511230918198_Upgrade_ModuleZero_0_7_4_1.resx">
|
||||
<DependentUpon>201511230918198_Upgrade_ModuleZero_0_7_4_1.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Migrations\201602171451570_Upgraded_To_Module_Zero_0_8.resx">
|
||||
<DependentUpon>201602171451570_Upgraded_To_Module_Zero_0_8.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Migrations\201605251608407_Upgraded_To_Module_Zero_0_9_1_1.resx">
|
||||
<DependentUpon>201605251608407_Upgraded_To_Module_Zero_0_9_1_1.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Migrations\201802061405552_Upgraded_To_ABP_3_4.resx">
|
||||
<DependentUpon>201802061405552_Upgraded_To_ABP_3_4.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<Content Include="READ_ME.txt" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="READ_ME.txt" />
|
||||
<EmbeddedResource Include="Migrations\201912100827426_Ugraded_To_Abp_5_1_0.resx">
|
||||
<DependentUpon>201912100827426_Ugraded_To_Abp_5_1_0.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<Import Project="$(SolutionDir)\.nuget\NuGet.targets" Condition="Exists('$(SolutionDir)\.nuget\NuGet.targets')" />
|
||||
|
|
|
@ -1,29 +0,0 @@
|
|||
// <auto-generated />
|
||||
namespace Abp.Samples.Blog.EntityFramework.Migrations
|
||||
{
|
||||
using System.CodeDom.Compiler;
|
||||
using System.Data.Entity.Migrations;
|
||||
using System.Data.Entity.Migrations.Infrastructure;
|
||||
using System.Resources;
|
||||
|
||||
[GeneratedCode("EntityFramework.Migrations", "6.1.1-30610")]
|
||||
public sealed partial class Added_Initial_Blog_Entities : IMigrationMetadata
|
||||
{
|
||||
private readonly ResourceManager Resources = new ResourceManager(typeof(Added_Initial_Blog_Entities));
|
||||
|
||||
string IMigrationMetadata.Id
|
||||
{
|
||||
get { return "201507141034315_Added_Initial_Blog_Entities"; }
|
||||
}
|
||||
|
||||
string IMigrationMetadata.Source
|
||||
{
|
||||
get { return null; }
|
||||
}
|
||||
|
||||
string IMigrationMetadata.Target
|
||||
{
|
||||
get { return Resources.GetString("Target"); }
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,92 +0,0 @@
|
|||
using System.Collections.Generic;
|
||||
using System.Data.Entity.Migrations;
|
||||
|
||||
namespace Abp.Samples.Blog.EntityFramework.Migrations
|
||||
{
|
||||
public partial class Added_Initial_Blog_Entities : DbMigration
|
||||
{
|
||||
public override void Up()
|
||||
{
|
||||
CreateTable(
|
||||
"dbo.Categories",
|
||||
c => new
|
||||
{
|
||||
Id = c.Int(nullable: false, identity: true),
|
||||
Name = c.String(nullable: false, maxLength: 128),
|
||||
CreationTime = c.DateTime(nullable: false),
|
||||
CreatorUserId = c.Long(),
|
||||
})
|
||||
.PrimaryKey(t => t.Id)
|
||||
.ForeignKey("dbo.AbpUsers", t => t.CreatorUserId)
|
||||
.Index(t => t.CreatorUserId);
|
||||
|
||||
CreateTable(
|
||||
"dbo.Comments",
|
||||
c => new
|
||||
{
|
||||
Id = c.Int(nullable: false, identity: true),
|
||||
Content = c.String(nullable: false, maxLength: 2000),
|
||||
CreationTime = c.DateTime(nullable: false),
|
||||
CreatorUserId = c.Long(),
|
||||
})
|
||||
.PrimaryKey(t => t.Id)
|
||||
.ForeignKey("dbo.AbpUsers", t => t.CreatorUserId)
|
||||
.Index(t => t.CreatorUserId);
|
||||
|
||||
CreateTable(
|
||||
"dbo.Posts",
|
||||
c => new
|
||||
{
|
||||
Id = c.Int(nullable: false, identity: true),
|
||||
CategoryId = c.Int(nullable: false),
|
||||
Title = c.String(nullable: false, maxLength: 128),
|
||||
Content = c.String(nullable: false),
|
||||
Tags = c.String(),
|
||||
Status = c.Byte(nullable: false),
|
||||
IsDeleted = c.Boolean(nullable: false),
|
||||
DeleterUserId = c.Long(),
|
||||
DeletionTime = c.DateTime(),
|
||||
LastModificationTime = c.DateTime(),
|
||||
LastModifierUserId = c.Long(),
|
||||
CreationTime = c.DateTime(nullable: false),
|
||||
CreatorUserId = c.Long(),
|
||||
},
|
||||
annotations: new Dictionary<string, object>
|
||||
{
|
||||
{ "DynamicFilter_Post_SoftDelete", "EntityFramework.DynamicFilters.DynamicFilterDefinition" },
|
||||
})
|
||||
.PrimaryKey(t => t.Id)
|
||||
.ForeignKey("dbo.Categories", t => t.CategoryId, cascadeDelete: true)
|
||||
.ForeignKey("dbo.AbpUsers", t => t.CreatorUserId)
|
||||
.ForeignKey("dbo.AbpUsers", t => t.DeleterUserId)
|
||||
.ForeignKey("dbo.AbpUsers", t => t.LastModifierUserId)
|
||||
.Index(t => t.CategoryId)
|
||||
.Index(t => t.DeleterUserId)
|
||||
.Index(t => t.LastModifierUserId)
|
||||
.Index(t => t.CreatorUserId);
|
||||
}
|
||||
|
||||
public override void Down()
|
||||
{
|
||||
DropForeignKey("dbo.Posts", "LastModifierUserId", "dbo.AbpUsers");
|
||||
DropForeignKey("dbo.Posts", "DeleterUserId", "dbo.AbpUsers");
|
||||
DropForeignKey("dbo.Posts", "CreatorUserId", "dbo.AbpUsers");
|
||||
DropForeignKey("dbo.Posts", "CategoryId", "dbo.Categories");
|
||||
DropForeignKey("dbo.Comments", "CreatorUserId", "dbo.AbpUsers");
|
||||
DropForeignKey("dbo.Categories", "CreatorUserId", "dbo.AbpUsers");
|
||||
DropIndex("dbo.Posts", new[] { "CreatorUserId" });
|
||||
DropIndex("dbo.Posts", new[] { "LastModifierUserId" });
|
||||
DropIndex("dbo.Posts", new[] { "DeleterUserId" });
|
||||
DropIndex("dbo.Posts", new[] { "CategoryId" });
|
||||
DropIndex("dbo.Comments", new[] { "CreatorUserId" });
|
||||
DropIndex("dbo.Categories", new[] { "CreatorUserId" });
|
||||
DropTable("dbo.Posts",
|
||||
removedAnnotations: new Dictionary<string, object>
|
||||
{
|
||||
{ "DynamicFilter_Post_SoftDelete", "EntityFramework.DynamicFilters.DynamicFilterDefinition" },
|
||||
});
|
||||
DropTable("dbo.Comments");
|
||||
DropTable("dbo.Categories");
|
||||
}
|
||||
}
|
||||
}
|
Различия файлов скрыты, потому что одна или несколько строк слишком длинны
|
@ -1,29 +0,0 @@
|
|||
// <auto-generated />
|
||||
namespace Abp.Samples.Blog.EntityFramework.Migrations
|
||||
{
|
||||
using System.CodeDom.Compiler;
|
||||
using System.Data.Entity.Migrations;
|
||||
using System.Data.Entity.Migrations.Infrastructure;
|
||||
using System.Resources;
|
||||
|
||||
[GeneratedCode("EntityFramework.Migrations", "6.1.1-30610")]
|
||||
public sealed partial class Renamed_Tables : IMigrationMetadata
|
||||
{
|
||||
private readonly ResourceManager Resources = new ResourceManager(typeof(Renamed_Tables));
|
||||
|
||||
string IMigrationMetadata.Id
|
||||
{
|
||||
get { return "201507141104288_Renamed_Tables"; }
|
||||
}
|
||||
|
||||
string IMigrationMetadata.Source
|
||||
{
|
||||
get { return null; }
|
||||
}
|
||||
|
||||
string IMigrationMetadata.Target
|
||||
{
|
||||
get { return Resources.GetString("Target"); }
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,22 +0,0 @@
|
|||
namespace Abp.Samples.Blog.EntityFramework.Migrations
|
||||
{
|
||||
using System;
|
||||
using System.Data.Entity.Migrations;
|
||||
|
||||
public partial class Renamed_Tables : DbMigration
|
||||
{
|
||||
public override void Up()
|
||||
{
|
||||
RenameTable(name: "dbo.Categories", newName: "BlgCategories");
|
||||
RenameTable(name: "dbo.Comments", newName: "BlgComments");
|
||||
RenameTable(name: "dbo.Posts", newName: "BlgPosts");
|
||||
}
|
||||
|
||||
public override void Down()
|
||||
{
|
||||
RenameTable(name: "dbo.BlgPosts", newName: "Posts");
|
||||
RenameTable(name: "dbo.BlgComments", newName: "Comments");
|
||||
RenameTable(name: "dbo.BlgCategories", newName: "Categories");
|
||||
}
|
||||
}
|
||||
}
|
Различия файлов скрыты, потому что одна или несколько строк слишком длинны
|
@ -1,29 +0,0 @@
|
|||
// <auto-generated />
|
||||
namespace Abp.Samples.Blog.EntityFramework.Migrations
|
||||
{
|
||||
using System.CodeDom.Compiler;
|
||||
using System.Data.Entity.Migrations;
|
||||
using System.Data.Entity.Migrations.Infrastructure;
|
||||
using System.Resources;
|
||||
|
||||
[GeneratedCode("EntityFramework.Migrations", "6.1.3-40302")]
|
||||
public sealed partial class Upgrade_ModuleZero_0_7_4_1 : IMigrationMetadata
|
||||
{
|
||||
private readonly ResourceManager Resources = new ResourceManager(typeof(Upgrade_ModuleZero_0_7_4_1));
|
||||
|
||||
string IMigrationMetadata.Id
|
||||
{
|
||||
get { return "201511230918198_Upgrade_ModuleZero_0_7_4_1"; }
|
||||
}
|
||||
|
||||
string IMigrationMetadata.Source
|
||||
{
|
||||
get { return null; }
|
||||
}
|
||||
|
||||
string IMigrationMetadata.Target
|
||||
{
|
||||
get { return Resources.GetString("Target"); }
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,20 +0,0 @@
|
|||
namespace Abp.Samples.Blog.EntityFramework.Migrations
|
||||
{
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data.Entity.Infrastructure.Annotations;
|
||||
using System.Data.Entity.Migrations;
|
||||
|
||||
public partial class Upgrade_ModuleZero_0_7_4_1 : DbMigration
|
||||
{
|
||||
public override void Up()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public override void Down()
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
Различия файлов скрыты, потому что одна или несколько строк слишком длинны
|
@ -1,29 +0,0 @@
|
|||
// <auto-generated />
|
||||
namespace Abp.Samples.Blog.EntityFramework.Migrations
|
||||
{
|
||||
using System.CodeDom.Compiler;
|
||||
using System.Data.Entity.Migrations;
|
||||
using System.Data.Entity.Migrations.Infrastructure;
|
||||
using System.Resources;
|
||||
|
||||
[GeneratedCode("EntityFramework.Migrations", "6.1.3-40302")]
|
||||
public sealed partial class Upgraded_To_Module_Zero_0_8 : IMigrationMetadata
|
||||
{
|
||||
private readonly ResourceManager Resources = new ResourceManager(typeof(Upgraded_To_Module_Zero_0_8));
|
||||
|
||||
string IMigrationMetadata.Id
|
||||
{
|
||||
get { return "201602171451570_Upgraded_To_Module_Zero_0_8"; }
|
||||
}
|
||||
|
||||
string IMigrationMetadata.Source
|
||||
{
|
||||
get { return null; }
|
||||
}
|
||||
|
||||
string IMigrationMetadata.Target
|
||||
{
|
||||
get { return Resources.GetString("Target"); }
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,20 +0,0 @@
|
|||
namespace Abp.Samples.Blog.EntityFramework.Migrations
|
||||
{
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data.Entity.Infrastructure.Annotations;
|
||||
using System.Data.Entity.Migrations;
|
||||
|
||||
public partial class Upgraded_To_Module_Zero_0_8 : DbMigration
|
||||
{
|
||||
public override void Up()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public override void Down()
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
Различия файлов скрыты, потому что одна или несколько строк слишком длинны
|
@ -1,29 +0,0 @@
|
|||
// <auto-generated />
|
||||
namespace Abp.Samples.Blog.EntityFramework.Migrations
|
||||
{
|
||||
using System.CodeDom.Compiler;
|
||||
using System.Data.Entity.Migrations;
|
||||
using System.Data.Entity.Migrations.Infrastructure;
|
||||
using System.Resources;
|
||||
|
||||
[GeneratedCode("EntityFramework.Migrations", "6.1.3-40302")]
|
||||
public sealed partial class Upgraded_To_Module_Zero_0_9_1_1 : IMigrationMetadata
|
||||
{
|
||||
private readonly ResourceManager Resources = new ResourceManager(typeof(Upgraded_To_Module_Zero_0_9_1_1));
|
||||
|
||||
string IMigrationMetadata.Id
|
||||
{
|
||||
get { return "201605251608407_Upgraded_To_Module_Zero_0_9_1_1"; }
|
||||
}
|
||||
|
||||
string IMigrationMetadata.Source
|
||||
{
|
||||
get { return null; }
|
||||
}
|
||||
|
||||
string IMigrationMetadata.Target
|
||||
{
|
||||
get { return Resources.GetString("Target"); }
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,18 +0,0 @@
|
|||
namespace Abp.Samples.Blog.EntityFramework.Migrations
|
||||
{
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data.Entity.Infrastructure.Annotations;
|
||||
using System.Data.Entity.Migrations;
|
||||
|
||||
public partial class Upgraded_To_Module_Zero_0_9_1_1 : DbMigration
|
||||
{
|
||||
public override void Up()
|
||||
{
|
||||
}
|
||||
|
||||
public override void Down()
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
Различия файлов скрыты, потому что одна или несколько строк слишком длинны
|
@ -1,20 +0,0 @@
|
|||
namespace Abp.Samples.Blog.EntityFramework.Migrations
|
||||
{
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data.Entity.Infrastructure.Annotations;
|
||||
using System.Data.Entity.Migrations;
|
||||
|
||||
public partial class Upgraded_To_ABP_3_4 : DbMigration
|
||||
{
|
||||
public override void Up()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public override void Down()
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
Различия файлов скрыты, потому что одна или несколько строк слишком длинны
|
@ -1,4 +1,4 @@
|
|||
// <auto-generated />
|
||||
// <auto-generated />
|
||||
namespace Abp.Samples.Blog.EntityFramework.Migrations
|
||||
{
|
||||
using System.CodeDom.Compiler;
|
||||
|
@ -6,14 +6,14 @@ namespace Abp.Samples.Blog.EntityFramework.Migrations
|
|||
using System.Data.Entity.Migrations.Infrastructure;
|
||||
using System.Resources;
|
||||
|
||||
[GeneratedCode("EntityFramework.Migrations", "6.2.0-61023")]
|
||||
public sealed partial class Upgraded_To_ABP_3_4 : IMigrationMetadata
|
||||
[GeneratedCode("EntityFramework.Migrations", "6.4.0")]
|
||||
public sealed partial class Ugraded_To_Abp_5_1_0 : IMigrationMetadata
|
||||
{
|
||||
private readonly ResourceManager Resources = new ResourceManager(typeof(Upgraded_To_ABP_3_4));
|
||||
private readonly ResourceManager Resources = new ResourceManager(typeof(Ugraded_To_Abp_5_1_0));
|
||||
|
||||
string IMigrationMetadata.Id
|
||||
{
|
||||
get { return "201802061405552_Upgraded_To_ABP_3_4"; }
|
||||
get { return "201912100827426_Ugraded_To_Abp_5_1_0"; }
|
||||
}
|
||||
|
||||
string IMigrationMetadata.Source
|
|
@ -0,0 +1,946 @@
|
|||
namespace Abp.Samples.Blog.EntityFramework.Migrations
|
||||
{
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data.Entity.Infrastructure.Annotations;
|
||||
using System.Data.Entity.Migrations;
|
||||
|
||||
public partial class Ugraded_To_Abp_5_1_0 : DbMigration
|
||||
{
|
||||
public override void Up()
|
||||
{
|
||||
CreateTable(
|
||||
"dbo.AbpAuditLogs",
|
||||
c => new
|
||||
{
|
||||
Id = c.Long(nullable: false, identity: true),
|
||||
TenantId = c.Int(),
|
||||
UserId = c.Long(),
|
||||
ServiceName = c.String(maxLength: 256),
|
||||
MethodName = c.String(maxLength: 256),
|
||||
Parameters = c.String(maxLength: 1024),
|
||||
ReturnValue = c.String(),
|
||||
ExecutionTime = c.DateTime(nullable: false),
|
||||
ExecutionDuration = c.Int(nullable: false),
|
||||
ClientIpAddress = c.String(maxLength: 64),
|
||||
ClientName = c.String(maxLength: 128),
|
||||
BrowserInfo = c.String(maxLength: 512),
|
||||
Exception = c.String(maxLength: 2000),
|
||||
ImpersonatorUserId = c.Long(),
|
||||
ImpersonatorTenantId = c.Int(),
|
||||
CustomData = c.String(maxLength: 2000),
|
||||
},
|
||||
annotations: new Dictionary<string, object>
|
||||
{
|
||||
{ "DynamicFilter_AuditLog_MayHaveTenant", "EntityFramework.DynamicFilters.DynamicFilterDefinition" },
|
||||
})
|
||||
.PrimaryKey(t => t.Id)
|
||||
.Index(t => t.TenantId);
|
||||
|
||||
CreateTable(
|
||||
"dbo.AbpBackgroundJobs",
|
||||
c => new
|
||||
{
|
||||
Id = c.Long(nullable: false, identity: true),
|
||||
JobType = c.String(nullable: false, maxLength: 512),
|
||||
JobArgs = c.String(nullable: false),
|
||||
TryCount = c.Short(nullable: false),
|
||||
NextTryTime = c.DateTime(nullable: false),
|
||||
LastTryTime = c.DateTime(),
|
||||
IsAbandoned = c.Boolean(nullable: false),
|
||||
Priority = c.Byte(nullable: false),
|
||||
CreationTime = c.DateTime(nullable: false),
|
||||
CreatorUserId = c.Long(),
|
||||
})
|
||||
.PrimaryKey(t => t.Id)
|
||||
.Index(t => new { t.IsAbandoned, t.NextTryTime });
|
||||
|
||||
CreateTable(
|
||||
"dbo.BlgCategories",
|
||||
c => new
|
||||
{
|
||||
Id = c.Int(nullable: false, identity: true),
|
||||
Name = c.String(nullable: false, maxLength: 128),
|
||||
CreationTime = c.DateTime(nullable: false),
|
||||
CreatorUserId = c.Long(),
|
||||
})
|
||||
.PrimaryKey(t => t.Id)
|
||||
.ForeignKey("dbo.AbpUsers", t => t.CreatorUserId)
|
||||
.Index(t => t.CreatorUserId);
|
||||
|
||||
CreateTable(
|
||||
"dbo.AbpUsers",
|
||||
c => new
|
||||
{
|
||||
Id = c.Long(nullable: false, identity: true),
|
||||
NormalizedUserName = c.String(nullable: false, maxLength: 256),
|
||||
NormalizedEmailAddress = c.String(nullable: false, maxLength: 256),
|
||||
AuthenticationSource = c.String(maxLength: 64),
|
||||
UserName = c.String(nullable: false, maxLength: 256),
|
||||
TenantId = c.Int(),
|
||||
EmailAddress = c.String(nullable: false, maxLength: 256),
|
||||
Name = c.String(nullable: false, maxLength: 64),
|
||||
Surname = c.String(nullable: false, maxLength: 64),
|
||||
Password = c.String(nullable: false, maxLength: 128),
|
||||
EmailConfirmationCode = c.String(maxLength: 328),
|
||||
PasswordResetCode = c.String(maxLength: 328),
|
||||
LockoutEndDateUtc = c.DateTime(),
|
||||
AccessFailedCount = c.Int(nullable: false),
|
||||
IsLockoutEnabled = c.Boolean(nullable: false),
|
||||
PhoneNumber = c.String(maxLength: 32),
|
||||
IsPhoneNumberConfirmed = c.Boolean(nullable: false),
|
||||
SecurityStamp = c.String(maxLength: 128),
|
||||
IsTwoFactorEnabled = c.Boolean(nullable: false),
|
||||
IsEmailConfirmed = c.Boolean(nullable: false),
|
||||
IsActive = c.Boolean(nullable: false),
|
||||
IsDeleted = c.Boolean(nullable: false),
|
||||
DeleterUserId = c.Long(),
|
||||
DeletionTime = c.DateTime(),
|
||||
LastModificationTime = c.DateTime(),
|
||||
LastModifierUserId = c.Long(),
|
||||
CreationTime = c.DateTime(nullable: false),
|
||||
CreatorUserId = c.Long(),
|
||||
},
|
||||
annotations: new Dictionary<string, object>
|
||||
{
|
||||
{ "DynamicFilter_BlogUser_MayHaveTenant", "EntityFramework.DynamicFilters.DynamicFilterDefinition" },
|
||||
{ "DynamicFilter_BlogUser_SoftDelete", "EntityFramework.DynamicFilters.DynamicFilterDefinition" },
|
||||
})
|
||||
.PrimaryKey(t => t.Id)
|
||||
.ForeignKey("dbo.AbpUsers", t => t.CreatorUserId)
|
||||
.ForeignKey("dbo.AbpUsers", t => t.DeleterUserId)
|
||||
.ForeignKey("dbo.AbpUsers", t => t.LastModifierUserId)
|
||||
.Index(t => t.TenantId)
|
||||
.Index(t => t.IsDeleted)
|
||||
.Index(t => t.DeleterUserId)
|
||||
.Index(t => t.LastModifierUserId)
|
||||
.Index(t => t.CreatorUserId);
|
||||
|
||||
CreateTable(
|
||||
"dbo.AbpUserClaims",
|
||||
c => new
|
||||
{
|
||||
Id = c.Long(nullable: false, identity: true),
|
||||
TenantId = c.Int(),
|
||||
UserId = c.Long(nullable: false),
|
||||
ClaimType = c.String(maxLength: 256),
|
||||
ClaimValue = c.String(),
|
||||
CreationTime = c.DateTime(nullable: false),
|
||||
CreatorUserId = c.Long(),
|
||||
},
|
||||
annotations: new Dictionary<string, object>
|
||||
{
|
||||
{ "DynamicFilter_UserClaim_MayHaveTenant", "EntityFramework.DynamicFilters.DynamicFilterDefinition" },
|
||||
})
|
||||
.PrimaryKey(t => t.Id)
|
||||
.ForeignKey("dbo.AbpUsers", t => t.UserId, cascadeDelete: true)
|
||||
.Index(t => t.TenantId)
|
||||
.Index(t => t.UserId);
|
||||
|
||||
CreateTable(
|
||||
"dbo.AbpUserLogins",
|
||||
c => new
|
||||
{
|
||||
Id = c.Long(nullable: false, identity: true),
|
||||
TenantId = c.Int(),
|
||||
UserId = c.Long(nullable: false),
|
||||
LoginProvider = c.String(nullable: false, maxLength: 128),
|
||||
ProviderKey = c.String(nullable: false, maxLength: 256),
|
||||
},
|
||||
annotations: new Dictionary<string, object>
|
||||
{
|
||||
{ "DynamicFilter_UserLogin_MayHaveTenant", "EntityFramework.DynamicFilters.DynamicFilterDefinition" },
|
||||
})
|
||||
.PrimaryKey(t => t.Id)
|
||||
.ForeignKey("dbo.AbpUsers", t => t.UserId, cascadeDelete: true)
|
||||
.Index(t => t.TenantId)
|
||||
.Index(t => t.UserId);
|
||||
|
||||
CreateTable(
|
||||
"dbo.AbpPermissions",
|
||||
c => new
|
||||
{
|
||||
Id = c.Long(nullable: false, identity: true),
|
||||
TenantId = c.Int(),
|
||||
Name = c.String(nullable: false, maxLength: 128),
|
||||
IsGranted = c.Boolean(nullable: false),
|
||||
CreationTime = c.DateTime(nullable: false),
|
||||
CreatorUserId = c.Long(),
|
||||
UserId = c.Long(),
|
||||
RoleId = c.Int(),
|
||||
Discriminator = c.String(nullable: false, maxLength: 128),
|
||||
},
|
||||
annotations: new Dictionary<string, object>
|
||||
{
|
||||
{ "DynamicFilter_PermissionSetting_MayHaveTenant", "EntityFramework.DynamicFilters.DynamicFilterDefinition" },
|
||||
{ "DynamicFilter_RolePermissionSetting_MayHaveTenant", "EntityFramework.DynamicFilters.DynamicFilterDefinition" },
|
||||
{ "DynamicFilter_UserPermissionSetting_MayHaveTenant", "EntityFramework.DynamicFilters.DynamicFilterDefinition" },
|
||||
})
|
||||
.PrimaryKey(t => t.Id)
|
||||
.ForeignKey("dbo.AbpUsers", t => t.UserId, cascadeDelete: true)
|
||||
.ForeignKey("dbo.AbpRoles", t => t.RoleId, cascadeDelete: true)
|
||||
.Index(t => t.TenantId)
|
||||
.Index(t => t.UserId)
|
||||
.Index(t => t.RoleId);
|
||||
|
||||
CreateTable(
|
||||
"dbo.AbpUserRoles",
|
||||
c => new
|
||||
{
|
||||
Id = c.Long(nullable: false, identity: true),
|
||||
TenantId = c.Int(),
|
||||
UserId = c.Long(nullable: false),
|
||||
RoleId = c.Int(nullable: false),
|
||||
CreationTime = c.DateTime(nullable: false),
|
||||
CreatorUserId = c.Long(),
|
||||
},
|
||||
annotations: new Dictionary<string, object>
|
||||
{
|
||||
{ "DynamicFilter_UserRole_MayHaveTenant", "EntityFramework.DynamicFilters.DynamicFilterDefinition" },
|
||||
})
|
||||
.PrimaryKey(t => t.Id)
|
||||
.ForeignKey("dbo.AbpUsers", t => t.UserId, cascadeDelete: true)
|
||||
.Index(t => t.TenantId)
|
||||
.Index(t => t.UserId);
|
||||
|
||||
CreateTable(
|
||||
"dbo.AbpSettings",
|
||||
c => new
|
||||
{
|
||||
Id = c.Long(nullable: false, identity: true),
|
||||
TenantId = c.Int(),
|
||||
UserId = c.Long(),
|
||||
Name = c.String(nullable: false, maxLength: 256),
|
||||
Value = c.String(maxLength: 2000),
|
||||
LastModificationTime = c.DateTime(),
|
||||
LastModifierUserId = c.Long(),
|
||||
CreationTime = c.DateTime(nullable: false),
|
||||
CreatorUserId = c.Long(),
|
||||
},
|
||||
annotations: new Dictionary<string, object>
|
||||
{
|
||||
{ "DynamicFilter_Setting_MayHaveTenant", "EntityFramework.DynamicFilters.DynamicFilterDefinition" },
|
||||
})
|
||||
.PrimaryKey(t => t.Id)
|
||||
.ForeignKey("dbo.AbpUsers", t => t.UserId)
|
||||
.Index(t => t.TenantId)
|
||||
.Index(t => new { t.TenantId, t.Name, t.UserId }, unique: true);
|
||||
|
||||
CreateTable(
|
||||
"dbo.BlgComments",
|
||||
c => new
|
||||
{
|
||||
Id = c.Int(nullable: false, identity: true),
|
||||
Content = c.String(nullable: false, maxLength: 2000),
|
||||
CreationTime = c.DateTime(nullable: false),
|
||||
CreatorUserId = c.Long(),
|
||||
})
|
||||
.PrimaryKey(t => t.Id)
|
||||
.ForeignKey("dbo.AbpUsers", t => t.CreatorUserId)
|
||||
.Index(t => t.CreatorUserId);
|
||||
|
||||
CreateTable(
|
||||
"dbo.AbpFeatures",
|
||||
c => new
|
||||
{
|
||||
Id = c.Long(nullable: false, identity: true),
|
||||
TenantId = c.Int(),
|
||||
Name = c.String(nullable: false, maxLength: 128),
|
||||
Value = c.String(nullable: false, maxLength: 2000),
|
||||
CreationTime = c.DateTime(nullable: false),
|
||||
CreatorUserId = c.Long(),
|
||||
EditionId = c.Int(),
|
||||
Discriminator = c.String(nullable: false, maxLength: 128),
|
||||
},
|
||||
annotations: new Dictionary<string, object>
|
||||
{
|
||||
{ "DynamicFilter_EditionFeatureSetting_MayHaveTenant", "EntityFramework.DynamicFilters.DynamicFilterDefinition" },
|
||||
{ "DynamicFilter_FeatureSetting_MayHaveTenant", "EntityFramework.DynamicFilters.DynamicFilterDefinition" },
|
||||
{ "DynamicFilter_TenantFeatureSetting_MayHaveTenant", "EntityFramework.DynamicFilters.DynamicFilterDefinition" },
|
||||
})
|
||||
.PrimaryKey(t => t.Id)
|
||||
.ForeignKey("dbo.AbpEditions", t => t.EditionId, cascadeDelete: true)
|
||||
.Index(t => t.TenantId)
|
||||
.Index(t => t.EditionId);
|
||||
|
||||
CreateTable(
|
||||
"dbo.AbpEditions",
|
||||
c => new
|
||||
{
|
||||
Id = c.Int(nullable: false, identity: true),
|
||||
Name = c.String(nullable: false, maxLength: 32),
|
||||
DisplayName = c.String(nullable: false, maxLength: 64),
|
||||
IsDeleted = c.Boolean(nullable: false),
|
||||
DeleterUserId = c.Long(),
|
||||
DeletionTime = c.DateTime(),
|
||||
LastModificationTime = c.DateTime(),
|
||||
LastModifierUserId = c.Long(),
|
||||
CreationTime = c.DateTime(nullable: false),
|
||||
CreatorUserId = c.Long(),
|
||||
},
|
||||
annotations: new Dictionary<string, object>
|
||||
{
|
||||
{ "DynamicFilter_Edition_SoftDelete", "EntityFramework.DynamicFilters.DynamicFilterDefinition" },
|
||||
})
|
||||
.PrimaryKey(t => t.Id)
|
||||
.Index(t => t.IsDeleted);
|
||||
|
||||
CreateTable(
|
||||
"dbo.AbpEntityChanges",
|
||||
c => new
|
||||
{
|
||||
Id = c.Long(nullable: false, identity: true),
|
||||
ChangeTime = c.DateTime(nullable: false),
|
||||
ChangeType = c.Byte(nullable: false),
|
||||
EntityChangeSetId = c.Long(nullable: false),
|
||||
EntityId = c.String(maxLength: 48),
|
||||
EntityTypeFullName = c.String(maxLength: 192),
|
||||
TenantId = c.Int(),
|
||||
},
|
||||
annotations: new Dictionary<string, object>
|
||||
{
|
||||
{ "DynamicFilter_EntityChange_MayHaveTenant", "EntityFramework.DynamicFilters.DynamicFilterDefinition" },
|
||||
})
|
||||
.PrimaryKey(t => t.Id)
|
||||
.ForeignKey("dbo.AbpEntityChangeSets", t => t.EntityChangeSetId, cascadeDelete: true)
|
||||
.Index(t => t.EntityChangeSetId)
|
||||
.Index(t => new { t.EntityTypeFullName, t.EntityId })
|
||||
.Index(t => t.TenantId);
|
||||
|
||||
CreateTable(
|
||||
"dbo.AbpEntityPropertyChanges",
|
||||
c => new
|
||||
{
|
||||
Id = c.Long(nullable: false, identity: true),
|
||||
EntityChangeId = c.Long(nullable: false),
|
||||
NewValue = c.String(maxLength: 512),
|
||||
OriginalValue = c.String(maxLength: 512),
|
||||
PropertyName = c.String(maxLength: 96),
|
||||
PropertyTypeFullName = c.String(maxLength: 192),
|
||||
TenantId = c.Int(),
|
||||
},
|
||||
annotations: new Dictionary<string, object>
|
||||
{
|
||||
{ "DynamicFilter_EntityPropertyChange_MayHaveTenant", "EntityFramework.DynamicFilters.DynamicFilterDefinition" },
|
||||
})
|
||||
.PrimaryKey(t => t.Id)
|
||||
.ForeignKey("dbo.AbpEntityChanges", t => t.EntityChangeId, cascadeDelete: true)
|
||||
.Index(t => t.EntityChangeId)
|
||||
.Index(t => t.TenantId);
|
||||
|
||||
CreateTable(
|
||||
"dbo.AbpEntityChangeSets",
|
||||
c => new
|
||||
{
|
||||
Id = c.Long(nullable: false, identity: true),
|
||||
BrowserInfo = c.String(maxLength: 512),
|
||||
ClientIpAddress = c.String(maxLength: 64),
|
||||
ClientName = c.String(maxLength: 128),
|
||||
CreationTime = c.DateTime(nullable: false),
|
||||
ExtensionData = c.String(),
|
||||
ImpersonatorTenantId = c.Int(),
|
||||
ImpersonatorUserId = c.Long(),
|
||||
Reason = c.String(maxLength: 256),
|
||||
TenantId = c.Int(),
|
||||
UserId = c.Long(),
|
||||
},
|
||||
annotations: new Dictionary<string, object>
|
||||
{
|
||||
{ "DynamicFilter_EntityChangeSet_MayHaveTenant", "EntityFramework.DynamicFilters.DynamicFilterDefinition" },
|
||||
})
|
||||
.PrimaryKey(t => t.Id)
|
||||
.Index(t => t.CreationTime, name: "IX_TenantId_CreationTime")
|
||||
.Index(t => new { t.TenantId, t.Reason })
|
||||
.Index(t => t.TenantId)
|
||||
.Index(t => t.UserId, name: "IX_TenantId_UserId");
|
||||
|
||||
CreateTable(
|
||||
"dbo.AbpLanguages",
|
||||
c => new
|
||||
{
|
||||
Id = c.Int(nullable: false, identity: true),
|
||||
TenantId = c.Int(),
|
||||
Name = c.String(nullable: false, maxLength: 128),
|
||||
DisplayName = c.String(nullable: false, maxLength: 64),
|
||||
Icon = c.String(maxLength: 128),
|
||||
IsDisabled = c.Boolean(nullable: false),
|
||||
IsDeleted = c.Boolean(nullable: false),
|
||||
DeleterUserId = c.Long(),
|
||||
DeletionTime = c.DateTime(),
|
||||
LastModificationTime = c.DateTime(),
|
||||
LastModifierUserId = c.Long(),
|
||||
CreationTime = c.DateTime(nullable: false),
|
||||
CreatorUserId = c.Long(),
|
||||
},
|
||||
annotations: new Dictionary<string, object>
|
||||
{
|
||||
{ "DynamicFilter_ApplicationLanguage_MayHaveTenant", "EntityFramework.DynamicFilters.DynamicFilterDefinition" },
|
||||
{ "DynamicFilter_ApplicationLanguage_SoftDelete", "EntityFramework.DynamicFilters.DynamicFilterDefinition" },
|
||||
})
|
||||
.PrimaryKey(t => t.Id)
|
||||
.Index(t => t.TenantId)
|
||||
.Index(t => t.IsDeleted);
|
||||
|
||||
CreateTable(
|
||||
"dbo.AbpLanguageTexts",
|
||||
c => new
|
||||
{
|
||||
Id = c.Long(nullable: false, identity: true),
|
||||
TenantId = c.Int(),
|
||||
LanguageName = c.String(nullable: false, maxLength: 128),
|
||||
Source = c.String(nullable: false, maxLength: 128),
|
||||
Key = c.String(nullable: false, maxLength: 256),
|
||||
Value = c.String(nullable: false),
|
||||
LastModificationTime = c.DateTime(),
|
||||
LastModifierUserId = c.Long(),
|
||||
CreationTime = c.DateTime(nullable: false),
|
||||
CreatorUserId = c.Long(),
|
||||
},
|
||||
annotations: new Dictionary<string, object>
|
||||
{
|
||||
{ "DynamicFilter_ApplicationLanguageText_MayHaveTenant", "EntityFramework.DynamicFilters.DynamicFilterDefinition" },
|
||||
})
|
||||
.PrimaryKey(t => t.Id)
|
||||
.Index(t => t.TenantId);
|
||||
|
||||
CreateTable(
|
||||
"dbo.AbpNotifications",
|
||||
c => new
|
||||
{
|
||||
Id = c.Guid(nullable: false),
|
||||
NotificationName = c.String(nullable: false, maxLength: 96),
|
||||
Data = c.String(),
|
||||
DataTypeName = c.String(maxLength: 512),
|
||||
EntityTypeName = c.String(maxLength: 250),
|
||||
EntityTypeAssemblyQualifiedName = c.String(maxLength: 512),
|
||||
EntityId = c.String(maxLength: 96),
|
||||
Severity = c.Byte(nullable: false),
|
||||
UserIds = c.String(),
|
||||
ExcludedUserIds = c.String(),
|
||||
TenantIds = c.String(),
|
||||
CreationTime = c.DateTime(nullable: false),
|
||||
CreatorUserId = c.Long(),
|
||||
})
|
||||
.PrimaryKey(t => t.Id);
|
||||
|
||||
CreateTable(
|
||||
"dbo.AbpNotificationSubscriptions",
|
||||
c => new
|
||||
{
|
||||
Id = c.Guid(nullable: false),
|
||||
TenantId = c.Int(),
|
||||
UserId = c.Long(nullable: false),
|
||||
NotificationName = c.String(maxLength: 96),
|
||||
EntityTypeName = c.String(maxLength: 250),
|
||||
EntityTypeAssemblyQualifiedName = c.String(maxLength: 512),
|
||||
EntityId = c.String(maxLength: 96),
|
||||
CreationTime = c.DateTime(nullable: false),
|
||||
CreatorUserId = c.Long(),
|
||||
},
|
||||
annotations: new Dictionary<string, object>
|
||||
{
|
||||
{ "DynamicFilter_NotificationSubscriptionInfo_MayHaveTenant", "EntityFramework.DynamicFilters.DynamicFilterDefinition" },
|
||||
})
|
||||
.PrimaryKey(t => t.Id)
|
||||
.Index(t => t.TenantId)
|
||||
.Index(t => new { t.NotificationName, t.EntityTypeName, t.EntityId, t.UserId });
|
||||
|
||||
CreateTable(
|
||||
"dbo.AbpOrganizationUnitRoles",
|
||||
c => new
|
||||
{
|
||||
Id = c.Long(nullable: false, identity: true),
|
||||
TenantId = c.Int(),
|
||||
RoleId = c.Int(nullable: false),
|
||||
OrganizationUnitId = c.Long(nullable: false),
|
||||
IsDeleted = c.Boolean(nullable: false),
|
||||
CreationTime = c.DateTime(nullable: false),
|
||||
CreatorUserId = c.Long(),
|
||||
},
|
||||
annotations: new Dictionary<string, object>
|
||||
{
|
||||
{ "DynamicFilter_OrganizationUnitRole_MayHaveTenant", "EntityFramework.DynamicFilters.DynamicFilterDefinition" },
|
||||
{ "DynamicFilter_OrganizationUnitRole_SoftDelete", "EntityFramework.DynamicFilters.DynamicFilterDefinition" },
|
||||
})
|
||||
.PrimaryKey(t => t.Id)
|
||||
.Index(t => t.TenantId)
|
||||
.Index(t => t.IsDeleted);
|
||||
|
||||
CreateTable(
|
||||
"dbo.AbpOrganizationUnits",
|
||||
c => new
|
||||
{
|
||||
Id = c.Long(nullable: false, identity: true),
|
||||
TenantId = c.Int(),
|
||||
ParentId = c.Long(),
|
||||
Code = c.String(nullable: false, maxLength: 95),
|
||||
DisplayName = c.String(nullable: false, maxLength: 128),
|
||||
IsDeleted = c.Boolean(nullable: false),
|
||||
DeleterUserId = c.Long(),
|
||||
DeletionTime = c.DateTime(),
|
||||
LastModificationTime = c.DateTime(),
|
||||
LastModifierUserId = c.Long(),
|
||||
CreationTime = c.DateTime(nullable: false),
|
||||
CreatorUserId = c.Long(),
|
||||
},
|
||||
annotations: new Dictionary<string, object>
|
||||
{
|
||||
{ "DynamicFilter_OrganizationUnit_MayHaveTenant", "EntityFramework.DynamicFilters.DynamicFilterDefinition" },
|
||||
{ "DynamicFilter_OrganizationUnit_SoftDelete", "EntityFramework.DynamicFilters.DynamicFilterDefinition" },
|
||||
})
|
||||
.PrimaryKey(t => t.Id)
|
||||
.ForeignKey("dbo.AbpOrganizationUnits", t => t.ParentId)
|
||||
.Index(t => t.TenantId)
|
||||
.Index(t => t.ParentId)
|
||||
.Index(t => t.IsDeleted);
|
||||
|
||||
CreateTable(
|
||||
"dbo.BlgPosts",
|
||||
c => new
|
||||
{
|
||||
Id = c.Int(nullable: false, identity: true),
|
||||
CategoryId = c.Int(nullable: false),
|
||||
Title = c.String(nullable: false, maxLength: 128),
|
||||
Content = c.String(nullable: false),
|
||||
Tags = c.String(),
|
||||
Status = c.Byte(nullable: false),
|
||||
IsDeleted = c.Boolean(nullable: false),
|
||||
DeleterUserId = c.Long(),
|
||||
DeletionTime = c.DateTime(),
|
||||
LastModificationTime = c.DateTime(),
|
||||
LastModifierUserId = c.Long(),
|
||||
CreationTime = c.DateTime(nullable: false),
|
||||
CreatorUserId = c.Long(),
|
||||
},
|
||||
annotations: new Dictionary<string, object>
|
||||
{
|
||||
{ "DynamicFilter_Post_SoftDelete", "EntityFramework.DynamicFilters.DynamicFilterDefinition" },
|
||||
})
|
||||
.PrimaryKey(t => t.Id)
|
||||
.ForeignKey("dbo.BlgCategories", t => t.CategoryId, cascadeDelete: true)
|
||||
.ForeignKey("dbo.AbpUsers", t => t.CreatorUserId)
|
||||
.ForeignKey("dbo.AbpUsers", t => t.DeleterUserId)
|
||||
.ForeignKey("dbo.AbpUsers", t => t.LastModifierUserId)
|
||||
.Index(t => t.CategoryId)
|
||||
.Index(t => t.IsDeleted)
|
||||
.Index(t => t.DeleterUserId)
|
||||
.Index(t => t.LastModifierUserId)
|
||||
.Index(t => t.CreatorUserId);
|
||||
|
||||
CreateTable(
|
||||
"dbo.AbpRoles",
|
||||
c => new
|
||||
{
|
||||
Id = c.Int(nullable: false, identity: true),
|
||||
NormalizedName = c.String(nullable: false, maxLength: 32),
|
||||
TenantId = c.Int(),
|
||||
Name = c.String(nullable: false, maxLength: 32),
|
||||
DisplayName = c.String(nullable: false, maxLength: 64),
|
||||
IsStatic = c.Boolean(nullable: false),
|
||||
IsDefault = c.Boolean(nullable: false),
|
||||
IsDeleted = c.Boolean(nullable: false),
|
||||
DeleterUserId = c.Long(),
|
||||
DeletionTime = c.DateTime(),
|
||||
LastModificationTime = c.DateTime(),
|
||||
LastModifierUserId = c.Long(),
|
||||
CreationTime = c.DateTime(nullable: false),
|
||||
CreatorUserId = c.Long(),
|
||||
},
|
||||
annotations: new Dictionary<string, object>
|
||||
{
|
||||
{ "DynamicFilter_BlogRole_MayHaveTenant", "EntityFramework.DynamicFilters.DynamicFilterDefinition" },
|
||||
{ "DynamicFilter_BlogRole_SoftDelete", "EntityFramework.DynamicFilters.DynamicFilterDefinition" },
|
||||
})
|
||||
.PrimaryKey(t => t.Id)
|
||||
.ForeignKey("dbo.AbpUsers", t => t.CreatorUserId)
|
||||
.ForeignKey("dbo.AbpUsers", t => t.DeleterUserId)
|
||||
.ForeignKey("dbo.AbpUsers", t => t.LastModifierUserId)
|
||||
.Index(t => t.TenantId)
|
||||
.Index(t => t.IsDeleted)
|
||||
.Index(t => t.DeleterUserId)
|
||||
.Index(t => t.LastModifierUserId)
|
||||
.Index(t => t.CreatorUserId);
|
||||
|
||||
CreateTable(
|
||||
"dbo.AbpTenantNotifications",
|
||||
c => new
|
||||
{
|
||||
Id = c.Guid(nullable: false),
|
||||
TenantId = c.Int(),
|
||||
NotificationName = c.String(nullable: false, maxLength: 96),
|
||||
Data = c.String(),
|
||||
DataTypeName = c.String(maxLength: 512),
|
||||
EntityTypeName = c.String(maxLength: 250),
|
||||
EntityTypeAssemblyQualifiedName = c.String(maxLength: 512),
|
||||
EntityId = c.String(maxLength: 96),
|
||||
Severity = c.Byte(nullable: false),
|
||||
CreationTime = c.DateTime(nullable: false),
|
||||
CreatorUserId = c.Long(),
|
||||
},
|
||||
annotations: new Dictionary<string, object>
|
||||
{
|
||||
{ "DynamicFilter_TenantNotificationInfo_MayHaveTenant", "EntityFramework.DynamicFilters.DynamicFilterDefinition" },
|
||||
})
|
||||
.PrimaryKey(t => t.Id)
|
||||
.Index(t => t.TenantId);
|
||||
|
||||
CreateTable(
|
||||
"dbo.AbpTenants",
|
||||
c => new
|
||||
{
|
||||
Id = c.Int(nullable: false, identity: true),
|
||||
EditionId = c.Int(),
|
||||
TenancyName = c.String(nullable: false, maxLength: 64),
|
||||
Name = c.String(nullable: false, maxLength: 128),
|
||||
ConnectionString = c.String(maxLength: 1024),
|
||||
IsActive = c.Boolean(nullable: false),
|
||||
IsDeleted = c.Boolean(nullable: false),
|
||||
DeleterUserId = c.Long(),
|
||||
DeletionTime = c.DateTime(),
|
||||
LastModificationTime = c.DateTime(),
|
||||
LastModifierUserId = c.Long(),
|
||||
CreationTime = c.DateTime(nullable: false),
|
||||
CreatorUserId = c.Long(),
|
||||
},
|
||||
annotations: new Dictionary<string, object>
|
||||
{
|
||||
{ "DynamicFilter_BlogTenant_SoftDelete", "EntityFramework.DynamicFilters.DynamicFilterDefinition" },
|
||||
})
|
||||
.PrimaryKey(t => t.Id)
|
||||
.ForeignKey("dbo.AbpUsers", t => t.CreatorUserId)
|
||||
.ForeignKey("dbo.AbpUsers", t => t.DeleterUserId)
|
||||
.ForeignKey("dbo.AbpEditions", t => t.EditionId)
|
||||
.ForeignKey("dbo.AbpUsers", t => t.LastModifierUserId)
|
||||
.Index(t => t.EditionId)
|
||||
.Index(t => t.IsDeleted)
|
||||
.Index(t => t.DeleterUserId)
|
||||
.Index(t => t.LastModifierUserId)
|
||||
.Index(t => t.CreatorUserId);
|
||||
|
||||
CreateTable(
|
||||
"dbo.AbpUserAccounts",
|
||||
c => new
|
||||
{
|
||||
Id = c.Long(nullable: false, identity: true),
|
||||
TenantId = c.Int(),
|
||||
UserId = c.Long(nullable: false),
|
||||
UserLinkId = c.Long(),
|
||||
UserName = c.String(maxLength: 256),
|
||||
EmailAddress = c.String(maxLength: 256),
|
||||
IsDeleted = c.Boolean(nullable: false),
|
||||
DeleterUserId = c.Long(),
|
||||
DeletionTime = c.DateTime(),
|
||||
LastModificationTime = c.DateTime(),
|
||||
LastModifierUserId = c.Long(),
|
||||
CreationTime = c.DateTime(nullable: false),
|
||||
CreatorUserId = c.Long(),
|
||||
},
|
||||
annotations: new Dictionary<string, object>
|
||||
{
|
||||
{ "DynamicFilter_UserAccount_SoftDelete", "EntityFramework.DynamicFilters.DynamicFilterDefinition" },
|
||||
})
|
||||
.PrimaryKey(t => t.Id)
|
||||
.Index(t => t.IsDeleted);
|
||||
|
||||
CreateTable(
|
||||
"dbo.AbpUserLoginAttempts",
|
||||
c => new
|
||||
{
|
||||
Id = c.Long(nullable: false, identity: true),
|
||||
TenantId = c.Int(),
|
||||
TenancyName = c.String(maxLength: 64),
|
||||
UserId = c.Long(),
|
||||
UserNameOrEmailAddress = c.String(maxLength: 255),
|
||||
ClientIpAddress = c.String(maxLength: 64),
|
||||
ClientName = c.String(maxLength: 128),
|
||||
BrowserInfo = c.String(maxLength: 512),
|
||||
Result = c.Byte(nullable: false),
|
||||
CreationTime = c.DateTime(nullable: false),
|
||||
},
|
||||
annotations: new Dictionary<string, object>
|
||||
{
|
||||
{ "DynamicFilter_UserLoginAttempt_MayHaveTenant", "EntityFramework.DynamicFilters.DynamicFilterDefinition" },
|
||||
})
|
||||
.PrimaryKey(t => t.Id)
|
||||
.Index(t => t.TenantId)
|
||||
.Index(t => new { t.UserId, t.TenantId })
|
||||
.Index(t => new { t.TenancyName, t.UserNameOrEmailAddress, t.Result });
|
||||
|
||||
CreateTable(
|
||||
"dbo.AbpUserNotifications",
|
||||
c => new
|
||||
{
|
||||
Id = c.Guid(nullable: false),
|
||||
TenantId = c.Int(),
|
||||
UserId = c.Long(nullable: false),
|
||||
TenantNotificationId = c.Guid(nullable: false),
|
||||
State = c.Int(nullable: false),
|
||||
CreationTime = c.DateTime(nullable: false),
|
||||
},
|
||||
annotations: new Dictionary<string, object>
|
||||
{
|
||||
{ "DynamicFilter_UserNotificationInfo_MayHaveTenant", "EntityFramework.DynamicFilters.DynamicFilterDefinition" },
|
||||
})
|
||||
.PrimaryKey(t => t.Id)
|
||||
.Index(t => t.TenantId)
|
||||
.Index(t => new { t.UserId, t.State, t.CreationTime });
|
||||
|
||||
CreateTable(
|
||||
"dbo.AbpUserOrganizationUnits",
|
||||
c => new
|
||||
{
|
||||
Id = c.Long(nullable: false, identity: true),
|
||||
TenantId = c.Int(),
|
||||
UserId = c.Long(nullable: false),
|
||||
OrganizationUnitId = c.Long(nullable: false),
|
||||
IsDeleted = c.Boolean(nullable: false),
|
||||
CreationTime = c.DateTime(nullable: false),
|
||||
CreatorUserId = c.Long(),
|
||||
},
|
||||
annotations: new Dictionary<string, object>
|
||||
{
|
||||
{ "DynamicFilter_UserOrganizationUnit_MayHaveTenant", "EntityFramework.DynamicFilters.DynamicFilterDefinition" },
|
||||
{ "DynamicFilter_UserOrganizationUnit_SoftDelete", "EntityFramework.DynamicFilters.DynamicFilterDefinition" },
|
||||
})
|
||||
.PrimaryKey(t => t.Id)
|
||||
.Index(t => t.TenantId)
|
||||
.Index(t => t.IsDeleted);
|
||||
|
||||
}
|
||||
|
||||
public override void Down()
|
||||
{
|
||||
DropForeignKey("dbo.AbpTenants", "LastModifierUserId", "dbo.AbpUsers");
|
||||
DropForeignKey("dbo.AbpTenants", "EditionId", "dbo.AbpEditions");
|
||||
DropForeignKey("dbo.AbpTenants", "DeleterUserId", "dbo.AbpUsers");
|
||||
DropForeignKey("dbo.AbpTenants", "CreatorUserId", "dbo.AbpUsers");
|
||||
DropForeignKey("dbo.AbpPermissions", "RoleId", "dbo.AbpRoles");
|
||||
DropForeignKey("dbo.AbpRoles", "LastModifierUserId", "dbo.AbpUsers");
|
||||
DropForeignKey("dbo.AbpRoles", "DeleterUserId", "dbo.AbpUsers");
|
||||
DropForeignKey("dbo.AbpRoles", "CreatorUserId", "dbo.AbpUsers");
|
||||
DropForeignKey("dbo.BlgPosts", "LastModifierUserId", "dbo.AbpUsers");
|
||||
DropForeignKey("dbo.BlgPosts", "DeleterUserId", "dbo.AbpUsers");
|
||||
DropForeignKey("dbo.BlgPosts", "CreatorUserId", "dbo.AbpUsers");
|
||||
DropForeignKey("dbo.BlgPosts", "CategoryId", "dbo.BlgCategories");
|
||||
DropForeignKey("dbo.AbpOrganizationUnits", "ParentId", "dbo.AbpOrganizationUnits");
|
||||
DropForeignKey("dbo.AbpEntityChanges", "EntityChangeSetId", "dbo.AbpEntityChangeSets");
|
||||
DropForeignKey("dbo.AbpEntityPropertyChanges", "EntityChangeId", "dbo.AbpEntityChanges");
|
||||
DropForeignKey("dbo.AbpFeatures", "EditionId", "dbo.AbpEditions");
|
||||
DropForeignKey("dbo.BlgComments", "CreatorUserId", "dbo.AbpUsers");
|
||||
DropForeignKey("dbo.BlgCategories", "CreatorUserId", "dbo.AbpUsers");
|
||||
DropForeignKey("dbo.AbpSettings", "UserId", "dbo.AbpUsers");
|
||||
DropForeignKey("dbo.AbpUserRoles", "UserId", "dbo.AbpUsers");
|
||||
DropForeignKey("dbo.AbpPermissions", "UserId", "dbo.AbpUsers");
|
||||
DropForeignKey("dbo.AbpUserLogins", "UserId", "dbo.AbpUsers");
|
||||
DropForeignKey("dbo.AbpUsers", "LastModifierUserId", "dbo.AbpUsers");
|
||||
DropForeignKey("dbo.AbpUsers", "DeleterUserId", "dbo.AbpUsers");
|
||||
DropForeignKey("dbo.AbpUsers", "CreatorUserId", "dbo.AbpUsers");
|
||||
DropForeignKey("dbo.AbpUserClaims", "UserId", "dbo.AbpUsers");
|
||||
DropIndex("dbo.AbpUserOrganizationUnits", new[] { "IsDeleted" });
|
||||
DropIndex("dbo.AbpUserOrganizationUnits", new[] { "TenantId" });
|
||||
DropIndex("dbo.AbpUserNotifications", new[] { "UserId", "State", "CreationTime" });
|
||||
DropIndex("dbo.AbpUserNotifications", new[] { "TenantId" });
|
||||
DropIndex("dbo.AbpUserLoginAttempts", new[] { "TenancyName", "UserNameOrEmailAddress", "Result" });
|
||||
DropIndex("dbo.AbpUserLoginAttempts", new[] { "UserId", "TenantId" });
|
||||
DropIndex("dbo.AbpUserLoginAttempts", new[] { "TenantId" });
|
||||
DropIndex("dbo.AbpUserAccounts", new[] { "IsDeleted" });
|
||||
DropIndex("dbo.AbpTenants", new[] { "CreatorUserId" });
|
||||
DropIndex("dbo.AbpTenants", new[] { "LastModifierUserId" });
|
||||
DropIndex("dbo.AbpTenants", new[] { "DeleterUserId" });
|
||||
DropIndex("dbo.AbpTenants", new[] { "IsDeleted" });
|
||||
DropIndex("dbo.AbpTenants", new[] { "EditionId" });
|
||||
DropIndex("dbo.AbpTenantNotifications", new[] { "TenantId" });
|
||||
DropIndex("dbo.AbpRoles", new[] { "CreatorUserId" });
|
||||
DropIndex("dbo.AbpRoles", new[] { "LastModifierUserId" });
|
||||
DropIndex("dbo.AbpRoles", new[] { "DeleterUserId" });
|
||||
DropIndex("dbo.AbpRoles", new[] { "IsDeleted" });
|
||||
DropIndex("dbo.AbpRoles", new[] { "TenantId" });
|
||||
DropIndex("dbo.BlgPosts", new[] { "CreatorUserId" });
|
||||
DropIndex("dbo.BlgPosts", new[] { "LastModifierUserId" });
|
||||
DropIndex("dbo.BlgPosts", new[] { "DeleterUserId" });
|
||||
DropIndex("dbo.BlgPosts", new[] { "IsDeleted" });
|
||||
DropIndex("dbo.BlgPosts", new[] { "CategoryId" });
|
||||
DropIndex("dbo.AbpOrganizationUnits", new[] { "IsDeleted" });
|
||||
DropIndex("dbo.AbpOrganizationUnits", new[] { "ParentId" });
|
||||
DropIndex("dbo.AbpOrganizationUnits", new[] { "TenantId" });
|
||||
DropIndex("dbo.AbpOrganizationUnitRoles", new[] { "IsDeleted" });
|
||||
DropIndex("dbo.AbpOrganizationUnitRoles", new[] { "TenantId" });
|
||||
DropIndex("dbo.AbpNotificationSubscriptions", new[] { "NotificationName", "EntityTypeName", "EntityId", "UserId" });
|
||||
DropIndex("dbo.AbpNotificationSubscriptions", new[] { "TenantId" });
|
||||
DropIndex("dbo.AbpLanguageTexts", new[] { "TenantId" });
|
||||
DropIndex("dbo.AbpLanguages", new[] { "IsDeleted" });
|
||||
DropIndex("dbo.AbpLanguages", new[] { "TenantId" });
|
||||
DropIndex("dbo.AbpEntityChangeSets", "IX_TenantId_UserId");
|
||||
DropIndex("dbo.AbpEntityChangeSets", new[] { "TenantId" });
|
||||
DropIndex("dbo.AbpEntityChangeSets", new[] { "TenantId", "Reason" });
|
||||
DropIndex("dbo.AbpEntityChangeSets", "IX_TenantId_CreationTime");
|
||||
DropIndex("dbo.AbpEntityPropertyChanges", new[] { "TenantId" });
|
||||
DropIndex("dbo.AbpEntityPropertyChanges", new[] { "EntityChangeId" });
|
||||
DropIndex("dbo.AbpEntityChanges", new[] { "TenantId" });
|
||||
DropIndex("dbo.AbpEntityChanges", new[] { "EntityTypeFullName", "EntityId" });
|
||||
DropIndex("dbo.AbpEntityChanges", new[] { "EntityChangeSetId" });
|
||||
DropIndex("dbo.AbpEditions", new[] { "IsDeleted" });
|
||||
DropIndex("dbo.AbpFeatures", new[] { "EditionId" });
|
||||
DropIndex("dbo.AbpFeatures", new[] { "TenantId" });
|
||||
DropIndex("dbo.BlgComments", new[] { "CreatorUserId" });
|
||||
DropIndex("dbo.AbpSettings", new[] { "TenantId", "Name", "UserId" });
|
||||
DropIndex("dbo.AbpSettings", new[] { "TenantId" });
|
||||
DropIndex("dbo.AbpUserRoles", new[] { "UserId" });
|
||||
DropIndex("dbo.AbpUserRoles", new[] { "TenantId" });
|
||||
DropIndex("dbo.AbpPermissions", new[] { "RoleId" });
|
||||
DropIndex("dbo.AbpPermissions", new[] { "UserId" });
|
||||
DropIndex("dbo.AbpPermissions", new[] { "TenantId" });
|
||||
DropIndex("dbo.AbpUserLogins", new[] { "UserId" });
|
||||
DropIndex("dbo.AbpUserLogins", new[] { "TenantId" });
|
||||
DropIndex("dbo.AbpUserClaims", new[] { "UserId" });
|
||||
DropIndex("dbo.AbpUserClaims", new[] { "TenantId" });
|
||||
DropIndex("dbo.AbpUsers", new[] { "CreatorUserId" });
|
||||
DropIndex("dbo.AbpUsers", new[] { "LastModifierUserId" });
|
||||
DropIndex("dbo.AbpUsers", new[] { "DeleterUserId" });
|
||||
DropIndex("dbo.AbpUsers", new[] { "IsDeleted" });
|
||||
DropIndex("dbo.AbpUsers", new[] { "TenantId" });
|
||||
DropIndex("dbo.BlgCategories", new[] { "CreatorUserId" });
|
||||
DropIndex("dbo.AbpBackgroundJobs", new[] { "IsAbandoned", "NextTryTime" });
|
||||
DropIndex("dbo.AbpAuditLogs", new[] { "TenantId" });
|
||||
DropTable("dbo.AbpUserOrganizationUnits",
|
||||
removedAnnotations: new Dictionary<string, object>
|
||||
{
|
||||
{ "DynamicFilter_UserOrganizationUnit_MayHaveTenant", "EntityFramework.DynamicFilters.DynamicFilterDefinition" },
|
||||
{ "DynamicFilter_UserOrganizationUnit_SoftDelete", "EntityFramework.DynamicFilters.DynamicFilterDefinition" },
|
||||
});
|
||||
DropTable("dbo.AbpUserNotifications",
|
||||
removedAnnotations: new Dictionary<string, object>
|
||||
{
|
||||
{ "DynamicFilter_UserNotificationInfo_MayHaveTenant", "EntityFramework.DynamicFilters.DynamicFilterDefinition" },
|
||||
});
|
||||
DropTable("dbo.AbpUserLoginAttempts",
|
||||
removedAnnotations: new Dictionary<string, object>
|
||||
{
|
||||
{ "DynamicFilter_UserLoginAttempt_MayHaveTenant", "EntityFramework.DynamicFilters.DynamicFilterDefinition" },
|
||||
});
|
||||
DropTable("dbo.AbpUserAccounts",
|
||||
removedAnnotations: new Dictionary<string, object>
|
||||
{
|
||||
{ "DynamicFilter_UserAccount_SoftDelete", "EntityFramework.DynamicFilters.DynamicFilterDefinition" },
|
||||
});
|
||||
DropTable("dbo.AbpTenants",
|
||||
removedAnnotations: new Dictionary<string, object>
|
||||
{
|
||||
{ "DynamicFilter_BlogTenant_SoftDelete", "EntityFramework.DynamicFilters.DynamicFilterDefinition" },
|
||||
});
|
||||
DropTable("dbo.AbpTenantNotifications",
|
||||
removedAnnotations: new Dictionary<string, object>
|
||||
{
|
||||
{ "DynamicFilter_TenantNotificationInfo_MayHaveTenant", "EntityFramework.DynamicFilters.DynamicFilterDefinition" },
|
||||
});
|
||||
DropTable("dbo.AbpRoles",
|
||||
removedAnnotations: new Dictionary<string, object>
|
||||
{
|
||||
{ "DynamicFilter_BlogRole_MayHaveTenant", "EntityFramework.DynamicFilters.DynamicFilterDefinition" },
|
||||
{ "DynamicFilter_BlogRole_SoftDelete", "EntityFramework.DynamicFilters.DynamicFilterDefinition" },
|
||||
});
|
||||
DropTable("dbo.BlgPosts",
|
||||
removedAnnotations: new Dictionary<string, object>
|
||||
{
|
||||
{ "DynamicFilter_Post_SoftDelete", "EntityFramework.DynamicFilters.DynamicFilterDefinition" },
|
||||
});
|
||||
DropTable("dbo.AbpOrganizationUnits",
|
||||
removedAnnotations: new Dictionary<string, object>
|
||||
{
|
||||
{ "DynamicFilter_OrganizationUnit_MayHaveTenant", "EntityFramework.DynamicFilters.DynamicFilterDefinition" },
|
||||
{ "DynamicFilter_OrganizationUnit_SoftDelete", "EntityFramework.DynamicFilters.DynamicFilterDefinition" },
|
||||
});
|
||||
DropTable("dbo.AbpOrganizationUnitRoles",
|
||||
removedAnnotations: new Dictionary<string, object>
|
||||
{
|
||||
{ "DynamicFilter_OrganizationUnitRole_MayHaveTenant", "EntityFramework.DynamicFilters.DynamicFilterDefinition" },
|
||||
{ "DynamicFilter_OrganizationUnitRole_SoftDelete", "EntityFramework.DynamicFilters.DynamicFilterDefinition" },
|
||||
});
|
||||
DropTable("dbo.AbpNotificationSubscriptions",
|
||||
removedAnnotations: new Dictionary<string, object>
|
||||
{
|
||||
{ "DynamicFilter_NotificationSubscriptionInfo_MayHaveTenant", "EntityFramework.DynamicFilters.DynamicFilterDefinition" },
|
||||
});
|
||||
DropTable("dbo.AbpNotifications");
|
||||
DropTable("dbo.AbpLanguageTexts",
|
||||
removedAnnotations: new Dictionary<string, object>
|
||||
{
|
||||
{ "DynamicFilter_ApplicationLanguageText_MayHaveTenant", "EntityFramework.DynamicFilters.DynamicFilterDefinition" },
|
||||
});
|
||||
DropTable("dbo.AbpLanguages",
|
||||
removedAnnotations: new Dictionary<string, object>
|
||||
{
|
||||
{ "DynamicFilter_ApplicationLanguage_MayHaveTenant", "EntityFramework.DynamicFilters.DynamicFilterDefinition" },
|
||||
{ "DynamicFilter_ApplicationLanguage_SoftDelete", "EntityFramework.DynamicFilters.DynamicFilterDefinition" },
|
||||
});
|
||||
DropTable("dbo.AbpEntityChangeSets",
|
||||
removedAnnotations: new Dictionary<string, object>
|
||||
{
|
||||
{ "DynamicFilter_EntityChangeSet_MayHaveTenant", "EntityFramework.DynamicFilters.DynamicFilterDefinition" },
|
||||
});
|
||||
DropTable("dbo.AbpEntityPropertyChanges",
|
||||
removedAnnotations: new Dictionary<string, object>
|
||||
{
|
||||
{ "DynamicFilter_EntityPropertyChange_MayHaveTenant", "EntityFramework.DynamicFilters.DynamicFilterDefinition" },
|
||||
});
|
||||
DropTable("dbo.AbpEntityChanges",
|
||||
removedAnnotations: new Dictionary<string, object>
|
||||
{
|
||||
{ "DynamicFilter_EntityChange_MayHaveTenant", "EntityFramework.DynamicFilters.DynamicFilterDefinition" },
|
||||
});
|
||||
DropTable("dbo.AbpEditions",
|
||||
removedAnnotations: new Dictionary<string, object>
|
||||
{
|
||||
{ "DynamicFilter_Edition_SoftDelete", "EntityFramework.DynamicFilters.DynamicFilterDefinition" },
|
||||
});
|
||||
DropTable("dbo.AbpFeatures",
|
||||
removedAnnotations: new Dictionary<string, object>
|
||||
{
|
||||
{ "DynamicFilter_EditionFeatureSetting_MayHaveTenant", "EntityFramework.DynamicFilters.DynamicFilterDefinition" },
|
||||
{ "DynamicFilter_FeatureSetting_MayHaveTenant", "EntityFramework.DynamicFilters.DynamicFilterDefinition" },
|
||||
{ "DynamicFilter_TenantFeatureSetting_MayHaveTenant", "EntityFramework.DynamicFilters.DynamicFilterDefinition" },
|
||||
});
|
||||
DropTable("dbo.BlgComments");
|
||||
DropTable("dbo.AbpSettings",
|
||||
removedAnnotations: new Dictionary<string, object>
|
||||
{
|
||||
{ "DynamicFilter_Setting_MayHaveTenant", "EntityFramework.DynamicFilters.DynamicFilterDefinition" },
|
||||
});
|
||||
DropTable("dbo.AbpUserRoles",
|
||||
removedAnnotations: new Dictionary<string, object>
|
||||
{
|
||||
{ "DynamicFilter_UserRole_MayHaveTenant", "EntityFramework.DynamicFilters.DynamicFilterDefinition" },
|
||||
});
|
||||
DropTable("dbo.AbpPermissions",
|
||||
removedAnnotations: new Dictionary<string, object>
|
||||
{
|
||||
{ "DynamicFilter_PermissionSetting_MayHaveTenant", "EntityFramework.DynamicFilters.DynamicFilterDefinition" },
|
||||
{ "DynamicFilter_RolePermissionSetting_MayHaveTenant", "EntityFramework.DynamicFilters.DynamicFilterDefinition" },
|
||||
{ "DynamicFilter_UserPermissionSetting_MayHaveTenant", "EntityFramework.DynamicFilters.DynamicFilterDefinition" },
|
||||
});
|
||||
DropTable("dbo.AbpUserLogins",
|
||||
removedAnnotations: new Dictionary<string, object>
|
||||
{
|
||||
{ "DynamicFilter_UserLogin_MayHaveTenant", "EntityFramework.DynamicFilters.DynamicFilterDefinition" },
|
||||
});
|
||||
DropTable("dbo.AbpUserClaims",
|
||||
removedAnnotations: new Dictionary<string, object>
|
||||
{
|
||||
{ "DynamicFilter_UserClaim_MayHaveTenant", "EntityFramework.DynamicFilters.DynamicFilterDefinition" },
|
||||
});
|
||||
DropTable("dbo.AbpUsers",
|
||||
removedAnnotations: new Dictionary<string, object>
|
||||
{
|
||||
{ "DynamicFilter_BlogUser_MayHaveTenant", "EntityFramework.DynamicFilters.DynamicFilterDefinition" },
|
||||
{ "DynamicFilter_BlogUser_SoftDelete", "EntityFramework.DynamicFilters.DynamicFilterDefinition" },
|
||||
});
|
||||
DropTable("dbo.BlgCategories");
|
||||
DropTable("dbo.AbpBackgroundJobs");
|
||||
DropTable("dbo.AbpAuditLogs",
|
||||
removedAnnotations: new Dictionary<string, object>
|
||||
{
|
||||
{ "DynamicFilter_AuditLog_MayHaveTenant", "EntityFramework.DynamicFilters.DynamicFilterDefinition" },
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
Различия файлов скрыты, потому что одна или несколько строк слишком длинны
|
@ -1,4 +1,5 @@
|
|||
using System.Linq;
|
||||
using Abp.Authorization.Users;
|
||||
using Abp.Samples.Blog.Auth;
|
||||
using Abp.Samples.Blog.Categories;
|
||||
using Abp.Samples.Blog.Posts;
|
||||
|
@ -16,17 +17,102 @@ namespace Abp.Samples.Blog.EntityFramework.Migrations.SeedData
|
|||
|
||||
public void Build()
|
||||
{
|
||||
CreateUserAndRoles();
|
||||
CreateCategories();
|
||||
CreatePosts();
|
||||
}
|
||||
|
||||
private void CreateCategories()
|
||||
{
|
||||
if (_context.Categories.Any())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
_context.Categories.Add(new Category { Name = "Programming" });
|
||||
_context.Categories.Add(new Category { Name = "Design" });
|
||||
|
||||
|
||||
_context.SaveChanges();
|
||||
}
|
||||
private void CreateUserAndRoles()
|
||||
{
|
||||
//Admin role for tenancy owner
|
||||
|
||||
var adminRoleForTenancyOwner = _context.Roles.FirstOrDefault(r => r.TenantId == null && r.Name == "Admin");
|
||||
if (adminRoleForTenancyOwner == null)
|
||||
{
|
||||
adminRoleForTenancyOwner = _context.Roles.Add(new BlogRole { Name = "Admin", DisplayName = "Admin" });
|
||||
_context.SaveChanges();
|
||||
}
|
||||
|
||||
//Admin user for tenancy owner
|
||||
|
||||
var adminUserForTenancyOwner = _context.Users.FirstOrDefault(u => u.TenantId == null && u.UserName == "admin");
|
||||
if (adminUserForTenancyOwner == null)
|
||||
{
|
||||
adminUserForTenancyOwner = _context.Users.Add(
|
||||
new BlogUser
|
||||
{
|
||||
TenantId = null,
|
||||
UserName = "admin",
|
||||
Name = "System",
|
||||
Surname = "Administrator",
|
||||
NormalizedUserName = "ADMIN",
|
||||
EmailAddress = "admin@aspnetboilerplate.com",
|
||||
NormalizedEmailAddress = "ADMIN@ASPNETBOILERPLATE.COM",
|
||||
IsEmailConfirmed = true,
|
||||
Password = "AM4OLBpptxBYmM79lGOX9egzZk3vIQU3d/gFCJzaBjAPXzYIK3tQ2N7X4fcrHtElTw==" //123qwe
|
||||
});
|
||||
|
||||
_context.SaveChanges();
|
||||
|
||||
_context.UserRoles.Add(new UserRole(null, adminUserForTenancyOwner.Id, adminRoleForTenancyOwner.Id));
|
||||
|
||||
_context.SaveChanges();
|
||||
}
|
||||
|
||||
//Default tenant
|
||||
|
||||
var defaultTenant = _context.Tenants.FirstOrDefault(t => t.TenancyName == "Default");
|
||||
if (defaultTenant == null)
|
||||
{
|
||||
defaultTenant = _context.Tenants.Add(new BlogTenant { TenancyName = "Default", Name = "Default" });
|
||||
_context.SaveChanges();
|
||||
}
|
||||
|
||||
//Admin role for 'Default' tenant
|
||||
|
||||
var adminRoleForDefaultTenant = _context.Roles.FirstOrDefault(r => r.TenantId == defaultTenant.Id && r.Name == "Admin");
|
||||
if (adminRoleForDefaultTenant == null)
|
||||
{
|
||||
adminRoleForDefaultTenant = _context.Roles.Add(new BlogRole { TenantId = defaultTenant.Id, Name = "Admin", DisplayName = "Admin" });
|
||||
_context.SaveChanges();
|
||||
}
|
||||
|
||||
//Admin for 'Default' tenant
|
||||
|
||||
var adminUserForDefaultTenant = _context.Users.FirstOrDefault(u => u.TenantId == defaultTenant.Id && u.UserName == "admin");
|
||||
if (adminUserForDefaultTenant == null)
|
||||
{
|
||||
adminUserForDefaultTenant = _context.Users.Add(
|
||||
new BlogUser
|
||||
{
|
||||
TenantId = defaultTenant.Id,
|
||||
UserName = "admin",
|
||||
Name = "System",
|
||||
Surname = "Administrator",
|
||||
NormalizedUserName = "ADMIN",
|
||||
EmailAddress = "admin@aspnetboilerplate.com",
|
||||
NormalizedEmailAddress = "ADMIN@ASPNETBOILERPLATE.COM",
|
||||
IsEmailConfirmed = true,
|
||||
Password = "AM4OLBpptxBYmM79lGOX9egzZk3vIQU3d/gFCJzaBjAPXzYIK3tQ2N7X4fcrHtElTw==" //123qwe
|
||||
});
|
||||
_context.SaveChanges();
|
||||
|
||||
_context.UserRoles.Add(new UserRole(defaultTenant.Id, adminUserForDefaultTenant.Id, adminRoleForDefaultTenant.Id));
|
||||
_context.SaveChanges();
|
||||
}
|
||||
}
|
||||
|
||||
private void CreatePosts()
|
||||
{
|
||||
|
@ -38,8 +124,8 @@ namespace Abp.Samples.Blog.EntityFramework.Migrations.SeedData
|
|||
const int defaultTenantId = 1;
|
||||
|
||||
var adminUser = _context.Users.Single(u => u.TenantId == defaultTenantId && u.UserName == BlogUser.AdminUserName);
|
||||
var programmingCategory = _context.Categories.Single(c => c.Name == "Programming");
|
||||
|
||||
var programmingCategory = _context.Categories.FirstOrDefault(c => c.Name == "Programming");
|
||||
|
||||
_context.Posts.Add(
|
||||
new Post
|
||||
{
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
<package id="Castle.LoggingFacility" version="5.0.1" targetFramework="net461" />
|
||||
<package id="Castle.Windsor" version="5.0.1" targetFramework="net461" />
|
||||
<package id="EntityFramework" version="6.4.0" targetFramework="net461" />
|
||||
<package id="EntityFramework.DynamicFilters" version="3.1.1" targetFramework="net461" />
|
||||
<package id="EntityFramework.DynamicFilters" version="3.1.0" targetFramework="net461" />
|
||||
<package id="JetBrains.Annotations" version="2019.1.3" targetFramework="net461" />
|
||||
<package id="Microsoft.AspNet.Identity.Core" version="2.2.3" targetFramework="net461" />
|
||||
<package id="Microsoft.Extensions.Caching.Abstractions" version="3.0.0" targetFramework="net461" />
|
||||
|
|
Загрузка…
Ссылка в новой задаче