divan/RMuseum/Migrations/20220207162117_PoetPhotoDbModel.cs
Anas Rashid 532d005cdb Rename Ganjoor -> Divan throughout the code
Projects (GanjooRazor -> DivanRazor, GanjoorService.sln -> DivanService.sln), files,
folders, classes, namespaces, settings, API routes (/api/divan) and DB tables (Divan*).
External addresses (ganjoor.net, github.com/ganjoor) unchanged. Migrations renamed
consistently (no pending model changes); requires a fresh database.
Upstream RUNNING_LOCALLY/SEMANTIC_SEARCH docs archived unmodified under docs/.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-04 23:49:01 +02:00

69 lines
2.9 KiB
C#

using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace RMuseum.Migrations
{
public partial class PoetPhotoDbModel : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "DivanPoetSuggestedPictures",
columns: table => new
{
Id = table.Column<int>(type: "int", nullable: false)
.Annotation("SqlServer:Identity", "1, 1"),
PoetId = table.Column<int>(type: "int", nullable: false),
PicOrder = table.Column<int>(type: "int", nullable: false),
PictureId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
SuggestedById = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
Published = table.Column<bool>(type: "bit", nullable: false),
ChosenOne = table.Column<bool>(type: "bit", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_DivanPoetSuggestedPictures", x => x.Id);
table.ForeignKey(
name: "FK_DivanPoetSuggestedPictures_AspNetUsers_SuggestedById",
column: x => x.SuggestedById,
principalTable: "AspNetUsers",
principalColumn: "Id");
table.ForeignKey(
name: "FK_DivanPoetSuggestedPictures_DivanPoets_PoetId",
column: x => x.PoetId,
principalTable: "DivanPoets",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_DivanPoetSuggestedPictures_GeneralImages_PictureId",
column: x => x.PictureId,
principalTable: "GeneralImages",
principalColumn: "Id");
});
migrationBuilder.CreateIndex(
name: "IX_DivanPoetSuggestedPictures_PictureId",
table: "DivanPoetSuggestedPictures",
column: "PictureId");
migrationBuilder.CreateIndex(
name: "IX_DivanPoetSuggestedPictures_PoetId",
table: "DivanPoetSuggestedPictures",
column: "PoetId");
migrationBuilder.CreateIndex(
name: "IX_DivanPoetSuggestedPictures_SuggestedById",
table: "DivanPoetSuggestedPictures",
column: "SuggestedById");
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "DivanPoetSuggestedPictures");
}
}
}