Files
Bewerbungs-Portfolio/RazorPagesMovie/Migrations/20260826122916_DropMovieTable.cs
T
2026-08-26 15:13:58 +02:00

40 lines
1.4 KiB
C#

using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace RazorPagesMovie.Migrations
{
/// <inheritdoc />
public partial class DropMovieTable : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "Movie");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "Movie",
columns: table => new
{
Id = table.Column<int>(type: "int", nullable: false)
.Annotation("SqlServer:Identity", "1, 1"),
Genre = table.Column<string>(type: "nvarchar(30)", maxLength: 30, nullable: false),
Price = table.Column<decimal>(type: "decimal(18,2)", nullable: false),
Rating = table.Column<string>(type: "nvarchar(5)", maxLength: 5, nullable: false),
ReleaseDate = table.Column<DateTime>(type: "datetime2", nullable: false),
Title = table.Column<string>(type: "nvarchar(60)", maxLength: 60, nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_Movie", x => x.Id);
});
}
}
}