Browse Source

Fix migrations on startup templates for AuditLogId duplication (see #652).

pull/671/head
Halil ibrahim Kalkan 8 years ago
parent
commit
b4f5559fc9
  1. 2
      templates/module/app/MyCompanyName.MyProjectName.DemoApp/Migrations/20181218134206_Initial.Designer.cs
  2. 0
      templates/module/app/MyCompanyName.MyProjectName.DemoApp/Migrations/20181218134206_Initial.cs
  3. 4
      templates/module/app/MyCompanyName.MyProjectName.DemoApp/MyCompanyName.MyProjectName.DemoApp.csproj
  4. 22
      templates/mvc/src/MyCompanyName.MyProjectName.EntityFrameworkCore/Migrations/20181218134025_Initial.Designer.cs
  5. 32
      templates/mvc/src/MyCompanyName.MyProjectName.EntityFrameworkCore/Migrations/20181218134025_Initial.cs
  6. 20
      templates/mvc/src/MyCompanyName.MyProjectName.EntityFrameworkCore/Migrations/MyProjectNameDbContextModelSnapshot.cs
  7. 2
      templates/mvc/src/MyCompanyName.MyProjectName.EntityFrameworkCore/MyCompanyName.MyProjectName.EntityFrameworkCore.csproj
  8. 4
      templates/service/host/IdentityServerHost/IdentityServerHost.csproj
  9. 2
      templates/service/host/IdentityServerHost/Migrations/20181218135354_Initial.Designer.cs
  10. 0
      templates/service/host/IdentityServerHost/Migrations/20181218135354_Initial.cs
  11. 22
      templates/service/host/MyCompanyName.MyProjectName.Host/Migrations/20181218135310_Initial.Designer.cs
  12. 28
      templates/service/host/MyCompanyName.MyProjectName.Host/Migrations/20181218135310_Initial.cs
  13. 20
      templates/service/host/MyCompanyName.MyProjectName.Host/Migrations/DemoAppDbContextModelSnapshot.cs
  14. 4
      templates/service/host/MyCompanyName.MyProjectName.Host/MyCompanyName.MyProjectName.Host.csproj

2
templates/module/app/MyCompanyName.MyProjectName.DemoApp/Migrations/20181212114934_Initial.Designer.cs → templates/module/app/MyCompanyName.MyProjectName.DemoApp/Migrations/20181218134206_Initial.Designer.cs

@ -10,7 +10,7 @@ using MyCompanyName.MyProjectName.DemoApp;
namespace MyCompanyName.MyProjectName.DemoApp.Migrations
{
[DbContext(typeof(DemoAppDbContext))]
[Migration("20181212114934_Initial")]
[Migration("20181218134206_Initial")]
partial class Initial
{
protected override void BuildTargetModel(ModelBuilder modelBuilder)

0
templates/module/app/MyCompanyName.MyProjectName.DemoApp/Migrations/20181212114934_Initial.cs → templates/module/app/MyCompanyName.MyProjectName.DemoApp/Migrations/20181218134206_Initial.cs

4
templates/module/app/MyCompanyName.MyProjectName.DemoApp/MyCompanyName.MyProjectName.DemoApp.csproj

@ -33,4 +33,8 @@
<None Remove="Logs\**" />
</ItemGroup>
<ItemGroup>
<Compile Remove="Migrations\20181212114934_Initial.cs" />
</ItemGroup>
</Project>

22
templates/mvc/src/MyCompanyName.MyProjectName.EntityFrameworkCore/Migrations/20181212113826_Initial.Designer.cs → templates/mvc/src/MyCompanyName.MyProjectName.EntityFrameworkCore/Migrations/20181218134025_Initial.Designer.cs

@ -11,7 +11,7 @@ using Volo.Abp.BackgroundJobs;
namespace MyCompanyName.MyProjectName.Migrations
{
[DbContext(typeof(MyProjectNameDbContext))]
[Migration("20181212113826_Initial")]
[Migration("20181218134025_Initial")]
partial class Initial
{
protected override void BuildTargetModel(ModelBuilder modelBuilder)
@ -101,8 +101,6 @@ namespace MyCompanyName.MyProjectName.Migrations
b.Property<Guid>("AuditLogId")
.HasColumnName("AuditLogId");
b.Property<Guid?>("AuditLogId1");
b.Property<int>("ExecutionDuration")
.HasColumnName("ExecutionDuration");
@ -130,8 +128,6 @@ namespace MyCompanyName.MyProjectName.Migrations
b.HasIndex("AuditLogId");
b.HasIndex("AuditLogId1");
b.HasIndex("TenantId", "ServiceName", "MethodName", "ExecutionTime");
b.ToTable("AbpAuditLogActions");
@ -145,8 +141,6 @@ namespace MyCompanyName.MyProjectName.Migrations
b.Property<Guid>("AuditLogId")
.HasColumnName("AuditLogId");
b.Property<Guid?>("AuditLogId1");
b.Property<DateTime>("ChangeTime")
.HasColumnName("ChangeTime");
@ -173,8 +167,6 @@ namespace MyCompanyName.MyProjectName.Migrations
b.HasIndex("AuditLogId");
b.HasIndex("AuditLogId1");
b.HasIndex("TenantId", "EntityTypeFullName", "EntityId");
b.ToTable("AbpEntityChanges");
@ -608,25 +600,17 @@ namespace MyCompanyName.MyProjectName.Migrations
modelBuilder.Entity("Volo.Abp.AuditLogging.AuditLogAction", b =>
{
b.HasOne("Volo.Abp.AuditLogging.AuditLog")
.WithMany()
.WithMany("Actions")
.HasForeignKey("AuditLogId")
.OnDelete(DeleteBehavior.Cascade);
b.HasOne("Volo.Abp.AuditLogging.AuditLog")
.WithMany("Actions")
.HasForeignKey("AuditLogId1");
});
modelBuilder.Entity("Volo.Abp.AuditLogging.EntityChange", b =>
{
b.HasOne("Volo.Abp.AuditLogging.AuditLog")
.WithMany()
.WithMany("EntityChanges")
.HasForeignKey("AuditLogId")
.OnDelete(DeleteBehavior.Cascade);
b.HasOne("Volo.Abp.AuditLogging.AuditLog")
.WithMany("EntityChanges")
.HasForeignKey("AuditLogId1");
});
modelBuilder.Entity("Volo.Abp.AuditLogging.EntityPropertyChange", b =>

32
templates/mvc/src/MyCompanyName.MyProjectName.EntityFrameworkCore/Migrations/20181212113826_Initial.cs → templates/mvc/src/MyCompanyName.MyProjectName.EntityFrameworkCore/Migrations/20181218134025_Initial.cs

@ -12,6 +12,7 @@ namespace MyCompanyName.MyProjectName.Migrations
columns: table => new
{
Id = table.Column<Guid>(nullable: false),
ExtraProperties = table.Column<string>(nullable: true),
ConcurrencyStamp = table.Column<string>(nullable: true),
UserId = table.Column<Guid>(nullable: true),
UserName = table.Column<string>(maxLength: 256, nullable: true),
@ -27,8 +28,7 @@ namespace MyCompanyName.MyProjectName.Migrations
Url = table.Column<string>(maxLength: 256, nullable: true),
Exceptions = table.Column<string>(maxLength: 4000, nullable: true),
Comments = table.Column<string>(maxLength: 256, nullable: true),
HttpStatusCode = table.Column<int>(nullable: true),
ExtraProperties = table.Column<string>(nullable: true)
HttpStatusCode = table.Column<int>(nullable: true)
},
constraints: table =>
{
@ -173,8 +173,7 @@ namespace MyCompanyName.MyProjectName.Migrations
Parameters = table.Column<string>(maxLength: 2000, nullable: true),
ExecutionTime = table.Column<DateTime>(nullable: false),
ExecutionDuration = table.Column<int>(nullable: false),
ExtraProperties = table.Column<string>(nullable: true),
AuditLogId1 = table.Column<Guid>(nullable: true)
ExtraProperties = table.Column<string>(nullable: true)
},
constraints: table =>
{
@ -185,12 +184,6 @@ namespace MyCompanyName.MyProjectName.Migrations
principalTable: "AbpAuditLogs",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_AbpAuditLogActions_AbpAuditLogs_AuditLogId1",
column: x => x.AuditLogId1,
principalTable: "AbpAuditLogs",
principalColumn: "Id",
onDelete: ReferentialAction.Restrict);
});
migrationBuilder.CreateTable(
@ -204,8 +197,7 @@ namespace MyCompanyName.MyProjectName.Migrations
ChangeType = table.Column<byte>(nullable: false),
EntityId = table.Column<string>(maxLength: 128, nullable: false),
EntityTypeFullName = table.Column<string>(maxLength: 128, nullable: false),
ExtraProperties = table.Column<string>(nullable: true),
AuditLogId1 = table.Column<Guid>(nullable: true)
ExtraProperties = table.Column<string>(nullable: true)
},
constraints: table =>
{
@ -216,12 +208,6 @@ namespace MyCompanyName.MyProjectName.Migrations
principalTable: "AbpAuditLogs",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_AbpEntityChanges_AbpAuditLogs_AuditLogId1",
column: x => x.AuditLogId1,
principalTable: "AbpAuditLogs",
principalColumn: "Id",
onDelete: ReferentialAction.Restrict);
});
migrationBuilder.CreateTable(
@ -368,11 +354,6 @@ namespace MyCompanyName.MyProjectName.Migrations
table: "AbpAuditLogActions",
column: "AuditLogId");
migrationBuilder.CreateIndex(
name: "IX_AbpAuditLogActions_AuditLogId1",
table: "AbpAuditLogActions",
column: "AuditLogId1");
migrationBuilder.CreateIndex(
name: "IX_AbpAuditLogActions_TenantId_ServiceName_MethodName_ExecutionTime",
table: "AbpAuditLogActions",
@ -398,11 +379,6 @@ namespace MyCompanyName.MyProjectName.Migrations
table: "AbpEntityChanges",
column: "AuditLogId");
migrationBuilder.CreateIndex(
name: "IX_AbpEntityChanges_AuditLogId1",
table: "AbpEntityChanges",
column: "AuditLogId1");
migrationBuilder.CreateIndex(
name: "IX_AbpEntityChanges_TenantId_EntityTypeFullName_EntityId",
table: "AbpEntityChanges",

20
templates/mvc/src/MyCompanyName.MyProjectName.EntityFrameworkCore/Migrations/MyProjectNameDbContextModelSnapshot.cs

@ -99,8 +99,6 @@ namespace MyCompanyName.MyProjectName.Migrations
b.Property<Guid>("AuditLogId")
.HasColumnName("AuditLogId");
b.Property<Guid?>("AuditLogId1");
b.Property<int>("ExecutionDuration")
.HasColumnName("ExecutionDuration");
@ -128,8 +126,6 @@ namespace MyCompanyName.MyProjectName.Migrations
b.HasIndex("AuditLogId");
b.HasIndex("AuditLogId1");
b.HasIndex("TenantId", "ServiceName", "MethodName", "ExecutionTime");
b.ToTable("AbpAuditLogActions");
@ -143,8 +139,6 @@ namespace MyCompanyName.MyProjectName.Migrations
b.Property<Guid>("AuditLogId")
.HasColumnName("AuditLogId");
b.Property<Guid?>("AuditLogId1");
b.Property<DateTime>("ChangeTime")
.HasColumnName("ChangeTime");
@ -171,8 +165,6 @@ namespace MyCompanyName.MyProjectName.Migrations
b.HasIndex("AuditLogId");
b.HasIndex("AuditLogId1");
b.HasIndex("TenantId", "EntityTypeFullName", "EntityId");
b.ToTable("AbpEntityChanges");
@ -606,25 +598,17 @@ namespace MyCompanyName.MyProjectName.Migrations
modelBuilder.Entity("Volo.Abp.AuditLogging.AuditLogAction", b =>
{
b.HasOne("Volo.Abp.AuditLogging.AuditLog")
.WithMany()
.WithMany("Actions")
.HasForeignKey("AuditLogId")
.OnDelete(DeleteBehavior.Cascade);
b.HasOne("Volo.Abp.AuditLogging.AuditLog")
.WithMany("Actions")
.HasForeignKey("AuditLogId1");
});
modelBuilder.Entity("Volo.Abp.AuditLogging.EntityChange", b =>
{
b.HasOne("Volo.Abp.AuditLogging.AuditLog")
.WithMany()
.WithMany("EntityChanges")
.HasForeignKey("AuditLogId")
.OnDelete(DeleteBehavior.Cascade);
b.HasOne("Volo.Abp.AuditLogging.AuditLog")
.WithMany("EntityChanges")
.HasForeignKey("AuditLogId1");
});
modelBuilder.Entity("Volo.Abp.AuditLogging.EntityPropertyChange", b =>

2
templates/mvc/src/MyCompanyName.MyProjectName.EntityFrameworkCore/MyCompanyName.MyProjectName.EntityFrameworkCore.csproj

@ -7,6 +7,8 @@
<ItemGroup>
<Compile Remove="Migrations\20181114070127_Initial.cs" />
<Compile Remove="Migrations\20181212113826_Initial.cs" />
<Compile Remove="Migrations\20181218133646_Remove_Duplicate_AuditLogId1.cs" />
</ItemGroup>
<ItemGroup>

4
templates/service/host/IdentityServerHost/IdentityServerHost.csproj

@ -25,4 +25,8 @@
<None Remove="Logs\**" />
</ItemGroup>
<ItemGroup>
<Compile Remove="Migrations\20181212121034_Initial.cs" />
</ItemGroup>
</Project>

2
templates/service/host/IdentityServerHost/Migrations/20181212121034_Initial.Designer.cs → templates/service/host/IdentityServerHost/Migrations/20181218135354_Initial.Designer.cs

@ -10,7 +10,7 @@ using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
namespace IdentityServerHost.Migrations
{
[DbContext(typeof(DemoAppDbContext))]
[Migration("20181212121034_Initial")]
[Migration("20181218135354_Initial")]
partial class Initial
{
protected override void BuildTargetModel(ModelBuilder modelBuilder)

0
templates/service/host/IdentityServerHost/Migrations/20181212121034_Initial.cs → templates/service/host/IdentityServerHost/Migrations/20181218135354_Initial.cs

22
templates/service/host/MyCompanyName.MyProjectName.Host/Migrations/20181212121232_Initial.Designer.cs → templates/service/host/MyCompanyName.MyProjectName.Host/Migrations/20181218135310_Initial.Designer.cs

@ -10,7 +10,7 @@ using MyCompanyName.MyProjectName.Host;
namespace MyCompanyName.MyProjectName.Host.Migrations
{
[DbContext(typeof(DemoAppDbContext))]
[Migration("20181212121232_Initial")]
[Migration("20181218135310_Initial")]
partial class Initial
{
protected override void BuildTargetModel(ModelBuilder modelBuilder)
@ -100,8 +100,6 @@ namespace MyCompanyName.MyProjectName.Host.Migrations
b.Property<Guid>("AuditLogId")
.HasColumnName("AuditLogId");
b.Property<Guid?>("AuditLogId1");
b.Property<int>("ExecutionDuration")
.HasColumnName("ExecutionDuration");
@ -129,8 +127,6 @@ namespace MyCompanyName.MyProjectName.Host.Migrations
b.HasIndex("AuditLogId");
b.HasIndex("AuditLogId1");
b.HasIndex("TenantId", "ServiceName", "MethodName", "ExecutionTime");
b.ToTable("AbpAuditLogActions");
@ -144,8 +140,6 @@ namespace MyCompanyName.MyProjectName.Host.Migrations
b.Property<Guid>("AuditLogId")
.HasColumnName("AuditLogId");
b.Property<Guid?>("AuditLogId1");
b.Property<DateTime>("ChangeTime")
.HasColumnName("ChangeTime");
@ -172,8 +166,6 @@ namespace MyCompanyName.MyProjectName.Host.Migrations
b.HasIndex("AuditLogId");
b.HasIndex("AuditLogId1");
b.HasIndex("TenantId", "EntityTypeFullName", "EntityId");
b.ToTable("AbpEntityChanges");
@ -272,25 +264,17 @@ namespace MyCompanyName.MyProjectName.Host.Migrations
modelBuilder.Entity("Volo.Abp.AuditLogging.AuditLogAction", b =>
{
b.HasOne("Volo.Abp.AuditLogging.AuditLog")
.WithMany()
.WithMany("Actions")
.HasForeignKey("AuditLogId")
.OnDelete(DeleteBehavior.Cascade);
b.HasOne("Volo.Abp.AuditLogging.AuditLog")
.WithMany("Actions")
.HasForeignKey("AuditLogId1");
});
modelBuilder.Entity("Volo.Abp.AuditLogging.EntityChange", b =>
{
b.HasOne("Volo.Abp.AuditLogging.AuditLog")
.WithMany()
.WithMany("EntityChanges")
.HasForeignKey("AuditLogId")
.OnDelete(DeleteBehavior.Cascade);
b.HasOne("Volo.Abp.AuditLogging.AuditLog")
.WithMany("EntityChanges")
.HasForeignKey("AuditLogId1");
});
modelBuilder.Entity("Volo.Abp.AuditLogging.EntityPropertyChange", b =>

28
templates/service/host/MyCompanyName.MyProjectName.Host/Migrations/20181212121232_Initial.cs → templates/service/host/MyCompanyName.MyProjectName.Host/Migrations/20181218135310_Initial.cs

@ -77,8 +77,7 @@ namespace MyCompanyName.MyProjectName.Host.Migrations
Parameters = table.Column<string>(maxLength: 2000, nullable: true),
ExecutionTime = table.Column<DateTime>(nullable: false),
ExecutionDuration = table.Column<int>(nullable: false),
ExtraProperties = table.Column<string>(nullable: true),
AuditLogId1 = table.Column<Guid>(nullable: true)
ExtraProperties = table.Column<string>(nullable: true)
},
constraints: table =>
{
@ -89,12 +88,6 @@ namespace MyCompanyName.MyProjectName.Host.Migrations
principalTable: "AbpAuditLogs",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_AbpAuditLogActions_AbpAuditLogs_AuditLogId1",
column: x => x.AuditLogId1,
principalTable: "AbpAuditLogs",
principalColumn: "Id",
onDelete: ReferentialAction.Restrict);
});
migrationBuilder.CreateTable(
@ -108,8 +101,7 @@ namespace MyCompanyName.MyProjectName.Host.Migrations
ChangeType = table.Column<byte>(nullable: false),
EntityId = table.Column<string>(maxLength: 128, nullable: false),
EntityTypeFullName = table.Column<string>(maxLength: 128, nullable: false),
ExtraProperties = table.Column<string>(nullable: true),
AuditLogId1 = table.Column<Guid>(nullable: true)
ExtraProperties = table.Column<string>(nullable: true)
},
constraints: table =>
{
@ -120,12 +112,6 @@ namespace MyCompanyName.MyProjectName.Host.Migrations
principalTable: "AbpAuditLogs",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_AbpEntityChanges_AbpAuditLogs_AuditLogId1",
column: x => x.AuditLogId1,
principalTable: "AbpAuditLogs",
principalColumn: "Id",
onDelete: ReferentialAction.Restrict);
});
migrationBuilder.CreateTable(
@ -163,11 +149,6 @@ namespace MyCompanyName.MyProjectName.Host.Migrations
table: "AbpAuditLogActions",
column: "AuditLogId");
migrationBuilder.CreateIndex(
name: "IX_AbpAuditLogActions_AuditLogId1",
table: "AbpAuditLogActions",
column: "AuditLogId1");
migrationBuilder.CreateIndex(
name: "IX_AbpAuditLogActions_TenantId_ServiceName_MethodName_ExecutionTime",
table: "AbpAuditLogActions",
@ -188,11 +169,6 @@ namespace MyCompanyName.MyProjectName.Host.Migrations
table: "AbpEntityChanges",
column: "AuditLogId");
migrationBuilder.CreateIndex(
name: "IX_AbpEntityChanges_AuditLogId1",
table: "AbpEntityChanges",
column: "AuditLogId1");
migrationBuilder.CreateIndex(
name: "IX_AbpEntityChanges_TenantId_EntityTypeFullName_EntityId",
table: "AbpEntityChanges",

20
templates/service/host/MyCompanyName.MyProjectName.Host/Migrations/DemoAppDbContextModelSnapshot.cs

@ -98,8 +98,6 @@ namespace MyCompanyName.MyProjectName.Host.Migrations
b.Property<Guid>("AuditLogId")
.HasColumnName("AuditLogId");
b.Property<Guid?>("AuditLogId1");
b.Property<int>("ExecutionDuration")
.HasColumnName("ExecutionDuration");
@ -127,8 +125,6 @@ namespace MyCompanyName.MyProjectName.Host.Migrations
b.HasIndex("AuditLogId");
b.HasIndex("AuditLogId1");
b.HasIndex("TenantId", "ServiceName", "MethodName", "ExecutionTime");
b.ToTable("AbpAuditLogActions");
@ -142,8 +138,6 @@ namespace MyCompanyName.MyProjectName.Host.Migrations
b.Property<Guid>("AuditLogId")
.HasColumnName("AuditLogId");
b.Property<Guid?>("AuditLogId1");
b.Property<DateTime>("ChangeTime")
.HasColumnName("ChangeTime");
@ -170,8 +164,6 @@ namespace MyCompanyName.MyProjectName.Host.Migrations
b.HasIndex("AuditLogId");
b.HasIndex("AuditLogId1");
b.HasIndex("TenantId", "EntityTypeFullName", "EntityId");
b.ToTable("AbpEntityChanges");
@ -270,25 +262,17 @@ namespace MyCompanyName.MyProjectName.Host.Migrations
modelBuilder.Entity("Volo.Abp.AuditLogging.AuditLogAction", b =>
{
b.HasOne("Volo.Abp.AuditLogging.AuditLog")
.WithMany()
.WithMany("Actions")
.HasForeignKey("AuditLogId")
.OnDelete(DeleteBehavior.Cascade);
b.HasOne("Volo.Abp.AuditLogging.AuditLog")
.WithMany("Actions")
.HasForeignKey("AuditLogId1");
});
modelBuilder.Entity("Volo.Abp.AuditLogging.EntityChange", b =>
{
b.HasOne("Volo.Abp.AuditLogging.AuditLog")
.WithMany()
.WithMany("EntityChanges")
.HasForeignKey("AuditLogId")
.OnDelete(DeleteBehavior.Cascade);
b.HasOne("Volo.Abp.AuditLogging.AuditLog")
.WithMany("EntityChanges")
.HasForeignKey("AuditLogId1");
});
modelBuilder.Entity("Volo.Abp.AuditLogging.EntityPropertyChange", b =>

4
templates/service/host/MyCompanyName.MyProjectName.Host/MyCompanyName.MyProjectName.Host.csproj

@ -30,4 +30,8 @@
<None Remove="Logs\**" />
</ItemGroup>
<ItemGroup>
<Compile Remove="Migrations\20181212121232_Initial.cs" />
</ItemGroup>
</Project>

Loading…
Cancel
Save