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(type: "TEXT", nullable: false), Type = table.Column(type: "INTEGER", nullable: false), CreatedAt = table.Column(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"); } } }