Files
DugunSalonu/Migrations/20250807213526_mg5.cs
2025-08-08 12:31:51 +03:00

67 lines
2.0 KiB
C#

using Microsoft.EntityFrameworkCore.Migrations;
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
#nullable disable
namespace DugunSalonu.Migrations
{
/// <inheritdoc />
public partial class mg5 : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.RenameColumn(
name: "il",
table: "salon",
newName: "IlId");
migrationBuilder.CreateTable(
name: "il",
columns: table => new
{
id = table.Column<int>(type: "integer", nullable: false)
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
adi = table.Column<string>(type: "text", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_il", x => x.id);
});
migrationBuilder.CreateIndex(
name: "IX_salon_IlId",
table: "salon",
column: "IlId");
migrationBuilder.AddForeignKey(
name: "FK_salon_il_IlId",
table: "salon",
column: "IlId",
principalTable: "il",
principalColumn: "id",
onDelete: ReferentialAction.Cascade);
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_salon_il_IlId",
table: "salon");
migrationBuilder.DropTable(
name: "il");
migrationBuilder.DropIndex(
name: "IX_salon_IlId",
table: "salon");
migrationBuilder.RenameColumn(
name: "IlId",
table: "salon",
newName: "il");
}
}
}