Files
Yi.Admin/CC.Yi/CC.Yi.API/Migrations/20210526080428_yi2.cs

42 lines
1.4 KiB
C#
Raw Normal View History

2021-03-20 14:12:24 +08:00
using Microsoft.EntityFrameworkCore.Migrations;
namespace CC.Yi.API.Migrations
{
2021-05-31 21:41:27 +08:00
public partial class yi2 : Migration
2021-03-20 14:12:24 +08:00
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
2021-05-31 21:41:27 +08:00
name: "prop",
2021-03-20 14:12:24 +08:00
columns: table => new
{
2021-05-13 01:39:34 +08:00
id = table.Column<int>(type: "INTEGER", nullable: false)
.Annotation("Sqlite:Autoincrement", true),
2021-05-31 21:41:27 +08:00
name = table.Column<string>(type: "TEXT", nullable: true),
studentid = table.Column<int>(type: "INTEGER", nullable: true)
2021-03-20 14:12:24 +08:00
},
constraints: table =>
{
2021-05-31 21:41:27 +08:00
table.PrimaryKey("PK_prop", x => x.id);
table.ForeignKey(
name: "FK_prop_student_studentid",
column: x => x.studentid,
principalTable: "student",
principalColumn: "id",
onDelete: ReferentialAction.Restrict);
2021-03-20 14:12:24 +08:00
});
2021-05-31 21:41:27 +08:00
migrationBuilder.CreateIndex(
name: "IX_prop_studentid",
table: "prop",
column: "studentid");
2021-03-20 14:12:24 +08:00
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
2021-05-31 21:41:27 +08:00
name: "prop");
2021-03-20 14:12:24 +08:00
}
}
}