using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace WebNote.Migrations
{
/// <inheritdoc />
public partial class AddSiteOwnerTable : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "SiteOwners",
columns: table => new
{
Id = table.Column<int>(type: "int", nullable: false)
.Annotation("SqlServer:Identity", "1, 1"),
Name = table.Column<string>(type: "nvarchar(100)", maxLength: 100, nullable: false),
Title = table.Column<string>(type: "nvarchar(200)", maxLength: 200, nullable: true),
Bio = table.Column<string>(type: "nvarchar(500)", maxLength: 500, nullable: true),
Resume = table.Column<string>(type: "nvarchar(max)", nullable: true),
AvatarPath = table.Column<string>(type: "nvarchar(255)", maxLength: 255, nullable: true),
Email = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true),
Mobile = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true),
GitHub = table.Column<string>(type: "nvarchar(100)", maxLength: 100, nullable: true),
QQ = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true),
CreatedAt = table.Column<DateTime>(type: "datetime2", nullable: false),
UpdatedAt = table.Column<DateTime>(type: "datetime2", nullable: true),
IsActive = table.Column<bool>(type: "bit", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_SiteOwners", x => x.Id);
});
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "SiteOwners");
}
}
}
Add-Migration AddSiteOwnerTable
Update-Database