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>
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: "DivanUserPoemVisits",
|
|
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_DivanUserPoemVisits", x => x.Id);
|
|
table.ForeignKey(
|
|
name: "FK_DivanUserPoemVisits_AspNetUsers_UserId",
|
|
column: x => x.UserId,
|
|
principalTable: "AspNetUsers",
|
|
principalColumn: "Id");
|
|
table.ForeignKey(
|
|
name: "FK_DivanUserPoemVisits_DivanPoems_PoemId",
|
|
column: x => x.PoemId,
|
|
principalTable: "DivanPoems",
|
|
principalColumn: "Id",
|
|
onDelete: ReferentialAction.Cascade);
|
|
});
|
|
|
|
migrationBuilder.CreateIndex(
|
|
name: "IX_DivanUserPoemVisits_PoemId",
|
|
table: "DivanUserPoemVisits",
|
|
column: "PoemId");
|
|
|
|
migrationBuilder.CreateIndex(
|
|
name: "IX_DivanUserPoemVisits_UserId",
|
|
table: "DivanUserPoemVisits",
|
|
column: "UserId");
|
|
}
|
|
|
|
protected override void Down(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.DropTable(
|
|
name: "DivanUserPoemVisits");
|
|
}
|
|
}
|
|
}
|