db migration fix
This commit is contained in:
parent
46798429e9
commit
c96ed74f6b
6054
RMuseum/Migrations/20260717152902_RChFix.Designer.cs
generated
Normal file
6054
RMuseum/Migrations/20260717152902_RChFix.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
91
RMuseum/Migrations/20260717152902_RChFix.cs
Normal file
91
RMuseum/Migrations/20260717152902_RChFix.cs
Normal file
@ -0,0 +1,91 @@
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace RMuseum.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class RChFix : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.CreateTable(
|
||||
name: "RChangeLogs",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
||||
WorkspaceId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
|
||||
EntityName = table.Column<string>(type: "nvarchar(16)", maxLength: 16, nullable: true),
|
||||
Operation = table.Column<string>(type: "nvarchar(24)", maxLength: 24, nullable: true),
|
||||
DateTime = table.Column<DateTime>(type: "datetime2", nullable: false),
|
||||
RAppUserId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
|
||||
Description = table.Column<string>(type: "nvarchar(128)", maxLength: 128, nullable: true),
|
||||
EntityJson = table.Column<string>(type: "nvarchar(max)", nullable: true),
|
||||
EntityUId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
|
||||
EntityId = table.Column<int>(type: "int", nullable: true)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_RChangeLogs", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_RChangeLogs_AspNetUsers_RAppUserId",
|
||||
column: x => x.RAppUserId,
|
||||
principalTable: "AspNetUsers",
|
||||
principalColumn: "Id");
|
||||
table.ForeignKey(
|
||||
name: "FK_RChangeLogs_RWorkspaces_WorkspaceId",
|
||||
column: x => x.WorkspaceId,
|
||||
principalTable: "RWorkspaces",
|
||||
principalColumn: "Id");
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "UserOldEmails",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
||||
UserId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
||||
ChangeDate = table.Column<DateTime>(type: "datetime2", nullable: false),
|
||||
Email = table.Column<string>(type: "nvarchar(max)", nullable: true),
|
||||
NormalizedEmail = table.Column<string>(type: "nvarchar(max)", nullable: true)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_UserOldEmails", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_UserOldEmails_AspNetUsers_UserId",
|
||||
column: x => x.UserId,
|
||||
principalTable: "AspNetUsers",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_RChangeLogs_RAppUserId",
|
||||
table: "RChangeLogs",
|
||||
column: "RAppUserId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_RChangeLogs_WorkspaceId",
|
||||
table: "RChangeLogs",
|
||||
column: "WorkspaceId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_UserOldEmails_UserId",
|
||||
table: "UserOldEmails",
|
||||
column: "UserId");
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropTable(
|
||||
name: "RChangeLogs");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "UserOldEmails");
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -17,7 +17,7 @@ namespace RMuseum.Migrations
|
||||
{
|
||||
#pragma warning disable 612, 618
|
||||
modelBuilder
|
||||
.HasAnnotation("ProductVersion", "9.0.2")
|
||||
.HasAnnotation("ProductVersion", "10.0.9")
|
||||
.HasAnnotation("Relational:MaxIdentifierLength", 128);
|
||||
|
||||
SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder);
|
||||
@ -4236,6 +4236,76 @@ namespace RMuseum.Migrations
|
||||
b.ToTable("VerifyQueueItems");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("RSecurityBackend.Models.Auth.Db.UserOldEmail", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<DateTime>("ChangeDate")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<string>("Email")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("NormalizedEmail")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<Guid>("UserId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("UserId");
|
||||
|
||||
b.ToTable("UserOldEmails");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("RSecurityBackend.Models.ChangeTracking.RChangeLog", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<DateTime>("DateTime")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<string>("Description")
|
||||
.HasMaxLength(128)
|
||||
.HasColumnType("nvarchar(128)");
|
||||
|
||||
b.Property<int?>("EntityId")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<string>("EntityJson")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("EntityName")
|
||||
.HasMaxLength(16)
|
||||
.HasColumnType("nvarchar(16)");
|
||||
|
||||
b.Property<Guid?>("EntityUId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<string>("Operation")
|
||||
.HasMaxLength(24)
|
||||
.HasColumnType("nvarchar(24)");
|
||||
|
||||
b.Property<Guid?>("RAppUserId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<Guid?>("WorkspaceId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("RAppUserId");
|
||||
|
||||
b.HasIndex("WorkspaceId");
|
||||
|
||||
b.ToTable("RChangeLogs");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("RSecurityBackend.Models.Cloud.RWSPermission", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
@ -4497,7 +4567,7 @@ namespace RMuseum.Migrations
|
||||
|
||||
b.ToTable("GeneralImages");
|
||||
|
||||
b.HasDiscriminator().HasValue("RImage");
|
||||
b.HasDiscriminator<string>("Discriminator").HasValue("RImage");
|
||||
|
||||
b.UseTphMappingStrategy();
|
||||
});
|
||||
@ -5760,6 +5830,32 @@ namespace RMuseum.Migrations
|
||||
b.Navigation("User");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("RSecurityBackend.Models.Auth.Db.UserOldEmail", b =>
|
||||
{
|
||||
b.HasOne("RSecurityBackend.Models.Auth.Db.RAppUser", "User")
|
||||
.WithMany()
|
||||
.HasForeignKey("UserId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("User");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("RSecurityBackend.Models.ChangeTracking.RChangeLog", b =>
|
||||
{
|
||||
b.HasOne("RSecurityBackend.Models.Auth.Db.RAppUser", "RAppUser")
|
||||
.WithMany()
|
||||
.HasForeignKey("RAppUserId");
|
||||
|
||||
b.HasOne("RSecurityBackend.Models.Cloud.RWorkspace", "Workspace")
|
||||
.WithMany()
|
||||
.HasForeignKey("WorkspaceId");
|
||||
|
||||
b.Navigation("RAppUser");
|
||||
|
||||
b.Navigation("Workspace");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("RSecurityBackend.Models.Cloud.RWSPermission", b =>
|
||||
{
|
||||
b.HasOne("RSecurityBackend.Models.Cloud.RWSRole", null)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user