Files
zap-stream-api/NostrStreamer/Migrations/20231207193950_Forwards.cs
2023-12-07 22:46:36 +00:00

48 lines
1.6 KiB
C#

using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace NostrStreamer.Migrations
{
/// <inheritdoc />
public partial class Forwards : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "Forwards",
columns: table => new
{
Id = table.Column<Guid>(type: "uuid", nullable: false),
UserPubkey = table.Column<string>(type: "text", nullable: false),
Name = table.Column<string>(type: "text", nullable: false),
Target = table.Column<string>(type: "text", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_Forwards", x => x.Id);
table.ForeignKey(
name: "FK_Forwards_Users_UserPubkey",
column: x => x.UserPubkey,
principalTable: "Users",
principalColumn: "PubKey",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateIndex(
name: "IX_Forwards_UserPubkey",
table: "Forwards",
column: "UserPubkey");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "Forwards");
}
}
}