Push notifications
This commit is contained in:
67
NostrStreamer/Migrations/20231218112430_PushSubscriptions.cs
Normal file
67
NostrStreamer/Migrations/20231218112430_PushSubscriptions.cs
Normal file
@ -0,0 +1,67 @@
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace NostrStreamer.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class PushSubscriptions : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.CreateTable(
|
||||
name: "PushSubscriptions",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<Guid>(type: "uuid", nullable: false),
|
||||
Created = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),
|
||||
LastUsed = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),
|
||||
Pubkey = table.Column<string>(type: "character varying(64)", maxLength: 64, nullable: false),
|
||||
Endpoint = table.Column<string>(type: "text", nullable: false),
|
||||
Key = table.Column<string>(type: "text", nullable: false),
|
||||
Auth = table.Column<string>(type: "text", nullable: false),
|
||||
Scope = table.Column<string>(type: "text", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_PushSubscriptions", x => x.Id);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "PushSubscriptionTargets",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<Guid>(type: "uuid", nullable: false),
|
||||
SubscriberPubkey = table.Column<string>(type: "character varying(64)", maxLength: 64, nullable: false),
|
||||
TargetPubkey = table.Column<string>(type: "character varying(64)", maxLength: 64, nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_PushSubscriptionTargets", x => x.Id);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_PushSubscriptionTargets_SubscriberPubkey_TargetPubkey",
|
||||
table: "PushSubscriptionTargets",
|
||||
columns: new[] { "SubscriberPubkey", "TargetPubkey" },
|
||||
unique: true);
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_PushSubscriptionTargets_TargetPubkey",
|
||||
table: "PushSubscriptionTargets",
|
||||
column: "TargetPubkey");
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropTable(
|
||||
name: "PushSubscriptions");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "PushSubscriptionTargets");
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user