48 lines
1.6 KiB
C#
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");
|
|
}
|
|
}
|
|
}
|