#106 site banner db migration
This commit is contained in:
parent
a3d82ad01f
commit
1f90b8044e
2319
RMuseum/Migrations/20210422113841_SiteBanner.Designer.cs
generated
Normal file
2319
RMuseum/Migrations/20210422113841_SiteBanner.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
44
RMuseum/Migrations/20210422113841_SiteBanner.cs
Normal file
44
RMuseum/Migrations/20210422113841_SiteBanner.cs
Normal file
@ -0,0 +1,44 @@
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
namespace RMuseum.Migrations
|
||||
{
|
||||
public partial class SiteBanner : Migration
|
||||
{
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.CreateTable(
|
||||
name: "GanjoorSiteBanners",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<int>(nullable: false)
|
||||
.Annotation("SqlServer:Identity", "1, 1"),
|
||||
RImageId = table.Column<Guid>(nullable: false),
|
||||
AlternateText = table.Column<string>(nullable: true),
|
||||
TargetUrl = table.Column<string>(nullable: true),
|
||||
Active = table.Column<bool>(nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_GanjoorSiteBanners", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_GanjoorSiteBanners_GeneralImages_RImageId",
|
||||
column: x => x.RImageId,
|
||||
principalTable: "GeneralImages",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_GanjoorSiteBanners_RImageId",
|
||||
table: "GanjoorSiteBanners",
|
||||
column: "RImageId");
|
||||
}
|
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropTable(
|
||||
name: "GanjoorSiteBanners");
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -671,6 +671,32 @@ namespace RMuseum.Migrations
|
||||
b.ToTable("GanjoorPoets");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("RMuseum.Models.Ganjoor.GanjoorSiteBanner", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int")
|
||||
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
|
||||
|
||||
b.Property<bool>("Active")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<string>("AlternateText")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<Guid>("RImageId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<string>("TargetUrl")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("RImageId");
|
||||
|
||||
b.ToTable("GanjoorSiteBanners");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("RMuseum.Models.Ganjoor.GanjoorVerse", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
@ -2038,6 +2064,15 @@ namespace RMuseum.Migrations
|
||||
.HasForeignKey("RImageId");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("RMuseum.Models.Ganjoor.GanjoorSiteBanner", b =>
|
||||
{
|
||||
b.HasOne("RSecurityBackend.Models.Image.RImage", "RImage")
|
||||
.WithMany()
|
||||
.HasForeignKey("RImageId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
});
|
||||
|
||||
modelBuilder.Entity("RMuseum.Models.Ganjoor.GanjoorVerse", b =>
|
||||
{
|
||||
b.HasOne("RMuseum.Models.Ganjoor.GanjoorPoem", "Poem")
|
||||
|
||||
Loading…
Reference in New Issue
Block a user