我正在学习learn.microsoft.com上的EF Core with MVC教程。
我有以下迁移:
using Microsoft.EntityFrameworkCore.Migrations;
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
#nullable disable
namespace ContosoUniversity.Migrations
{
public partial class ComplexDataModel : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AlterColumn<DateTime>(
name: "EnrollmentDate",
table: "Student",
type: "timestamp with time zone",
nullable: true,
oldClrType: typeof(DateTime),
oldType: "timestamp with time zone"
);
migrationBuilder.AlterColumn<string>(
name: "Title",
table: "Course",
type: "character varying(50)",
maxLength: 50,
nullable: false,
oldClrType: typeof(string),
oldType: "text"
);
// migrationBuilder.AddColumn<int>(
// name: "DepartmentID",
// table: "Course",
// type: "integer",
// nullable: …Run Code Online (Sandbox Code Playgroud)