database migration
This commit is contained in:
parent
262b452a9c
commit
d48222c983
5492
RMuseum/Migrations/20231123175639_DotNet8.Designer.cs
generated
Normal file
5492
RMuseum/Migrations/20231123175639_DotNet8.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
235
RMuseum/Migrations/20231123175639_DotNet8.cs
Normal file
235
RMuseum/Migrations/20231123175639_DotNet8.cs
Normal file
@ -0,0 +1,235 @@
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace RMuseum.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class DotNet8 : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AlterColumn<string>(
|
||||
name: "Discriminator",
|
||||
table: "GeneralImages",
|
||||
type: "nvarchar(13)",
|
||||
maxLength: 13,
|
||||
nullable: false,
|
||||
oldClrType: typeof(string),
|
||||
oldType: "nvarchar(max)");
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "RWorkspaces",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
||||
Name = table.Column<string>(type: "nvarchar(max)", nullable: true),
|
||||
Description = table.Column<string>(type: "nvarchar(max)", nullable: true),
|
||||
CreateDate = table.Column<DateTime>(type: "datetime2", nullable: false),
|
||||
Active = table.Column<bool>(type: "bit", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_RWorkspaces", x => x.Id);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "RWSRoles",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
||||
WorkspaceId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
|
||||
Description = table.Column<string>(type: "nvarchar(max)", nullable: true),
|
||||
Name = table.Column<string>(type: "nvarchar(max)", nullable: true),
|
||||
NormalizedName = table.Column<string>(type: "nvarchar(max)", nullable: true),
|
||||
ConcurrencyStamp = table.Column<string>(type: "nvarchar(max)", nullable: true)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_RWSRoles", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_RWSRoles_RWorkspaces_WorkspaceId",
|
||||
column: x => x.WorkspaceId,
|
||||
principalTable: "RWorkspaces",
|
||||
principalColumn: "Id");
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "RWSUsers",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
||||
RAppUserId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
|
||||
Status = table.Column<int>(type: "int", nullable: false),
|
||||
InviteDate = table.Column<DateTime>(type: "datetime2", nullable: false),
|
||||
MemberFrom = table.Column<DateTime>(type: "datetime2", nullable: true),
|
||||
RWorkspaceId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
|
||||
WorkspaceOrder = table.Column<int>(type: "int", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_RWSUsers", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_RWSUsers_AspNetUsers_RAppUserId",
|
||||
column: x => x.RAppUserId,
|
||||
principalTable: "AspNetUsers",
|
||||
principalColumn: "Id");
|
||||
table.ForeignKey(
|
||||
name: "FK_RWSUsers_RWorkspaces_RWorkspaceId",
|
||||
column: x => x.RWorkspaceId,
|
||||
principalTable: "RWorkspaces",
|
||||
principalColumn: "Id");
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "WorkspaceUserInvitations",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
||||
UserId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
||||
WorkspaceId = table.Column<Guid>(type: "uniqueidentifier", nullable: true)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_WorkspaceUserInvitations", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_WorkspaceUserInvitations_AspNetUsers_UserId",
|
||||
column: x => x.UserId,
|
||||
principalTable: "AspNetUsers",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
table.ForeignKey(
|
||||
name: "FK_WorkspaceUserInvitations_RWorkspaces_WorkspaceId",
|
||||
column: x => x.WorkspaceId,
|
||||
principalTable: "RWorkspaces",
|
||||
principalColumn: "Id");
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "RWSPermissions",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
||||
SecurableItemShortName = table.Column<string>(type: "nvarchar(max)", nullable: true),
|
||||
OperationShortName = table.Column<string>(type: "nvarchar(max)", nullable: true),
|
||||
RWSRoleId = table.Column<Guid>(type: "uniqueidentifier", nullable: true)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_RWSPermissions", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_RWSPermissions_RWSRoles_RWSRoleId",
|
||||
column: x => x.RWSRoleId,
|
||||
principalTable: "RWSRoles",
|
||||
principalColumn: "Id");
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "RWSUserRoles",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
||||
WorkspaceId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
|
||||
UserId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
|
||||
RoleId = table.Column<Guid>(type: "uniqueidentifier", nullable: true)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_RWSUserRoles", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_RWSUserRoles_AspNetUsers_UserId",
|
||||
column: x => x.UserId,
|
||||
principalTable: "AspNetUsers",
|
||||
principalColumn: "Id");
|
||||
table.ForeignKey(
|
||||
name: "FK_RWSUserRoles_RWSRoles_RoleId",
|
||||
column: x => x.RoleId,
|
||||
principalTable: "RWSRoles",
|
||||
principalColumn: "Id");
|
||||
table.ForeignKey(
|
||||
name: "FK_RWSUserRoles_RWorkspaces_WorkspaceId",
|
||||
column: x => x.WorkspaceId,
|
||||
principalTable: "RWorkspaces",
|
||||
principalColumn: "Id");
|
||||
});
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_RWSPermissions_RWSRoleId",
|
||||
table: "RWSPermissions",
|
||||
column: "RWSRoleId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_RWSRoles_WorkspaceId",
|
||||
table: "RWSRoles",
|
||||
column: "WorkspaceId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_RWSUserRoles_RoleId",
|
||||
table: "RWSUserRoles",
|
||||
column: "RoleId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_RWSUserRoles_UserId",
|
||||
table: "RWSUserRoles",
|
||||
column: "UserId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_RWSUserRoles_WorkspaceId",
|
||||
table: "RWSUserRoles",
|
||||
column: "WorkspaceId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_RWSUsers_RAppUserId",
|
||||
table: "RWSUsers",
|
||||
column: "RAppUserId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_RWSUsers_RWorkspaceId",
|
||||
table: "RWSUsers",
|
||||
column: "RWorkspaceId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_WorkspaceUserInvitations_UserId",
|
||||
table: "WorkspaceUserInvitations",
|
||||
column: "UserId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_WorkspaceUserInvitations_WorkspaceId",
|
||||
table: "WorkspaceUserInvitations",
|
||||
column: "WorkspaceId");
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropTable(
|
||||
name: "RWSPermissions");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "RWSUserRoles");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "RWSUsers");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "WorkspaceUserInvitations");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "RWSRoles");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "RWorkspaces");
|
||||
|
||||
migrationBuilder.AlterColumn<string>(
|
||||
name: "Discriminator",
|
||||
table: "GeneralImages",
|
||||
type: "nvarchar(max)",
|
||||
nullable: false,
|
||||
oldClrType: typeof(string),
|
||||
oldType: "nvarchar(13)",
|
||||
oldMaxLength: 13);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -17,7 +17,7 @@ namespace RMuseum.Migrations
|
||||
{
|
||||
#pragma warning disable 612, 618
|
||||
modelBuilder
|
||||
.HasAnnotation("ProductVersion", "7.0.9")
|
||||
.HasAnnotation("ProductVersion", "8.0.0")
|
||||
.HasAnnotation("Relational:MaxIdentifierLength", 128);
|
||||
|
||||
SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder);
|
||||
@ -3810,6 +3810,159 @@ namespace RMuseum.Migrations
|
||||
b.ToTable("VerifyQueueItems");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("RSecurityBackend.Models.Cloud.RWSPermission", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<string>("OperationShortName")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<Guid?>("RWSRoleId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<string>("SecurableItemShortName")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("RWSRoleId");
|
||||
|
||||
b.ToTable("RWSPermissions");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("RSecurityBackend.Models.Cloud.RWSRole", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<string>("ConcurrencyStamp")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("Description")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("Name")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("NormalizedName")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<Guid?>("WorkspaceId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("WorkspaceId");
|
||||
|
||||
b.ToTable("RWSRoles");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("RSecurityBackend.Models.Cloud.RWSUser", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<DateTime>("InviteDate")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<DateTime?>("MemberFrom")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<Guid?>("RAppUserId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<Guid?>("RWorkspaceId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<int>("Status")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("WorkspaceOrder")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("RAppUserId");
|
||||
|
||||
b.HasIndex("RWorkspaceId");
|
||||
|
||||
b.ToTable("RWSUsers");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("RSecurityBackend.Models.Cloud.RWSUserRole", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<Guid?>("RoleId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<Guid?>("UserId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<Guid?>("WorkspaceId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("RoleId");
|
||||
|
||||
b.HasIndex("UserId");
|
||||
|
||||
b.HasIndex("WorkspaceId");
|
||||
|
||||
b.ToTable("RWSUserRoles");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("RSecurityBackend.Models.Cloud.RWorkspace", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<bool>("Active")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<DateTime>("CreateDate")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<string>("Description")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("Name")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("RWorkspaces");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("RSecurityBackend.Models.Cloud.WorkspaceUserInvitation", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<Guid>("UserId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<Guid?>("WorkspaceId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("UserId");
|
||||
|
||||
b.HasIndex("WorkspaceId");
|
||||
|
||||
b.ToTable("WorkspaceUserInvitations");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("RSecurityBackend.Models.Generic.Db.RGenericOption", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
@ -3882,7 +4035,8 @@ namespace RMuseum.Migrations
|
||||
|
||||
b.Property<string>("Discriminator")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
.HasMaxLength(13)
|
||||
.HasColumnType("nvarchar(13)");
|
||||
|
||||
b.Property<long>("FileSizeInBytes")
|
||||
.HasColumnType("bigint");
|
||||
@ -5141,6 +5295,73 @@ namespace RMuseum.Migrations
|
||||
b.Navigation("User");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("RSecurityBackend.Models.Cloud.RWSPermission", b =>
|
||||
{
|
||||
b.HasOne("RSecurityBackend.Models.Cloud.RWSRole", null)
|
||||
.WithMany("Permissions")
|
||||
.HasForeignKey("RWSRoleId");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("RSecurityBackend.Models.Cloud.RWSRole", b =>
|
||||
{
|
||||
b.HasOne("RSecurityBackend.Models.Cloud.RWorkspace", "Workspace")
|
||||
.WithMany()
|
||||
.HasForeignKey("WorkspaceId");
|
||||
|
||||
b.Navigation("Workspace");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("RSecurityBackend.Models.Cloud.RWSUser", b =>
|
||||
{
|
||||
b.HasOne("RSecurityBackend.Models.Auth.Db.RAppUser", "RAppUser")
|
||||
.WithMany()
|
||||
.HasForeignKey("RAppUserId");
|
||||
|
||||
b.HasOne("RSecurityBackend.Models.Cloud.RWorkspace", null)
|
||||
.WithMany("Members")
|
||||
.HasForeignKey("RWorkspaceId");
|
||||
|
||||
b.Navigation("RAppUser");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("RSecurityBackend.Models.Cloud.RWSUserRole", b =>
|
||||
{
|
||||
b.HasOne("RSecurityBackend.Models.Cloud.RWSRole", "Role")
|
||||
.WithMany()
|
||||
.HasForeignKey("RoleId");
|
||||
|
||||
b.HasOne("RSecurityBackend.Models.Auth.Db.RAppUser", "User")
|
||||
.WithMany()
|
||||
.HasForeignKey("UserId");
|
||||
|
||||
b.HasOne("RSecurityBackend.Models.Cloud.RWorkspace", "Workspace")
|
||||
.WithMany()
|
||||
.HasForeignKey("WorkspaceId");
|
||||
|
||||
b.Navigation("Role");
|
||||
|
||||
b.Navigation("User");
|
||||
|
||||
b.Navigation("Workspace");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("RSecurityBackend.Models.Cloud.WorkspaceUserInvitation", b =>
|
||||
{
|
||||
b.HasOne("RSecurityBackend.Models.Auth.Db.RAppUser", "User")
|
||||
.WithMany()
|
||||
.HasForeignKey("UserId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("RSecurityBackend.Models.Cloud.RWorkspace", "Workspace")
|
||||
.WithMany()
|
||||
.HasForeignKey("WorkspaceId");
|
||||
|
||||
b.Navigation("User");
|
||||
|
||||
b.Navigation("Workspace");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("RSecurityBackend.Models.Generic.Db.RGenericOption", b =>
|
||||
{
|
||||
b.HasOne("RSecurityBackend.Models.Auth.Db.RAppUser", "RAppUser")
|
||||
@ -5252,6 +5473,16 @@ namespace RMuseum.Migrations
|
||||
{
|
||||
b.Navigation("Permissions");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("RSecurityBackend.Models.Cloud.RWSRole", b =>
|
||||
{
|
||||
b.Navigation("Permissions");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("RSecurityBackend.Models.Cloud.RWorkspace", b =>
|
||||
{
|
||||
b.Navigation("Members");
|
||||
});
|
||||
#pragma warning restore 612, 618
|
||||
}
|
||||
}
|
||||
|
||||
@ -3565,6 +3565,18 @@
|
||||
<member name="M:RMuseum.Migrations.QResultId.BuildTargetModel(Microsoft.EntityFrameworkCore.ModelBuilder)">
|
||||
<inheritdoc />
|
||||
</member>
|
||||
<member name="T:RMuseum.Migrations.DotNet8">
|
||||
<inheritdoc />
|
||||
</member>
|
||||
<member name="M:RMuseum.Migrations.DotNet8.Up(Microsoft.EntityFrameworkCore.Migrations.MigrationBuilder)">
|
||||
<inheritdoc />
|
||||
</member>
|
||||
<member name="M:RMuseum.Migrations.DotNet8.Down(Microsoft.EntityFrameworkCore.Migrations.MigrationBuilder)">
|
||||
<inheritdoc />
|
||||
</member>
|
||||
<member name="M:RMuseum.Migrations.DotNet8.BuildTargetModel(Microsoft.EntityFrameworkCore.ModelBuilder)">
|
||||
<inheritdoc />
|
||||
</member>
|
||||
<member name="T:RMuseum.Models.Accounting.DonationExpenditure">
|
||||
<summary>
|
||||
donation expenditures
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
{
|
||||
"sdk": {
|
||||
"version": "7.0.400"
|
||||
"version": "8.0.100"
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user