数据迁移结果

在这里插入图片描述abp new Meowb.Blog

abp new Meowb.Blog -aspnet-core 3.1

Microsoft.EntityFrameworkCore.Internal.SemanticVersionComparer

Add-Migration Initial -c MeowvBlogMigrationsDbContext

Update-Database -context MeowvBlogMigrationsDbContext

using System;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations;

namespace Meowv.Blog.Migrations
{
public partial class Initial : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: “meowv_Catagories”,
columns: table => new
{
Id = table.Column(type: “int”, nullable: false)
.Annotation(“MySql:ValueGenerationStrategy”, MySqlValueGenerationStrategy.IdentityColumn),
CategoryName = table.Column(type: “varchar(50) CHARACTER SET utf8mb4”, maxLength: 50, nullable: false),
DisplayName = table.Column(type: “varchar(50) CHARACTER SET utf8mb4”, maxLength: 50, nullable: false)
},
constraints: table =>
{
table.PrimaryKey(“PK_meowv_Catagories”, x => x.Id);
});

        migrationBuilder.CreateTable(
            name: "meowv_FriendLinks",
            columns: table => new
            {
                Id = table.Column<int>(type: "int", nullable: false)
                    .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
                Title = table.Column<string>(type: "varchar(20) CHARACTER SET utf8mb4", maxLength: 20, nullable: false),
                LinkUrl = table.Column<string>(type: "varchar(100) CHARACTER SET utf8mb4", maxLength: 100, nullable: false)
            },
            constraints: table =>
            {
                table.PrimaryKey("PK_meowv_FriendLinks", x => x.Id);
            });

        migrationBuilder.CreateTable(
            name: "meowv_Post_Tags",
            columns: table => new
            {
                Id = table.Column<int>(type: "int", nullable: false)
                    .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
                PostId = table.Column<int>(type: "int", nullable: false),
                TagId = table.Column<int>(type: "int", nullable: false)
            },
            constraints: table =>
            {
                table.PrimaryKey("PK_meowv_Post_Tags", x => x.Id);
            });

        migrationBuilder.CreateTable(
            name: "meowv_Posts",
            columns: table => new
            {
                Id = table.Column<int>(type: "int", nullable: false)
                    .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
                Title = table.Column<string>(type: "varchar(200) CHARACTER SET utf8mb4", maxLength: 200, nullable: false),
                Author = table.Column<string>(type: "varchar(10) CHARACTER SET utf8mb4", maxLength: 10, nullable: true),
                Url = table.Column<string>(type: "varchar(100) CHARACTER SET utf8mb4", maxLength: 100, nullable: false),
                Html = table.Column<string>(type: "longtext", nullable: false),
                Markdown = table.Column<string>(type: "longtext", nullable: false),
                CategoryId = table.Column<int>(type: "int", nullable: false),
                CreationTime = table.Column<DateTime>(type: "datetime", nullable: false)
            },
            constraints: table =>
            {
                table.PrimaryKey("PK_meowv_Posts", x => x.Id);
            });

        migrationBuilder.CreateTable(
            name: "meowv_Tags",
            columns: table => new
            {
                Id = table.Column<int>(type: "int", nullable: false)
                    .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
                TagName = table.Column<string>(type: "varchar(50) CHARACTER SET utf8mb4", maxLength: 50, nullable: false),
                DisplayName = table.Column<string>(type: "varchar(50) CHARACTER SET utf8mb4", maxLength: 50, nullable: false)
            },
            constraints: table =>
            {
                table.PrimaryKey("PK_meowv_Tags", x => x.Id);
            });
    }

    protected override void Down(MigrationBuilder migrationBuilder)
    {
        migrationBuilder.DropTable(
            name: "meowv_Catagories");

        migrationBuilder.DropTable(
            name: "meowv_FriendLinks");

        migrationBuilder.DropTable(
            name: "meowv_Post_Tags");

        migrationBuilder.DropTable(
            name: "meowv_Posts");

        migrationBuilder.DropTable(
            name: "meowv_Tags");
    }
}

}

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值