using Microsoft.EntityFrameworkCore.Migrations; using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; #nullable disable namespace DugunSalonu.Migrations { /// public partial class mg5 : Migration { /// protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.RenameColumn( name: "il", table: "salon", newName: "IlId"); migrationBuilder.CreateTable( name: "il", columns: table => new { id = table.Column(type: "integer", nullable: false) .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), adi = table.Column(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); } /// 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"); } } }