hn-dotnet/Infrastructure/Migrations/20201210094301_CreateLinkVote.cs
2020-12-10 11:43:47 +01:00

37 lines
1.3 KiB
C#

using System;
using Microsoft.EntityFrameworkCore.Migrations;
namespace Infrastructure.Migrations
{
public partial class CreateLinkVote : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "link_votes",
columns: table => new
{
LinkId = 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_link_votes", x => x.LinkId);
table.ForeignKey(
name: "FK_link_votes_links_LinkId",
column: x => x.LinkId,
principalTable: "links",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "link_votes");
}
}
}