🗃️ Merge migrations in sphere
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -1,350 +0,0 @@
|
|||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using DysonNetwork.Shared.Models;
|
|
||||||
using Microsoft.EntityFrameworkCore.Migrations;
|
|
||||||
using NodaTime;
|
|
||||||
|
|
||||||
#nullable disable
|
|
||||||
|
|
||||||
namespace DysonNetwork.Sphere.Migrations
|
|
||||||
{
|
|
||||||
/// <inheritdoc />
|
|
||||||
public partial class AddActivityPub : Migration
|
|
||||||
{
|
|
||||||
/// <inheritdoc />
|
|
||||||
protected override void Up(MigrationBuilder migrationBuilder)
|
|
||||||
{
|
|
||||||
migrationBuilder.AddColumn<Dictionary<string, object>>(
|
|
||||||
name: "meta",
|
|
||||||
table: "publishers",
|
|
||||||
type: "jsonb",
|
|
||||||
nullable: true);
|
|
||||||
|
|
||||||
migrationBuilder.CreateTable(
|
|
||||||
name: "fediverse_instances",
|
|
||||||
columns: table => new
|
|
||||||
{
|
|
||||||
id = table.Column<Guid>(type: "uuid", nullable: false),
|
|
||||||
domain = table.Column<string>(type: "character varying(256)", maxLength: 256, nullable: false),
|
|
||||||
name = table.Column<string>(type: "character varying(512)", maxLength: 512, nullable: true),
|
|
||||||
description = table.Column<string>(type: "character varying(4096)", maxLength: 4096, nullable: true),
|
|
||||||
software = table.Column<string>(type: "character varying(2048)", maxLength: 2048, nullable: true),
|
|
||||||
version = table.Column<string>(type: "character varying(2048)", maxLength: 2048, nullable: true),
|
|
||||||
metadata = table.Column<Dictionary<string, object>>(type: "jsonb", nullable: true),
|
|
||||||
is_blocked = table.Column<bool>(type: "boolean", nullable: false),
|
|
||||||
is_silenced = table.Column<bool>(type: "boolean", nullable: false),
|
|
||||||
block_reason = table.Column<string>(type: "character varying(2048)", maxLength: 2048, nullable: true),
|
|
||||||
last_fetched_at = table.Column<Instant>(type: "timestamp with time zone", nullable: true),
|
|
||||||
last_activity_at = table.Column<Instant>(type: "timestamp with time zone", nullable: true),
|
|
||||||
created_at = table.Column<Instant>(type: "timestamp with time zone", nullable: false),
|
|
||||||
updated_at = table.Column<Instant>(type: "timestamp with time zone", nullable: false),
|
|
||||||
deleted_at = table.Column<Instant>(type: "timestamp with time zone", nullable: true)
|
|
||||||
},
|
|
||||||
constraints: table =>
|
|
||||||
{
|
|
||||||
table.PrimaryKey("pk_fediverse_instances", x => x.id);
|
|
||||||
});
|
|
||||||
|
|
||||||
migrationBuilder.CreateTable(
|
|
||||||
name: "fediverse_actors",
|
|
||||||
columns: table => new
|
|
||||||
{
|
|
||||||
id = table.Column<Guid>(type: "uuid", nullable: false),
|
|
||||||
uri = table.Column<string>(type: "character varying(2048)", maxLength: 2048, nullable: false),
|
|
||||||
username = table.Column<string>(type: "character varying(256)", maxLength: 256, nullable: false),
|
|
||||||
display_name = table.Column<string>(type: "character varying(2048)", maxLength: 2048, nullable: true),
|
|
||||||
bio = table.Column<string>(type: "character varying(4096)", maxLength: 4096, nullable: true),
|
|
||||||
inbox_uri = table.Column<string>(type: "character varying(2048)", maxLength: 2048, nullable: true),
|
|
||||||
outbox_uri = table.Column<string>(type: "character varying(2048)", maxLength: 2048, nullable: true),
|
|
||||||
followers_uri = table.Column<string>(type: "character varying(2048)", maxLength: 2048, nullable: true),
|
|
||||||
following_uri = table.Column<string>(type: "character varying(2048)", maxLength: 2048, nullable: true),
|
|
||||||
featured_uri = table.Column<string>(type: "character varying(2048)", maxLength: 2048, nullable: true),
|
|
||||||
public_key_id = table.Column<string>(type: "character varying(2048)", maxLength: 2048, nullable: true),
|
|
||||||
public_key = table.Column<string>(type: "character varying(8192)", maxLength: 8192, nullable: true),
|
|
||||||
metadata = table.Column<Dictionary<string, object>>(type: "jsonb", nullable: true),
|
|
||||||
avatar_url = table.Column<string>(type: "character varying(2048)", maxLength: 2048, nullable: true),
|
|
||||||
header_url = table.Column<string>(type: "character varying(2048)", maxLength: 2048, nullable: true),
|
|
||||||
is_bot = table.Column<bool>(type: "boolean", nullable: false),
|
|
||||||
is_locked = table.Column<bool>(type: "boolean", nullable: false),
|
|
||||||
is_discoverable = table.Column<bool>(type: "boolean", nullable: false),
|
|
||||||
instance_id = table.Column<Guid>(type: "uuid", nullable: false),
|
|
||||||
last_fetched_at = table.Column<Instant>(type: "timestamp with time zone", nullable: true),
|
|
||||||
last_activity_at = table.Column<Instant>(type: "timestamp with time zone", nullable: true),
|
|
||||||
created_at = table.Column<Instant>(type: "timestamp with time zone", nullable: false),
|
|
||||||
updated_at = table.Column<Instant>(type: "timestamp with time zone", nullable: false),
|
|
||||||
deleted_at = table.Column<Instant>(type: "timestamp with time zone", nullable: true)
|
|
||||||
},
|
|
||||||
constraints: table =>
|
|
||||||
{
|
|
||||||
table.PrimaryKey("pk_fediverse_actors", x => x.id);
|
|
||||||
table.ForeignKey(
|
|
||||||
name: "fk_fediverse_actors_fediverse_instances_instance_id",
|
|
||||||
column: x => x.instance_id,
|
|
||||||
principalTable: "fediverse_instances",
|
|
||||||
principalColumn: "id",
|
|
||||||
onDelete: ReferentialAction.Cascade);
|
|
||||||
});
|
|
||||||
|
|
||||||
migrationBuilder.CreateTable(
|
|
||||||
name: "fediverse_contents",
|
|
||||||
columns: table => new
|
|
||||||
{
|
|
||||||
id = table.Column<Guid>(type: "uuid", nullable: false),
|
|
||||||
uri = table.Column<string>(type: "character varying(2048)", maxLength: 2048, nullable: false),
|
|
||||||
type = table.Column<int>(type: "integer", nullable: false),
|
|
||||||
title = table.Column<string>(type: "character varying(1024)", maxLength: 1024, nullable: true),
|
|
||||||
summary = table.Column<string>(type: "character varying(4096)", maxLength: 4096, nullable: true),
|
|
||||||
content = table.Column<string>(type: "text", nullable: true),
|
|
||||||
content_html = table.Column<string>(type: "text", nullable: true),
|
|
||||||
language = table.Column<string>(type: "character varying(2048)", maxLength: 2048, nullable: true),
|
|
||||||
in_reply_to = table.Column<string>(type: "character varying(2048)", maxLength: 2048, nullable: true),
|
|
||||||
announced_content_uri = table.Column<string>(type: "character varying(2048)", maxLength: 2048, nullable: true),
|
|
||||||
published_at = table.Column<Instant>(type: "timestamp with time zone", nullable: true),
|
|
||||||
edited_at = table.Column<Instant>(type: "timestamp with time zone", nullable: true),
|
|
||||||
is_sensitive = table.Column<bool>(type: "boolean", nullable: false),
|
|
||||||
// attachments = table.Column<List<ContentAttachment>>(type: "jsonb", nullable: true),
|
|
||||||
// mentions = table.Column<List<ContentMention>>(type: "jsonb", nullable: true),
|
|
||||||
// tags = table.Column<List<ContentTag>>(type: "jsonb", nullable: true),
|
|
||||||
// emojis = table.Column<List<ContentEmoji>>(type: "jsonb", nullable: true),
|
|
||||||
metadata = table.Column<Dictionary<string, object>>(type: "jsonb", nullable: true),
|
|
||||||
actor_id = table.Column<Guid>(type: "uuid", nullable: false),
|
|
||||||
instance_id = table.Column<Guid>(type: "uuid", nullable: false),
|
|
||||||
reply_count = table.Column<int>(type: "integer", nullable: false),
|
|
||||||
boost_count = table.Column<int>(type: "integer", nullable: false),
|
|
||||||
like_count = table.Column<int>(type: "integer", nullable: false),
|
|
||||||
local_post_id = table.Column<Guid>(type: "uuid", nullable: true),
|
|
||||||
created_at = table.Column<Instant>(type: "timestamp with time zone", nullable: false),
|
|
||||||
updated_at = table.Column<Instant>(type: "timestamp with time zone", nullable: false),
|
|
||||||
deleted_at = table.Column<Instant>(type: "timestamp with time zone", nullable: true)
|
|
||||||
},
|
|
||||||
constraints: table =>
|
|
||||||
{
|
|
||||||
table.PrimaryKey("pk_fediverse_contents", x => x.id);
|
|
||||||
table.ForeignKey(
|
|
||||||
name: "fk_fediverse_contents_fediverse_actors_actor_id",
|
|
||||||
column: x => x.actor_id,
|
|
||||||
principalTable: "fediverse_actors",
|
|
||||||
principalColumn: "id",
|
|
||||||
onDelete: ReferentialAction.Cascade);
|
|
||||||
table.ForeignKey(
|
|
||||||
name: "fk_fediverse_contents_fediverse_instances_instance_id",
|
|
||||||
column: x => x.instance_id,
|
|
||||||
principalTable: "fediverse_instances",
|
|
||||||
principalColumn: "id",
|
|
||||||
onDelete: ReferentialAction.Cascade);
|
|
||||||
});
|
|
||||||
|
|
||||||
migrationBuilder.CreateTable(
|
|
||||||
name: "fediverse_relationships",
|
|
||||||
columns: table => new
|
|
||||||
{
|
|
||||||
id = table.Column<Guid>(type: "uuid", nullable: false),
|
|
||||||
actor_id = table.Column<Guid>(type: "uuid", nullable: false),
|
|
||||||
target_actor_id = table.Column<Guid>(type: "uuid", nullable: false),
|
|
||||||
state = table.Column<int>(type: "integer", nullable: false),
|
|
||||||
is_following = table.Column<bool>(type: "boolean", nullable: false),
|
|
||||||
is_followed_by = table.Column<bool>(type: "boolean", nullable: false),
|
|
||||||
is_muting = table.Column<bool>(type: "boolean", nullable: false),
|
|
||||||
is_blocking = table.Column<bool>(type: "boolean", nullable: false),
|
|
||||||
followed_at = table.Column<Instant>(type: "timestamp with time zone", nullable: true),
|
|
||||||
followed_back_at = table.Column<Instant>(type: "timestamp with time zone", nullable: true),
|
|
||||||
reject_reason = table.Column<string>(type: "character varying(4096)", maxLength: 4096, nullable: true),
|
|
||||||
is_local_actor = table.Column<bool>(type: "boolean", nullable: false),
|
|
||||||
local_account_id = table.Column<Guid>(type: "uuid", nullable: true),
|
|
||||||
local_publisher_id = table.Column<Guid>(type: "uuid", nullable: true),
|
|
||||||
created_at = table.Column<Instant>(type: "timestamp with time zone", nullable: false),
|
|
||||||
updated_at = table.Column<Instant>(type: "timestamp with time zone", nullable: false),
|
|
||||||
deleted_at = table.Column<Instant>(type: "timestamp with time zone", nullable: true)
|
|
||||||
},
|
|
||||||
constraints: table =>
|
|
||||||
{
|
|
||||||
table.PrimaryKey("pk_fediverse_relationships", x => x.id);
|
|
||||||
table.ForeignKey(
|
|
||||||
name: "fk_fediverse_relationships_fediverse_actors_actor_id",
|
|
||||||
column: x => x.actor_id,
|
|
||||||
principalTable: "fediverse_actors",
|
|
||||||
principalColumn: "id",
|
|
||||||
onDelete: ReferentialAction.Cascade);
|
|
||||||
table.ForeignKey(
|
|
||||||
name: "fk_fediverse_relationships_fediverse_actors_target_actor_id",
|
|
||||||
column: x => x.target_actor_id,
|
|
||||||
principalTable: "fediverse_actors",
|
|
||||||
principalColumn: "id",
|
|
||||||
onDelete: ReferentialAction.Cascade);
|
|
||||||
});
|
|
||||||
|
|
||||||
migrationBuilder.CreateTable(
|
|
||||||
name: "fediverse_activities",
|
|
||||||
columns: table => new
|
|
||||||
{
|
|
||||||
id = table.Column<Guid>(type: "uuid", nullable: false),
|
|
||||||
uri = table.Column<string>(type: "character varying(2048)", maxLength: 2048, nullable: false),
|
|
||||||
type = table.Column<int>(type: "integer", nullable: false),
|
|
||||||
object_uri = table.Column<string>(type: "character varying(2048)", maxLength: 2048, nullable: true),
|
|
||||||
target_uri = table.Column<string>(type: "character varying(2048)", maxLength: 2048, nullable: true),
|
|
||||||
published_at = table.Column<Instant>(type: "timestamp with time zone", nullable: true),
|
|
||||||
is_local = table.Column<bool>(type: "boolean", nullable: false),
|
|
||||||
raw_data = table.Column<Dictionary<string, object>>(type: "jsonb", nullable: true),
|
|
||||||
actor_id = table.Column<Guid>(type: "uuid", nullable: false),
|
|
||||||
content_id = table.Column<Guid>(type: "uuid", nullable: true),
|
|
||||||
target_actor_id = table.Column<Guid>(type: "uuid", nullable: true),
|
|
||||||
local_post_id = table.Column<Guid>(type: "uuid", nullable: true),
|
|
||||||
local_account_id = table.Column<Guid>(type: "uuid", nullable: true),
|
|
||||||
status = table.Column<int>(type: "integer", nullable: false),
|
|
||||||
error_message = table.Column<string>(type: "character varying(4096)", maxLength: 4096, nullable: true),
|
|
||||||
created_at = table.Column<Instant>(type: "timestamp with time zone", nullable: false),
|
|
||||||
updated_at = table.Column<Instant>(type: "timestamp with time zone", nullable: false),
|
|
||||||
deleted_at = table.Column<Instant>(type: "timestamp with time zone", nullable: true)
|
|
||||||
},
|
|
||||||
constraints: table =>
|
|
||||||
{
|
|
||||||
table.PrimaryKey("pk_fediverse_activities", x => x.id);
|
|
||||||
table.ForeignKey(
|
|
||||||
name: "fk_fediverse_activities_fediverse_actors_actor_id",
|
|
||||||
column: x => x.actor_id,
|
|
||||||
principalTable: "fediverse_actors",
|
|
||||||
principalColumn: "id",
|
|
||||||
onDelete: ReferentialAction.Cascade);
|
|
||||||
table.ForeignKey(
|
|
||||||
name: "fk_fediverse_activities_fediverse_actors_target_actor_id",
|
|
||||||
column: x => x.target_actor_id,
|
|
||||||
principalTable: "fediverse_actors",
|
|
||||||
principalColumn: "id");
|
|
||||||
table.ForeignKey(
|
|
||||||
name: "fk_fediverse_activities_fediverse_contents_content_id",
|
|
||||||
column: x => x.content_id,
|
|
||||||
principalTable: "fediverse_contents",
|
|
||||||
principalColumn: "id",
|
|
||||||
onDelete: ReferentialAction.Cascade);
|
|
||||||
});
|
|
||||||
|
|
||||||
migrationBuilder.CreateTable(
|
|
||||||
name: "fediverse_reactions",
|
|
||||||
columns: table => new
|
|
||||||
{
|
|
||||||
id = table.Column<Guid>(type: "uuid", nullable: false),
|
|
||||||
uri = table.Column<string>(type: "character varying(2048)", maxLength: 2048, nullable: false),
|
|
||||||
type = table.Column<int>(type: "integer", nullable: false),
|
|
||||||
emoji = table.Column<string>(type: "character varying(64)", maxLength: 64, nullable: true),
|
|
||||||
is_local = table.Column<bool>(type: "boolean", nullable: false),
|
|
||||||
content_id = table.Column<Guid>(type: "uuid", nullable: false),
|
|
||||||
actor_id = table.Column<Guid>(type: "uuid", nullable: false),
|
|
||||||
local_account_id = table.Column<Guid>(type: "uuid", nullable: true),
|
|
||||||
local_reaction_id = table.Column<Guid>(type: "uuid", nullable: true),
|
|
||||||
created_at = table.Column<Instant>(type: "timestamp with time zone", nullable: false),
|
|
||||||
updated_at = table.Column<Instant>(type: "timestamp with time zone", nullable: false),
|
|
||||||
deleted_at = table.Column<Instant>(type: "timestamp with time zone", nullable: true)
|
|
||||||
},
|
|
||||||
constraints: table =>
|
|
||||||
{
|
|
||||||
table.PrimaryKey("pk_fediverse_reactions", x => x.id);
|
|
||||||
table.ForeignKey(
|
|
||||||
name: "fk_fediverse_reactions_fediverse_actors_actor_id",
|
|
||||||
column: x => x.actor_id,
|
|
||||||
principalTable: "fediverse_actors",
|
|
||||||
principalColumn: "id",
|
|
||||||
onDelete: ReferentialAction.Cascade);
|
|
||||||
table.ForeignKey(
|
|
||||||
name: "fk_fediverse_reactions_fediverse_contents_content_id",
|
|
||||||
column: x => x.content_id,
|
|
||||||
principalTable: "fediverse_contents",
|
|
||||||
principalColumn: "id",
|
|
||||||
onDelete: ReferentialAction.Cascade);
|
|
||||||
});
|
|
||||||
|
|
||||||
migrationBuilder.CreateIndex(
|
|
||||||
name: "ix_fediverse_activities_actor_id",
|
|
||||||
table: "fediverse_activities",
|
|
||||||
column: "actor_id");
|
|
||||||
|
|
||||||
migrationBuilder.CreateIndex(
|
|
||||||
name: "ix_fediverse_activities_content_id",
|
|
||||||
table: "fediverse_activities",
|
|
||||||
column: "content_id");
|
|
||||||
|
|
||||||
migrationBuilder.CreateIndex(
|
|
||||||
name: "ix_fediverse_activities_target_actor_id",
|
|
||||||
table: "fediverse_activities",
|
|
||||||
column: "target_actor_id");
|
|
||||||
|
|
||||||
migrationBuilder.CreateIndex(
|
|
||||||
name: "ix_fediverse_actors_instance_id",
|
|
||||||
table: "fediverse_actors",
|
|
||||||
column: "instance_id");
|
|
||||||
|
|
||||||
migrationBuilder.CreateIndex(
|
|
||||||
name: "ix_fediverse_actors_uri",
|
|
||||||
table: "fediverse_actors",
|
|
||||||
column: "uri",
|
|
||||||
unique: true);
|
|
||||||
|
|
||||||
migrationBuilder.CreateIndex(
|
|
||||||
name: "ix_fediverse_contents_actor_id",
|
|
||||||
table: "fediverse_contents",
|
|
||||||
column: "actor_id");
|
|
||||||
|
|
||||||
migrationBuilder.CreateIndex(
|
|
||||||
name: "ix_fediverse_contents_instance_id",
|
|
||||||
table: "fediverse_contents",
|
|
||||||
column: "instance_id");
|
|
||||||
|
|
||||||
migrationBuilder.CreateIndex(
|
|
||||||
name: "ix_fediverse_contents_uri",
|
|
||||||
table: "fediverse_contents",
|
|
||||||
column: "uri",
|
|
||||||
unique: true);
|
|
||||||
|
|
||||||
migrationBuilder.CreateIndex(
|
|
||||||
name: "ix_fediverse_instances_domain",
|
|
||||||
table: "fediverse_instances",
|
|
||||||
column: "domain",
|
|
||||||
unique: true);
|
|
||||||
|
|
||||||
migrationBuilder.CreateIndex(
|
|
||||||
name: "ix_fediverse_reactions_actor_id",
|
|
||||||
table: "fediverse_reactions",
|
|
||||||
column: "actor_id");
|
|
||||||
|
|
||||||
migrationBuilder.CreateIndex(
|
|
||||||
name: "ix_fediverse_reactions_content_id",
|
|
||||||
table: "fediverse_reactions",
|
|
||||||
column: "content_id");
|
|
||||||
|
|
||||||
migrationBuilder.CreateIndex(
|
|
||||||
name: "ix_fediverse_relationships_actor_id",
|
|
||||||
table: "fediverse_relationships",
|
|
||||||
column: "actor_id");
|
|
||||||
|
|
||||||
migrationBuilder.CreateIndex(
|
|
||||||
name: "ix_fediverse_relationships_target_actor_id",
|
|
||||||
table: "fediverse_relationships",
|
|
||||||
column: "target_actor_id");
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <inheritdoc />
|
|
||||||
protected override void Down(MigrationBuilder migrationBuilder)
|
|
||||||
{
|
|
||||||
migrationBuilder.DropTable(
|
|
||||||
name: "fediverse_activities");
|
|
||||||
|
|
||||||
migrationBuilder.DropTable(
|
|
||||||
name: "fediverse_reactions");
|
|
||||||
|
|
||||||
migrationBuilder.DropTable(
|
|
||||||
name: "fediverse_relationships");
|
|
||||||
|
|
||||||
migrationBuilder.DropTable(
|
|
||||||
name: "fediverse_contents");
|
|
||||||
|
|
||||||
migrationBuilder.DropTable(
|
|
||||||
name: "fediverse_actors");
|
|
||||||
|
|
||||||
migrationBuilder.DropTable(
|
|
||||||
name: "fediverse_instances");
|
|
||||||
|
|
||||||
migrationBuilder.DropColumn(
|
|
||||||
name: "meta",
|
|
||||||
table: "publishers");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
File diff suppressed because it is too large
Load Diff
@@ -1,30 +0,0 @@
|
|||||||
using Microsoft.EntityFrameworkCore.Migrations;
|
|
||||||
|
|
||||||
#nullable disable
|
|
||||||
|
|
||||||
namespace DysonNetwork.Sphere.Migrations
|
|
||||||
{
|
|
||||||
/// <inheritdoc />
|
|
||||||
public partial class AddSeprateActorType : Migration
|
|
||||||
{
|
|
||||||
/// <inheritdoc />
|
|
||||||
protected override void Up(MigrationBuilder migrationBuilder)
|
|
||||||
{
|
|
||||||
migrationBuilder.AddColumn<string>(
|
|
||||||
name: "type",
|
|
||||||
table: "fediverse_actors",
|
|
||||||
type: "character varying(2048)",
|
|
||||||
maxLength: 2048,
|
|
||||||
nullable: false,
|
|
||||||
defaultValue: "Person");
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <inheritdoc />
|
|
||||||
protected override void Down(MigrationBuilder migrationBuilder)
|
|
||||||
{
|
|
||||||
migrationBuilder.DropColumn(
|
|
||||||
name: "type",
|
|
||||||
table: "fediverse_actors");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
File diff suppressed because it is too large
Load Diff
@@ -1,83 +0,0 @@
|
|||||||
using Microsoft.EntityFrameworkCore.Migrations;
|
|
||||||
using NodaTime;
|
|
||||||
|
|
||||||
#nullable disable
|
|
||||||
|
|
||||||
namespace DysonNetwork.Sphere.Migrations
|
|
||||||
{
|
|
||||||
/// <inheritdoc />
|
|
||||||
public partial class EnrichFediverseInstance : Migration
|
|
||||||
{
|
|
||||||
/// <inheritdoc />
|
|
||||||
protected override void Up(MigrationBuilder migrationBuilder)
|
|
||||||
{
|
|
||||||
migrationBuilder.AddColumn<int>(
|
|
||||||
name: "active_users",
|
|
||||||
table: "fediverse_instances",
|
|
||||||
type: "integer",
|
|
||||||
nullable: true);
|
|
||||||
|
|
||||||
migrationBuilder.AddColumn<string>(
|
|
||||||
name: "contact_account_username",
|
|
||||||
table: "fediverse_instances",
|
|
||||||
type: "character varying(256)",
|
|
||||||
maxLength: 256,
|
|
||||||
nullable: true);
|
|
||||||
|
|
||||||
migrationBuilder.AddColumn<string>(
|
|
||||||
name: "contact_email",
|
|
||||||
table: "fediverse_instances",
|
|
||||||
type: "character varying(512)",
|
|
||||||
maxLength: 512,
|
|
||||||
nullable: true);
|
|
||||||
|
|
||||||
migrationBuilder.AddColumn<string>(
|
|
||||||
name: "icon_url",
|
|
||||||
table: "fediverse_instances",
|
|
||||||
type: "character varying(2048)",
|
|
||||||
maxLength: 2048,
|
|
||||||
nullable: true);
|
|
||||||
|
|
||||||
migrationBuilder.AddColumn<Instant>(
|
|
||||||
name: "metadata_fetched_at",
|
|
||||||
table: "fediverse_instances",
|
|
||||||
type: "timestamp with time zone",
|
|
||||||
nullable: true);
|
|
||||||
|
|
||||||
migrationBuilder.AddColumn<string>(
|
|
||||||
name: "thumbnail_url",
|
|
||||||
table: "fediverse_instances",
|
|
||||||
type: "character varying(2048)",
|
|
||||||
maxLength: 2048,
|
|
||||||
nullable: true);
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <inheritdoc />
|
|
||||||
protected override void Down(MigrationBuilder migrationBuilder)
|
|
||||||
{
|
|
||||||
migrationBuilder.DropColumn(
|
|
||||||
name: "active_users",
|
|
||||||
table: "fediverse_instances");
|
|
||||||
|
|
||||||
migrationBuilder.DropColumn(
|
|
||||||
name: "contact_account_username",
|
|
||||||
table: "fediverse_instances");
|
|
||||||
|
|
||||||
migrationBuilder.DropColumn(
|
|
||||||
name: "contact_email",
|
|
||||||
table: "fediverse_instances");
|
|
||||||
|
|
||||||
migrationBuilder.DropColumn(
|
|
||||||
name: "icon_url",
|
|
||||||
table: "fediverse_instances");
|
|
||||||
|
|
||||||
migrationBuilder.DropColumn(
|
|
||||||
name: "metadata_fetched_at",
|
|
||||||
table: "fediverse_instances");
|
|
||||||
|
|
||||||
migrationBuilder.DropColumn(
|
|
||||||
name: "thumbnail_url",
|
|
||||||
table: "fediverse_instances");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
File diff suppressed because it is too large
Load Diff
@@ -1,60 +0,0 @@
|
|||||||
using System;
|
|
||||||
using Microsoft.EntityFrameworkCore.Migrations;
|
|
||||||
|
|
||||||
#nullable disable
|
|
||||||
|
|
||||||
namespace DysonNetwork.Sphere.Migrations
|
|
||||||
{
|
|
||||||
/// <inheritdoc />
|
|
||||||
public partial class BetterLocalActor : Migration
|
|
||||||
{
|
|
||||||
/// <inheritdoc />
|
|
||||||
protected override void Up(MigrationBuilder migrationBuilder)
|
|
||||||
{
|
|
||||||
migrationBuilder.DropColumn(
|
|
||||||
name: "is_local_actor",
|
|
||||||
table: "fediverse_relationships");
|
|
||||||
|
|
||||||
migrationBuilder.DropColumn(
|
|
||||||
name: "local_account_id",
|
|
||||||
table: "fediverse_relationships");
|
|
||||||
|
|
||||||
migrationBuilder.DropColumn(
|
|
||||||
name: "local_publisher_id",
|
|
||||||
table: "fediverse_relationships");
|
|
||||||
|
|
||||||
migrationBuilder.AddColumn<Guid>(
|
|
||||||
name: "publisher_id",
|
|
||||||
table: "fediverse_actors",
|
|
||||||
type: "uuid",
|
|
||||||
nullable: true);
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <inheritdoc />
|
|
||||||
protected override void Down(MigrationBuilder migrationBuilder)
|
|
||||||
{
|
|
||||||
migrationBuilder.DropColumn(
|
|
||||||
name: "publisher_id",
|
|
||||||
table: "fediverse_actors");
|
|
||||||
|
|
||||||
migrationBuilder.AddColumn<bool>(
|
|
||||||
name: "is_local_actor",
|
|
||||||
table: "fediverse_relationships",
|
|
||||||
type: "boolean",
|
|
||||||
nullable: false,
|
|
||||||
defaultValue: false);
|
|
||||||
|
|
||||||
migrationBuilder.AddColumn<Guid>(
|
|
||||||
name: "local_account_id",
|
|
||||||
table: "fediverse_relationships",
|
|
||||||
type: "uuid",
|
|
||||||
nullable: true);
|
|
||||||
|
|
||||||
migrationBuilder.AddColumn<Guid>(
|
|
||||||
name: "local_publisher_id",
|
|
||||||
table: "fediverse_relationships",
|
|
||||||
type: "uuid",
|
|
||||||
nullable: true);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
File diff suppressed because it is too large
Load Diff
@@ -1,40 +0,0 @@
|
|||||||
using Microsoft.EntityFrameworkCore.Migrations;
|
|
||||||
|
|
||||||
#nullable disable
|
|
||||||
|
|
||||||
namespace DysonNetwork.Sphere.Migrations
|
|
||||||
{
|
|
||||||
/// <inheritdoc />
|
|
||||||
public partial class AddPublisherKeys : Migration
|
|
||||||
{
|
|
||||||
/// <inheritdoc />
|
|
||||||
protected override void Up(MigrationBuilder migrationBuilder)
|
|
||||||
{
|
|
||||||
migrationBuilder.AddColumn<string>(
|
|
||||||
name: "private_key_pem",
|
|
||||||
table: "publishers",
|
|
||||||
type: "character varying(8192)",
|
|
||||||
maxLength: 8192,
|
|
||||||
nullable: true);
|
|
||||||
|
|
||||||
migrationBuilder.AddColumn<string>(
|
|
||||||
name: "public_key_pem",
|
|
||||||
table: "publishers",
|
|
||||||
type: "character varying(8192)",
|
|
||||||
maxLength: 8192,
|
|
||||||
nullable: true);
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <inheritdoc />
|
|
||||||
protected override void Down(MigrationBuilder migrationBuilder)
|
|
||||||
{
|
|
||||||
migrationBuilder.DropColumn(
|
|
||||||
name: "private_key_pem",
|
|
||||||
table: "publishers");
|
|
||||||
|
|
||||||
migrationBuilder.DropColumn(
|
|
||||||
name: "public_key_pem",
|
|
||||||
table: "publishers");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -1,40 +0,0 @@
|
|||||||
using Microsoft.EntityFrameworkCore.Migrations;
|
|
||||||
|
|
||||||
#nullable disable
|
|
||||||
|
|
||||||
namespace DysonNetwork.Sphere.Migrations
|
|
||||||
{
|
|
||||||
/// <inheritdoc />
|
|
||||||
public partial class RemoveFollowingBooleanInFediverse : Migration
|
|
||||||
{
|
|
||||||
/// <inheritdoc />
|
|
||||||
protected override void Up(MigrationBuilder migrationBuilder)
|
|
||||||
{
|
|
||||||
migrationBuilder.DropColumn(
|
|
||||||
name: "is_followed_by",
|
|
||||||
table: "fediverse_relationships");
|
|
||||||
|
|
||||||
migrationBuilder.DropColumn(
|
|
||||||
name: "is_following",
|
|
||||||
table: "fediverse_relationships");
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <inheritdoc />
|
|
||||||
protected override void Down(MigrationBuilder migrationBuilder)
|
|
||||||
{
|
|
||||||
migrationBuilder.AddColumn<bool>(
|
|
||||||
name: "is_followed_by",
|
|
||||||
table: "fediverse_relationships",
|
|
||||||
type: "boolean",
|
|
||||||
nullable: false,
|
|
||||||
defaultValue: false);
|
|
||||||
|
|
||||||
migrationBuilder.AddColumn<bool>(
|
|
||||||
name: "is_following",
|
|
||||||
table: "fediverse_relationships",
|
|
||||||
type: "boolean",
|
|
||||||
nullable: false,
|
|
||||||
defaultValue: false);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
File diff suppressed because it is too large
Load Diff
@@ -1,29 +0,0 @@
|
|||||||
using Microsoft.EntityFrameworkCore.Migrations;
|
|
||||||
|
|
||||||
#nullable disable
|
|
||||||
|
|
||||||
namespace DysonNetwork.Sphere.Migrations
|
|
||||||
{
|
|
||||||
/// <inheritdoc />
|
|
||||||
public partial class RemoveSeprateLikeCountOnPost : Migration
|
|
||||||
{
|
|
||||||
/// <inheritdoc />
|
|
||||||
protected override void Up(MigrationBuilder migrationBuilder)
|
|
||||||
{
|
|
||||||
migrationBuilder.DropColumn(
|
|
||||||
name: "like_count",
|
|
||||||
table: "posts");
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <inheritdoc />
|
|
||||||
protected override void Down(MigrationBuilder migrationBuilder)
|
|
||||||
{
|
|
||||||
migrationBuilder.AddColumn<int>(
|
|
||||||
name: "like_count",
|
|
||||||
table: "posts",
|
|
||||||
type: "integer",
|
|
||||||
nullable: false,
|
|
||||||
defaultValue: 0);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,48 +0,0 @@
|
|||||||
using System;
|
|
||||||
using Microsoft.EntityFrameworkCore.Migrations;
|
|
||||||
using NodaTime;
|
|
||||||
|
|
||||||
#nullable disable
|
|
||||||
|
|
||||||
namespace DysonNetwork.Sphere.Migrations
|
|
||||||
{
|
|
||||||
/// <inheritdoc />
|
|
||||||
public partial class AddActivityPubDelivery : Migration
|
|
||||||
{
|
|
||||||
/// <inheritdoc />
|
|
||||||
protected override void Up(MigrationBuilder migrationBuilder)
|
|
||||||
{
|
|
||||||
migrationBuilder.CreateTable(
|
|
||||||
name: "activity_pub_deliveries",
|
|
||||||
columns: table => new
|
|
||||||
{
|
|
||||||
id = table.Column<Guid>(type: "uuid", nullable: false),
|
|
||||||
activity_id = table.Column<string>(type: "character varying(2048)", maxLength: 2048, nullable: false),
|
|
||||||
activity_type = table.Column<string>(type: "character varying(128)", maxLength: 128, nullable: false),
|
|
||||||
inbox_uri = table.Column<string>(type: "character varying(2048)", maxLength: 2048, nullable: false),
|
|
||||||
actor_uri = table.Column<string>(type: "character varying(2048)", maxLength: 2048, nullable: false),
|
|
||||||
status = table.Column<int>(type: "integer", nullable: false),
|
|
||||||
retry_count = table.Column<int>(type: "integer", nullable: false),
|
|
||||||
error_message = table.Column<string>(type: "character varying(4096)", maxLength: 4096, nullable: true),
|
|
||||||
last_attempt_at = table.Column<Instant>(type: "timestamp with time zone", nullable: true),
|
|
||||||
next_retry_at = table.Column<Instant>(type: "timestamp with time zone", nullable: true),
|
|
||||||
sent_at = table.Column<Instant>(type: "timestamp with time zone", nullable: true),
|
|
||||||
response_status_code = table.Column<string>(type: "character varying(2048)", maxLength: 2048, nullable: true),
|
|
||||||
created_at = table.Column<Instant>(type: "timestamp with time zone", nullable: false),
|
|
||||||
updated_at = table.Column<Instant>(type: "timestamp with time zone", nullable: false),
|
|
||||||
deleted_at = table.Column<Instant>(type: "timestamp with time zone", nullable: true)
|
|
||||||
},
|
|
||||||
constraints: table =>
|
|
||||||
{
|
|
||||||
table.PrimaryKey("pk_activity_pub_deliveries", x => x.id);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <inheritdoc />
|
|
||||||
protected override void Down(MigrationBuilder migrationBuilder)
|
|
||||||
{
|
|
||||||
migrationBuilder.DropTable(
|
|
||||||
name: "activity_pub_deliveries");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -17,8 +17,8 @@ using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
|
|||||||
namespace DysonNetwork.Sphere.Migrations
|
namespace DysonNetwork.Sphere.Migrations
|
||||||
{
|
{
|
||||||
[DbContext(typeof(AppDatabase))]
|
[DbContext(typeof(AppDatabase))]
|
||||||
[Migration("20251231163256_AddActivityPubDelivery")]
|
[Migration("20260101135529_AddActivityPub")]
|
||||||
partial class AddActivityPubDelivery
|
partial class AddActivityPub
|
||||||
{
|
{
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using DysonNetwork.Shared.Models;
|
using DysonNetwork.Shared.Models;
|
||||||
using Microsoft.EntityFrameworkCore.Migrations;
|
using Microsoft.EntityFrameworkCore.Migrations;
|
||||||
@@ -9,23 +9,162 @@ using NodaTime;
|
|||||||
namespace DysonNetwork.Sphere.Migrations
|
namespace DysonNetwork.Sphere.Migrations
|
||||||
{
|
{
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public partial class MergeFediverseDataClass : Migration
|
public partial class AddActivityPub : Migration
|
||||||
{
|
{
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
protected override void Up(MigrationBuilder migrationBuilder)
|
protected override void Up(MigrationBuilder migrationBuilder)
|
||||||
{
|
{
|
||||||
migrationBuilder.DropForeignKey(
|
migrationBuilder.AddColumn<Dictionary<string, object>>(
|
||||||
name: "fk_posts_publishers_publisher_id",
|
name: "meta",
|
||||||
table: "posts");
|
table: "publishers",
|
||||||
|
type: "jsonb",
|
||||||
|
nullable: true);
|
||||||
|
|
||||||
migrationBuilder.DropTable(
|
migrationBuilder.AddColumn<string>(
|
||||||
name: "fediverse_activities");
|
name: "private_key_pem",
|
||||||
|
table: "publishers",
|
||||||
|
type: "character varying(8192)",
|
||||||
|
maxLength: 8192,
|
||||||
|
nullable: true);
|
||||||
|
|
||||||
migrationBuilder.DropTable(
|
migrationBuilder.AddColumn<string>(
|
||||||
name: "fediverse_reactions");
|
name: "public_key_pem",
|
||||||
|
table: "publishers",
|
||||||
|
type: "character varying(8192)",
|
||||||
|
maxLength: 8192,
|
||||||
|
nullable: true);
|
||||||
|
|
||||||
migrationBuilder.DropTable(
|
migrationBuilder.CreateTable(
|
||||||
name: "fediverse_contents");
|
name: "fediverse_instances",
|
||||||
|
columns: table => new
|
||||||
|
{
|
||||||
|
id = table.Column<Guid>(type: "uuid", nullable: false),
|
||||||
|
domain = table.Column<string>(type: "character varying(256)", maxLength: 256, nullable: false),
|
||||||
|
name = table.Column<string>(type: "character varying(512)", maxLength: 512, nullable: true),
|
||||||
|
description = table.Column<string>(type: "character varying(4096)", maxLength: 4096, nullable: true),
|
||||||
|
software = table.Column<string>(type: "character varying(2048)", maxLength: 2048, nullable: true),
|
||||||
|
version = table.Column<string>(type: "character varying(2048)", maxLength: 2048, nullable: true),
|
||||||
|
metadata = table.Column<Dictionary<string, object>>(type: "jsonb", nullable: true),
|
||||||
|
is_blocked = table.Column<bool>(type: "boolean", nullable: false),
|
||||||
|
is_silenced = table.Column<bool>(type: "boolean", nullable: false),
|
||||||
|
block_reason = table.Column<string>(type: "character varying(2048)", maxLength: 2048, nullable: true),
|
||||||
|
last_fetched_at = table.Column<Instant>(type: "timestamp with time zone", nullable: true),
|
||||||
|
last_activity_at = table.Column<Instant>(type: "timestamp with time zone", nullable: true),
|
||||||
|
created_at = table.Column<Instant>(type: "timestamp with time zone", nullable: false),
|
||||||
|
updated_at = table.Column<Instant>(type: "timestamp with time zone", nullable: false),
|
||||||
|
deleted_at = table.Column<Instant>(type: "timestamp with time zone", nullable: true),
|
||||||
|
active_users = table.Column<int>(type: "integer", nullable: true),
|
||||||
|
contact_account_username = table.Column<string>(type: "character varying(256)", maxLength: 256, nullable: true),
|
||||||
|
contact_email = table.Column<string>(type: "character varying(512)", maxLength: 512, nullable: true),
|
||||||
|
icon_url = table.Column<string>(type: "character varying(2048)", maxLength: 2048, nullable: true),
|
||||||
|
metadata_fetched_at = table.Column<Instant>(type: "timestamp with time zone", nullable: true),
|
||||||
|
thumbnail_url = table.Column<string>(type: "character varying(2048)", maxLength: 2048, nullable: true)
|
||||||
|
},
|
||||||
|
constraints: table =>
|
||||||
|
{
|
||||||
|
table.PrimaryKey("pk_fediverse_instances", x => x.id);
|
||||||
|
});
|
||||||
|
|
||||||
|
migrationBuilder.CreateTable(
|
||||||
|
name: "fediverse_actors",
|
||||||
|
columns: table => new
|
||||||
|
{
|
||||||
|
id = table.Column<Guid>(type: "uuid", nullable: false),
|
||||||
|
uri = table.Column<string>(type: "character varying(2048)", maxLength: 2048, nullable: false),
|
||||||
|
username = table.Column<string>(type: "character varying(256)", maxLength: 256, nullable: false),
|
||||||
|
display_name = table.Column<string>(type: "character varying(2048)", maxLength: 2048, nullable: true),
|
||||||
|
bio = table.Column<string>(type: "character varying(4096)", maxLength: 4096, nullable: true),
|
||||||
|
inbox_uri = table.Column<string>(type: "character varying(2048)", maxLength: 2048, nullable: true),
|
||||||
|
outbox_uri = table.Column<string>(type: "character varying(2048)", maxLength: 2048, nullable: true),
|
||||||
|
followers_uri = table.Column<string>(type: "character varying(2048)", maxLength: 2048, nullable: true),
|
||||||
|
following_uri = table.Column<string>(type: "character varying(2048)", maxLength: 2048, nullable: true),
|
||||||
|
featured_uri = table.Column<string>(type: "character varying(2048)", maxLength: 2048, nullable: true),
|
||||||
|
public_key_id = table.Column<string>(type: "character varying(2048)", maxLength: 2048, nullable: true),
|
||||||
|
public_key = table.Column<string>(type: "character varying(8192)", maxLength: 8192, nullable: true),
|
||||||
|
metadata = table.Column<Dictionary<string, object>>(type: "jsonb", nullable: true),
|
||||||
|
avatar_url = table.Column<string>(type: "character varying(2048)", maxLength: 2048, nullable: true),
|
||||||
|
header_url = table.Column<string>(type: "character varying(2048)", maxLength: 2048, nullable: true),
|
||||||
|
is_bot = table.Column<bool>(type: "boolean", nullable: false),
|
||||||
|
is_locked = table.Column<bool>(type: "boolean", nullable: false),
|
||||||
|
is_discoverable = table.Column<bool>(type: "boolean", nullable: false),
|
||||||
|
instance_id = table.Column<Guid>(type: "uuid", nullable: false),
|
||||||
|
last_fetched_at = table.Column<Instant>(type: "timestamp with time zone", nullable: true),
|
||||||
|
last_activity_at = table.Column<Instant>(type: "timestamp with time zone", nullable: true),
|
||||||
|
created_at = table.Column<Instant>(type: "timestamp with time zone", nullable: false),
|
||||||
|
updated_at = table.Column<Instant>(type: "timestamp with time zone", nullable: false),
|
||||||
|
deleted_at = table.Column<Instant>(type: "timestamp with time zone", nullable: true),
|
||||||
|
type = table.Column<string>(type: "character varying(2048)", maxLength: 2048, nullable: false, defaultValue: "Person"),
|
||||||
|
publisher_id = table.Column<Guid>(type: "uuid", nullable: true)
|
||||||
|
},
|
||||||
|
constraints: table =>
|
||||||
|
{
|
||||||
|
table.PrimaryKey("pk_fediverse_actors", x => x.id);
|
||||||
|
table.ForeignKey(
|
||||||
|
name: "fk_fediverse_actors_fediverse_instances_instance_id",
|
||||||
|
column: x => x.instance_id,
|
||||||
|
principalTable: "fediverse_instances",
|
||||||
|
principalColumn: "id",
|
||||||
|
onDelete: ReferentialAction.Cascade);
|
||||||
|
});
|
||||||
|
|
||||||
|
migrationBuilder.CreateTable(
|
||||||
|
name: "fediverse_relationships",
|
||||||
|
columns: table => new
|
||||||
|
{
|
||||||
|
id = table.Column<Guid>(type: "uuid", nullable: false),
|
||||||
|
actor_id = table.Column<Guid>(type: "uuid", nullable: false),
|
||||||
|
target_actor_id = table.Column<Guid>(type: "uuid", nullable: false),
|
||||||
|
state = table.Column<int>(type: "integer", nullable: false),
|
||||||
|
is_muting = table.Column<bool>(type: "boolean", nullable: false),
|
||||||
|
is_blocking = table.Column<bool>(type: "boolean", nullable: false),
|
||||||
|
followed_at = table.Column<Instant>(type: "timestamp with time zone", nullable: true),
|
||||||
|
followed_back_at = table.Column<Instant>(type: "timestamp with time zone", nullable: true),
|
||||||
|
reject_reason = table.Column<string>(type: "character varying(4096)", maxLength: 4096, nullable: true),
|
||||||
|
created_at = table.Column<Instant>(type: "timestamp with time zone", nullable: false),
|
||||||
|
updated_at = table.Column<Instant>(type: "timestamp with time zone", nullable: false),
|
||||||
|
deleted_at = table.Column<Instant>(type: "timestamp with time zone", nullable: true)
|
||||||
|
},
|
||||||
|
constraints: table =>
|
||||||
|
{
|
||||||
|
table.PrimaryKey("pk_fediverse_relationships", x => x.id);
|
||||||
|
table.ForeignKey(
|
||||||
|
name: "fk_fediverse_relationships_fediverse_actors_actor_id",
|
||||||
|
column: x => x.actor_id,
|
||||||
|
principalTable: "fediverse_actors",
|
||||||
|
principalColumn: "id",
|
||||||
|
onDelete: ReferentialAction.Cascade);
|
||||||
|
table.ForeignKey(
|
||||||
|
name: "fk_fediverse_relationships_fediverse_actors_target_actor_id",
|
||||||
|
column: x => x.target_actor_id,
|
||||||
|
principalTable: "fediverse_actors",
|
||||||
|
principalColumn: "id",
|
||||||
|
onDelete: ReferentialAction.Cascade);
|
||||||
|
});
|
||||||
|
|
||||||
|
migrationBuilder.CreateTable(
|
||||||
|
name: "activity_pub_deliveries",
|
||||||
|
columns: table => new
|
||||||
|
{
|
||||||
|
id = table.Column<Guid>(type: "uuid", nullable: false),
|
||||||
|
activity_id = table.Column<string>(type: "character varying(2048)", maxLength: 2048, nullable: false),
|
||||||
|
activity_type = table.Column<string>(type: "character varying(128)", maxLength: 128, nullable: false),
|
||||||
|
inbox_uri = table.Column<string>(type: "character varying(2048)", maxLength: 2048, nullable: false),
|
||||||
|
actor_uri = table.Column<string>(type: "character varying(2048)", maxLength: 2048, nullable: false),
|
||||||
|
status = table.Column<int>(type: "integer", nullable: false),
|
||||||
|
retry_count = table.Column<int>(type: "integer", nullable: false),
|
||||||
|
error_message = table.Column<string>(type: "character varying(4096)", maxLength: 4096, nullable: true),
|
||||||
|
last_attempt_at = table.Column<Instant>(type: "timestamp with time zone", nullable: true),
|
||||||
|
next_retry_at = table.Column<Instant>(type: "timestamp with time zone", nullable: true),
|
||||||
|
sent_at = table.Column<Instant>(type: "timestamp with time zone", nullable: true),
|
||||||
|
response_status_code = table.Column<string>(type: "character varying(2048)", maxLength: 2048, nullable: true),
|
||||||
|
created_at = table.Column<Instant>(type: "timestamp with time zone", nullable: false),
|
||||||
|
updated_at = table.Column<Instant>(type: "timestamp with time zone", nullable: false),
|
||||||
|
deleted_at = table.Column<Instant>(type: "timestamp with time zone", nullable: true)
|
||||||
|
},
|
||||||
|
constraints: table =>
|
||||||
|
{
|
||||||
|
table.PrimaryKey("pk_activity_pub_deliveries", x => x.id);
|
||||||
|
});
|
||||||
|
|
||||||
migrationBuilder.RenameColumn(
|
migrationBuilder.RenameColumn(
|
||||||
name: "meta",
|
name: "meta",
|
||||||
@@ -80,13 +219,6 @@ namespace DysonNetwork.Sphere.Migrations
|
|||||||
maxLength: 2048,
|
maxLength: 2048,
|
||||||
nullable: true);
|
nullable: true);
|
||||||
|
|
||||||
migrationBuilder.AddColumn<int>(
|
|
||||||
name: "like_count",
|
|
||||||
table: "posts",
|
|
||||||
type: "integer",
|
|
||||||
nullable: false,
|
|
||||||
defaultValue: 0);
|
|
||||||
|
|
||||||
migrationBuilder.AddColumn<List<ContentMention>>(
|
migrationBuilder.AddColumn<List<ContentMention>>(
|
||||||
name: "mentions",
|
name: "mentions",
|
||||||
table: "posts",
|
table: "posts",
|
||||||
@@ -128,6 +260,33 @@ namespace DysonNetwork.Sphere.Migrations
|
|||||||
nullable: false,
|
nullable: false,
|
||||||
defaultValue: false);
|
defaultValue: false);
|
||||||
|
|
||||||
|
migrationBuilder.CreateIndex(
|
||||||
|
name: "ix_fediverse_actors_instance_id",
|
||||||
|
table: "fediverse_actors",
|
||||||
|
column: "instance_id");
|
||||||
|
|
||||||
|
migrationBuilder.CreateIndex(
|
||||||
|
name: "ix_fediverse_actors_uri",
|
||||||
|
table: "fediverse_actors",
|
||||||
|
column: "uri",
|
||||||
|
unique: true);
|
||||||
|
|
||||||
|
migrationBuilder.CreateIndex(
|
||||||
|
name: "ix_fediverse_instances_domain",
|
||||||
|
table: "fediverse_instances",
|
||||||
|
column: "domain",
|
||||||
|
unique: true);
|
||||||
|
|
||||||
|
migrationBuilder.CreateIndex(
|
||||||
|
name: "ix_fediverse_relationships_actor_id",
|
||||||
|
table: "fediverse_relationships",
|
||||||
|
column: "actor_id");
|
||||||
|
|
||||||
|
migrationBuilder.CreateIndex(
|
||||||
|
name: "ix_fediverse_relationships_target_actor_id",
|
||||||
|
table: "fediverse_relationships",
|
||||||
|
column: "target_actor_id");
|
||||||
|
|
||||||
migrationBuilder.CreateIndex(
|
migrationBuilder.CreateIndex(
|
||||||
name: "ix_posts_actor_id",
|
name: "ix_posts_actor_id",
|
||||||
table: "posts",
|
table: "posts",
|
||||||
@@ -157,7 +316,8 @@ namespace DysonNetwork.Sphere.Migrations
|
|||||||
table: "posts",
|
table: "posts",
|
||||||
column: "publisher_id",
|
column: "publisher_id",
|
||||||
principalTable: "publishers",
|
principalTable: "publishers",
|
||||||
principalColumn: "id");
|
principalColumn: "id",
|
||||||
|
onDelete: ReferentialAction.Cascade);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
@@ -183,68 +343,37 @@ namespace DysonNetwork.Sphere.Migrations
|
|||||||
name: "ix_post_reactions_actor_id",
|
name: "ix_post_reactions_actor_id",
|
||||||
table: "post_reactions");
|
table: "post_reactions");
|
||||||
|
|
||||||
migrationBuilder.DropColumn(
|
migrationBuilder.DropIndex(
|
||||||
name: "actor_id",
|
name: "ix_fediverse_relationships_target_actor_id",
|
||||||
table: "posts");
|
table: "fediverse_relationships");
|
||||||
|
|
||||||
migrationBuilder.DropColumn(
|
migrationBuilder.DropIndex(
|
||||||
name: "boost_count",
|
name: "ix_fediverse_relationships_actor_id",
|
||||||
table: "posts");
|
table: "fediverse_relationships");
|
||||||
|
|
||||||
migrationBuilder.DropColumn(
|
migrationBuilder.DropIndex(
|
||||||
name: "content_type",
|
name: "ix_fediverse_instances_domain",
|
||||||
table: "posts");
|
table: "fediverse_instances");
|
||||||
|
|
||||||
migrationBuilder.DropColumn(
|
migrationBuilder.DropIndex(
|
||||||
name: "fediverse_type",
|
name: "ix_fediverse_actors_uri",
|
||||||
table: "posts");
|
table: "fediverse_actors");
|
||||||
|
|
||||||
migrationBuilder.DropColumn(
|
migrationBuilder.DropIndex(
|
||||||
name: "fediverse_uri",
|
name: "ix_fediverse_actors_instance_id",
|
||||||
table: "posts");
|
table: "fediverse_actors");
|
||||||
|
|
||||||
migrationBuilder.DropColumn(
|
|
||||||
name: "language",
|
|
||||||
table: "posts");
|
|
||||||
|
|
||||||
migrationBuilder.DropColumn(
|
|
||||||
name: "like_count",
|
|
||||||
table: "posts");
|
|
||||||
|
|
||||||
migrationBuilder.DropColumn(
|
|
||||||
name: "mentions",
|
|
||||||
table: "posts");
|
|
||||||
|
|
||||||
migrationBuilder.DropColumn(
|
|
||||||
name: "replies_count",
|
|
||||||
table: "posts");
|
|
||||||
|
|
||||||
migrationBuilder.DropColumn(
|
|
||||||
name: "actor_id",
|
|
||||||
table: "post_reactions");
|
|
||||||
|
|
||||||
migrationBuilder.DropColumn(
|
|
||||||
name: "fediverse_uri",
|
|
||||||
table: "post_reactions");
|
|
||||||
|
|
||||||
migrationBuilder.DropColumn(
|
migrationBuilder.DropColumn(
|
||||||
name: "is_local",
|
name: "is_local",
|
||||||
table: "post_reactions");
|
table: "post_reactions");
|
||||||
|
|
||||||
migrationBuilder.RenameColumn(
|
migrationBuilder.DropColumn(
|
||||||
name: "metadata",
|
name: "fediverse_uri",
|
||||||
table: "posts",
|
table: "post_reactions");
|
||||||
newName: "meta");
|
|
||||||
|
|
||||||
migrationBuilder.AlterColumn<Guid>(
|
migrationBuilder.DropColumn(
|
||||||
name: "publisher_id",
|
name: "actor_id",
|
||||||
table: "posts",
|
table: "post_reactions");
|
||||||
type: "uuid",
|
|
||||||
nullable: false,
|
|
||||||
defaultValue: new Guid("00000000-0000-0000-0000-000000000000"),
|
|
||||||
oldClrType: typeof(Guid),
|
|
||||||
oldType: "uuid",
|
|
||||||
oldNullable: true);
|
|
||||||
|
|
||||||
migrationBuilder.AlterColumn<Guid>(
|
migrationBuilder.AlterColumn<Guid>(
|
||||||
name: "account_id",
|
name: "account_id",
|
||||||
@@ -256,178 +385,76 @@ namespace DysonNetwork.Sphere.Migrations
|
|||||||
oldType: "uuid",
|
oldType: "uuid",
|
||||||
oldNullable: true);
|
oldNullable: true);
|
||||||
|
|
||||||
migrationBuilder.CreateTable(
|
migrationBuilder.DropColumn(
|
||||||
name: "fediverse_contents",
|
name: "replies_count",
|
||||||
columns: table => new
|
table: "posts");
|
||||||
{
|
|
||||||
id = table.Column<Guid>(type: "uuid", nullable: false),
|
|
||||||
actor_id = table.Column<Guid>(type: "uuid", nullable: false),
|
|
||||||
instance_id = table.Column<Guid>(type: "uuid", nullable: false),
|
|
||||||
announced_content_uri = table.Column<string>(type: "character varying(2048)", maxLength: 2048, nullable: true),
|
|
||||||
boost_count = table.Column<int>(type: "integer", nullable: false),
|
|
||||||
content = table.Column<string>(type: "text", nullable: true),
|
|
||||||
content_html = table.Column<string>(type: "text", nullable: true),
|
|
||||||
created_at = table.Column<Instant>(type: "timestamp with time zone", nullable: false),
|
|
||||||
deleted_at = table.Column<Instant>(type: "timestamp with time zone", nullable: true),
|
|
||||||
edited_at = table.Column<Instant>(type: "timestamp with time zone", nullable: true),
|
|
||||||
in_reply_to = table.Column<string>(type: "character varying(2048)", maxLength: 2048, nullable: true),
|
|
||||||
is_sensitive = table.Column<bool>(type: "boolean", nullable: false),
|
|
||||||
language = table.Column<string>(type: "character varying(2048)", maxLength: 2048, nullable: true),
|
|
||||||
like_count = table.Column<int>(type: "integer", nullable: false),
|
|
||||||
local_post_id = table.Column<Guid>(type: "uuid", nullable: true),
|
|
||||||
metadata = table.Column<Dictionary<string, object>>(type: "jsonb", nullable: true),
|
|
||||||
published_at = table.Column<Instant>(type: "timestamp with time zone", nullable: true),
|
|
||||||
reply_count = table.Column<int>(type: "integer", nullable: false),
|
|
||||||
summary = table.Column<string>(type: "character varying(4096)", maxLength: 4096, nullable: true),
|
|
||||||
title = table.Column<string>(type: "character varying(1024)", maxLength: 1024, nullable: true),
|
|
||||||
type = table.Column<int>(type: "integer", nullable: false),
|
|
||||||
updated_at = table.Column<Instant>(type: "timestamp with time zone", nullable: false),
|
|
||||||
uri = table.Column<string>(type: "character varying(2048)", maxLength: 2048, nullable: false)
|
|
||||||
},
|
|
||||||
constraints: table =>
|
|
||||||
{
|
|
||||||
table.PrimaryKey("pk_fediverse_contents", x => x.id);
|
|
||||||
table.ForeignKey(
|
|
||||||
name: "fk_fediverse_contents_fediverse_actors_actor_id",
|
|
||||||
column: x => x.actor_id,
|
|
||||||
principalTable: "fediverse_actors",
|
|
||||||
principalColumn: "id",
|
|
||||||
onDelete: ReferentialAction.Cascade);
|
|
||||||
table.ForeignKey(
|
|
||||||
name: "fk_fediverse_contents_fediverse_instances_instance_id",
|
|
||||||
column: x => x.instance_id,
|
|
||||||
principalTable: "fediverse_instances",
|
|
||||||
principalColumn: "id",
|
|
||||||
onDelete: ReferentialAction.Cascade);
|
|
||||||
});
|
|
||||||
|
|
||||||
migrationBuilder.CreateTable(
|
migrationBuilder.DropColumn(
|
||||||
name: "fediverse_activities",
|
name: "mentions",
|
||||||
columns: table => new
|
table: "posts");
|
||||||
{
|
|
||||||
id = table.Column<Guid>(type: "uuid", nullable: false),
|
|
||||||
actor_id = table.Column<Guid>(type: "uuid", nullable: false),
|
|
||||||
content_id = table.Column<Guid>(type: "uuid", nullable: true),
|
|
||||||
target_actor_id = table.Column<Guid>(type: "uuid", nullable: true),
|
|
||||||
created_at = table.Column<Instant>(type: "timestamp with time zone", nullable: false),
|
|
||||||
deleted_at = table.Column<Instant>(type: "timestamp with time zone", nullable: true),
|
|
||||||
error_message = table.Column<string>(type: "character varying(4096)", maxLength: 4096, nullable: true),
|
|
||||||
is_local = table.Column<bool>(type: "boolean", nullable: false),
|
|
||||||
local_account_id = table.Column<Guid>(type: "uuid", nullable: true),
|
|
||||||
local_post_id = table.Column<Guid>(type: "uuid", nullable: true),
|
|
||||||
object_uri = table.Column<string>(type: "character varying(2048)", maxLength: 2048, nullable: true),
|
|
||||||
published_at = table.Column<Instant>(type: "timestamp with time zone", nullable: true),
|
|
||||||
raw_data = table.Column<Dictionary<string, object>>(type: "jsonb", nullable: true),
|
|
||||||
status = table.Column<int>(type: "integer", nullable: false),
|
|
||||||
target_uri = table.Column<string>(type: "character varying(2048)", maxLength: 2048, nullable: true),
|
|
||||||
type = table.Column<int>(type: "integer", nullable: false),
|
|
||||||
updated_at = table.Column<Instant>(type: "timestamp with time zone", nullable: false),
|
|
||||||
uri = table.Column<string>(type: "character varying(2048)", maxLength: 2048, nullable: false)
|
|
||||||
},
|
|
||||||
constraints: table =>
|
|
||||||
{
|
|
||||||
table.PrimaryKey("pk_fediverse_activities", x => x.id);
|
|
||||||
table.ForeignKey(
|
|
||||||
name: "fk_fediverse_activities_fediverse_actors_actor_id",
|
|
||||||
column: x => x.actor_id,
|
|
||||||
principalTable: "fediverse_actors",
|
|
||||||
principalColumn: "id",
|
|
||||||
onDelete: ReferentialAction.Cascade);
|
|
||||||
table.ForeignKey(
|
|
||||||
name: "fk_fediverse_activities_fediverse_actors_target_actor_id",
|
|
||||||
column: x => x.target_actor_id,
|
|
||||||
principalTable: "fediverse_actors",
|
|
||||||
principalColumn: "id");
|
|
||||||
table.ForeignKey(
|
|
||||||
name: "fk_fediverse_activities_fediverse_contents_content_id",
|
|
||||||
column: x => x.content_id,
|
|
||||||
principalTable: "fediverse_contents",
|
|
||||||
principalColumn: "id",
|
|
||||||
onDelete: ReferentialAction.Cascade);
|
|
||||||
});
|
|
||||||
|
|
||||||
migrationBuilder.CreateTable(
|
migrationBuilder.DropColumn(
|
||||||
name: "fediverse_reactions",
|
name: "language",
|
||||||
columns: table => new
|
table: "posts");
|
||||||
{
|
|
||||||
id = table.Column<Guid>(type: "uuid", nullable: false),
|
|
||||||
actor_id = table.Column<Guid>(type: "uuid", nullable: false),
|
|
||||||
content_id = table.Column<Guid>(type: "uuid", nullable: false),
|
|
||||||
created_at = table.Column<Instant>(type: "timestamp with time zone", nullable: false),
|
|
||||||
deleted_at = table.Column<Instant>(type: "timestamp with time zone", nullable: true),
|
|
||||||
emoji = table.Column<string>(type: "character varying(64)", maxLength: 64, nullable: true),
|
|
||||||
is_local = table.Column<bool>(type: "boolean", nullable: false),
|
|
||||||
local_account_id = table.Column<Guid>(type: "uuid", nullable: true),
|
|
||||||
local_reaction_id = table.Column<Guid>(type: "uuid", nullable: true),
|
|
||||||
type = table.Column<int>(type: "integer", nullable: false),
|
|
||||||
updated_at = table.Column<Instant>(type: "timestamp with time zone", nullable: false),
|
|
||||||
uri = table.Column<string>(type: "character varying(2048)", maxLength: 2048, nullable: false)
|
|
||||||
},
|
|
||||||
constraints: table =>
|
|
||||||
{
|
|
||||||
table.PrimaryKey("pk_fediverse_reactions", x => x.id);
|
|
||||||
table.ForeignKey(
|
|
||||||
name: "fk_fediverse_reactions_fediverse_actors_actor_id",
|
|
||||||
column: x => x.actor_id,
|
|
||||||
principalTable: "fediverse_actors",
|
|
||||||
principalColumn: "id",
|
|
||||||
onDelete: ReferentialAction.Cascade);
|
|
||||||
table.ForeignKey(
|
|
||||||
name: "fk_fediverse_reactions_fediverse_contents_content_id",
|
|
||||||
column: x => x.content_id,
|
|
||||||
principalTable: "fediverse_contents",
|
|
||||||
principalColumn: "id",
|
|
||||||
onDelete: ReferentialAction.Cascade);
|
|
||||||
});
|
|
||||||
|
|
||||||
migrationBuilder.CreateIndex(
|
migrationBuilder.DropColumn(
|
||||||
name: "ix_fediverse_activities_actor_id",
|
name: "fediverse_uri",
|
||||||
table: "fediverse_activities",
|
table: "posts");
|
||||||
column: "actor_id");
|
|
||||||
|
|
||||||
migrationBuilder.CreateIndex(
|
migrationBuilder.DropColumn(
|
||||||
name: "ix_fediverse_activities_content_id",
|
name: "fediverse_type",
|
||||||
table: "fediverse_activities",
|
table: "posts");
|
||||||
column: "content_id");
|
|
||||||
|
|
||||||
migrationBuilder.CreateIndex(
|
migrationBuilder.DropColumn(
|
||||||
name: "ix_fediverse_activities_target_actor_id",
|
name: "content_type",
|
||||||
table: "fediverse_activities",
|
table: "posts");
|
||||||
column: "target_actor_id");
|
|
||||||
|
|
||||||
migrationBuilder.CreateIndex(
|
migrationBuilder.DropColumn(
|
||||||
name: "ix_fediverse_contents_actor_id",
|
name: "boost_count",
|
||||||
table: "fediverse_contents",
|
table: "posts");
|
||||||
column: "actor_id");
|
|
||||||
|
|
||||||
migrationBuilder.CreateIndex(
|
migrationBuilder.DropColumn(
|
||||||
name: "ix_fediverse_contents_instance_id",
|
name: "actor_id",
|
||||||
table: "fediverse_contents",
|
table: "posts");
|
||||||
column: "instance_id");
|
|
||||||
|
|
||||||
migrationBuilder.CreateIndex(
|
migrationBuilder.AlterColumn<Guid>(
|
||||||
name: "ix_fediverse_contents_uri",
|
name: "publisher_id",
|
||||||
table: "fediverse_contents",
|
|
||||||
column: "uri",
|
|
||||||
unique: true);
|
|
||||||
|
|
||||||
migrationBuilder.CreateIndex(
|
|
||||||
name: "ix_fediverse_reactions_actor_id",
|
|
||||||
table: "fediverse_reactions",
|
|
||||||
column: "actor_id");
|
|
||||||
|
|
||||||
migrationBuilder.CreateIndex(
|
|
||||||
name: "ix_fediverse_reactions_content_id",
|
|
||||||
table: "fediverse_reactions",
|
|
||||||
column: "content_id");
|
|
||||||
|
|
||||||
migrationBuilder.AddForeignKey(
|
|
||||||
name: "fk_posts_publishers_publisher_id",
|
|
||||||
table: "posts",
|
table: "posts",
|
||||||
column: "publisher_id",
|
type: "uuid",
|
||||||
principalTable: "publishers",
|
nullable: false,
|
||||||
principalColumn: "id",
|
defaultValue: new Guid("00000000-0000-0000-0000-000000000000"),
|
||||||
onDelete: ReferentialAction.Cascade);
|
oldClrType: typeof(Guid),
|
||||||
|
oldType: "uuid",
|
||||||
|
oldNullable: true);
|
||||||
|
|
||||||
|
migrationBuilder.RenameColumn(
|
||||||
|
name: "metadata",
|
||||||
|
table: "posts",
|
||||||
|
newName: "meta");
|
||||||
|
|
||||||
|
migrationBuilder.DropTable(
|
||||||
|
name: "activity_pub_deliveries");
|
||||||
|
|
||||||
|
migrationBuilder.DropTable(
|
||||||
|
name: "fediverse_relationships");
|
||||||
|
|
||||||
|
migrationBuilder.DropTable(
|
||||||
|
name: "fediverse_actors");
|
||||||
|
|
||||||
|
migrationBuilder.DropTable(
|
||||||
|
name: "fediverse_instances");
|
||||||
|
|
||||||
|
migrationBuilder.DropColumn(
|
||||||
|
name: "public_key_pem",
|
||||||
|
table: "publishers");
|
||||||
|
|
||||||
|
migrationBuilder.DropColumn(
|
||||||
|
name: "private_key_pem",
|
||||||
|
table: "publishers");
|
||||||
|
|
||||||
|
migrationBuilder.DropColumn(
|
||||||
|
name: "meta",
|
||||||
|
table: "publishers");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user