Files
zap-stream-api/NostrStreamer/Migrations/20231208131841_Clips.cs
2023-12-08 14:50:02 +00:00

49 lines
1.7 KiB
C#

using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace NostrStreamer.Migrations
{
/// <inheritdoc />
public partial class Clips : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "Clips",
columns: table => new
{
Id = table.Column<Guid>(type: "uuid", nullable: false),
UserStreamId = table.Column<Guid>(type: "uuid", nullable: false),
Created = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),
TakenByPubkey = table.Column<string>(type: "text", nullable: false),
Url = table.Column<string>(type: "text", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_Clips", x => x.Id);
table.ForeignKey(
name: "FK_Clips_Streams_UserStreamId",
column: x => x.UserStreamId,
principalTable: "Streams",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateIndex(
name: "IX_Clips_UserStreamId",
table: "Clips",
column: "UserStreamId");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "Clips");
}
}
}