ddd
This commit is contained in:
66
Migrations/20250807213526_mg5.cs
Normal file
66
Migrations/20250807213526_mg5.cs
Normal file
@@ -0,0 +1,66 @@
|
||||
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");
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user