37 lines
1.3 KiB
C#
37 lines
1.3 KiB
C#
using System;
|
|
using Microsoft.EntityFrameworkCore.Migrations;
|
|
|
|
namespace Infrastructure.Migrations
|
|
{
|
|
public partial class CreateCommentVote : Migration
|
|
{
|
|
protected override void Up(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.CreateTable(
|
|
name: "comment_votes",
|
|
columns: table => new
|
|
{
|
|
CommentId = table.Column<Guid>(type: "TEXT", nullable: false),
|
|
Type = table.Column<int>(type: "INTEGER", nullable: false),
|
|
CreatedAt = table.Column<DateTime>(type: "TEXT", nullable: false)
|
|
},
|
|
constraints: table =>
|
|
{
|
|
table.PrimaryKey("PK_comment_votes", x => x.CommentId);
|
|
table.ForeignKey(
|
|
name: "FK_comment_votes_comments_CommentId",
|
|
column: x => x.CommentId,
|
|
principalTable: "comments",
|
|
principalColumn: "Id",
|
|
onDelete: ReferentialAction.Cascade);
|
|
});
|
|
}
|
|
|
|
protected override void Down(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.DropTable(
|
|
name: "comment_votes");
|
|
}
|
|
}
|
|
}
|