Projects (GanjooRazor -> DiwanRazor, GanjoorService.sln -> DiwanService.sln), files, folders, classes, namespaces, settings, API routes (/api/diwan) and DB tables (Diwan*). 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>
55 lines
2.0 KiB
C#
55 lines
2.0 KiB
C#
using System;
|
|
using Microsoft.EntityFrameworkCore.Migrations;
|
|
|
|
#nullable disable
|
|
|
|
namespace RMuseum.Migrations
|
|
{
|
|
public partial class UserVisitsModel : Migration
|
|
{
|
|
protected override void Up(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.CreateTable(
|
|
name: "DiwanUserPoemVisits",
|
|
columns: table => new
|
|
{
|
|
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
|
UserId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
|
|
PoemId = table.Column<int>(type: "int", nullable: false),
|
|
DateTime = table.Column<DateTime>(type: "datetime2", nullable: false)
|
|
},
|
|
constraints: table =>
|
|
{
|
|
table.PrimaryKey("PK_DiwanUserPoemVisits", x => x.Id);
|
|
table.ForeignKey(
|
|
name: "FK_DiwanUserPoemVisits_AspNetUsers_UserId",
|
|
column: x => x.UserId,
|
|
principalTable: "AspNetUsers",
|
|
principalColumn: "Id");
|
|
table.ForeignKey(
|
|
name: "FK_DiwanUserPoemVisits_DiwanPoems_PoemId",
|
|
column: x => x.PoemId,
|
|
principalTable: "DiwanPoems",
|
|
principalColumn: "Id",
|
|
onDelete: ReferentialAction.Cascade);
|
|
});
|
|
|
|
migrationBuilder.CreateIndex(
|
|
name: "IX_DiwanUserPoemVisits_PoemId",
|
|
table: "DiwanUserPoemVisits",
|
|
column: "PoemId");
|
|
|
|
migrationBuilder.CreateIndex(
|
|
name: "IX_DiwanUserPoemVisits_UserId",
|
|
table: "DiwanUserPoemVisits",
|
|
column: "UserId");
|
|
}
|
|
|
|
protected override void Down(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.DropTable(
|
|
name: "DiwanUserPoemVisits");
|
|
}
|
|
}
|
|
}
|