💥 Switch all id to uuid

This commit is contained in:
2025-05-14 20:03:47 +08:00
parent aeeed24290
commit 9576870373
53 changed files with 765 additions and 24171 deletions

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,112 +0,0 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace DysonNetwork.Sphere.Migrations
{
/// <inheritdoc />
public partial class NoIdeaHowToNameThis : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "fk_message_reaction_chat_members_sender_id",
table: "message_reaction");
migrationBuilder.DropForeignKey(
name: "fk_message_reaction_chat_messages_message_id",
table: "message_reaction");
migrationBuilder.DropPrimaryKey(
name: "pk_message_reaction",
table: "message_reaction");
migrationBuilder.RenameTable(
name: "message_reaction",
newName: "chat_reactions");
migrationBuilder.RenameIndex(
name: "ix_message_reaction_sender_id",
table: "chat_reactions",
newName: "ix_chat_reactions_sender_id");
migrationBuilder.RenameIndex(
name: "ix_message_reaction_message_id",
table: "chat_reactions",
newName: "ix_chat_reactions_message_id");
migrationBuilder.AddPrimaryKey(
name: "pk_chat_reactions",
table: "chat_reactions",
column: "id");
migrationBuilder.AddForeignKey(
name: "fk_chat_reactions_chat_members_sender_id",
table: "chat_reactions",
column: "sender_id",
principalTable: "chat_members",
principalColumn: "id",
onDelete: ReferentialAction.Cascade);
migrationBuilder.AddForeignKey(
name: "fk_chat_reactions_chat_messages_message_id",
table: "chat_reactions",
column: "message_id",
principalTable: "chat_messages",
principalColumn: "id",
onDelete: ReferentialAction.Cascade);
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "fk_chat_reactions_chat_members_sender_id",
table: "chat_reactions");
migrationBuilder.DropForeignKey(
name: "fk_chat_reactions_chat_messages_message_id",
table: "chat_reactions");
migrationBuilder.DropPrimaryKey(
name: "pk_chat_reactions",
table: "chat_reactions");
migrationBuilder.RenameTable(
name: "chat_reactions",
newName: "message_reaction");
migrationBuilder.RenameIndex(
name: "ix_chat_reactions_sender_id",
table: "message_reaction",
newName: "ix_message_reaction_sender_id");
migrationBuilder.RenameIndex(
name: "ix_chat_reactions_message_id",
table: "message_reaction",
newName: "ix_message_reaction_message_id");
migrationBuilder.AddPrimaryKey(
name: "pk_message_reaction",
table: "message_reaction",
column: "id");
migrationBuilder.AddForeignKey(
name: "fk_message_reaction_chat_members_sender_id",
table: "message_reaction",
column: "sender_id",
principalTable: "chat_members",
principalColumn: "id",
onDelete: ReferentialAction.Cascade);
migrationBuilder.AddForeignKey(
name: "fk_message_reaction_chat_messages_message_id",
table: "message_reaction",
column: "message_id",
principalTable: "chat_messages",
principalColumn: "id",
onDelete: ReferentialAction.Cascade);
}
}
}

File diff suppressed because it is too large Load Diff

View File

@ -1,96 +0,0 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
using NodaTime;
#nullable disable
namespace DysonNetwork.Sphere.Migrations
{
/// <inheritdoc />
public partial class AddChatRealtimeCall : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AlterColumn<string>(
name: "content",
table: "chat_messages",
type: "character varying(4096)",
maxLength: 4096,
nullable: true,
oldClrType: typeof(string),
oldType: "character varying(4096)",
oldMaxLength: 4096);
migrationBuilder.AddColumn<string>(
name: "type",
table: "chat_messages",
type: "text",
nullable: false,
defaultValue: "");
migrationBuilder.CreateTable(
name: "chat_realtime_call",
columns: table => new
{
id = table.Column<Guid>(type: "uuid", nullable: false),
title = table.Column<string>(type: "text", nullable: true),
ended_at = table.Column<Instant>(type: "timestamp with time zone", nullable: true),
sender_id = table.Column<Guid>(type: "uuid", nullable: false),
room_id = table.Column<long>(type: "bigint", nullable: false),
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_chat_realtime_call", x => x.id);
table.ForeignKey(
name: "fk_chat_realtime_call_chat_members_sender_id",
column: x => x.sender_id,
principalTable: "chat_members",
principalColumn: "id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "fk_chat_realtime_call_chat_rooms_room_id",
column: x => x.room_id,
principalTable: "chat_rooms",
principalColumn: "id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateIndex(
name: "ix_chat_realtime_call_room_id",
table: "chat_realtime_call",
column: "room_id");
migrationBuilder.CreateIndex(
name: "ix_chat_realtime_call_sender_id",
table: "chat_realtime_call",
column: "sender_id");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "chat_realtime_call");
migrationBuilder.DropColumn(
name: "type",
table: "chat_messages");
migrationBuilder.AlterColumn<string>(
name: "content",
table: "chat_messages",
type: "character varying(4096)",
maxLength: 4096,
nullable: false,
defaultValue: "",
oldClrType: typeof(string),
oldType: "character varying(4096)",
oldMaxLength: 4096,
oldNullable: true);
}
}
}

File diff suppressed because it is too large Load Diff

View File

@ -1,54 +0,0 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
using NodaTime;
#nullable disable
namespace DysonNetwork.Sphere.Migrations
{
/// <inheritdoc />
public partial class AddAccountStatuses : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "account_statuses",
columns: table => new
{
id = table.Column<Guid>(type: "uuid", nullable: false),
attitude = table.Column<int>(type: "integer", nullable: false),
is_invisible = table.Column<bool>(type: "boolean", nullable: false),
is_not_disturb = table.Column<bool>(type: "boolean", nullable: false),
label = table.Column<string>(type: "character varying(1024)", maxLength: 1024, nullable: true),
cleared_at = table.Column<Instant>(type: "timestamp with time zone", nullable: true),
account_id = table.Column<long>(type: "bigint", nullable: false),
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_account_statuses", x => x.id);
table.ForeignKey(
name: "fk_account_statuses_accounts_account_id",
column: x => x.account_id,
principalTable: "accounts",
principalColumn: "id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateIndex(
name: "ix_account_statuses_account_id",
table: "account_statuses",
column: "account_id");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "account_statuses");
}
}
}

File diff suppressed because it is too large Load Diff

View File

@ -1,53 +0,0 @@
using System;
using System.Collections.Generic;
using DysonNetwork.Sphere.Account;
using Microsoft.EntityFrameworkCore.Migrations;
using NodaTime;
#nullable disable
namespace DysonNetwork.Sphere.Migrations
{
/// <inheritdoc />
public partial class AddAccountCheckIn : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "account_check_in_results",
columns: table => new
{
id = table.Column<Guid>(type: "uuid", nullable: false),
level = table.Column<int>(type: "integer", nullable: false),
tips = table.Column<ICollection<FortuneTip>>(type: "jsonb", nullable: false),
account_id = table.Column<long>(type: "bigint", nullable: false),
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_account_check_in_results", x => x.id);
table.ForeignKey(
name: "fk_account_check_in_results_accounts_account_id",
column: x => x.account_id,
principalTable: "accounts",
principalColumn: "id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateIndex(
name: "ix_account_check_in_results_account_id",
table: "account_check_in_results",
column: "account_id");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "account_check_in_results");
}
}
}

View File

@ -1,39 +0,0 @@
using System.Collections.Generic;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace DysonNetwork.Sphere.Migrations
{
/// <inheritdoc />
public partial class DontKnowHowToNameThing : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<Dictionary<string, object>>(
name: "meta",
table: "activities",
type: "jsonb",
nullable: false);
migrationBuilder.AddColumn<ICollection<long>>(
name: "users_visible",
table: "activities",
type: "jsonb",
nullable: false);
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "meta",
table: "activities");
migrationBuilder.DropColumn(
name: "users_visible",
table: "activities");
}
}
}

File diff suppressed because it is too large Load Diff

View File

@ -1,94 +0,0 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
using NodaTime;
#nullable disable
namespace DysonNetwork.Sphere.Migrations
{
/// <inheritdoc />
public partial class AddStickerAndPacks : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "sticker_packs",
columns: table => new
{
id = table.Column<Guid>(type: "uuid", nullable: false),
name = table.Column<string>(type: "character varying(1024)", maxLength: 1024, nullable: false),
description = table.Column<string>(type: "character varying(4096)", maxLength: 4096, nullable: false),
prefix = table.Column<string>(type: "character varying(128)", maxLength: 128, nullable: false),
publisher_id = table.Column<long>(type: "bigint", nullable: false),
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_sticker_packs", x => x.id);
table.ForeignKey(
name: "fk_sticker_packs_publishers_publisher_id",
column: x => x.publisher_id,
principalTable: "publishers",
principalColumn: "id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "stickers",
columns: table => new
{
id = table.Column<Guid>(type: "uuid", nullable: false),
slug = table.Column<string>(type: "character varying(128)", maxLength: 128, nullable: false),
image_id = table.Column<string>(type: "character varying(128)", nullable: false),
pack_id = table.Column<Guid>(type: "uuid", nullable: false),
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_stickers", x => x.id);
table.ForeignKey(
name: "fk_stickers_files_image_id",
column: x => x.image_id,
principalTable: "files",
principalColumn: "id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "fk_stickers_sticker_packs_pack_id",
column: x => x.pack_id,
principalTable: "sticker_packs",
principalColumn: "id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateIndex(
name: "ix_sticker_packs_publisher_id",
table: "sticker_packs",
column: "publisher_id");
migrationBuilder.CreateIndex(
name: "ix_stickers_image_id",
table: "stickers",
column: "image_id");
migrationBuilder.CreateIndex(
name: "ix_stickers_pack_id",
table: "stickers",
column: "pack_id");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "stickers");
migrationBuilder.DropTable(
name: "sticker_packs");
}
}
}

View File

@ -1,63 +0,0 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
using NodaTime;
#nullable disable
namespace DysonNetwork.Sphere.Migrations
{
/// <inheritdoc />
public partial class AddPublisherSubscription : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "publisher_subscriptions",
columns: table => new
{
id = table.Column<Guid>(type: "uuid", nullable: false),
publisher_id = table.Column<long>(type: "bigint", nullable: false),
account_id = table.Column<long>(type: "bigint", nullable: false),
status = table.Column<int>(type: "integer", nullable: false),
tier = table.Column<int>(type: "integer", nullable: false),
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_publisher_subscriptions", x => x.id);
table.ForeignKey(
name: "fk_publisher_subscriptions_accounts_account_id",
column: x => x.account_id,
principalTable: "accounts",
principalColumn: "id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "fk_publisher_subscriptions_publishers_publisher_id",
column: x => x.publisher_id,
principalTable: "publishers",
principalColumn: "id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateIndex(
name: "ix_publisher_subscriptions_account_id",
table: "publisher_subscriptions",
column: "account_id");
migrationBuilder.CreateIndex(
name: "ix_publisher_subscriptions_publisher_id",
table: "publisher_subscriptions",
column: "publisher_id");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "publisher_subscriptions");
}
}
}

View File

@ -1,48 +0,0 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace DysonNetwork.Sphere.Migrations
{
/// <inheritdoc />
public partial class PublisherWithOrganization : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<long>(
name: "realm_id",
table: "publishers",
type: "bigint",
nullable: true);
migrationBuilder.CreateIndex(
name: "ix_publishers_realm_id",
table: "publishers",
column: "realm_id");
migrationBuilder.AddForeignKey(
name: "fk_publishers_realms_realm_id",
table: "publishers",
column: "realm_id",
principalTable: "realms",
principalColumn: "id");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "fk_publishers_realms_realm_id",
table: "publishers");
migrationBuilder.DropIndex(
name: "ix_publishers_realm_id",
table: "publishers");
migrationBuilder.DropColumn(
name: "realm_id",
table: "publishers");
}
}
}

View File

@ -1,55 +0,0 @@
using System;
using System.Collections.Generic;
using Microsoft.EntityFrameworkCore.Migrations;
using NodaTime;
#nullable disable
namespace DysonNetwork.Sphere.Migrations
{
/// <inheritdoc />
public partial class AddAccountBadges : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "badges",
columns: table => new
{
id = table.Column<Guid>(type: "uuid", nullable: false),
type = table.Column<string>(type: "character varying(1024)", maxLength: 1024, nullable: false),
label = table.Column<string>(type: "character varying(1024)", maxLength: 1024, nullable: true),
caption = table.Column<string>(type: "character varying(4096)", maxLength: 4096, nullable: true),
meta = table.Column<Dictionary<string, object>>(type: "jsonb", nullable: false),
expired_at = table.Column<Instant>(type: "timestamp with time zone", nullable: true),
account_id = table.Column<long>(type: "bigint", nullable: false),
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_badges", x => x.id);
table.ForeignKey(
name: "fk_badges_accounts_account_id",
column: x => x.account_id,
principalTable: "accounts",
principalColumn: "id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateIndex(
name: "ix_badges_account_id",
table: "badges",
column: "account_id");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "badges");
}
}
}

View File

@ -17,8 +17,8 @@ using NpgsqlTypes;
namespace DysonNetwork.Sphere.Migrations
{
[DbContext(typeof(AppDatabase))]
[Migration("20250512160008_AddAccountBadges")]
partial class AddAccountBadges
[Migration("20250514115228_InitialMigration")]
partial class InitialMigration
{
/// <inheritdoc />
protected override void BuildTargetModel(ModelBuilder modelBuilder)
@ -32,13 +32,11 @@ namespace DysonNetwork.Sphere.Migrations
modelBuilder.Entity("DysonNetwork.Sphere.Account.Account", b =>
{
b.Property<long>("Id")
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint")
.HasColumnType("uuid")
.HasColumnName("id");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<long>("Id"));
b.Property<Instant?>("ActivatedAt")
.HasColumnType("timestamp with time zone")
.HasColumnName("activated_at");
@ -89,15 +87,13 @@ namespace DysonNetwork.Sphere.Migrations
modelBuilder.Entity("DysonNetwork.Sphere.Account.AccountAuthFactor", b =>
{
b.Property<long>("Id")
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint")
.HasColumnType("uuid")
.HasColumnName("id");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<long>("Id"));
b.Property<long>("AccountId")
.HasColumnType("bigint")
b.Property<Guid>("AccountId")
.HasColumnType("uuid")
.HasColumnName("account_id");
b.Property<Instant>("CreatedAt")
@ -109,7 +105,8 @@ namespace DysonNetwork.Sphere.Migrations
.HasColumnName("deleted_at");
b.Property<string>("Secret")
.HasColumnType("text")
.HasMaxLength(8196)
.HasColumnType("character varying(8196)")
.HasColumnName("secret");
b.Property<int>("Type")
@ -131,15 +128,13 @@ namespace DysonNetwork.Sphere.Migrations
modelBuilder.Entity("DysonNetwork.Sphere.Account.AccountContact", b =>
{
b.Property<long>("Id")
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint")
.HasColumnType("uuid")
.HasColumnName("id");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<long>("Id"));
b.Property<long>("AccountId")
.HasColumnType("bigint")
b.Property<Guid>("AccountId")
.HasColumnType("uuid")
.HasColumnName("account_id");
b.Property<string>("Content")
@ -184,8 +179,8 @@ namespace DysonNetwork.Sphere.Migrations
.HasColumnType("uuid")
.HasColumnName("id");
b.Property<long>("AccountId")
.HasColumnType("bigint")
b.Property<Guid>("AccountId")
.HasColumnType("uuid")
.HasColumnName("account_id");
b.Property<string>("Caption")
@ -241,8 +236,8 @@ namespace DysonNetwork.Sphere.Migrations
.HasColumnType("uuid")
.HasColumnName("id");
b.Property<long>("AccountId")
.HasColumnType("bigint")
b.Property<Guid>("AccountId")
.HasColumnType("uuid")
.HasColumnName("account_id");
b.Property<Instant>("CreatedAt")
@ -282,8 +277,8 @@ namespace DysonNetwork.Sphere.Migrations
.HasColumnType("uuid")
.HasColumnName("id");
b.Property<long?>("AccountId")
.HasColumnType("bigint")
b.Property<Guid?>("AccountId")
.HasColumnType("uuid")
.HasColumnName("account_id");
b.Property<Instant?>("AffectedAt")
@ -341,8 +336,8 @@ namespace DysonNetwork.Sphere.Migrations
.HasColumnType("uuid")
.HasColumnName("id");
b.Property<long>("AccountId")
.HasColumnType("bigint")
b.Property<Guid>("AccountId")
.HasColumnType("uuid")
.HasColumnName("account_id");
b.Property<string>("Content")
@ -406,8 +401,8 @@ namespace DysonNetwork.Sphere.Migrations
.HasColumnType("uuid")
.HasColumnName("id");
b.Property<long>("AccountId")
.HasColumnType("bigint")
b.Property<Guid>("AccountId")
.HasColumnType("uuid")
.HasColumnName("account_id");
b.Property<Instant>("CreatedAt")
@ -461,8 +456,8 @@ namespace DysonNetwork.Sphere.Migrations
modelBuilder.Entity("DysonNetwork.Sphere.Account.Profile", b =>
{
b.Property<long>("Id")
.HasColumnType("bigint")
b.Property<Guid>("Id")
.HasColumnType("uuid")
.HasColumnName("id");
b.Property<string>("BackgroundId")
@ -519,12 +514,12 @@ namespace DysonNetwork.Sphere.Migrations
modelBuilder.Entity("DysonNetwork.Sphere.Account.Relationship", b =>
{
b.Property<long>("AccountId")
.HasColumnType("bigint")
b.Property<Guid>("AccountId")
.HasColumnType("uuid")
.HasColumnName("account_id");
b.Property<long>("RelatedId")
.HasColumnType("bigint")
b.Property<Guid>("RelatedId")
.HasColumnType("uuid")
.HasColumnName("related_id");
b.Property<Instant>("CreatedAt")
@ -563,8 +558,8 @@ namespace DysonNetwork.Sphere.Migrations
.HasColumnType("uuid")
.HasColumnName("id");
b.Property<long>("AccountId")
.HasColumnType("bigint")
b.Property<Guid>("AccountId")
.HasColumnType("uuid")
.HasColumnName("account_id");
b.Property<int>("Attitude")
@ -616,8 +611,8 @@ namespace DysonNetwork.Sphere.Migrations
.HasColumnType("uuid")
.HasColumnName("id");
b.Property<long>("AccountId")
.HasColumnType("bigint")
b.Property<Guid>("AccountId")
.HasColumnType("uuid")
.HasColumnName("account_id");
b.Property<Instant>("CreatedAt")
@ -649,7 +644,7 @@ namespace DysonNetwork.Sphere.Migrations
.HasColumnType("timestamp with time zone")
.HasColumnName("updated_at");
b.Property<ICollection<long>>("UsersVisible")
b.Property<ICollection<Guid>>("UsersVisible")
.IsRequired()
.HasColumnType("jsonb")
.HasColumnName("users_visible");
@ -674,8 +669,8 @@ namespace DysonNetwork.Sphere.Migrations
.HasColumnType("uuid")
.HasColumnName("id");
b.Property<long>("AccountId")
.HasColumnType("bigint")
b.Property<Guid>("AccountId")
.HasColumnType("uuid")
.HasColumnName("account_id");
b.Property<List<string>>("Audiences")
@ -683,7 +678,7 @@ namespace DysonNetwork.Sphere.Migrations
.HasColumnType("jsonb")
.HasColumnName("audiences");
b.Property<List<long>>("BlacklistFactors")
b.Property<List<Guid>>("BlacklistFactors")
.IsRequired()
.HasColumnType("jsonb")
.HasColumnName("blacklist_factors");
@ -765,8 +760,8 @@ namespace DysonNetwork.Sphere.Migrations
.HasColumnType("uuid")
.HasColumnName("id");
b.Property<long>("AccountId")
.HasColumnType("bigint")
b.Property<Guid>("AccountId")
.HasColumnType("uuid")
.HasColumnName("account_id");
b.Property<Guid>("ChallengeId")
@ -817,12 +812,12 @@ namespace DysonNetwork.Sphere.Migrations
.HasColumnType("uuid")
.HasColumnName("id");
b.Property<long>("AccountId")
.HasColumnType("bigint")
b.Property<Guid>("AccountId")
.HasColumnType("uuid")
.HasColumnName("account_id");
b.Property<long>("ChatRoomId")
.HasColumnType("bigint")
b.Property<Guid>("ChatRoomId")
.HasColumnType("uuid")
.HasColumnName("chat_room_id");
b.Property<Instant>("CreatedAt")
@ -872,13 +867,11 @@ namespace DysonNetwork.Sphere.Migrations
modelBuilder.Entity("DysonNetwork.Sphere.Chat.ChatRoom", b =>
{
b.Property<long>("Id")
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint")
.HasColumnType("uuid")
.HasColumnName("id");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<long>("Id"));
b.Property<string>("BackgroundId")
.HasColumnType("character varying(128)")
.HasColumnName("background_id");
@ -911,8 +904,8 @@ namespace DysonNetwork.Sphere.Migrations
.HasColumnType("character varying(128)")
.HasColumnName("picture_id");
b.Property<long?>("RealmId")
.HasColumnType("bigint")
b.Property<Guid?>("RealmId")
.HasColumnType("uuid")
.HasColumnName("realm_id");
b.Property<int>("Type")
@ -945,8 +938,8 @@ namespace DysonNetwork.Sphere.Migrations
.HasColumnType("uuid")
.HasColumnName("id");
b.Property<long>("ChatRoomId")
.HasColumnType("bigint")
b.Property<Guid>("ChatRoomId")
.HasColumnType("uuid")
.HasColumnName("chat_room_id");
b.Property<string>("Content")
@ -1122,8 +1115,8 @@ namespace DysonNetwork.Sphere.Migrations
.HasColumnType("timestamp with time zone")
.HasColumnName("ended_at");
b.Property<long>("RoomId")
.HasColumnType("bigint")
b.Property<Guid>("RoomId")
.HasColumnType("uuid")
.HasColumnName("room_id");
b.Property<Guid>("SenderId")
@ -1286,13 +1279,11 @@ namespace DysonNetwork.Sphere.Migrations
modelBuilder.Entity("DysonNetwork.Sphere.Post.Post", b =>
{
b.Property<long>("Id")
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint")
.HasColumnType("uuid")
.HasColumnName("id");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<long>("Id"));
b.Property<string>("Content")
.HasColumnType("text")
.HasColumnName("content");
@ -1318,8 +1309,8 @@ namespace DysonNetwork.Sphere.Migrations
.HasColumnType("timestamp with time zone")
.HasColumnName("edited_at");
b.Property<long?>("ForwardedPostId")
.HasColumnType("bigint")
b.Property<Guid?>("ForwardedPostId")
.HasColumnType("uuid")
.HasColumnName("forwarded_post_id");
b.Property<string>("Language")
@ -1335,12 +1326,12 @@ namespace DysonNetwork.Sphere.Migrations
.HasColumnType("timestamp with time zone")
.HasColumnName("published_at");
b.Property<long>("PublisherId")
.HasColumnType("bigint")
b.Property<Guid>("PublisherId")
.HasColumnType("uuid")
.HasColumnName("publisher_id");
b.Property<long?>("RepliedPostId")
.HasColumnType("bigint")
b.Property<Guid?>("RepliedPostId")
.HasColumnType("uuid")
.HasColumnName("replied_post_id");
b.Property<NpgsqlTsVector>("SearchVector")
@ -1351,8 +1342,8 @@ namespace DysonNetwork.Sphere.Migrations
.HasAnnotation("Npgsql:TsVectorConfig", "simple")
.HasAnnotation("Npgsql:TsVectorProperties", new[] { "Title", "Description", "Content" });
b.Property<long?>("ThreadedPostId")
.HasColumnType("bigint")
b.Property<Guid?>("ThreadedPostId")
.HasColumnType("uuid")
.HasColumnName("threaded_post_id");
b.Property<string>("Title")
@ -1410,13 +1401,11 @@ namespace DysonNetwork.Sphere.Migrations
modelBuilder.Entity("DysonNetwork.Sphere.Post.PostCategory", b =>
{
b.Property<long>("Id")
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint")
.HasColumnType("uuid")
.HasColumnName("id");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<long>("Id"));
b.Property<Instant>("CreatedAt")
.HasColumnType("timestamp with time zone")
.HasColumnName("created_at");
@ -1448,13 +1437,11 @@ namespace DysonNetwork.Sphere.Migrations
modelBuilder.Entity("DysonNetwork.Sphere.Post.PostCollection", b =>
{
b.Property<long>("Id")
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint")
.HasColumnType("uuid")
.HasColumnName("id");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<long>("Id"));
b.Property<Instant>("CreatedAt")
.HasColumnType("timestamp with time zone")
.HasColumnName("created_at");
@ -1473,8 +1460,8 @@ namespace DysonNetwork.Sphere.Migrations
.HasColumnType("character varying(256)")
.HasColumnName("name");
b.Property<long>("PublisherId")
.HasColumnType("bigint")
b.Property<Guid>("PublisherId")
.HasColumnType("uuid")
.HasColumnName("publisher_id");
b.Property<string>("Slug")
@ -1498,15 +1485,13 @@ namespace DysonNetwork.Sphere.Migrations
modelBuilder.Entity("DysonNetwork.Sphere.Post.PostReaction", b =>
{
b.Property<long>("Id")
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint")
.HasColumnType("uuid")
.HasColumnName("id");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<long>("Id"));
b.Property<long>("AccountId")
.HasColumnType("bigint")
b.Property<Guid>("AccountId")
.HasColumnType("uuid")
.HasColumnName("account_id");
b.Property<int>("Attitude")
@ -1521,8 +1506,8 @@ namespace DysonNetwork.Sphere.Migrations
.HasColumnType("timestamp with time zone")
.HasColumnName("deleted_at");
b.Property<long>("PostId")
.HasColumnType("bigint")
b.Property<Guid>("PostId")
.HasColumnType("uuid")
.HasColumnName("post_id");
b.Property<string>("Symbol")
@ -1549,13 +1534,11 @@ namespace DysonNetwork.Sphere.Migrations
modelBuilder.Entity("DysonNetwork.Sphere.Post.PostTag", b =>
{
b.Property<long>("Id")
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint")
.HasColumnType("uuid")
.HasColumnName("id");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<long>("Id"));
b.Property<Instant>("CreatedAt")
.HasColumnType("timestamp with time zone")
.HasColumnName("created_at");
@ -1587,15 +1570,13 @@ namespace DysonNetwork.Sphere.Migrations
modelBuilder.Entity("DysonNetwork.Sphere.Post.Publisher", b =>
{
b.Property<long>("Id")
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint")
.HasColumnType("uuid")
.HasColumnName("id");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<long>("Id"));
b.Property<long?>("AccountId")
.HasColumnType("bigint")
b.Property<Guid?>("AccountId")
.HasColumnType("uuid")
.HasColumnName("account_id");
b.Property<string>("BackgroundId")
@ -1635,8 +1616,8 @@ namespace DysonNetwork.Sphere.Migrations
.HasColumnType("integer")
.HasColumnName("publisher_type");
b.Property<long?>("RealmId")
.HasColumnType("bigint")
b.Property<Guid?>("RealmId")
.HasColumnType("uuid")
.HasColumnName("realm_id");
b.Property<Instant>("UpdatedAt")
@ -1667,12 +1648,12 @@ namespace DysonNetwork.Sphere.Migrations
modelBuilder.Entity("DysonNetwork.Sphere.Post.PublisherMember", b =>
{
b.Property<long>("PublisherId")
.HasColumnType("bigint")
b.Property<Guid>("PublisherId")
.HasColumnType("uuid")
.HasColumnName("publisher_id");
b.Property<long>("AccountId")
.HasColumnType("bigint")
b.Property<Guid>("AccountId")
.HasColumnType("uuid")
.HasColumnName("account_id");
b.Property<Instant>("CreatedAt")
@ -1711,8 +1692,8 @@ namespace DysonNetwork.Sphere.Migrations
.HasColumnType("uuid")
.HasColumnName("id");
b.Property<long>("AccountId")
.HasColumnType("bigint")
b.Property<Guid>("AccountId")
.HasColumnType("uuid")
.HasColumnName("account_id");
b.Property<Instant>("CreatedAt")
@ -1723,8 +1704,8 @@ namespace DysonNetwork.Sphere.Migrations
.HasColumnType("timestamp with time zone")
.HasColumnName("deleted_at");
b.Property<long>("PublisherId")
.HasColumnType("bigint")
b.Property<Guid>("PublisherId")
.HasColumnType("uuid")
.HasColumnName("publisher_id");
b.Property<int>("Status")
@ -1753,15 +1734,13 @@ namespace DysonNetwork.Sphere.Migrations
modelBuilder.Entity("DysonNetwork.Sphere.Realm.Realm", b =>
{
b.Property<long>("Id")
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint")
.HasColumnType("uuid")
.HasColumnName("id");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<long>("Id"));
b.Property<long>("AccountId")
.HasColumnType("bigint")
b.Property<Guid>("AccountId")
.HasColumnType("uuid")
.HasColumnName("account_id");
b.Property<string>("BackgroundId")
@ -1840,12 +1819,12 @@ namespace DysonNetwork.Sphere.Migrations
modelBuilder.Entity("DysonNetwork.Sphere.Realm.RealmMember", b =>
{
b.Property<long>("RealmId")
.HasColumnType("bigint")
b.Property<Guid>("RealmId")
.HasColumnType("uuid")
.HasColumnName("realm_id");
b.Property<long>("AccountId")
.HasColumnType("bigint")
b.Property<Guid>("AccountId")
.HasColumnType("uuid")
.HasColumnName("account_id");
b.Property<Instant>("CreatedAt")
@ -1956,8 +1935,8 @@ namespace DysonNetwork.Sphere.Migrations
.HasColumnType("character varying(128)")
.HasColumnName("prefix");
b.Property<long>("PublisherId")
.HasColumnType("bigint")
b.Property<Guid>("PublisherId")
.HasColumnType("uuid")
.HasColumnName("publisher_id");
b.Property<Instant>("UpdatedAt")
@ -1980,8 +1959,8 @@ namespace DysonNetwork.Sphere.Migrations
.HasColumnType("character varying(128)")
.HasColumnName("id");
b.Property<long>("AccountId")
.HasColumnType("bigint")
b.Property<Guid>("AccountId")
.HasColumnType("uuid")
.HasColumnName("account_id");
b.Property<Instant>("CreatedAt")
@ -2029,8 +2008,8 @@ namespace DysonNetwork.Sphere.Migrations
.HasColumnType("character varying(1024)")
.HasColumnName("name");
b.Property<long?>("PostId")
.HasColumnType("bigint")
b.Property<Guid?>("PostId")
.HasColumnType("uuid")
.HasColumnName("post_id");
b.Property<long>("Size")
@ -2075,12 +2054,12 @@ namespace DysonNetwork.Sphere.Migrations
modelBuilder.Entity("PostPostCategory", b =>
{
b.Property<long>("CategoriesId")
.HasColumnType("bigint")
b.Property<Guid>("CategoriesId")
.HasColumnType("uuid")
.HasColumnName("categories_id");
b.Property<long>("PostsId")
.HasColumnType("bigint")
b.Property<Guid>("PostsId")
.HasColumnType("uuid")
.HasColumnName("posts_id");
b.HasKey("CategoriesId", "PostsId")
@ -2094,12 +2073,12 @@ namespace DysonNetwork.Sphere.Migrations
modelBuilder.Entity("PostPostCollection", b =>
{
b.Property<long>("CollectionsId")
.HasColumnType("bigint")
b.Property<Guid>("CollectionsId")
.HasColumnType("uuid")
.HasColumnName("collections_id");
b.Property<long>("PostsId")
.HasColumnType("bigint")
b.Property<Guid>("PostsId")
.HasColumnType("uuid")
.HasColumnName("posts_id");
b.HasKey("CollectionsId", "PostsId")
@ -2113,12 +2092,12 @@ namespace DysonNetwork.Sphere.Migrations
modelBuilder.Entity("PostPostTag", b =>
{
b.Property<long>("PostsId")
.HasColumnType("bigint")
b.Property<Guid>("PostsId")
.HasColumnType("uuid")
.HasColumnName("posts_id");
b.Property<long>("TagsId")
.HasColumnType("bigint")
b.Property<Guid>("TagsId")
.HasColumnType("uuid")
.HasColumnName("tags_id");
b.HasKey("PostsId", "TagsId")

View File

@ -1,9 +1,9 @@
using System;
using System.Collections.Generic;
using System.Text.Json;
using DysonNetwork.Sphere.Account;
using Microsoft.EntityFrameworkCore.Migrations;
using NodaTime;
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
using NpgsqlTypes;
#nullable disable
@ -20,8 +20,7 @@ namespace DysonNetwork.Sphere.Migrations
name: "accounts",
columns: table => new
{
id = table.Column<long>(type: "bigint", nullable: false)
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
id = table.Column<Guid>(type: "uuid", nullable: false),
name = table.Column<string>(type: "character varying(256)", maxLength: 256, nullable: false),
nick = table.Column<string>(type: "character varying(256)", maxLength: 256, nullable: false),
language = table.Column<string>(type: "character varying(32)", maxLength: 32, nullable: false),
@ -55,8 +54,7 @@ namespace DysonNetwork.Sphere.Migrations
name: "post_categories",
columns: table => new
{
id = table.Column<long>(type: "bigint", nullable: false)
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
id = table.Column<Guid>(type: "uuid", nullable: false),
slug = table.Column<string>(type: "character varying(128)", maxLength: 128, nullable: false),
name = table.Column<string>(type: "character varying(256)", maxLength: 256, nullable: true),
created_at = table.Column<Instant>(type: "timestamp with time zone", nullable: false),
@ -72,8 +70,7 @@ namespace DysonNetwork.Sphere.Migrations
name: "post_tags",
columns: table => new
{
id = table.Column<long>(type: "bigint", nullable: false)
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
id = table.Column<Guid>(type: "uuid", nullable: false),
slug = table.Column<string>(type: "character varying(128)", maxLength: 128, nullable: false),
name = table.Column<string>(type: "character varying(256)", maxLength: 256, nullable: true),
created_at = table.Column<Instant>(type: "timestamp with time zone", nullable: false),
@ -89,11 +86,10 @@ namespace DysonNetwork.Sphere.Migrations
name: "account_auth_factors",
columns: table => new
{
id = table.Column<long>(type: "bigint", nullable: false)
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
id = table.Column<Guid>(type: "uuid", nullable: false),
type = table.Column<int>(type: "integer", nullable: false),
secret = table.Column<string>(type: "text", nullable: true),
account_id = table.Column<long>(type: "bigint", nullable: false),
secret = table.Column<string>(type: "character varying(8196)", maxLength: 8196, nullable: true),
account_id = table.Column<Guid>(type: "uuid", nullable: false),
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)
@ -109,16 +105,38 @@ namespace DysonNetwork.Sphere.Migrations
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "account_check_in_results",
columns: table => new
{
id = table.Column<Guid>(type: "uuid", nullable: false),
level = table.Column<int>(type: "integer", nullable: false),
tips = table.Column<ICollection<FortuneTip>>(type: "jsonb", nullable: false),
account_id = table.Column<Guid>(type: "uuid", nullable: false),
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_account_check_in_results", x => x.id);
table.ForeignKey(
name: "fk_account_check_in_results_accounts_account_id",
column: x => x.account_id,
principalTable: "accounts",
principalColumn: "id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "account_contacts",
columns: table => new
{
id = table.Column<long>(type: "bigint", nullable: false)
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
id = table.Column<Guid>(type: "uuid", nullable: false),
type = table.Column<int>(type: "integer", nullable: false),
verified_at = table.Column<Instant>(type: "timestamp with time zone", nullable: true),
content = table.Column<string>(type: "character varying(1024)", maxLength: 1024, nullable: false),
account_id = table.Column<long>(type: "bigint", nullable: false),
account_id = table.Column<Guid>(type: "uuid", nullable: false),
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)
@ -138,8 +156,8 @@ namespace DysonNetwork.Sphere.Migrations
name: "account_relationships",
columns: table => new
{
account_id = table.Column<long>(type: "bigint", nullable: false),
related_id = table.Column<long>(type: "bigint", nullable: false),
account_id = table.Column<Guid>(type: "uuid", nullable: false),
related_id = table.Column<Guid>(type: "uuid", nullable: false),
expired_at = table.Column<Instant>(type: "timestamp with time zone", nullable: true),
status = table.Column<int>(type: "integer", nullable: false),
created_at = table.Column<Instant>(type: "timestamp with time zone", nullable: false),
@ -163,6 +181,32 @@ namespace DysonNetwork.Sphere.Migrations
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "account_statuses",
columns: table => new
{
id = table.Column<Guid>(type: "uuid", nullable: false),
attitude = table.Column<int>(type: "integer", nullable: false),
is_invisible = table.Column<bool>(type: "boolean", nullable: false),
is_not_disturb = table.Column<bool>(type: "boolean", nullable: false),
label = table.Column<string>(type: "character varying(1024)", maxLength: 1024, nullable: true),
cleared_at = table.Column<Instant>(type: "timestamp with time zone", nullable: true),
account_id = table.Column<Guid>(type: "uuid", nullable: false),
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_account_statuses", x => x.id);
table.ForeignKey(
name: "fk_account_statuses_accounts_account_id",
column: x => x.account_id,
principalTable: "accounts",
principalColumn: "id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "activities",
columns: table => new
@ -171,7 +215,9 @@ namespace DysonNetwork.Sphere.Migrations
type = table.Column<string>(type: "character varying(1024)", maxLength: 1024, nullable: false),
resource_identifier = table.Column<string>(type: "character varying(4096)", maxLength: 4096, nullable: false),
visibility = table.Column<int>(type: "integer", nullable: false),
account_id = table.Column<long>(type: "bigint", nullable: false),
meta = table.Column<Dictionary<string, object>>(type: "jsonb", nullable: false),
users_visible = table.Column<ICollection<Guid>>(type: "jsonb", nullable: false),
account_id = table.Column<Guid>(type: "uuid", nullable: false),
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)
@ -198,14 +244,14 @@ namespace DysonNetwork.Sphere.Migrations
failed_attempts = table.Column<int>(type: "integer", nullable: false),
platform = table.Column<int>(type: "integer", nullable: false),
type = table.Column<int>(type: "integer", nullable: false),
blacklist_factors = table.Column<List<long>>(type: "jsonb", nullable: false),
blacklist_factors = table.Column<List<Guid>>(type: "jsonb", nullable: false),
audiences = table.Column<List<string>>(type: "jsonb", nullable: false),
scopes = table.Column<List<string>>(type: "jsonb", nullable: false),
ip_address = table.Column<string>(type: "character varying(128)", maxLength: 128, nullable: true),
user_agent = table.Column<string>(type: "character varying(512)", maxLength: 512, nullable: true),
device_id = table.Column<string>(type: "character varying(256)", maxLength: 256, nullable: true),
nonce = table.Column<string>(type: "character varying(1024)", maxLength: 1024, nullable: true),
account_id = table.Column<long>(type: "bigint", nullable: false),
account_id = table.Column<Guid>(type: "uuid", nullable: false),
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)
@ -221,6 +267,32 @@ namespace DysonNetwork.Sphere.Migrations
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "badges",
columns: table => new
{
id = table.Column<Guid>(type: "uuid", nullable: false),
type = table.Column<string>(type: "character varying(1024)", maxLength: 1024, nullable: false),
label = table.Column<string>(type: "character varying(1024)", maxLength: 1024, nullable: true),
caption = table.Column<string>(type: "character varying(4096)", maxLength: 4096, nullable: true),
meta = table.Column<Dictionary<string, object>>(type: "jsonb", nullable: false),
expired_at = table.Column<Instant>(type: "timestamp with time zone", nullable: true),
account_id = table.Column<Guid>(type: "uuid", nullable: false),
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_badges", x => x.id);
table.ForeignKey(
name: "fk_badges_accounts_account_id",
column: x => x.account_id,
principalTable: "accounts",
principalColumn: "id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "magic_spells",
columns: table => new
@ -231,7 +303,7 @@ namespace DysonNetwork.Sphere.Migrations
expires_at = table.Column<Instant>(type: "timestamp with time zone", nullable: true),
affected_at = table.Column<Instant>(type: "timestamp with time zone", nullable: true),
meta = table.Column<Dictionary<string, object>>(type: "jsonb", nullable: false),
account_id = table.Column<long>(type: "bigint", nullable: true),
account_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)
@ -255,7 +327,7 @@ namespace DysonNetwork.Sphere.Migrations
device_token = table.Column<string>(type: "character varying(4096)", maxLength: 4096, nullable: false),
provider = table.Column<int>(type: "integer", nullable: false),
last_used_at = table.Column<Instant>(type: "timestamp with time zone", nullable: true),
account_id = table.Column<long>(type: "bigint", nullable: false),
account_id = table.Column<Guid>(type: "uuid", nullable: false),
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)
@ -283,7 +355,7 @@ namespace DysonNetwork.Sphere.Migrations
meta = table.Column<Dictionary<string, object>>(type: "jsonb", nullable: true),
priority = table.Column<int>(type: "integer", nullable: false),
viewed_at = table.Column<Instant>(type: "timestamp with time zone", nullable: true),
account_id = table.Column<long>(type: "bigint", nullable: false),
account_id = table.Column<Guid>(type: "uuid", nullable: false),
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)
@ -356,7 +428,7 @@ namespace DysonNetwork.Sphere.Migrations
label = table.Column<string>(type: "character varying(1024)", maxLength: 1024, nullable: true),
last_granted_at = table.Column<Instant>(type: "timestamp with time zone", nullable: true),
expired_at = table.Column<Instant>(type: "timestamp with time zone", nullable: true),
account_id = table.Column<long>(type: "bigint", nullable: false),
account_id = table.Column<Guid>(type: "uuid", nullable: false),
challenge_id = table.Column<Guid>(type: "uuid", nullable: false),
created_at = table.Column<Instant>(type: "timestamp with time zone", nullable: false),
updated_at = table.Column<Instant>(type: "timestamp with time zone", nullable: false),
@ -383,7 +455,7 @@ namespace DysonNetwork.Sphere.Migrations
name: "account_profiles",
columns: table => new
{
id = table.Column<long>(type: "bigint", nullable: false),
id = table.Column<Guid>(type: "uuid", nullable: false),
first_name = table.Column<string>(type: "character varying(256)", maxLength: 256, nullable: true),
middle_name = table.Column<string>(type: "character varying(256)", maxLength: 256, nullable: true),
last_name = table.Column<string>(type: "character varying(256)", maxLength: 256, nullable: true),
@ -410,8 +482,8 @@ namespace DysonNetwork.Sphere.Migrations
columns: table => new
{
id = table.Column<Guid>(type: "uuid", nullable: false),
chat_room_id = table.Column<long>(type: "bigint", nullable: false),
account_id = table.Column<long>(type: "bigint", nullable: false),
chat_room_id = table.Column<Guid>(type: "uuid", nullable: false),
account_id = table.Column<Guid>(type: "uuid", nullable: false),
nick = table.Column<string>(type: "character varying(1024)", maxLength: 1024, nullable: true),
role = table.Column<int>(type: "integer", nullable: false),
notify = table.Column<int>(type: "integer", nullable: false),
@ -438,7 +510,8 @@ namespace DysonNetwork.Sphere.Migrations
columns: table => new
{
id = table.Column<Guid>(type: "uuid", nullable: false),
content = table.Column<string>(type: "character varying(4096)", maxLength: 4096, nullable: false),
type = table.Column<string>(type: "text", nullable: false),
content = table.Column<string>(type: "character varying(4096)", maxLength: 4096, nullable: true),
meta = table.Column<Dictionary<string, object>>(type: "jsonb", nullable: true),
members_mentioned = table.Column<List<Guid>>(type: "jsonb", nullable: true),
nonce = table.Column<string>(type: "character varying(36)", maxLength: 36, nullable: false),
@ -446,7 +519,7 @@ namespace DysonNetwork.Sphere.Migrations
replied_message_id = table.Column<Guid>(type: "uuid", nullable: true),
forwarded_message_id = table.Column<Guid>(type: "uuid", nullable: true),
sender_id = table.Column<Guid>(type: "uuid", nullable: false),
chat_room_id = table.Column<long>(type: "bigint", nullable: false),
chat_room_id = table.Column<Guid>(type: "uuid", nullable: false),
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)
@ -474,6 +547,36 @@ namespace DysonNetwork.Sphere.Migrations
onDelete: ReferentialAction.Restrict);
});
migrationBuilder.CreateTable(
name: "chat_reactions",
columns: table => new
{
id = table.Column<Guid>(type: "uuid", nullable: false),
message_id = table.Column<Guid>(type: "uuid", nullable: false),
sender_id = table.Column<Guid>(type: "uuid", nullable: false),
symbol = table.Column<string>(type: "character varying(256)", maxLength: 256, nullable: false),
attitude = table.Column<int>(type: "integer", nullable: false),
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_chat_reactions", x => x.id);
table.ForeignKey(
name: "fk_chat_reactions_chat_members_sender_id",
column: x => x.sender_id,
principalTable: "chat_members",
principalColumn: "id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "fk_chat_reactions_chat_messages_message_id",
column: x => x.message_id,
principalTable: "chat_messages",
principalColumn: "id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "chat_statuses",
columns: table => new
@ -503,48 +606,41 @@ namespace DysonNetwork.Sphere.Migrations
});
migrationBuilder.CreateTable(
name: "message_reaction",
name: "chat_realtime_call",
columns: table => new
{
id = table.Column<Guid>(type: "uuid", nullable: false),
message_id = table.Column<Guid>(type: "uuid", nullable: false),
title = table.Column<string>(type: "text", nullable: true),
ended_at = table.Column<Instant>(type: "timestamp with time zone", nullable: true),
sender_id = table.Column<Guid>(type: "uuid", nullable: false),
symbol = table.Column<string>(type: "character varying(256)", maxLength: 256, nullable: false),
attitude = table.Column<int>(type: "integer", nullable: false),
room_id = table.Column<Guid>(type: "uuid", nullable: false),
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_message_reaction", x => x.id);
table.PrimaryKey("pk_chat_realtime_call", x => x.id);
table.ForeignKey(
name: "fk_message_reaction_chat_members_sender_id",
name: "fk_chat_realtime_call_chat_members_sender_id",
column: x => x.sender_id,
principalTable: "chat_members",
principalColumn: "id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "fk_message_reaction_chat_messages_message_id",
column: x => x.message_id,
principalTable: "chat_messages",
principalColumn: "id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "chat_rooms",
columns: table => new
{
id = table.Column<long>(type: "bigint", nullable: false)
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
id = table.Column<Guid>(type: "uuid", nullable: false),
name = table.Column<string>(type: "character varying(1024)", maxLength: 1024, nullable: false),
description = table.Column<string>(type: "character varying(4096)", maxLength: 4096, nullable: false),
type = table.Column<int>(type: "integer", nullable: false),
is_public = table.Column<bool>(type: "boolean", nullable: false),
picture_id = table.Column<string>(type: "character varying(128)", nullable: true),
background_id = table.Column<string>(type: "character varying(128)", nullable: true),
realm_id = table.Column<long>(type: "bigint", nullable: true),
realm_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)
@ -571,9 +667,9 @@ namespace DysonNetwork.Sphere.Migrations
uploaded_to = table.Column<string>(type: "character varying(128)", maxLength: 128, nullable: true),
has_compression = table.Column<bool>(type: "boolean", nullable: false),
used_count = table.Column<int>(type: "integer", nullable: false),
account_id = table.Column<long>(type: "bigint", nullable: false),
account_id = table.Column<Guid>(type: "uuid", nullable: false),
message_id = table.Column<Guid>(type: "uuid", nullable: true),
post_id = table.Column<long>(type: "bigint", nullable: true),
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)
@ -594,49 +690,11 @@ namespace DysonNetwork.Sphere.Migrations
principalColumn: "id");
});
migrationBuilder.CreateTable(
name: "publishers",
columns: table => new
{
id = table.Column<long>(type: "bigint", nullable: false)
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
publisher_type = table.Column<int>(type: "integer", nullable: false),
name = table.Column<string>(type: "character varying(256)", maxLength: 256, nullable: false),
nick = table.Column<string>(type: "character varying(256)", maxLength: 256, nullable: false),
bio = table.Column<string>(type: "character varying(4096)", maxLength: 4096, nullable: true),
picture_id = table.Column<string>(type: "character varying(128)", nullable: true),
background_id = table.Column<string>(type: "character varying(128)", nullable: true),
account_id = table.Column<long>(type: "bigint", 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_publishers", x => x.id);
table.ForeignKey(
name: "fk_publishers_accounts_account_id",
column: x => x.account_id,
principalTable: "accounts",
principalColumn: "id");
table.ForeignKey(
name: "fk_publishers_files_background_id",
column: x => x.background_id,
principalTable: "files",
principalColumn: "id");
table.ForeignKey(
name: "fk_publishers_files_picture_id",
column: x => x.picture_id,
principalTable: "files",
principalColumn: "id");
});
migrationBuilder.CreateTable(
name: "realms",
columns: table => new
{
id = table.Column<long>(type: "bigint", nullable: false)
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
id = table.Column<Guid>(type: "uuid", nullable: false),
slug = table.Column<string>(type: "character varying(1024)", maxLength: 1024, nullable: false),
name = table.Column<string>(type: "character varying(1024)", maxLength: 1024, nullable: false),
description = table.Column<string>(type: "character varying(4096)", maxLength: 4096, nullable: false),
@ -646,7 +704,7 @@ namespace DysonNetwork.Sphere.Migrations
is_public = table.Column<bool>(type: "boolean", nullable: false),
picture_id = table.Column<string>(type: "character varying(128)", nullable: true),
background_id = table.Column<string>(type: "character varying(128)", nullable: true),
account_id = table.Column<long>(type: "bigint", nullable: false),
account_id = table.Column<Guid>(type: "uuid", nullable: false),
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)
@ -672,16 +730,86 @@ namespace DysonNetwork.Sphere.Migrations
principalColumn: "id");
});
migrationBuilder.CreateTable(
name: "publishers",
columns: table => new
{
id = table.Column<Guid>(type: "uuid", nullable: false),
publisher_type = table.Column<int>(type: "integer", nullable: false),
name = table.Column<string>(type: "character varying(256)", maxLength: 256, nullable: false),
nick = table.Column<string>(type: "character varying(256)", maxLength: 256, nullable: false),
bio = table.Column<string>(type: "character varying(4096)", maxLength: 4096, nullable: true),
picture_id = table.Column<string>(type: "character varying(128)", nullable: true),
background_id = table.Column<string>(type: "character varying(128)", nullable: true),
account_id = table.Column<Guid>(type: "uuid", nullable: true),
realm_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_publishers", x => x.id);
table.ForeignKey(
name: "fk_publishers_accounts_account_id",
column: x => x.account_id,
principalTable: "accounts",
principalColumn: "id");
table.ForeignKey(
name: "fk_publishers_files_background_id",
column: x => x.background_id,
principalTable: "files",
principalColumn: "id");
table.ForeignKey(
name: "fk_publishers_files_picture_id",
column: x => x.picture_id,
principalTable: "files",
principalColumn: "id");
table.ForeignKey(
name: "fk_publishers_realms_realm_id",
column: x => x.realm_id,
principalTable: "realms",
principalColumn: "id");
});
migrationBuilder.CreateTable(
name: "realm_members",
columns: table => new
{
realm_id = table.Column<Guid>(type: "uuid", nullable: false),
account_id = table.Column<Guid>(type: "uuid", nullable: false),
role = table.Column<int>(type: "integer", nullable: false),
joined_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_realm_members", x => new { x.realm_id, x.account_id });
table.ForeignKey(
name: "fk_realm_members_accounts_account_id",
column: x => x.account_id,
principalTable: "accounts",
principalColumn: "id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "fk_realm_members_realms_realm_id",
column: x => x.realm_id,
principalTable: "realms",
principalColumn: "id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "post_collections",
columns: table => new
{
id = table.Column<long>(type: "bigint", nullable: false)
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
id = table.Column<Guid>(type: "uuid", nullable: false),
slug = table.Column<string>(type: "character varying(128)", maxLength: 128, nullable: false),
name = table.Column<string>(type: "character varying(256)", maxLength: 256, nullable: true),
description = table.Column<string>(type: "character varying(4096)", maxLength: 4096, nullable: true),
publisher_id = table.Column<long>(type: "bigint", nullable: false),
publisher_id = table.Column<Guid>(type: "uuid", nullable: false),
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)
@ -701,8 +829,7 @@ namespace DysonNetwork.Sphere.Migrations
name: "posts",
columns: table => new
{
id = table.Column<long>(type: "bigint", nullable: false)
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
id = table.Column<Guid>(type: "uuid", nullable: false),
title = table.Column<string>(type: "character varying(1024)", maxLength: 1024, nullable: true),
description = table.Column<string>(type: "character varying(4096)", maxLength: 4096, nullable: true),
language = table.Column<string>(type: "character varying(128)", maxLength: 128, nullable: true),
@ -716,13 +843,13 @@ namespace DysonNetwork.Sphere.Migrations
views_total = table.Column<int>(type: "integer", nullable: false),
upvotes = table.Column<int>(type: "integer", nullable: false),
downvotes = table.Column<int>(type: "integer", nullable: false),
threaded_post_id = table.Column<long>(type: "bigint", nullable: true),
replied_post_id = table.Column<long>(type: "bigint", nullable: true),
forwarded_post_id = table.Column<long>(type: "bigint", nullable: true),
threaded_post_id = table.Column<Guid>(type: "uuid", nullable: true),
replied_post_id = table.Column<Guid>(type: "uuid", nullable: true),
forwarded_post_id = table.Column<Guid>(type: "uuid", nullable: true),
search_vector = table.Column<NpgsqlTsVector>(type: "tsvector", nullable: false)
.Annotation("Npgsql:TsVectorConfig", "simple")
.Annotation("Npgsql:TsVectorProperties", new[] { "title", "description", "content" }),
publisher_id = table.Column<long>(type: "bigint", nullable: false),
publisher_id = table.Column<Guid>(type: "uuid", nullable: false),
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)
@ -759,8 +886,8 @@ namespace DysonNetwork.Sphere.Migrations
name: "publisher_members",
columns: table => new
{
publisher_id = table.Column<long>(type: "bigint", nullable: false),
account_id = table.Column<long>(type: "bigint", nullable: false),
publisher_id = table.Column<Guid>(type: "uuid", nullable: false),
account_id = table.Column<Guid>(type: "uuid", nullable: false),
role = table.Column<int>(type: "integer", nullable: false),
joined_at = table.Column<Instant>(type: "timestamp with time zone", nullable: true),
created_at = table.Column<Instant>(type: "timestamp with time zone", nullable: false),
@ -785,30 +912,55 @@ namespace DysonNetwork.Sphere.Migrations
});
migrationBuilder.CreateTable(
name: "realm_members",
name: "publisher_subscriptions",
columns: table => new
{
realm_id = table.Column<long>(type: "bigint", nullable: false),
account_id = table.Column<long>(type: "bigint", nullable: false),
role = table.Column<int>(type: "integer", nullable: false),
joined_at = table.Column<Instant>(type: "timestamp with time zone", nullable: true),
id = table.Column<Guid>(type: "uuid", nullable: false),
publisher_id = table.Column<Guid>(type: "uuid", nullable: false),
account_id = table.Column<Guid>(type: "uuid", nullable: false),
status = table.Column<int>(type: "integer", nullable: false),
tier = table.Column<int>(type: "integer", nullable: false),
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_realm_members", x => new { x.realm_id, x.account_id });
table.PrimaryKey("pk_publisher_subscriptions", x => x.id);
table.ForeignKey(
name: "fk_realm_members_accounts_account_id",
name: "fk_publisher_subscriptions_accounts_account_id",
column: x => x.account_id,
principalTable: "accounts",
principalColumn: "id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "fk_realm_members_realms_realm_id",
column: x => x.realm_id,
principalTable: "realms",
name: "fk_publisher_subscriptions_publishers_publisher_id",
column: x => x.publisher_id,
principalTable: "publishers",
principalColumn: "id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "sticker_packs",
columns: table => new
{
id = table.Column<Guid>(type: "uuid", nullable: false),
name = table.Column<string>(type: "character varying(1024)", maxLength: 1024, nullable: false),
description = table.Column<string>(type: "character varying(4096)", maxLength: 4096, nullable: false),
prefix = table.Column<string>(type: "character varying(128)", maxLength: 128, nullable: false),
publisher_id = table.Column<Guid>(type: "uuid", nullable: false),
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_sticker_packs", x => x.id);
table.ForeignKey(
name: "fk_sticker_packs_publishers_publisher_id",
column: x => x.publisher_id,
principalTable: "publishers",
principalColumn: "id",
onDelete: ReferentialAction.Cascade);
});
@ -817,8 +969,8 @@ namespace DysonNetwork.Sphere.Migrations
name: "post_category_links",
columns: table => new
{
categories_id = table.Column<long>(type: "bigint", nullable: false),
posts_id = table.Column<long>(type: "bigint", nullable: false)
categories_id = table.Column<Guid>(type: "uuid", nullable: false),
posts_id = table.Column<Guid>(type: "uuid", nullable: false)
},
constraints: table =>
{
@ -841,8 +993,8 @@ namespace DysonNetwork.Sphere.Migrations
name: "post_collection_links",
columns: table => new
{
collections_id = table.Column<long>(type: "bigint", nullable: false),
posts_id = table.Column<long>(type: "bigint", nullable: false)
collections_id = table.Column<Guid>(type: "uuid", nullable: false),
posts_id = table.Column<Guid>(type: "uuid", nullable: false)
},
constraints: table =>
{
@ -865,12 +1017,11 @@ namespace DysonNetwork.Sphere.Migrations
name: "post_reactions",
columns: table => new
{
id = table.Column<long>(type: "bigint", nullable: false)
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
id = table.Column<Guid>(type: "uuid", nullable: false),
symbol = table.Column<string>(type: "character varying(256)", maxLength: 256, nullable: false),
attitude = table.Column<int>(type: "integer", nullable: false),
post_id = table.Column<long>(type: "bigint", nullable: false),
account_id = table.Column<long>(type: "bigint", nullable: false),
post_id = table.Column<Guid>(type: "uuid", nullable: false),
account_id = table.Column<Guid>(type: "uuid", nullable: false),
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)
@ -896,8 +1047,8 @@ namespace DysonNetwork.Sphere.Migrations
name: "post_tag_links",
columns: table => new
{
posts_id = table.Column<long>(type: "bigint", nullable: false),
tags_id = table.Column<long>(type: "bigint", nullable: false)
posts_id = table.Column<Guid>(type: "uuid", nullable: false),
tags_id = table.Column<Guid>(type: "uuid", nullable: false)
},
constraints: table =>
{
@ -916,11 +1067,45 @@ namespace DysonNetwork.Sphere.Migrations
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "stickers",
columns: table => new
{
id = table.Column<Guid>(type: "uuid", nullable: false),
slug = table.Column<string>(type: "character varying(128)", maxLength: 128, nullable: false),
image_id = table.Column<string>(type: "character varying(128)", nullable: false),
pack_id = table.Column<Guid>(type: "uuid", nullable: false),
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_stickers", x => x.id);
table.ForeignKey(
name: "fk_stickers_files_image_id",
column: x => x.image_id,
principalTable: "files",
principalColumn: "id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "fk_stickers_sticker_packs_pack_id",
column: x => x.pack_id,
principalTable: "sticker_packs",
principalColumn: "id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateIndex(
name: "ix_account_auth_factors_account_id",
table: "account_auth_factors",
column: "account_id");
migrationBuilder.CreateIndex(
name: "ix_account_check_in_results_account_id",
table: "account_check_in_results",
column: "account_id");
migrationBuilder.CreateIndex(
name: "ix_account_contacts_account_id",
table: "account_contacts",
@ -941,6 +1126,11 @@ namespace DysonNetwork.Sphere.Migrations
table: "account_relationships",
column: "related_id");
migrationBuilder.CreateIndex(
name: "ix_account_statuses_account_id",
table: "account_statuses",
column: "account_id");
migrationBuilder.CreateIndex(
name: "ix_accounts_name",
table: "accounts",
@ -967,6 +1157,11 @@ namespace DysonNetwork.Sphere.Migrations
table: "auth_sessions",
column: "challenge_id");
migrationBuilder.CreateIndex(
name: "ix_badges_account_id",
table: "badges",
column: "account_id");
migrationBuilder.CreateIndex(
name: "ix_chat_members_account_id",
table: "chat_members",
@ -992,6 +1187,26 @@ namespace DysonNetwork.Sphere.Migrations
table: "chat_messages",
column: "sender_id");
migrationBuilder.CreateIndex(
name: "ix_chat_reactions_message_id",
table: "chat_reactions",
column: "message_id");
migrationBuilder.CreateIndex(
name: "ix_chat_reactions_sender_id",
table: "chat_reactions",
column: "sender_id");
migrationBuilder.CreateIndex(
name: "ix_chat_realtime_call_room_id",
table: "chat_realtime_call",
column: "room_id");
migrationBuilder.CreateIndex(
name: "ix_chat_realtime_call_sender_id",
table: "chat_realtime_call",
column: "sender_id");
migrationBuilder.CreateIndex(
name: "ix_chat_rooms_background_id",
table: "chat_rooms",
@ -1038,16 +1253,6 @@ namespace DysonNetwork.Sphere.Migrations
column: "spell",
unique: true);
migrationBuilder.CreateIndex(
name: "ix_message_reaction_message_id",
table: "message_reaction",
column: "message_id");
migrationBuilder.CreateIndex(
name: "ix_message_reaction_sender_id",
table: "message_reaction",
column: "sender_id");
migrationBuilder.CreateIndex(
name: "ix_notification_push_subscriptions_account_id",
table: "notification_push_subscriptions",
@ -1142,6 +1347,16 @@ namespace DysonNetwork.Sphere.Migrations
table: "publisher_members",
column: "account_id");
migrationBuilder.CreateIndex(
name: "ix_publisher_subscriptions_account_id",
table: "publisher_subscriptions",
column: "account_id");
migrationBuilder.CreateIndex(
name: "ix_publisher_subscriptions_publisher_id",
table: "publisher_subscriptions",
column: "publisher_id");
migrationBuilder.CreateIndex(
name: "ix_publishers_account_id",
table: "publishers",
@ -1163,6 +1378,11 @@ namespace DysonNetwork.Sphere.Migrations
table: "publishers",
column: "picture_id");
migrationBuilder.CreateIndex(
name: "ix_publishers_realm_id",
table: "publishers",
column: "realm_id");
migrationBuilder.CreateIndex(
name: "ix_realm_members_account_id",
table: "realm_members",
@ -1189,6 +1409,21 @@ namespace DysonNetwork.Sphere.Migrations
column: "slug",
unique: true);
migrationBuilder.CreateIndex(
name: "ix_sticker_packs_publisher_id",
table: "sticker_packs",
column: "publisher_id");
migrationBuilder.CreateIndex(
name: "ix_stickers_image_id",
table: "stickers",
column: "image_id");
migrationBuilder.CreateIndex(
name: "ix_stickers_pack_id",
table: "stickers",
column: "pack_id");
migrationBuilder.AddForeignKey(
name: "fk_account_profiles_files_background_id",
table: "account_profiles",
@ -1219,6 +1454,14 @@ namespace DysonNetwork.Sphere.Migrations
principalColumn: "id",
onDelete: ReferentialAction.Cascade);
migrationBuilder.AddForeignKey(
name: "fk_chat_realtime_call_chat_rooms_room_id",
table: "chat_realtime_call",
column: "room_id",
principalTable: "chat_rooms",
principalColumn: "id",
onDelete: ReferentialAction.Cascade);
migrationBuilder.AddForeignKey(
name: "fk_chat_rooms_files_background_id",
table: "chat_rooms",
@ -1294,6 +1537,9 @@ namespace DysonNetwork.Sphere.Migrations
migrationBuilder.DropTable(
name: "account_auth_factors");
migrationBuilder.DropTable(
name: "account_check_in_results");
migrationBuilder.DropTable(
name: "account_contacts");
@ -1303,21 +1549,30 @@ namespace DysonNetwork.Sphere.Migrations
migrationBuilder.DropTable(
name: "account_relationships");
migrationBuilder.DropTable(
name: "account_statuses");
migrationBuilder.DropTable(
name: "activities");
migrationBuilder.DropTable(
name: "auth_sessions");
migrationBuilder.DropTable(
name: "badges");
migrationBuilder.DropTable(
name: "chat_reactions");
migrationBuilder.DropTable(
name: "chat_realtime_call");
migrationBuilder.DropTable(
name: "chat_statuses");
migrationBuilder.DropTable(
name: "magic_spells");
migrationBuilder.DropTable(
name: "message_reaction");
migrationBuilder.DropTable(
name: "notification_push_subscriptions");
@ -1345,9 +1600,15 @@ namespace DysonNetwork.Sphere.Migrations
migrationBuilder.DropTable(
name: "publisher_members");
migrationBuilder.DropTable(
name: "publisher_subscriptions");
migrationBuilder.DropTable(
name: "realm_members");
migrationBuilder.DropTable(
name: "stickers");
migrationBuilder.DropTable(
name: "auth_challenges");
@ -1363,6 +1624,9 @@ namespace DysonNetwork.Sphere.Migrations
migrationBuilder.DropTable(
name: "post_tags");
migrationBuilder.DropTable(
name: "sticker_packs");
migrationBuilder.DropTable(
name: "accounts");

View File

@ -29,13 +29,11 @@ namespace DysonNetwork.Sphere.Migrations
modelBuilder.Entity("DysonNetwork.Sphere.Account.Account", b =>
{
b.Property<long>("Id")
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint")
.HasColumnType("uuid")
.HasColumnName("id");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<long>("Id"));
b.Property<Instant?>("ActivatedAt")
.HasColumnType("timestamp with time zone")
.HasColumnName("activated_at");
@ -86,15 +84,13 @@ namespace DysonNetwork.Sphere.Migrations
modelBuilder.Entity("DysonNetwork.Sphere.Account.AccountAuthFactor", b =>
{
b.Property<long>("Id")
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint")
.HasColumnType("uuid")
.HasColumnName("id");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<long>("Id"));
b.Property<long>("AccountId")
.HasColumnType("bigint")
b.Property<Guid>("AccountId")
.HasColumnType("uuid")
.HasColumnName("account_id");
b.Property<Instant>("CreatedAt")
@ -106,7 +102,8 @@ namespace DysonNetwork.Sphere.Migrations
.HasColumnName("deleted_at");
b.Property<string>("Secret")
.HasColumnType("text")
.HasMaxLength(8196)
.HasColumnType("character varying(8196)")
.HasColumnName("secret");
b.Property<int>("Type")
@ -128,15 +125,13 @@ namespace DysonNetwork.Sphere.Migrations
modelBuilder.Entity("DysonNetwork.Sphere.Account.AccountContact", b =>
{
b.Property<long>("Id")
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint")
.HasColumnType("uuid")
.HasColumnName("id");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<long>("Id"));
b.Property<long>("AccountId")
.HasColumnType("bigint")
b.Property<Guid>("AccountId")
.HasColumnType("uuid")
.HasColumnName("account_id");
b.Property<string>("Content")
@ -181,8 +176,8 @@ namespace DysonNetwork.Sphere.Migrations
.HasColumnType("uuid")
.HasColumnName("id");
b.Property<long>("AccountId")
.HasColumnType("bigint")
b.Property<Guid>("AccountId")
.HasColumnType("uuid")
.HasColumnName("account_id");
b.Property<string>("Caption")
@ -238,8 +233,8 @@ namespace DysonNetwork.Sphere.Migrations
.HasColumnType("uuid")
.HasColumnName("id");
b.Property<long>("AccountId")
.HasColumnType("bigint")
b.Property<Guid>("AccountId")
.HasColumnType("uuid")
.HasColumnName("account_id");
b.Property<Instant>("CreatedAt")
@ -279,8 +274,8 @@ namespace DysonNetwork.Sphere.Migrations
.HasColumnType("uuid")
.HasColumnName("id");
b.Property<long?>("AccountId")
.HasColumnType("bigint")
b.Property<Guid?>("AccountId")
.HasColumnType("uuid")
.HasColumnName("account_id");
b.Property<Instant?>("AffectedAt")
@ -338,8 +333,8 @@ namespace DysonNetwork.Sphere.Migrations
.HasColumnType("uuid")
.HasColumnName("id");
b.Property<long>("AccountId")
.HasColumnType("bigint")
b.Property<Guid>("AccountId")
.HasColumnType("uuid")
.HasColumnName("account_id");
b.Property<string>("Content")
@ -403,8 +398,8 @@ namespace DysonNetwork.Sphere.Migrations
.HasColumnType("uuid")
.HasColumnName("id");
b.Property<long>("AccountId")
.HasColumnType("bigint")
b.Property<Guid>("AccountId")
.HasColumnType("uuid")
.HasColumnName("account_id");
b.Property<Instant>("CreatedAt")
@ -458,8 +453,8 @@ namespace DysonNetwork.Sphere.Migrations
modelBuilder.Entity("DysonNetwork.Sphere.Account.Profile", b =>
{
b.Property<long>("Id")
.HasColumnType("bigint")
b.Property<Guid>("Id")
.HasColumnType("uuid")
.HasColumnName("id");
b.Property<string>("BackgroundId")
@ -516,12 +511,12 @@ namespace DysonNetwork.Sphere.Migrations
modelBuilder.Entity("DysonNetwork.Sphere.Account.Relationship", b =>
{
b.Property<long>("AccountId")
.HasColumnType("bigint")
b.Property<Guid>("AccountId")
.HasColumnType("uuid")
.HasColumnName("account_id");
b.Property<long>("RelatedId")
.HasColumnType("bigint")
b.Property<Guid>("RelatedId")
.HasColumnType("uuid")
.HasColumnName("related_id");
b.Property<Instant>("CreatedAt")
@ -560,8 +555,8 @@ namespace DysonNetwork.Sphere.Migrations
.HasColumnType("uuid")
.HasColumnName("id");
b.Property<long>("AccountId")
.HasColumnType("bigint")
b.Property<Guid>("AccountId")
.HasColumnType("uuid")
.HasColumnName("account_id");
b.Property<int>("Attitude")
@ -613,8 +608,8 @@ namespace DysonNetwork.Sphere.Migrations
.HasColumnType("uuid")
.HasColumnName("id");
b.Property<long>("AccountId")
.HasColumnType("bigint")
b.Property<Guid>("AccountId")
.HasColumnType("uuid")
.HasColumnName("account_id");
b.Property<Instant>("CreatedAt")
@ -646,7 +641,7 @@ namespace DysonNetwork.Sphere.Migrations
.HasColumnType("timestamp with time zone")
.HasColumnName("updated_at");
b.Property<ICollection<long>>("UsersVisible")
b.Property<ICollection<Guid>>("UsersVisible")
.IsRequired()
.HasColumnType("jsonb")
.HasColumnName("users_visible");
@ -671,8 +666,8 @@ namespace DysonNetwork.Sphere.Migrations
.HasColumnType("uuid")
.HasColumnName("id");
b.Property<long>("AccountId")
.HasColumnType("bigint")
b.Property<Guid>("AccountId")
.HasColumnType("uuid")
.HasColumnName("account_id");
b.Property<List<string>>("Audiences")
@ -680,7 +675,7 @@ namespace DysonNetwork.Sphere.Migrations
.HasColumnType("jsonb")
.HasColumnName("audiences");
b.Property<List<long>>("BlacklistFactors")
b.Property<List<Guid>>("BlacklistFactors")
.IsRequired()
.HasColumnType("jsonb")
.HasColumnName("blacklist_factors");
@ -762,8 +757,8 @@ namespace DysonNetwork.Sphere.Migrations
.HasColumnType("uuid")
.HasColumnName("id");
b.Property<long>("AccountId")
.HasColumnType("bigint")
b.Property<Guid>("AccountId")
.HasColumnType("uuid")
.HasColumnName("account_id");
b.Property<Guid>("ChallengeId")
@ -814,12 +809,12 @@ namespace DysonNetwork.Sphere.Migrations
.HasColumnType("uuid")
.HasColumnName("id");
b.Property<long>("AccountId")
.HasColumnType("bigint")
b.Property<Guid>("AccountId")
.HasColumnType("uuid")
.HasColumnName("account_id");
b.Property<long>("ChatRoomId")
.HasColumnType("bigint")
b.Property<Guid>("ChatRoomId")
.HasColumnType("uuid")
.HasColumnName("chat_room_id");
b.Property<Instant>("CreatedAt")
@ -869,13 +864,11 @@ namespace DysonNetwork.Sphere.Migrations
modelBuilder.Entity("DysonNetwork.Sphere.Chat.ChatRoom", b =>
{
b.Property<long>("Id")
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint")
.HasColumnType("uuid")
.HasColumnName("id");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<long>("Id"));
b.Property<string>("BackgroundId")
.HasColumnType("character varying(128)")
.HasColumnName("background_id");
@ -908,8 +901,8 @@ namespace DysonNetwork.Sphere.Migrations
.HasColumnType("character varying(128)")
.HasColumnName("picture_id");
b.Property<long?>("RealmId")
.HasColumnType("bigint")
b.Property<Guid?>("RealmId")
.HasColumnType("uuid")
.HasColumnName("realm_id");
b.Property<int>("Type")
@ -942,8 +935,8 @@ namespace DysonNetwork.Sphere.Migrations
.HasColumnType("uuid")
.HasColumnName("id");
b.Property<long>("ChatRoomId")
.HasColumnType("bigint")
b.Property<Guid>("ChatRoomId")
.HasColumnType("uuid")
.HasColumnName("chat_room_id");
b.Property<string>("Content")
@ -1119,8 +1112,8 @@ namespace DysonNetwork.Sphere.Migrations
.HasColumnType("timestamp with time zone")
.HasColumnName("ended_at");
b.Property<long>("RoomId")
.HasColumnType("bigint")
b.Property<Guid>("RoomId")
.HasColumnType("uuid")
.HasColumnName("room_id");
b.Property<Guid>("SenderId")
@ -1283,13 +1276,11 @@ namespace DysonNetwork.Sphere.Migrations
modelBuilder.Entity("DysonNetwork.Sphere.Post.Post", b =>
{
b.Property<long>("Id")
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint")
.HasColumnType("uuid")
.HasColumnName("id");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<long>("Id"));
b.Property<string>("Content")
.HasColumnType("text")
.HasColumnName("content");
@ -1315,8 +1306,8 @@ namespace DysonNetwork.Sphere.Migrations
.HasColumnType("timestamp with time zone")
.HasColumnName("edited_at");
b.Property<long?>("ForwardedPostId")
.HasColumnType("bigint")
b.Property<Guid?>("ForwardedPostId")
.HasColumnType("uuid")
.HasColumnName("forwarded_post_id");
b.Property<string>("Language")
@ -1332,12 +1323,12 @@ namespace DysonNetwork.Sphere.Migrations
.HasColumnType("timestamp with time zone")
.HasColumnName("published_at");
b.Property<long>("PublisherId")
.HasColumnType("bigint")
b.Property<Guid>("PublisherId")
.HasColumnType("uuid")
.HasColumnName("publisher_id");
b.Property<long?>("RepliedPostId")
.HasColumnType("bigint")
b.Property<Guid?>("RepliedPostId")
.HasColumnType("uuid")
.HasColumnName("replied_post_id");
b.Property<NpgsqlTsVector>("SearchVector")
@ -1348,8 +1339,8 @@ namespace DysonNetwork.Sphere.Migrations
.HasAnnotation("Npgsql:TsVectorConfig", "simple")
.HasAnnotation("Npgsql:TsVectorProperties", new[] { "Title", "Description", "Content" });
b.Property<long?>("ThreadedPostId")
.HasColumnType("bigint")
b.Property<Guid?>("ThreadedPostId")
.HasColumnType("uuid")
.HasColumnName("threaded_post_id");
b.Property<string>("Title")
@ -1407,13 +1398,11 @@ namespace DysonNetwork.Sphere.Migrations
modelBuilder.Entity("DysonNetwork.Sphere.Post.PostCategory", b =>
{
b.Property<long>("Id")
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint")
.HasColumnType("uuid")
.HasColumnName("id");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<long>("Id"));
b.Property<Instant>("CreatedAt")
.HasColumnType("timestamp with time zone")
.HasColumnName("created_at");
@ -1445,13 +1434,11 @@ namespace DysonNetwork.Sphere.Migrations
modelBuilder.Entity("DysonNetwork.Sphere.Post.PostCollection", b =>
{
b.Property<long>("Id")
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint")
.HasColumnType("uuid")
.HasColumnName("id");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<long>("Id"));
b.Property<Instant>("CreatedAt")
.HasColumnType("timestamp with time zone")
.HasColumnName("created_at");
@ -1470,8 +1457,8 @@ namespace DysonNetwork.Sphere.Migrations
.HasColumnType("character varying(256)")
.HasColumnName("name");
b.Property<long>("PublisherId")
.HasColumnType("bigint")
b.Property<Guid>("PublisherId")
.HasColumnType("uuid")
.HasColumnName("publisher_id");
b.Property<string>("Slug")
@ -1495,15 +1482,13 @@ namespace DysonNetwork.Sphere.Migrations
modelBuilder.Entity("DysonNetwork.Sphere.Post.PostReaction", b =>
{
b.Property<long>("Id")
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint")
.HasColumnType("uuid")
.HasColumnName("id");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<long>("Id"));
b.Property<long>("AccountId")
.HasColumnType("bigint")
b.Property<Guid>("AccountId")
.HasColumnType("uuid")
.HasColumnName("account_id");
b.Property<int>("Attitude")
@ -1518,8 +1503,8 @@ namespace DysonNetwork.Sphere.Migrations
.HasColumnType("timestamp with time zone")
.HasColumnName("deleted_at");
b.Property<long>("PostId")
.HasColumnType("bigint")
b.Property<Guid>("PostId")
.HasColumnType("uuid")
.HasColumnName("post_id");
b.Property<string>("Symbol")
@ -1546,13 +1531,11 @@ namespace DysonNetwork.Sphere.Migrations
modelBuilder.Entity("DysonNetwork.Sphere.Post.PostTag", b =>
{
b.Property<long>("Id")
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint")
.HasColumnType("uuid")
.HasColumnName("id");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<long>("Id"));
b.Property<Instant>("CreatedAt")
.HasColumnType("timestamp with time zone")
.HasColumnName("created_at");
@ -1584,15 +1567,13 @@ namespace DysonNetwork.Sphere.Migrations
modelBuilder.Entity("DysonNetwork.Sphere.Post.Publisher", b =>
{
b.Property<long>("Id")
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint")
.HasColumnType("uuid")
.HasColumnName("id");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<long>("Id"));
b.Property<long?>("AccountId")
.HasColumnType("bigint")
b.Property<Guid?>("AccountId")
.HasColumnType("uuid")
.HasColumnName("account_id");
b.Property<string>("BackgroundId")
@ -1632,8 +1613,8 @@ namespace DysonNetwork.Sphere.Migrations
.HasColumnType("integer")
.HasColumnName("publisher_type");
b.Property<long?>("RealmId")
.HasColumnType("bigint")
b.Property<Guid?>("RealmId")
.HasColumnType("uuid")
.HasColumnName("realm_id");
b.Property<Instant>("UpdatedAt")
@ -1664,12 +1645,12 @@ namespace DysonNetwork.Sphere.Migrations
modelBuilder.Entity("DysonNetwork.Sphere.Post.PublisherMember", b =>
{
b.Property<long>("PublisherId")
.HasColumnType("bigint")
b.Property<Guid>("PublisherId")
.HasColumnType("uuid")
.HasColumnName("publisher_id");
b.Property<long>("AccountId")
.HasColumnType("bigint")
b.Property<Guid>("AccountId")
.HasColumnType("uuid")
.HasColumnName("account_id");
b.Property<Instant>("CreatedAt")
@ -1708,8 +1689,8 @@ namespace DysonNetwork.Sphere.Migrations
.HasColumnType("uuid")
.HasColumnName("id");
b.Property<long>("AccountId")
.HasColumnType("bigint")
b.Property<Guid>("AccountId")
.HasColumnType("uuid")
.HasColumnName("account_id");
b.Property<Instant>("CreatedAt")
@ -1720,8 +1701,8 @@ namespace DysonNetwork.Sphere.Migrations
.HasColumnType("timestamp with time zone")
.HasColumnName("deleted_at");
b.Property<long>("PublisherId")
.HasColumnType("bigint")
b.Property<Guid>("PublisherId")
.HasColumnType("uuid")
.HasColumnName("publisher_id");
b.Property<int>("Status")
@ -1750,15 +1731,13 @@ namespace DysonNetwork.Sphere.Migrations
modelBuilder.Entity("DysonNetwork.Sphere.Realm.Realm", b =>
{
b.Property<long>("Id")
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint")
.HasColumnType("uuid")
.HasColumnName("id");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<long>("Id"));
b.Property<long>("AccountId")
.HasColumnType("bigint")
b.Property<Guid>("AccountId")
.HasColumnType("uuid")
.HasColumnName("account_id");
b.Property<string>("BackgroundId")
@ -1837,12 +1816,12 @@ namespace DysonNetwork.Sphere.Migrations
modelBuilder.Entity("DysonNetwork.Sphere.Realm.RealmMember", b =>
{
b.Property<long>("RealmId")
.HasColumnType("bigint")
b.Property<Guid>("RealmId")
.HasColumnType("uuid")
.HasColumnName("realm_id");
b.Property<long>("AccountId")
.HasColumnType("bigint")
b.Property<Guid>("AccountId")
.HasColumnType("uuid")
.HasColumnName("account_id");
b.Property<Instant>("CreatedAt")
@ -1953,8 +1932,8 @@ namespace DysonNetwork.Sphere.Migrations
.HasColumnType("character varying(128)")
.HasColumnName("prefix");
b.Property<long>("PublisherId")
.HasColumnType("bigint")
b.Property<Guid>("PublisherId")
.HasColumnType("uuid")
.HasColumnName("publisher_id");
b.Property<Instant>("UpdatedAt")
@ -1977,8 +1956,8 @@ namespace DysonNetwork.Sphere.Migrations
.HasColumnType("character varying(128)")
.HasColumnName("id");
b.Property<long>("AccountId")
.HasColumnType("bigint")
b.Property<Guid>("AccountId")
.HasColumnType("uuid")
.HasColumnName("account_id");
b.Property<Instant>("CreatedAt")
@ -2026,8 +2005,8 @@ namespace DysonNetwork.Sphere.Migrations
.HasColumnType("character varying(1024)")
.HasColumnName("name");
b.Property<long?>("PostId")
.HasColumnType("bigint")
b.Property<Guid?>("PostId")
.HasColumnType("uuid")
.HasColumnName("post_id");
b.Property<long>("Size")
@ -2072,12 +2051,12 @@ namespace DysonNetwork.Sphere.Migrations
modelBuilder.Entity("PostPostCategory", b =>
{
b.Property<long>("CategoriesId")
.HasColumnType("bigint")
b.Property<Guid>("CategoriesId")
.HasColumnType("uuid")
.HasColumnName("categories_id");
b.Property<long>("PostsId")
.HasColumnType("bigint")
b.Property<Guid>("PostsId")
.HasColumnType("uuid")
.HasColumnName("posts_id");
b.HasKey("CategoriesId", "PostsId")
@ -2091,12 +2070,12 @@ namespace DysonNetwork.Sphere.Migrations
modelBuilder.Entity("PostPostCollection", b =>
{
b.Property<long>("CollectionsId")
.HasColumnType("bigint")
b.Property<Guid>("CollectionsId")
.HasColumnType("uuid")
.HasColumnName("collections_id");
b.Property<long>("PostsId")
.HasColumnType("bigint")
b.Property<Guid>("PostsId")
.HasColumnType("uuid")
.HasColumnName("posts_id");
b.HasKey("CollectionsId", "PostsId")
@ -2110,12 +2089,12 @@ namespace DysonNetwork.Sphere.Migrations
modelBuilder.Entity("PostPostTag", b =>
{
b.Property<long>("PostsId")
.HasColumnType("bigint")
b.Property<Guid>("PostsId")
.HasColumnType("uuid")
.HasColumnName("posts_id");
b.Property<long>("TagsId")
.HasColumnType("bigint")
b.Property<Guid>("TagsId")
.HasColumnType("uuid")
.HasColumnName("tags_id");
b.HasKey("PostsId", "TagsId")