💥 Switch all id to uuid
This commit is contained in:
parent
aeeed24290
commit
9576870373
@ -9,7 +9,7 @@ namespace DysonNetwork.Sphere.Account;
|
|||||||
[Index(nameof(Name), IsUnique = true)]
|
[Index(nameof(Name), IsUnique = true)]
|
||||||
public class Account : ModelBase
|
public class Account : ModelBase
|
||||||
{
|
{
|
||||||
public long Id { get; set; }
|
public Guid Id { get; set; }
|
||||||
[MaxLength(256)] public string Name { get; set; } = string.Empty;
|
[MaxLength(256)] public string Name { get; set; } = string.Empty;
|
||||||
[MaxLength(256)] public string Nick { get; set; } = string.Empty;
|
[MaxLength(256)] public string Nick { get; set; } = string.Empty;
|
||||||
[MaxLength(32)] public string Language { get; set; } = string.Empty;
|
[MaxLength(32)] public string Language { get; set; } = string.Empty;
|
||||||
@ -30,7 +30,7 @@ public class Account : ModelBase
|
|||||||
|
|
||||||
public class Profile : ModelBase
|
public class Profile : ModelBase
|
||||||
{
|
{
|
||||||
public long Id { get; set; }
|
public Guid Id { get; set; }
|
||||||
[MaxLength(256)] public string? FirstName { get; set; }
|
[MaxLength(256)] public string? FirstName { get; set; }
|
||||||
[MaxLength(256)] public string? MiddleName { get; set; }
|
[MaxLength(256)] public string? MiddleName { get; set; }
|
||||||
[MaxLength(256)] public string? LastName { get; set; }
|
[MaxLength(256)] public string? LastName { get; set; }
|
||||||
@ -46,7 +46,7 @@ public class Profile : ModelBase
|
|||||||
|
|
||||||
public class AccountContact : ModelBase
|
public class AccountContact : ModelBase
|
||||||
{
|
{
|
||||||
public long Id { get; set; }
|
public Guid Id { get; set; }
|
||||||
public AccountContactType Type { get; set; }
|
public AccountContactType Type { get; set; }
|
||||||
public Instant? VerifiedAt { get; set; }
|
public Instant? VerifiedAt { get; set; }
|
||||||
[MaxLength(1024)] public string Content { get; set; } = string.Empty;
|
[MaxLength(1024)] public string Content { get; set; } = string.Empty;
|
||||||
@ -63,9 +63,9 @@ public enum AccountContactType
|
|||||||
|
|
||||||
public class AccountAuthFactor : ModelBase
|
public class AccountAuthFactor : ModelBase
|
||||||
{
|
{
|
||||||
public long Id { get; set; }
|
public Guid Id { get; set; }
|
||||||
public AccountAuthFactorType Type { get; set; }
|
public AccountAuthFactorType Type { get; set; }
|
||||||
public string? Secret { get; set; } = null;
|
[MaxLength(8196)] public string? Secret { get; set; } = null;
|
||||||
|
|
||||||
[JsonIgnore] public Account Account { get; set; } = null!;
|
[JsonIgnore] public Account Account { get; set; } = null!;
|
||||||
|
|
||||||
|
@ -19,13 +19,13 @@ public class AccountEventService(
|
|||||||
private static readonly Random Random = new();
|
private static readonly Random Random = new();
|
||||||
private const string StatusCacheKey = "account_status_";
|
private const string StatusCacheKey = "account_status_";
|
||||||
|
|
||||||
public void PurgeStatusCache(long userId)
|
public void PurgeStatusCache(Guid userId)
|
||||||
{
|
{
|
||||||
var cacheKey = $"{StatusCacheKey}{userId}";
|
var cacheKey = $"{StatusCacheKey}{userId}";
|
||||||
cache.Remove(cacheKey);
|
cache.Remove(cacheKey);
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task<Status> GetStatus(long userId)
|
public async Task<Status> GetStatus(Guid userId)
|
||||||
{
|
{
|
||||||
var cacheKey = $"{StatusCacheKey}{userId}";
|
var cacheKey = $"{StatusCacheKey}{userId}";
|
||||||
if (cache.TryGetValue(cacheKey, out Status? cachedStatus))
|
if (cache.TryGetValue(cacheKey, out Status? cachedStatus))
|
||||||
|
@ -14,6 +14,6 @@ public class Badge : ModelBase
|
|||||||
[Column(TypeName = "jsonb")] public Dictionary<string, object> Meta { get; set; } = new();
|
[Column(TypeName = "jsonb")] public Dictionary<string, object> Meta { get; set; } = new();
|
||||||
public Instant? ExpiredAt { get; set; }
|
public Instant? ExpiredAt { get; set; }
|
||||||
|
|
||||||
public long AccountId { get; set; }
|
public Guid AccountId { get; set; }
|
||||||
[JsonIgnore] public Account Account { get; set; } = null!;
|
[JsonIgnore] public Account Account { get; set; } = null!;
|
||||||
}
|
}
|
@ -22,7 +22,7 @@ public class Status : ModelBase
|
|||||||
[MaxLength(1024)] public string? Label { get; set; }
|
[MaxLength(1024)] public string? Label { get; set; }
|
||||||
public Instant? ClearedAt { get; set; }
|
public Instant? ClearedAt { get; set; }
|
||||||
|
|
||||||
public long AccountId { get; set; }
|
public Guid AccountId { get; set; }
|
||||||
public Account Account { get; set; } = null!;
|
public Account Account { get; set; } = null!;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -41,7 +41,7 @@ public class CheckInResult : ModelBase
|
|||||||
public CheckInResultLevel Level { get; set; }
|
public CheckInResultLevel Level { get; set; }
|
||||||
[Column(TypeName = "jsonb")] public ICollection<FortuneTip> Tips { get; set; } = new List<FortuneTip>();
|
[Column(TypeName = "jsonb")] public ICollection<FortuneTip> Tips { get; set; } = new List<FortuneTip>();
|
||||||
|
|
||||||
public long AccountId { get; set; }
|
public Guid AccountId { get; set; }
|
||||||
public Account Account { get; set; } = null!;
|
public Account Account { get; set; } = null!;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -25,6 +25,6 @@ public class MagicSpell : ModelBase
|
|||||||
public Instant? AffectedAt { get; set; }
|
public Instant? AffectedAt { get; set; }
|
||||||
[Column(TypeName = "jsonb")] public Dictionary<string, object> Meta { get; set; }
|
[Column(TypeName = "jsonb")] public Dictionary<string, object> Meta { get; set; }
|
||||||
|
|
||||||
public long? AccountId { get; set; }
|
public Guid? AccountId { get; set; }
|
||||||
public Account? Account { get; set; }
|
public Account? Account { get; set; }
|
||||||
}
|
}
|
@ -17,7 +17,7 @@ public class Notification : ModelBase
|
|||||||
public int Priority { get; set; } = 10;
|
public int Priority { get; set; } = 10;
|
||||||
public Instant? ViewedAt { get; set; }
|
public Instant? ViewedAt { get; set; }
|
||||||
|
|
||||||
public long AccountId { get; set; }
|
public Guid AccountId { get; set; }
|
||||||
[JsonIgnore] public Account Account { get; set; } = null!;
|
[JsonIgnore] public Account Account { get; set; } = null!;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -37,6 +37,6 @@ public class NotificationPushSubscription : ModelBase
|
|||||||
public NotificationPushProvider Provider { get; set; }
|
public NotificationPushProvider Provider { get; set; }
|
||||||
public Instant? LastUsedAt { get; set; }
|
public Instant? LastUsedAt { get; set; }
|
||||||
|
|
||||||
public long AccountId { get; set; }
|
public Guid AccountId { get; set; }
|
||||||
[JsonIgnore] public Account Account { get; set; } = null!;
|
[JsonIgnore] public Account Account { get; set; } = null!;
|
||||||
}
|
}
|
@ -11,9 +11,9 @@ public enum RelationshipStatus
|
|||||||
|
|
||||||
public class Relationship : ModelBase
|
public class Relationship : ModelBase
|
||||||
{
|
{
|
||||||
public long AccountId { get; set; }
|
public Guid AccountId { get; set; }
|
||||||
public Account Account { get; set; } = null!;
|
public Account Account { get; set; } = null!;
|
||||||
public long RelatedId { get; set; }
|
public Guid RelatedId { get; set; }
|
||||||
public Account Related { get; set; } = null!;
|
public Account Related { get; set; } = null!;
|
||||||
|
|
||||||
public Instant? ExpiredAt { get; set; }
|
public Instant? ExpiredAt { get; set; }
|
||||||
|
@ -124,9 +124,9 @@ public class RelationshipService(AppDatabase db, PermissionService pm, IMemoryCa
|
|||||||
return relationship;
|
return relationship;
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task<List<long>> ListAccountFriends(Account account)
|
public async Task<List<Guid>> ListAccountFriends(Account account)
|
||||||
{
|
{
|
||||||
if (!cache.TryGetValue($"UserFriends_{account.Id}", out List<long>? friends))
|
if (!cache.TryGetValue($"UserFriends_{account.Id}", out List<Guid>? friends))
|
||||||
{
|
{
|
||||||
friends = await db.AccountRelationships
|
friends = await db.AccountRelationships
|
||||||
.Where(r => r.RelatedId == account.Id)
|
.Where(r => r.RelatedId == account.Id)
|
||||||
|
@ -17,9 +17,9 @@ public class Activity : ModelBase
|
|||||||
[MaxLength(4096)] public string ResourceIdentifier { get; set; } = null!;
|
[MaxLength(4096)] public string ResourceIdentifier { get; set; } = null!;
|
||||||
public ActivityVisibility Visibility { get; set; } = ActivityVisibility.Public;
|
public ActivityVisibility Visibility { get; set; } = ActivityVisibility.Public;
|
||||||
[Column(TypeName = "jsonb")] public Dictionary<string, object> Meta { get; set; } = new();
|
[Column(TypeName = "jsonb")] public Dictionary<string, object> Meta { get; set; } = new();
|
||||||
[Column(TypeName = "jsonb")] public ICollection<long> UsersVisible { get; set; } = new List<long>();
|
[Column(TypeName = "jsonb")] public ICollection<Guid> UsersVisible { get; set; } = new List<Guid>();
|
||||||
|
|
||||||
public long AccountId { get; set; }
|
public Guid AccountId { get; set; }
|
||||||
public Account.Account Account { get; set; } = null!;
|
public Account.Account Account { get; set; } = null!;
|
||||||
|
|
||||||
[NotMapped] public object? Data { get; set; }
|
[NotMapped] public object? Data { get; set; }
|
||||||
|
@ -1,19 +1,18 @@
|
|||||||
using DysonNetwork.Sphere.Post;
|
using DysonNetwork.Sphere.Post;
|
||||||
using Microsoft.EntityFrameworkCore;
|
using Microsoft.EntityFrameworkCore;
|
||||||
using NodaTime;
|
|
||||||
|
|
||||||
namespace DysonNetwork.Sphere.Activity;
|
namespace DysonNetwork.Sphere.Activity;
|
||||||
|
|
||||||
public class ActivityReaderService(AppDatabase db, PostService ps)
|
public class ActivityReaderService(AppDatabase db, PostService ps)
|
||||||
{
|
{
|
||||||
public async Task<List<Activity>> LoadActivityData(List<Activity> input, Account.Account? currentUser,
|
public async Task<List<Activity>> LoadActivityData(List<Activity> input, Account.Account? currentUser,
|
||||||
List<long> userFriends)
|
List<Guid> userFriends)
|
||||||
{
|
{
|
||||||
if (input.Count == 0) return input;
|
if (input.Count == 0) return input;
|
||||||
|
|
||||||
var postsId = input
|
var postsId = input
|
||||||
.Where(e => e.ResourceIdentifier.StartsWith("posts/"))
|
.Where(e => e.ResourceIdentifier.StartsWith("posts/"))
|
||||||
.Select(e => long.Parse(e.ResourceIdentifier.Split("/").Last()))
|
.Select(e => Guid.Parse(e.ResourceIdentifier.Split("/").Last()))
|
||||||
.Distinct()
|
.Distinct()
|
||||||
.ToList();
|
.ToList();
|
||||||
if (postsId.Count > 0)
|
if (postsId.Count > 0)
|
||||||
@ -40,7 +39,7 @@ public class ActivityReaderService(AppDatabase db, PostService ps)
|
|||||||
{
|
{
|
||||||
var resourceIdentifier = item.ResourceIdentifier;
|
var resourceIdentifier = item.ResourceIdentifier;
|
||||||
if (!resourceIdentifier.StartsWith("posts/")) continue;
|
if (!resourceIdentifier.StartsWith("posts/")) continue;
|
||||||
var postId = long.Parse(resourceIdentifier.Split("/").Last());
|
var postId = Guid.Parse(resourceIdentifier.Split("/").Last());
|
||||||
if (postsDict.TryGetValue(postId, out var post) && item.Data is null)
|
if (postsDict.TryGetValue(postId, out var post) && item.Data is null)
|
||||||
{
|
{
|
||||||
item.Data = post;
|
item.Data = post;
|
||||||
@ -109,7 +108,7 @@ public class ActivityService(AppDatabase db)
|
|||||||
string type,
|
string type,
|
||||||
string identifier,
|
string identifier,
|
||||||
ActivityVisibility visibility = ActivityVisibility.Public,
|
ActivityVisibility visibility = ActivityVisibility.Public,
|
||||||
List<long>? visibleUsers = null
|
List<Guid>? visibleUsers = null
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
var activity = new Activity
|
var activity = new Activity
|
||||||
@ -158,7 +157,7 @@ public class ActivityService(AppDatabase db)
|
|||||||
public static class ActivityQueryExtensions
|
public static class ActivityQueryExtensions
|
||||||
{
|
{
|
||||||
public static IQueryable<Activity> FilterWithVisibility(this IQueryable<Activity> source,
|
public static IQueryable<Activity> FilterWithVisibility(this IQueryable<Activity> source,
|
||||||
Account.Account? currentUser, List<long> userFriends)
|
Account.Account? currentUser, List<Guid> userFriends)
|
||||||
{
|
{
|
||||||
if (currentUser is null)
|
if (currentUser is null)
|
||||||
return source.Where(e => e.Visibility == ActivityVisibility.Public);
|
return source.Where(e => e.Visibility == ActivityVisibility.Public);
|
||||||
|
@ -78,8 +78,8 @@ public class AuthController(
|
|||||||
: challenge.Account.AuthFactors.ToList();
|
: challenge.Account.AuthFactors.ToList();
|
||||||
}
|
}
|
||||||
|
|
||||||
[HttpPost("challenge/{id}/factors/{factorId:long}")]
|
[HttpPost("challenge/{id}/factors/{factorId:guid}")]
|
||||||
public async Task<ActionResult> RequestFactorCode([FromRoute] Guid id, [FromRoute] long factorId)
|
public async Task<ActionResult> RequestFactorCode([FromRoute] Guid id, [FromRoute] Guid factorId)
|
||||||
{
|
{
|
||||||
var challenge = await db.AuthChallenges
|
var challenge = await db.AuthChallenges
|
||||||
.Include(e => e.Account)
|
.Include(e => e.Account)
|
||||||
|
@ -43,7 +43,7 @@ public class Challenge : ModelBase
|
|||||||
public int FailedAttempts { get; set; }
|
public int FailedAttempts { get; set; }
|
||||||
public ChallengePlatform Platform { get; set; } = ChallengePlatform.Unidentified;
|
public ChallengePlatform Platform { get; set; } = ChallengePlatform.Unidentified;
|
||||||
public ChallengeType Type { get; set; } = ChallengeType.Login;
|
public ChallengeType Type { get; set; } = ChallengeType.Login;
|
||||||
[Column(TypeName = "jsonb")] public List<long> BlacklistFactors { get; set; } = new();
|
[Column(TypeName = "jsonb")] public List<Guid> BlacklistFactors { get; set; } = new();
|
||||||
[Column(TypeName = "jsonb")] public List<string> Audiences { get; set; } = new();
|
[Column(TypeName = "jsonb")] public List<string> Audiences { get; set; } = new();
|
||||||
[Column(TypeName = "jsonb")] public List<string> Scopes { get; set; } = new();
|
[Column(TypeName = "jsonb")] public List<string> Scopes { get; set; } = new();
|
||||||
[MaxLength(128)] public string? IpAddress { get; set; }
|
[MaxLength(128)] public string? IpAddress { get; set; }
|
||||||
@ -51,7 +51,7 @@ public class Challenge : ModelBase
|
|||||||
[MaxLength(256)] public string? DeviceId { get; set; }
|
[MaxLength(256)] public string? DeviceId { get; set; }
|
||||||
[MaxLength(1024)] public string? Nonce { get; set; }
|
[MaxLength(1024)] public string? Nonce { get; set; }
|
||||||
|
|
||||||
public long AccountId { get; set; }
|
public Guid AccountId { get; set; }
|
||||||
[JsonIgnore] public Account.Account Account { get; set; } = null!;
|
[JsonIgnore] public Account.Account Account { get; set; } = null!;
|
||||||
|
|
||||||
public Challenge Normalize()
|
public Challenge Normalize()
|
||||||
|
@ -16,7 +16,7 @@ public partial class ChatController(AppDatabase db, ChatService cs) : Controller
|
|||||||
public class MarkMessageReadRequest
|
public class MarkMessageReadRequest
|
||||||
{
|
{
|
||||||
public Guid MessageId { get; set; }
|
public Guid MessageId { get; set; }
|
||||||
public long ChatRoomId { get; set; }
|
public Guid ChatRoomId { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public class SendMessageRequest
|
public class SendMessageRequest
|
||||||
@ -29,8 +29,8 @@ public partial class ChatController(AppDatabase db, ChatService cs) : Controller
|
|||||||
public Guid? ForwardedMessageId { get; set; }
|
public Guid? ForwardedMessageId { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
[HttpGet("{roomId:long}/messages")]
|
[HttpGet("{roomId:guid}/messages")]
|
||||||
public async Task<ActionResult<List<Message>>> ListMessages(long roomId, [FromQuery] int offset, [FromQuery] int take = 20)
|
public async Task<ActionResult<List<Message>>> ListMessages(Guid roomId, [FromQuery] int offset, [FromQuery] int take = 20)
|
||||||
{
|
{
|
||||||
var currentUser = HttpContext.Items["CurrentUser"] as Account.Account;
|
var currentUser = HttpContext.Items["CurrentUser"] as Account.Account;
|
||||||
|
|
||||||
@ -67,8 +67,8 @@ public partial class ChatController(AppDatabase db, ChatService cs) : Controller
|
|||||||
return Ok(messages);
|
return Ok(messages);
|
||||||
}
|
}
|
||||||
|
|
||||||
[HttpGet("{roomId:long}/messages/{messageId:guid}")]
|
[HttpGet("{roomId:guid}/messages/{messageId:guid}")]
|
||||||
public async Task<ActionResult<Message>> GetMessage(long roomId, Guid messageId)
|
public async Task<ActionResult<Message>> GetMessage(Guid roomId, Guid messageId)
|
||||||
{
|
{
|
||||||
var currentUser = HttpContext.Items["CurrentUser"] as Account.Account;
|
var currentUser = HttpContext.Items["CurrentUser"] as Account.Account;
|
||||||
|
|
||||||
@ -104,10 +104,10 @@ public partial class ChatController(AppDatabase db, ChatService cs) : Controller
|
|||||||
[GeneratedRegex("@([A-Za-z0-9_-]+)")]
|
[GeneratedRegex("@([A-Za-z0-9_-]+)")]
|
||||||
private static partial Regex MentionRegex();
|
private static partial Regex MentionRegex();
|
||||||
|
|
||||||
[HttpPost("{roomId:long}/messages")]
|
[HttpPost("{roomId:guid}/messages")]
|
||||||
[Authorize]
|
[Authorize]
|
||||||
[RequiredPermission("global", "chat.messages.create")]
|
[RequiredPermission("global", "chat.messages.create")]
|
||||||
public async Task<ActionResult> SendMessage([FromBody] SendMessageRequest request, long roomId)
|
public async Task<ActionResult> SendMessage([FromBody] SendMessageRequest request, Guid roomId)
|
||||||
{
|
{
|
||||||
if (HttpContext.Items["CurrentUser"] is not Account.Account currentUser) return Unauthorized();
|
if (HttpContext.Items["CurrentUser"] is not Account.Account currentUser) return Unauthorized();
|
||||||
if (string.IsNullOrWhiteSpace(request.Content) && (request.AttachmentsId == null || request.AttachmentsId.Count == 0))
|
if (string.IsNullOrWhiteSpace(request.Content) && (request.AttachmentsId == null || request.AttachmentsId.Count == 0))
|
||||||
@ -185,9 +185,9 @@ public partial class ChatController(AppDatabase db, ChatService cs) : Controller
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
[HttpPatch("{roomId:long}/messages/{messageId:guid}")]
|
[HttpPatch("{roomId:guid}/messages/{messageId:guid}")]
|
||||||
[Authorize]
|
[Authorize]
|
||||||
public async Task<ActionResult> UpdateMessage([FromBody] SendMessageRequest request, long roomId, Guid messageId)
|
public async Task<ActionResult> UpdateMessage([FromBody] SendMessageRequest request, Guid roomId, Guid messageId)
|
||||||
{
|
{
|
||||||
if (HttpContext.Items["CurrentUser"] is not Account.Account currentUser) return Unauthorized();
|
if (HttpContext.Items["CurrentUser"] is not Account.Account currentUser) return Unauthorized();
|
||||||
|
|
||||||
@ -254,9 +254,9 @@ public partial class ChatController(AppDatabase db, ChatService cs) : Controller
|
|||||||
return Ok(message);
|
return Ok(message);
|
||||||
}
|
}
|
||||||
|
|
||||||
[HttpDelete("{roomId:long}/messages/{messageId:guid}")]
|
[HttpDelete("{roomId:guid}/messages/{messageId:guid}")]
|
||||||
[Authorize]
|
[Authorize]
|
||||||
public async Task<ActionResult> DeleteMessage(long roomId, Guid messageId)
|
public async Task<ActionResult> DeleteMessage(Guid roomId, Guid messageId)
|
||||||
{
|
{
|
||||||
if (HttpContext.Items["CurrentUser"] is not Account.Account currentUser) return Unauthorized();
|
if (HttpContext.Items["CurrentUser"] is not Account.Account currentUser) return Unauthorized();
|
||||||
|
|
||||||
@ -280,8 +280,8 @@ public partial class ChatController(AppDatabase db, ChatService cs) : Controller
|
|||||||
public long LastSyncTimestamp { get; set; }
|
public long LastSyncTimestamp { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
[HttpPost("{roomId:long}/sync")]
|
[HttpPost("{roomId:guid}/sync")]
|
||||||
public async Task<ActionResult<SyncResponse>> GetSyncData([FromBody] SyncRequest request, long roomId)
|
public async Task<ActionResult<SyncResponse>> GetSyncData([FromBody] SyncRequest request, Guid roomId)
|
||||||
{
|
{
|
||||||
if (HttpContext.Items["CurrentUser"] is not Account.Account currentUser)
|
if (HttpContext.Items["CurrentUser"] is not Account.Account currentUser)
|
||||||
return Unauthorized();
|
return Unauthorized();
|
||||||
|
@ -14,7 +14,7 @@ public enum ChatRoomType
|
|||||||
|
|
||||||
public class ChatRoom : ModelBase
|
public class ChatRoom : ModelBase
|
||||||
{
|
{
|
||||||
public long Id { get; set; }
|
public Guid Id { get; set; }
|
||||||
[MaxLength(1024)] public string Name { get; set; } = string.Empty;
|
[MaxLength(1024)] public string Name { get; set; } = string.Empty;
|
||||||
[MaxLength(4096)] public string Description { get; set; } = string.Empty;
|
[MaxLength(4096)] public string Description { get; set; } = string.Empty;
|
||||||
public ChatRoomType Type { get; set; }
|
public ChatRoomType Type { get; set; }
|
||||||
@ -27,7 +27,7 @@ public class ChatRoom : ModelBase
|
|||||||
|
|
||||||
[JsonIgnore] public ICollection<ChatMember> Members { get; set; } = new List<ChatMember>();
|
[JsonIgnore] public ICollection<ChatMember> Members { get; set; } = new List<ChatMember>();
|
||||||
|
|
||||||
public long? RealmId { get; set; }
|
public Guid? RealmId { get; set; }
|
||||||
public Realm.Realm? Realm { get; set; }
|
public Realm.Realm? Realm { get; set; }
|
||||||
|
|
||||||
[NotMapped]
|
[NotMapped]
|
||||||
@ -53,9 +53,9 @@ public enum ChatMemberNotify
|
|||||||
public class ChatMember : ModelBase
|
public class ChatMember : ModelBase
|
||||||
{
|
{
|
||||||
public Guid Id { get; set; }
|
public Guid Id { get; set; }
|
||||||
public long ChatRoomId { get; set; }
|
public Guid ChatRoomId { get; set; }
|
||||||
public ChatRoom ChatRoom { get; set; } = null!;
|
public ChatRoom ChatRoom { get; set; } = null!;
|
||||||
public long AccountId { get; set; }
|
public Guid AccountId { get; set; }
|
||||||
public Account.Account Account { get; set; } = null!;
|
public Account.Account Account { get; set; } = null!;
|
||||||
|
|
||||||
[MaxLength(1024)] public string? Nick { get; set; }
|
[MaxLength(1024)] public string? Nick { get; set; }
|
||||||
@ -69,8 +69,8 @@ public class ChatMember : ModelBase
|
|||||||
public class ChatMemberTransmissionObject : ModelBase
|
public class ChatMemberTransmissionObject : ModelBase
|
||||||
{
|
{
|
||||||
public Guid Id { get; set; }
|
public Guid Id { get; set; }
|
||||||
public long ChatRoomId { get; set; }
|
public Guid ChatRoomId { get; set; }
|
||||||
public long AccountId { get; set; }
|
public Guid AccountId { get; set; }
|
||||||
public Account.Account Account { get; set; } = null!;
|
public Account.Account Account { get; set; } = null!;
|
||||||
|
|
||||||
[MaxLength(1024)] public string? Nick { get; set; }
|
[MaxLength(1024)] public string? Nick { get; set; }
|
||||||
|
@ -12,8 +12,8 @@ namespace DysonNetwork.Sphere.Chat;
|
|||||||
[Route("/chat")]
|
[Route("/chat")]
|
||||||
public class ChatRoomController(AppDatabase db, FileService fs, ChatRoomService crs) : ControllerBase
|
public class ChatRoomController(AppDatabase db, FileService fs, ChatRoomService crs) : ControllerBase
|
||||||
{
|
{
|
||||||
[HttpGet("{id:long}")]
|
[HttpGet("{id:guid}")]
|
||||||
public async Task<ActionResult<ChatRoom>> GetChatRoom(long id)
|
public async Task<ActionResult<ChatRoom>> GetChatRoom(Guid id)
|
||||||
{
|
{
|
||||||
var chatRoom = await db.ChatRooms
|
var chatRoom = await db.ChatRooms
|
||||||
.Where(c => c.Id == id)
|
.Where(c => c.Id == id)
|
||||||
@ -59,7 +59,7 @@ public class ChatRoomController(AppDatabase db, FileService fs, ChatRoomService
|
|||||||
.Include(m => m.Account)
|
.Include(m => m.Account)
|
||||||
.Include(m => m.Account.Profile)
|
.Include(m => m.Account.Profile)
|
||||||
.ToDictionaryAsync(m => m.ChatRoomId, m => m)
|
.ToDictionaryAsync(m => m.ChatRoomId, m => m)
|
||||||
: new Dictionary<long, ChatMember>();
|
: new Dictionary<Guid, ChatMember>();
|
||||||
|
|
||||||
// Map the results
|
// Map the results
|
||||||
var result = chatRooms.Select(r =>
|
var result = chatRooms.Select(r =>
|
||||||
@ -75,7 +75,7 @@ public class ChatRoomController(AppDatabase db, FileService fs, ChatRoomService
|
|||||||
|
|
||||||
public class DirectMessageRequest
|
public class DirectMessageRequest
|
||||||
{
|
{
|
||||||
[Required] public long RelatedUserId { get; set; }
|
[Required] public Guid RelatedUserId { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
[HttpPost("direct")]
|
[HttpPost("direct")]
|
||||||
@ -139,7 +139,7 @@ public class ChatRoomController(AppDatabase db, FileService fs, ChatRoomService
|
|||||||
[MaxLength(4096)] public string? Description { get; set; }
|
[MaxLength(4096)] public string? Description { get; set; }
|
||||||
public string? PictureId { get; set; }
|
public string? PictureId { get; set; }
|
||||||
public string? BackgroundId { get; set; }
|
public string? BackgroundId { get; set; }
|
||||||
public long? RealmId { get; set; }
|
public Guid? RealmId { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
[HttpPost]
|
[HttpPost]
|
||||||
@ -202,8 +202,8 @@ public class ChatRoomController(AppDatabase db, FileService fs, ChatRoomService
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
[HttpPatch("{id:long}")]
|
[HttpPatch("{id:guid}")]
|
||||||
public async Task<ActionResult<ChatRoom>> UpdateChatRoom(long id, [FromBody] ChatRoomRequest request)
|
public async Task<ActionResult<ChatRoom>> UpdateChatRoom(Guid id, [FromBody] ChatRoomRequest request)
|
||||||
{
|
{
|
||||||
if (HttpContext.Items["CurrentUser"] is not Account.Account currentUser) return Unauthorized();
|
if (HttpContext.Items["CurrentUser"] is not Account.Account currentUser) return Unauthorized();
|
||||||
|
|
||||||
@ -273,8 +273,8 @@ public class ChatRoomController(AppDatabase db, FileService fs, ChatRoomService
|
|||||||
return Ok(chatRoom);
|
return Ok(chatRoom);
|
||||||
}
|
}
|
||||||
|
|
||||||
[HttpDelete("{id:long}")]
|
[HttpDelete("{id:guid}")]
|
||||||
public async Task<ActionResult> DeleteChatRoom(long id)
|
public async Task<ActionResult> DeleteChatRoom(Guid id)
|
||||||
{
|
{
|
||||||
if (HttpContext.Items["CurrentUser"] is not Account.Account currentUser) return Unauthorized();
|
if (HttpContext.Items["CurrentUser"] is not Account.Account currentUser) return Unauthorized();
|
||||||
|
|
||||||
@ -315,9 +315,9 @@ public class ChatRoomController(AppDatabase db, FileService fs, ChatRoomService
|
|||||||
return NoContent();
|
return NoContent();
|
||||||
}
|
}
|
||||||
|
|
||||||
[HttpGet("{roomId:long}/members/me")]
|
[HttpGet("{roomId:guid}/members/me")]
|
||||||
[Authorize]
|
[Authorize]
|
||||||
public async Task<ActionResult<ChatMember>> GetRoomIdentity(long roomId)
|
public async Task<ActionResult<ChatMember>> GetRoomIdentity(Guid roomId)
|
||||||
{
|
{
|
||||||
if (HttpContext.Items["CurrentUser"] is not Account.Account currentUser)
|
if (HttpContext.Items["CurrentUser"] is not Account.Account currentUser)
|
||||||
return Unauthorized();
|
return Unauthorized();
|
||||||
@ -334,8 +334,8 @@ public class ChatRoomController(AppDatabase db, FileService fs, ChatRoomService
|
|||||||
return Ok(member);
|
return Ok(member);
|
||||||
}
|
}
|
||||||
|
|
||||||
[HttpGet("{roomId:long}/members")]
|
[HttpGet("{roomId:guid}/members")]
|
||||||
public async Task<ActionResult<List<ChatMember>>> ListMembers(long roomId, [FromQuery] int take = 20,
|
public async Task<ActionResult<List<ChatMember>>> ListMembers(Guid roomId, [FromQuery] int take = 20,
|
||||||
[FromQuery] int skip = 0)
|
[FromQuery] int skip = 0)
|
||||||
{
|
{
|
||||||
var currentUser = HttpContext.Items["CurrentUser"] as Account.Account;
|
var currentUser = HttpContext.Items["CurrentUser"] as Account.Account;
|
||||||
@ -371,13 +371,13 @@ public class ChatRoomController(AppDatabase db, FileService fs, ChatRoomService
|
|||||||
|
|
||||||
public class ChatMemberRequest
|
public class ChatMemberRequest
|
||||||
{
|
{
|
||||||
[Required] public long RelatedUserId { get; set; }
|
[Required] public Guid RelatedUserId { get; set; }
|
||||||
[Required] public ChatMemberRole Role { get; set; }
|
[Required] public ChatMemberRole Role { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
[HttpPost("invites/{roomId:long}")]
|
[HttpPost("invites/{roomId:guid}")]
|
||||||
[Authorize]
|
[Authorize]
|
||||||
public async Task<ActionResult<ChatMember>> InviteMember(long roomId,
|
public async Task<ActionResult<ChatMember>> InviteMember(Guid roomId,
|
||||||
[FromBody] ChatMemberRequest request)
|
[FromBody] ChatMemberRequest request)
|
||||||
{
|
{
|
||||||
if (HttpContext.Items["CurrentUser"] is not Account.Account currentUser) return Unauthorized();
|
if (HttpContext.Items["CurrentUser"] is not Account.Account currentUser) return Unauthorized();
|
||||||
@ -448,9 +448,9 @@ public class ChatRoomController(AppDatabase db, FileService fs, ChatRoomService
|
|||||||
return members.ToList();
|
return members.ToList();
|
||||||
}
|
}
|
||||||
|
|
||||||
[HttpPost("invites/{roomId:long}/accept")]
|
[HttpPost("invites/{roomId:guid}/accept")]
|
||||||
[Authorize]
|
[Authorize]
|
||||||
public async Task<ActionResult<ChatRoom>> AcceptChatInvite(long roomId)
|
public async Task<ActionResult<ChatRoom>> AcceptChatInvite(Guid roomId)
|
||||||
{
|
{
|
||||||
if (HttpContext.Items["CurrentUser"] is not Account.Account currentUser) return Unauthorized();
|
if (HttpContext.Items["CurrentUser"] is not Account.Account currentUser) return Unauthorized();
|
||||||
var userId = currentUser.Id;
|
var userId = currentUser.Id;
|
||||||
@ -469,9 +469,9 @@ public class ChatRoomController(AppDatabase db, FileService fs, ChatRoomService
|
|||||||
return Ok(member);
|
return Ok(member);
|
||||||
}
|
}
|
||||||
|
|
||||||
[HttpPost("invites/{roomId:long}/decline")]
|
[HttpPost("invites/{roomId:guid}/decline")]
|
||||||
[Authorize]
|
[Authorize]
|
||||||
public async Task<ActionResult> DeclineChatInvite(long roomId)
|
public async Task<ActionResult> DeclineChatInvite(Guid roomId)
|
||||||
{
|
{
|
||||||
if (HttpContext.Items["CurrentUser"] is not Account.Account currentUser) return Unauthorized();
|
if (HttpContext.Items["CurrentUser"] is not Account.Account currentUser) return Unauthorized();
|
||||||
var userId = currentUser.Id;
|
var userId = currentUser.Id;
|
||||||
@ -489,9 +489,9 @@ public class ChatRoomController(AppDatabase db, FileService fs, ChatRoomService
|
|||||||
return NoContent();
|
return NoContent();
|
||||||
}
|
}
|
||||||
|
|
||||||
[HttpPatch("{roomId:long}/members/{memberId:long}/role")]
|
[HttpPatch("{roomId:guid}/members/{memberId:guid}/role")]
|
||||||
[Authorize]
|
[Authorize]
|
||||||
public async Task<ActionResult<ChatMember>> UpdateChatMemberRole(long roomId, long memberId,
|
public async Task<ActionResult<ChatMember>> UpdateChatMemberRole(Guid roomId, Guid memberId,
|
||||||
[FromBody] ChatMemberRequest request)
|
[FromBody] ChatMemberRequest request)
|
||||||
{
|
{
|
||||||
if (HttpContext.Items["CurrentUser"] is not Account.Account currentUser) return Unauthorized();
|
if (HttpContext.Items["CurrentUser"] is not Account.Account currentUser) return Unauthorized();
|
||||||
@ -542,9 +542,9 @@ public class ChatRoomController(AppDatabase db, FileService fs, ChatRoomService
|
|||||||
return BadRequest();
|
return BadRequest();
|
||||||
}
|
}
|
||||||
|
|
||||||
[HttpDelete("{roomId:long}/members/{memberId:long}")]
|
[HttpDelete("{roomId:guid}/members/{memberId:guid}")]
|
||||||
[Authorize]
|
[Authorize]
|
||||||
public async Task<ActionResult> RemoveChatMember(long roomId, long memberId)
|
public async Task<ActionResult> RemoveChatMember(Guid roomId, Guid memberId)
|
||||||
{
|
{
|
||||||
if (HttpContext.Items["CurrentUser"] is not Account.Account currentUser) return Unauthorized();
|
if (HttpContext.Items["CurrentUser"] is not Account.Account currentUser) return Unauthorized();
|
||||||
|
|
||||||
@ -591,9 +591,9 @@ public class ChatRoomController(AppDatabase db, FileService fs, ChatRoomService
|
|||||||
return BadRequest();
|
return BadRequest();
|
||||||
}
|
}
|
||||||
|
|
||||||
[HttpDelete("{roomId:long}/members/me")]
|
[HttpDelete("{roomId:guid}/members/me")]
|
||||||
[Authorize]
|
[Authorize]
|
||||||
public async Task<ActionResult> LeaveChat(long roomId)
|
public async Task<ActionResult> LeaveChat(Guid roomId)
|
||||||
{
|
{
|
||||||
if (HttpContext.Items["CurrentUser"] is not Account.Account currentUser) return Unauthorized();
|
if (HttpContext.Items["CurrentUser"] is not Account.Account currentUser) return Unauthorized();
|
||||||
|
|
||||||
|
@ -59,7 +59,7 @@ public class ChatService(AppDatabase db, IServiceScopeFactory scopeFactory)
|
|||||||
await Task.WhenAll(tasks);
|
await Task.WhenAll(tasks);
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task MarkMessageAsReadAsync(Guid messageId, long roomId, long userId)
|
public async Task MarkMessageAsReadAsync(Guid messageId, Guid roomId, Guid userId)
|
||||||
{
|
{
|
||||||
var existingStatus = await db.ChatStatuses
|
var existingStatus = await db.ChatStatuses
|
||||||
.FirstOrDefaultAsync(x => x.MessageId == messageId && x.Sender.AccountId == userId);
|
.FirstOrDefaultAsync(x => x.MessageId == messageId && x.Sender.AccountId == userId);
|
||||||
@ -81,13 +81,13 @@ public class ChatService(AppDatabase db, IServiceScopeFactory scopeFactory)
|
|||||||
await db.SaveChangesAsync();
|
await db.SaveChangesAsync();
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task<bool> GetMessageReadStatus(Guid messageId, long userId)
|
public async Task<bool> GetMessageReadStatus(Guid messageId, Guid userId)
|
||||||
{
|
{
|
||||||
return await db.ChatStatuses
|
return await db.ChatStatuses
|
||||||
.AnyAsync(x => x.MessageId == messageId && x.Sender.AccountId == userId);
|
.AnyAsync(x => x.MessageId == messageId && x.Sender.AccountId == userId);
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task<int> CountUnreadMessage(long userId, long chatRoomId)
|
public async Task<int> CountUnreadMessage(Guid userId, Guid chatRoomId)
|
||||||
{
|
{
|
||||||
var messages = await db.ChatMessages
|
var messages = await db.ChatMessages
|
||||||
.Where(m => m.ChatRoomId == chatRoomId)
|
.Where(m => m.ChatRoomId == chatRoomId)
|
||||||
@ -101,7 +101,7 @@ public class ChatService(AppDatabase db, IServiceScopeFactory scopeFactory)
|
|||||||
return messages.Count(m => !m.IsRead);
|
return messages.Count(m => !m.IsRead);
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task<Dictionary<long, int>> CountUnreadMessagesForJoinedRoomsAsync(long userId)
|
public async Task<Dictionary<Guid, int>> CountUnreadMessagesForJoinedRoomsAsync(Guid userId)
|
||||||
{
|
{
|
||||||
var userRooms = await db.ChatMembers
|
var userRooms = await db.ChatMembers
|
||||||
.Where(m => m.AccountId == userId)
|
.Where(m => m.AccountId == userId)
|
||||||
@ -149,7 +149,7 @@ public class ChatService(AppDatabase db, IServiceScopeFactory scopeFactory)
|
|||||||
return call;
|
return call;
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task EndCallAsync(long roomId)
|
public async Task EndCallAsync(Guid roomId)
|
||||||
{
|
{
|
||||||
var call = await GetCallOngoingAsync(roomId);
|
var call = await GetCallOngoingAsync(roomId);
|
||||||
if (call is null) throw new InvalidOperationException("No ongoing call was not found.");
|
if (call is null) throw new InvalidOperationException("No ongoing call was not found.");
|
||||||
@ -170,7 +170,7 @@ public class ChatService(AppDatabase db, IServiceScopeFactory scopeFactory)
|
|||||||
}, call.Sender, call.Room);
|
}, call.Sender, call.Room);
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task<RealtimeCall?> GetCallOngoingAsync(long roomId)
|
public async Task<RealtimeCall?> GetCallOngoingAsync(Guid roomId)
|
||||||
{
|
{
|
||||||
return await db.ChatRealtimeCall
|
return await db.ChatRealtimeCall
|
||||||
.Where(c => c.RoomId == roomId)
|
.Where(c => c.RoomId == roomId)
|
||||||
@ -180,7 +180,7 @@ public class ChatService(AppDatabase db, IServiceScopeFactory scopeFactory)
|
|||||||
.FirstOrDefaultAsync();
|
.FirstOrDefaultAsync();
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task<SyncResponse> GetSyncDataAsync(long roomId, long lastSyncTimestamp)
|
public async Task<SyncResponse> GetSyncDataAsync(Guid roomId, long lastSyncTimestamp)
|
||||||
{
|
{
|
||||||
var timestamp = Instant.FromUnixTimeMilliseconds(lastSyncTimestamp);
|
var timestamp = Instant.FromUnixTimeMilliseconds(lastSyncTimestamp);
|
||||||
var changes = await db.ChatMessages
|
var changes = await db.ChatMessages
|
||||||
|
@ -27,7 +27,7 @@ public class Message : ModelBase
|
|||||||
|
|
||||||
public Guid SenderId { get; set; }
|
public Guid SenderId { get; set; }
|
||||||
public ChatMember Sender { get; set; } = null!;
|
public ChatMember Sender { get; set; } = null!;
|
||||||
public long ChatRoomId { get; set; }
|
public Guid ChatRoomId { get; set; }
|
||||||
[JsonIgnore] public ChatRoom ChatRoom { get; set; } = null!;
|
[JsonIgnore] public ChatRoom ChatRoom { get; set; } = null!;
|
||||||
|
|
||||||
public Message Clone()
|
public Message Clone()
|
||||||
|
@ -10,6 +10,6 @@ public class RealtimeCall : ModelBase
|
|||||||
|
|
||||||
public Guid SenderId { get; set; }
|
public Guid SenderId { get; set; }
|
||||||
public ChatMember Sender { get; set; } = null!;
|
public ChatMember Sender { get; set; } = null!;
|
||||||
public long RoomId { get; set; }
|
public Guid RoomId { get; set; }
|
||||||
public ChatRoom Room { get; set; } = null!;
|
public ChatRoom Room { get; set; } = null!;
|
||||||
}
|
}
|
@ -32,9 +32,9 @@ public class RealtimeCallController(IConfiguration configuration, AppDatabase db
|
|||||||
public string Token { get; set; } = null!;
|
public string Token { get; set; } = null!;
|
||||||
}
|
}
|
||||||
|
|
||||||
[HttpGet("{roomId:long}")]
|
[HttpGet("{roomId:guid}")]
|
||||||
[Authorize]
|
[Authorize]
|
||||||
public async Task<ActionResult<RealtimeChatToken>> GetToken(long roomId)
|
public async Task<ActionResult<RealtimeChatToken>> GetToken(Guid roomId)
|
||||||
{
|
{
|
||||||
if (HttpContext.Items["CurrentUser"] is not Account.Account currentUser) return Unauthorized();
|
if (HttpContext.Items["CurrentUser"] is not Account.Account currentUser) return Unauthorized();
|
||||||
|
|
||||||
@ -60,9 +60,9 @@ public class RealtimeCallController(IConfiguration configuration, AppDatabase db
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
[HttpPost("{roomId:long}")]
|
[HttpPost("{roomId:guid}")]
|
||||||
[Authorize]
|
[Authorize]
|
||||||
public async Task<IActionResult> StartCall(long roomId)
|
public async Task<IActionResult> StartCall(Guid roomId)
|
||||||
{
|
{
|
||||||
if (HttpContext.Items["CurrentUser"] is not Account.Account currentUser) return Unauthorized();
|
if (HttpContext.Items["CurrentUser"] is not Account.Account currentUser) return Unauthorized();
|
||||||
|
|
||||||
@ -79,9 +79,9 @@ public class RealtimeCallController(IConfiguration configuration, AppDatabase db
|
|||||||
return Ok(call);
|
return Ok(call);
|
||||||
}
|
}
|
||||||
|
|
||||||
[HttpDelete("{roomId:long}")]
|
[HttpDelete("{roomId:guid}")]
|
||||||
[Authorize]
|
[Authorize]
|
||||||
public async Task<IActionResult> EndCall(long roomId)
|
public async Task<IActionResult> EndCall(Guid roomId)
|
||||||
{
|
{
|
||||||
if (HttpContext.Items["CurrentUser"] is not Account.Account currentUser) return Unauthorized();
|
if (HttpContext.Items["CurrentUser"] is not Account.Account currentUser) return Unauthorized();
|
||||||
|
|
||||||
|
@ -13,12 +13,12 @@ public class WebSocketService
|
|||||||
}
|
}
|
||||||
|
|
||||||
private static readonly ConcurrentDictionary<
|
private static readonly ConcurrentDictionary<
|
||||||
(long AccountId, string DeviceId),
|
(Guid AccountId, string DeviceId),
|
||||||
(WebSocket Socket, CancellationTokenSource Cts)
|
(WebSocket Socket, CancellationTokenSource Cts)
|
||||||
> ActiveConnections = new();
|
> ActiveConnections = new();
|
||||||
|
|
||||||
public bool TryAdd(
|
public bool TryAdd(
|
||||||
(long AccountId, string DeviceId) key,
|
(Guid AccountId, string DeviceId) key,
|
||||||
WebSocket socket,
|
WebSocket socket,
|
||||||
CancellationTokenSource cts
|
CancellationTokenSource cts
|
||||||
)
|
)
|
||||||
@ -29,7 +29,7 @@ public class WebSocketService
|
|||||||
return ActiveConnections.TryAdd(key, (socket, cts));
|
return ActiveConnections.TryAdd(key, (socket, cts));
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Disconnect((long AccountId, string DeviceId) key, string? reason = null)
|
public void Disconnect((Guid AccountId, string DeviceId) key, string? reason = null)
|
||||||
{
|
{
|
||||||
if (!ActiveConnections.TryGetValue(key, out var data)) return;
|
if (!ActiveConnections.TryGetValue(key, out var data)) return;
|
||||||
data.Socket.CloseAsync(
|
data.Socket.CloseAsync(
|
||||||
@ -41,12 +41,12 @@ public class WebSocketService
|
|||||||
ActiveConnections.TryRemove(key, out _);
|
ActiveConnections.TryRemove(key, out _);
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool GetAccountIsConnected(long accountId)
|
public bool GetAccountIsConnected(Guid accountId)
|
||||||
{
|
{
|
||||||
return ActiveConnections.Any(c => c.Key.AccountId == accountId);
|
return ActiveConnections.Any(c => c.Key.AccountId == accountId);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void SendPacketToAccount(long userId, WebSocketPacket packet)
|
public void SendPacketToAccount(Guid userId, WebSocketPacket packet)
|
||||||
{
|
{
|
||||||
var connections = ActiveConnections.Where(c => c.Key.AccountId == userId);
|
var connections = ActiveConnections.Where(c => c.Key.AccountId == userId);
|
||||||
var packetBytes = packet.ToBytes();
|
var packetBytes = packet.ToBytes();
|
||||||
|
@ -55,7 +55,6 @@
|
|||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Folder Include="Migrations\" />
|
|
||||||
<Folder Include="Uploads\" />
|
<Folder Include="Uploads\" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -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
@ -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
@ -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
@ -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");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
File diff suppressed because it is too large
Load Diff
@ -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
@ -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");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
File diff suppressed because it is too large
Load Diff
@ -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");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
File diff suppressed because it is too large
Load Diff
@ -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");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -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");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -17,8 +17,8 @@ using NpgsqlTypes;
|
|||||||
namespace DysonNetwork.Sphere.Migrations
|
namespace DysonNetwork.Sphere.Migrations
|
||||||
{
|
{
|
||||||
[DbContext(typeof(AppDatabase))]
|
[DbContext(typeof(AppDatabase))]
|
||||||
[Migration("20250512160008_AddAccountBadges")]
|
[Migration("20250514115228_InitialMigration")]
|
||||||
partial class AddAccountBadges
|
partial class InitialMigration
|
||||||
{
|
{
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
||||||
@ -32,13 +32,11 @@ namespace DysonNetwork.Sphere.Migrations
|
|||||||
|
|
||||||
modelBuilder.Entity("DysonNetwork.Sphere.Account.Account", b =>
|
modelBuilder.Entity("DysonNetwork.Sphere.Account.Account", b =>
|
||||||
{
|
{
|
||||||
b.Property<long>("Id")
|
b.Property<Guid>("Id")
|
||||||
.ValueGeneratedOnAdd()
|
.ValueGeneratedOnAdd()
|
||||||
.HasColumnType("bigint")
|
.HasColumnType("uuid")
|
||||||
.HasColumnName("id");
|
.HasColumnName("id");
|
||||||
|
|
||||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<long>("Id"));
|
|
||||||
|
|
||||||
b.Property<Instant?>("ActivatedAt")
|
b.Property<Instant?>("ActivatedAt")
|
||||||
.HasColumnType("timestamp with time zone")
|
.HasColumnType("timestamp with time zone")
|
||||||
.HasColumnName("activated_at");
|
.HasColumnName("activated_at");
|
||||||
@ -89,15 +87,13 @@ namespace DysonNetwork.Sphere.Migrations
|
|||||||
|
|
||||||
modelBuilder.Entity("DysonNetwork.Sphere.Account.AccountAuthFactor", b =>
|
modelBuilder.Entity("DysonNetwork.Sphere.Account.AccountAuthFactor", b =>
|
||||||
{
|
{
|
||||||
b.Property<long>("Id")
|
b.Property<Guid>("Id")
|
||||||
.ValueGeneratedOnAdd()
|
.ValueGeneratedOnAdd()
|
||||||
.HasColumnType("bigint")
|
.HasColumnType("uuid")
|
||||||
.HasColumnName("id");
|
.HasColumnName("id");
|
||||||
|
|
||||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<long>("Id"));
|
b.Property<Guid>("AccountId")
|
||||||
|
.HasColumnType("uuid")
|
||||||
b.Property<long>("AccountId")
|
|
||||||
.HasColumnType("bigint")
|
|
||||||
.HasColumnName("account_id");
|
.HasColumnName("account_id");
|
||||||
|
|
||||||
b.Property<Instant>("CreatedAt")
|
b.Property<Instant>("CreatedAt")
|
||||||
@ -109,7 +105,8 @@ namespace DysonNetwork.Sphere.Migrations
|
|||||||
.HasColumnName("deleted_at");
|
.HasColumnName("deleted_at");
|
||||||
|
|
||||||
b.Property<string>("Secret")
|
b.Property<string>("Secret")
|
||||||
.HasColumnType("text")
|
.HasMaxLength(8196)
|
||||||
|
.HasColumnType("character varying(8196)")
|
||||||
.HasColumnName("secret");
|
.HasColumnName("secret");
|
||||||
|
|
||||||
b.Property<int>("Type")
|
b.Property<int>("Type")
|
||||||
@ -131,15 +128,13 @@ namespace DysonNetwork.Sphere.Migrations
|
|||||||
|
|
||||||
modelBuilder.Entity("DysonNetwork.Sphere.Account.AccountContact", b =>
|
modelBuilder.Entity("DysonNetwork.Sphere.Account.AccountContact", b =>
|
||||||
{
|
{
|
||||||
b.Property<long>("Id")
|
b.Property<Guid>("Id")
|
||||||
.ValueGeneratedOnAdd()
|
.ValueGeneratedOnAdd()
|
||||||
.HasColumnType("bigint")
|
.HasColumnType("uuid")
|
||||||
.HasColumnName("id");
|
.HasColumnName("id");
|
||||||
|
|
||||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<long>("Id"));
|
b.Property<Guid>("AccountId")
|
||||||
|
.HasColumnType("uuid")
|
||||||
b.Property<long>("AccountId")
|
|
||||||
.HasColumnType("bigint")
|
|
||||||
.HasColumnName("account_id");
|
.HasColumnName("account_id");
|
||||||
|
|
||||||
b.Property<string>("Content")
|
b.Property<string>("Content")
|
||||||
@ -184,8 +179,8 @@ namespace DysonNetwork.Sphere.Migrations
|
|||||||
.HasColumnType("uuid")
|
.HasColumnType("uuid")
|
||||||
.HasColumnName("id");
|
.HasColumnName("id");
|
||||||
|
|
||||||
b.Property<long>("AccountId")
|
b.Property<Guid>("AccountId")
|
||||||
.HasColumnType("bigint")
|
.HasColumnType("uuid")
|
||||||
.HasColumnName("account_id");
|
.HasColumnName("account_id");
|
||||||
|
|
||||||
b.Property<string>("Caption")
|
b.Property<string>("Caption")
|
||||||
@ -241,8 +236,8 @@ namespace DysonNetwork.Sphere.Migrations
|
|||||||
.HasColumnType("uuid")
|
.HasColumnType("uuid")
|
||||||
.HasColumnName("id");
|
.HasColumnName("id");
|
||||||
|
|
||||||
b.Property<long>("AccountId")
|
b.Property<Guid>("AccountId")
|
||||||
.HasColumnType("bigint")
|
.HasColumnType("uuid")
|
||||||
.HasColumnName("account_id");
|
.HasColumnName("account_id");
|
||||||
|
|
||||||
b.Property<Instant>("CreatedAt")
|
b.Property<Instant>("CreatedAt")
|
||||||
@ -282,8 +277,8 @@ namespace DysonNetwork.Sphere.Migrations
|
|||||||
.HasColumnType("uuid")
|
.HasColumnType("uuid")
|
||||||
.HasColumnName("id");
|
.HasColumnName("id");
|
||||||
|
|
||||||
b.Property<long?>("AccountId")
|
b.Property<Guid?>("AccountId")
|
||||||
.HasColumnType("bigint")
|
.HasColumnType("uuid")
|
||||||
.HasColumnName("account_id");
|
.HasColumnName("account_id");
|
||||||
|
|
||||||
b.Property<Instant?>("AffectedAt")
|
b.Property<Instant?>("AffectedAt")
|
||||||
@ -341,8 +336,8 @@ namespace DysonNetwork.Sphere.Migrations
|
|||||||
.HasColumnType("uuid")
|
.HasColumnType("uuid")
|
||||||
.HasColumnName("id");
|
.HasColumnName("id");
|
||||||
|
|
||||||
b.Property<long>("AccountId")
|
b.Property<Guid>("AccountId")
|
||||||
.HasColumnType("bigint")
|
.HasColumnType("uuid")
|
||||||
.HasColumnName("account_id");
|
.HasColumnName("account_id");
|
||||||
|
|
||||||
b.Property<string>("Content")
|
b.Property<string>("Content")
|
||||||
@ -406,8 +401,8 @@ namespace DysonNetwork.Sphere.Migrations
|
|||||||
.HasColumnType("uuid")
|
.HasColumnType("uuid")
|
||||||
.HasColumnName("id");
|
.HasColumnName("id");
|
||||||
|
|
||||||
b.Property<long>("AccountId")
|
b.Property<Guid>("AccountId")
|
||||||
.HasColumnType("bigint")
|
.HasColumnType("uuid")
|
||||||
.HasColumnName("account_id");
|
.HasColumnName("account_id");
|
||||||
|
|
||||||
b.Property<Instant>("CreatedAt")
|
b.Property<Instant>("CreatedAt")
|
||||||
@ -461,8 +456,8 @@ namespace DysonNetwork.Sphere.Migrations
|
|||||||
|
|
||||||
modelBuilder.Entity("DysonNetwork.Sphere.Account.Profile", b =>
|
modelBuilder.Entity("DysonNetwork.Sphere.Account.Profile", b =>
|
||||||
{
|
{
|
||||||
b.Property<long>("Id")
|
b.Property<Guid>("Id")
|
||||||
.HasColumnType("bigint")
|
.HasColumnType("uuid")
|
||||||
.HasColumnName("id");
|
.HasColumnName("id");
|
||||||
|
|
||||||
b.Property<string>("BackgroundId")
|
b.Property<string>("BackgroundId")
|
||||||
@ -519,12 +514,12 @@ namespace DysonNetwork.Sphere.Migrations
|
|||||||
|
|
||||||
modelBuilder.Entity("DysonNetwork.Sphere.Account.Relationship", b =>
|
modelBuilder.Entity("DysonNetwork.Sphere.Account.Relationship", b =>
|
||||||
{
|
{
|
||||||
b.Property<long>("AccountId")
|
b.Property<Guid>("AccountId")
|
||||||
.HasColumnType("bigint")
|
.HasColumnType("uuid")
|
||||||
.HasColumnName("account_id");
|
.HasColumnName("account_id");
|
||||||
|
|
||||||
b.Property<long>("RelatedId")
|
b.Property<Guid>("RelatedId")
|
||||||
.HasColumnType("bigint")
|
.HasColumnType("uuid")
|
||||||
.HasColumnName("related_id");
|
.HasColumnName("related_id");
|
||||||
|
|
||||||
b.Property<Instant>("CreatedAt")
|
b.Property<Instant>("CreatedAt")
|
||||||
@ -563,8 +558,8 @@ namespace DysonNetwork.Sphere.Migrations
|
|||||||
.HasColumnType("uuid")
|
.HasColumnType("uuid")
|
||||||
.HasColumnName("id");
|
.HasColumnName("id");
|
||||||
|
|
||||||
b.Property<long>("AccountId")
|
b.Property<Guid>("AccountId")
|
||||||
.HasColumnType("bigint")
|
.HasColumnType("uuid")
|
||||||
.HasColumnName("account_id");
|
.HasColumnName("account_id");
|
||||||
|
|
||||||
b.Property<int>("Attitude")
|
b.Property<int>("Attitude")
|
||||||
@ -616,8 +611,8 @@ namespace DysonNetwork.Sphere.Migrations
|
|||||||
.HasColumnType("uuid")
|
.HasColumnType("uuid")
|
||||||
.HasColumnName("id");
|
.HasColumnName("id");
|
||||||
|
|
||||||
b.Property<long>("AccountId")
|
b.Property<Guid>("AccountId")
|
||||||
.HasColumnType("bigint")
|
.HasColumnType("uuid")
|
||||||
.HasColumnName("account_id");
|
.HasColumnName("account_id");
|
||||||
|
|
||||||
b.Property<Instant>("CreatedAt")
|
b.Property<Instant>("CreatedAt")
|
||||||
@ -649,7 +644,7 @@ namespace DysonNetwork.Sphere.Migrations
|
|||||||
.HasColumnType("timestamp with time zone")
|
.HasColumnType("timestamp with time zone")
|
||||||
.HasColumnName("updated_at");
|
.HasColumnName("updated_at");
|
||||||
|
|
||||||
b.Property<ICollection<long>>("UsersVisible")
|
b.Property<ICollection<Guid>>("UsersVisible")
|
||||||
.IsRequired()
|
.IsRequired()
|
||||||
.HasColumnType("jsonb")
|
.HasColumnType("jsonb")
|
||||||
.HasColumnName("users_visible");
|
.HasColumnName("users_visible");
|
||||||
@ -674,8 +669,8 @@ namespace DysonNetwork.Sphere.Migrations
|
|||||||
.HasColumnType("uuid")
|
.HasColumnType("uuid")
|
||||||
.HasColumnName("id");
|
.HasColumnName("id");
|
||||||
|
|
||||||
b.Property<long>("AccountId")
|
b.Property<Guid>("AccountId")
|
||||||
.HasColumnType("bigint")
|
.HasColumnType("uuid")
|
||||||
.HasColumnName("account_id");
|
.HasColumnName("account_id");
|
||||||
|
|
||||||
b.Property<List<string>>("Audiences")
|
b.Property<List<string>>("Audiences")
|
||||||
@ -683,7 +678,7 @@ namespace DysonNetwork.Sphere.Migrations
|
|||||||
.HasColumnType("jsonb")
|
.HasColumnType("jsonb")
|
||||||
.HasColumnName("audiences");
|
.HasColumnName("audiences");
|
||||||
|
|
||||||
b.Property<List<long>>("BlacklistFactors")
|
b.Property<List<Guid>>("BlacklistFactors")
|
||||||
.IsRequired()
|
.IsRequired()
|
||||||
.HasColumnType("jsonb")
|
.HasColumnType("jsonb")
|
||||||
.HasColumnName("blacklist_factors");
|
.HasColumnName("blacklist_factors");
|
||||||
@ -765,8 +760,8 @@ namespace DysonNetwork.Sphere.Migrations
|
|||||||
.HasColumnType("uuid")
|
.HasColumnType("uuid")
|
||||||
.HasColumnName("id");
|
.HasColumnName("id");
|
||||||
|
|
||||||
b.Property<long>("AccountId")
|
b.Property<Guid>("AccountId")
|
||||||
.HasColumnType("bigint")
|
.HasColumnType("uuid")
|
||||||
.HasColumnName("account_id");
|
.HasColumnName("account_id");
|
||||||
|
|
||||||
b.Property<Guid>("ChallengeId")
|
b.Property<Guid>("ChallengeId")
|
||||||
@ -817,12 +812,12 @@ namespace DysonNetwork.Sphere.Migrations
|
|||||||
.HasColumnType("uuid")
|
.HasColumnType("uuid")
|
||||||
.HasColumnName("id");
|
.HasColumnName("id");
|
||||||
|
|
||||||
b.Property<long>("AccountId")
|
b.Property<Guid>("AccountId")
|
||||||
.HasColumnType("bigint")
|
.HasColumnType("uuid")
|
||||||
.HasColumnName("account_id");
|
.HasColumnName("account_id");
|
||||||
|
|
||||||
b.Property<long>("ChatRoomId")
|
b.Property<Guid>("ChatRoomId")
|
||||||
.HasColumnType("bigint")
|
.HasColumnType("uuid")
|
||||||
.HasColumnName("chat_room_id");
|
.HasColumnName("chat_room_id");
|
||||||
|
|
||||||
b.Property<Instant>("CreatedAt")
|
b.Property<Instant>("CreatedAt")
|
||||||
@ -872,13 +867,11 @@ namespace DysonNetwork.Sphere.Migrations
|
|||||||
|
|
||||||
modelBuilder.Entity("DysonNetwork.Sphere.Chat.ChatRoom", b =>
|
modelBuilder.Entity("DysonNetwork.Sphere.Chat.ChatRoom", b =>
|
||||||
{
|
{
|
||||||
b.Property<long>("Id")
|
b.Property<Guid>("Id")
|
||||||
.ValueGeneratedOnAdd()
|
.ValueGeneratedOnAdd()
|
||||||
.HasColumnType("bigint")
|
.HasColumnType("uuid")
|
||||||
.HasColumnName("id");
|
.HasColumnName("id");
|
||||||
|
|
||||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<long>("Id"));
|
|
||||||
|
|
||||||
b.Property<string>("BackgroundId")
|
b.Property<string>("BackgroundId")
|
||||||
.HasColumnType("character varying(128)")
|
.HasColumnType("character varying(128)")
|
||||||
.HasColumnName("background_id");
|
.HasColumnName("background_id");
|
||||||
@ -911,8 +904,8 @@ namespace DysonNetwork.Sphere.Migrations
|
|||||||
.HasColumnType("character varying(128)")
|
.HasColumnType("character varying(128)")
|
||||||
.HasColumnName("picture_id");
|
.HasColumnName("picture_id");
|
||||||
|
|
||||||
b.Property<long?>("RealmId")
|
b.Property<Guid?>("RealmId")
|
||||||
.HasColumnType("bigint")
|
.HasColumnType("uuid")
|
||||||
.HasColumnName("realm_id");
|
.HasColumnName("realm_id");
|
||||||
|
|
||||||
b.Property<int>("Type")
|
b.Property<int>("Type")
|
||||||
@ -945,8 +938,8 @@ namespace DysonNetwork.Sphere.Migrations
|
|||||||
.HasColumnType("uuid")
|
.HasColumnType("uuid")
|
||||||
.HasColumnName("id");
|
.HasColumnName("id");
|
||||||
|
|
||||||
b.Property<long>("ChatRoomId")
|
b.Property<Guid>("ChatRoomId")
|
||||||
.HasColumnType("bigint")
|
.HasColumnType("uuid")
|
||||||
.HasColumnName("chat_room_id");
|
.HasColumnName("chat_room_id");
|
||||||
|
|
||||||
b.Property<string>("Content")
|
b.Property<string>("Content")
|
||||||
@ -1122,8 +1115,8 @@ namespace DysonNetwork.Sphere.Migrations
|
|||||||
.HasColumnType("timestamp with time zone")
|
.HasColumnType("timestamp with time zone")
|
||||||
.HasColumnName("ended_at");
|
.HasColumnName("ended_at");
|
||||||
|
|
||||||
b.Property<long>("RoomId")
|
b.Property<Guid>("RoomId")
|
||||||
.HasColumnType("bigint")
|
.HasColumnType("uuid")
|
||||||
.HasColumnName("room_id");
|
.HasColumnName("room_id");
|
||||||
|
|
||||||
b.Property<Guid>("SenderId")
|
b.Property<Guid>("SenderId")
|
||||||
@ -1286,13 +1279,11 @@ namespace DysonNetwork.Sphere.Migrations
|
|||||||
|
|
||||||
modelBuilder.Entity("DysonNetwork.Sphere.Post.Post", b =>
|
modelBuilder.Entity("DysonNetwork.Sphere.Post.Post", b =>
|
||||||
{
|
{
|
||||||
b.Property<long>("Id")
|
b.Property<Guid>("Id")
|
||||||
.ValueGeneratedOnAdd()
|
.ValueGeneratedOnAdd()
|
||||||
.HasColumnType("bigint")
|
.HasColumnType("uuid")
|
||||||
.HasColumnName("id");
|
.HasColumnName("id");
|
||||||
|
|
||||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<long>("Id"));
|
|
||||||
|
|
||||||
b.Property<string>("Content")
|
b.Property<string>("Content")
|
||||||
.HasColumnType("text")
|
.HasColumnType("text")
|
||||||
.HasColumnName("content");
|
.HasColumnName("content");
|
||||||
@ -1318,8 +1309,8 @@ namespace DysonNetwork.Sphere.Migrations
|
|||||||
.HasColumnType("timestamp with time zone")
|
.HasColumnType("timestamp with time zone")
|
||||||
.HasColumnName("edited_at");
|
.HasColumnName("edited_at");
|
||||||
|
|
||||||
b.Property<long?>("ForwardedPostId")
|
b.Property<Guid?>("ForwardedPostId")
|
||||||
.HasColumnType("bigint")
|
.HasColumnType("uuid")
|
||||||
.HasColumnName("forwarded_post_id");
|
.HasColumnName("forwarded_post_id");
|
||||||
|
|
||||||
b.Property<string>("Language")
|
b.Property<string>("Language")
|
||||||
@ -1335,12 +1326,12 @@ namespace DysonNetwork.Sphere.Migrations
|
|||||||
.HasColumnType("timestamp with time zone")
|
.HasColumnType("timestamp with time zone")
|
||||||
.HasColumnName("published_at");
|
.HasColumnName("published_at");
|
||||||
|
|
||||||
b.Property<long>("PublisherId")
|
b.Property<Guid>("PublisherId")
|
||||||
.HasColumnType("bigint")
|
.HasColumnType("uuid")
|
||||||
.HasColumnName("publisher_id");
|
.HasColumnName("publisher_id");
|
||||||
|
|
||||||
b.Property<long?>("RepliedPostId")
|
b.Property<Guid?>("RepliedPostId")
|
||||||
.HasColumnType("bigint")
|
.HasColumnType("uuid")
|
||||||
.HasColumnName("replied_post_id");
|
.HasColumnName("replied_post_id");
|
||||||
|
|
||||||
b.Property<NpgsqlTsVector>("SearchVector")
|
b.Property<NpgsqlTsVector>("SearchVector")
|
||||||
@ -1351,8 +1342,8 @@ namespace DysonNetwork.Sphere.Migrations
|
|||||||
.HasAnnotation("Npgsql:TsVectorConfig", "simple")
|
.HasAnnotation("Npgsql:TsVectorConfig", "simple")
|
||||||
.HasAnnotation("Npgsql:TsVectorProperties", new[] { "Title", "Description", "Content" });
|
.HasAnnotation("Npgsql:TsVectorProperties", new[] { "Title", "Description", "Content" });
|
||||||
|
|
||||||
b.Property<long?>("ThreadedPostId")
|
b.Property<Guid?>("ThreadedPostId")
|
||||||
.HasColumnType("bigint")
|
.HasColumnType("uuid")
|
||||||
.HasColumnName("threaded_post_id");
|
.HasColumnName("threaded_post_id");
|
||||||
|
|
||||||
b.Property<string>("Title")
|
b.Property<string>("Title")
|
||||||
@ -1410,13 +1401,11 @@ namespace DysonNetwork.Sphere.Migrations
|
|||||||
|
|
||||||
modelBuilder.Entity("DysonNetwork.Sphere.Post.PostCategory", b =>
|
modelBuilder.Entity("DysonNetwork.Sphere.Post.PostCategory", b =>
|
||||||
{
|
{
|
||||||
b.Property<long>("Id")
|
b.Property<Guid>("Id")
|
||||||
.ValueGeneratedOnAdd()
|
.ValueGeneratedOnAdd()
|
||||||
.HasColumnType("bigint")
|
.HasColumnType("uuid")
|
||||||
.HasColumnName("id");
|
.HasColumnName("id");
|
||||||
|
|
||||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<long>("Id"));
|
|
||||||
|
|
||||||
b.Property<Instant>("CreatedAt")
|
b.Property<Instant>("CreatedAt")
|
||||||
.HasColumnType("timestamp with time zone")
|
.HasColumnType("timestamp with time zone")
|
||||||
.HasColumnName("created_at");
|
.HasColumnName("created_at");
|
||||||
@ -1448,13 +1437,11 @@ namespace DysonNetwork.Sphere.Migrations
|
|||||||
|
|
||||||
modelBuilder.Entity("DysonNetwork.Sphere.Post.PostCollection", b =>
|
modelBuilder.Entity("DysonNetwork.Sphere.Post.PostCollection", b =>
|
||||||
{
|
{
|
||||||
b.Property<long>("Id")
|
b.Property<Guid>("Id")
|
||||||
.ValueGeneratedOnAdd()
|
.ValueGeneratedOnAdd()
|
||||||
.HasColumnType("bigint")
|
.HasColumnType("uuid")
|
||||||
.HasColumnName("id");
|
.HasColumnName("id");
|
||||||
|
|
||||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<long>("Id"));
|
|
||||||
|
|
||||||
b.Property<Instant>("CreatedAt")
|
b.Property<Instant>("CreatedAt")
|
||||||
.HasColumnType("timestamp with time zone")
|
.HasColumnType("timestamp with time zone")
|
||||||
.HasColumnName("created_at");
|
.HasColumnName("created_at");
|
||||||
@ -1473,8 +1460,8 @@ namespace DysonNetwork.Sphere.Migrations
|
|||||||
.HasColumnType("character varying(256)")
|
.HasColumnType("character varying(256)")
|
||||||
.HasColumnName("name");
|
.HasColumnName("name");
|
||||||
|
|
||||||
b.Property<long>("PublisherId")
|
b.Property<Guid>("PublisherId")
|
||||||
.HasColumnType("bigint")
|
.HasColumnType("uuid")
|
||||||
.HasColumnName("publisher_id");
|
.HasColumnName("publisher_id");
|
||||||
|
|
||||||
b.Property<string>("Slug")
|
b.Property<string>("Slug")
|
||||||
@ -1498,15 +1485,13 @@ namespace DysonNetwork.Sphere.Migrations
|
|||||||
|
|
||||||
modelBuilder.Entity("DysonNetwork.Sphere.Post.PostReaction", b =>
|
modelBuilder.Entity("DysonNetwork.Sphere.Post.PostReaction", b =>
|
||||||
{
|
{
|
||||||
b.Property<long>("Id")
|
b.Property<Guid>("Id")
|
||||||
.ValueGeneratedOnAdd()
|
.ValueGeneratedOnAdd()
|
||||||
.HasColumnType("bigint")
|
.HasColumnType("uuid")
|
||||||
.HasColumnName("id");
|
.HasColumnName("id");
|
||||||
|
|
||||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<long>("Id"));
|
b.Property<Guid>("AccountId")
|
||||||
|
.HasColumnType("uuid")
|
||||||
b.Property<long>("AccountId")
|
|
||||||
.HasColumnType("bigint")
|
|
||||||
.HasColumnName("account_id");
|
.HasColumnName("account_id");
|
||||||
|
|
||||||
b.Property<int>("Attitude")
|
b.Property<int>("Attitude")
|
||||||
@ -1521,8 +1506,8 @@ namespace DysonNetwork.Sphere.Migrations
|
|||||||
.HasColumnType("timestamp with time zone")
|
.HasColumnType("timestamp with time zone")
|
||||||
.HasColumnName("deleted_at");
|
.HasColumnName("deleted_at");
|
||||||
|
|
||||||
b.Property<long>("PostId")
|
b.Property<Guid>("PostId")
|
||||||
.HasColumnType("bigint")
|
.HasColumnType("uuid")
|
||||||
.HasColumnName("post_id");
|
.HasColumnName("post_id");
|
||||||
|
|
||||||
b.Property<string>("Symbol")
|
b.Property<string>("Symbol")
|
||||||
@ -1549,13 +1534,11 @@ namespace DysonNetwork.Sphere.Migrations
|
|||||||
|
|
||||||
modelBuilder.Entity("DysonNetwork.Sphere.Post.PostTag", b =>
|
modelBuilder.Entity("DysonNetwork.Sphere.Post.PostTag", b =>
|
||||||
{
|
{
|
||||||
b.Property<long>("Id")
|
b.Property<Guid>("Id")
|
||||||
.ValueGeneratedOnAdd()
|
.ValueGeneratedOnAdd()
|
||||||
.HasColumnType("bigint")
|
.HasColumnType("uuid")
|
||||||
.HasColumnName("id");
|
.HasColumnName("id");
|
||||||
|
|
||||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<long>("Id"));
|
|
||||||
|
|
||||||
b.Property<Instant>("CreatedAt")
|
b.Property<Instant>("CreatedAt")
|
||||||
.HasColumnType("timestamp with time zone")
|
.HasColumnType("timestamp with time zone")
|
||||||
.HasColumnName("created_at");
|
.HasColumnName("created_at");
|
||||||
@ -1587,15 +1570,13 @@ namespace DysonNetwork.Sphere.Migrations
|
|||||||
|
|
||||||
modelBuilder.Entity("DysonNetwork.Sphere.Post.Publisher", b =>
|
modelBuilder.Entity("DysonNetwork.Sphere.Post.Publisher", b =>
|
||||||
{
|
{
|
||||||
b.Property<long>("Id")
|
b.Property<Guid>("Id")
|
||||||
.ValueGeneratedOnAdd()
|
.ValueGeneratedOnAdd()
|
||||||
.HasColumnType("bigint")
|
.HasColumnType("uuid")
|
||||||
.HasColumnName("id");
|
.HasColumnName("id");
|
||||||
|
|
||||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<long>("Id"));
|
b.Property<Guid?>("AccountId")
|
||||||
|
.HasColumnType("uuid")
|
||||||
b.Property<long?>("AccountId")
|
|
||||||
.HasColumnType("bigint")
|
|
||||||
.HasColumnName("account_id");
|
.HasColumnName("account_id");
|
||||||
|
|
||||||
b.Property<string>("BackgroundId")
|
b.Property<string>("BackgroundId")
|
||||||
@ -1635,8 +1616,8 @@ namespace DysonNetwork.Sphere.Migrations
|
|||||||
.HasColumnType("integer")
|
.HasColumnType("integer")
|
||||||
.HasColumnName("publisher_type");
|
.HasColumnName("publisher_type");
|
||||||
|
|
||||||
b.Property<long?>("RealmId")
|
b.Property<Guid?>("RealmId")
|
||||||
.HasColumnType("bigint")
|
.HasColumnType("uuid")
|
||||||
.HasColumnName("realm_id");
|
.HasColumnName("realm_id");
|
||||||
|
|
||||||
b.Property<Instant>("UpdatedAt")
|
b.Property<Instant>("UpdatedAt")
|
||||||
@ -1667,12 +1648,12 @@ namespace DysonNetwork.Sphere.Migrations
|
|||||||
|
|
||||||
modelBuilder.Entity("DysonNetwork.Sphere.Post.PublisherMember", b =>
|
modelBuilder.Entity("DysonNetwork.Sphere.Post.PublisherMember", b =>
|
||||||
{
|
{
|
||||||
b.Property<long>("PublisherId")
|
b.Property<Guid>("PublisherId")
|
||||||
.HasColumnType("bigint")
|
.HasColumnType("uuid")
|
||||||
.HasColumnName("publisher_id");
|
.HasColumnName("publisher_id");
|
||||||
|
|
||||||
b.Property<long>("AccountId")
|
b.Property<Guid>("AccountId")
|
||||||
.HasColumnType("bigint")
|
.HasColumnType("uuid")
|
||||||
.HasColumnName("account_id");
|
.HasColumnName("account_id");
|
||||||
|
|
||||||
b.Property<Instant>("CreatedAt")
|
b.Property<Instant>("CreatedAt")
|
||||||
@ -1711,8 +1692,8 @@ namespace DysonNetwork.Sphere.Migrations
|
|||||||
.HasColumnType("uuid")
|
.HasColumnType("uuid")
|
||||||
.HasColumnName("id");
|
.HasColumnName("id");
|
||||||
|
|
||||||
b.Property<long>("AccountId")
|
b.Property<Guid>("AccountId")
|
||||||
.HasColumnType("bigint")
|
.HasColumnType("uuid")
|
||||||
.HasColumnName("account_id");
|
.HasColumnName("account_id");
|
||||||
|
|
||||||
b.Property<Instant>("CreatedAt")
|
b.Property<Instant>("CreatedAt")
|
||||||
@ -1723,8 +1704,8 @@ namespace DysonNetwork.Sphere.Migrations
|
|||||||
.HasColumnType("timestamp with time zone")
|
.HasColumnType("timestamp with time zone")
|
||||||
.HasColumnName("deleted_at");
|
.HasColumnName("deleted_at");
|
||||||
|
|
||||||
b.Property<long>("PublisherId")
|
b.Property<Guid>("PublisherId")
|
||||||
.HasColumnType("bigint")
|
.HasColumnType("uuid")
|
||||||
.HasColumnName("publisher_id");
|
.HasColumnName("publisher_id");
|
||||||
|
|
||||||
b.Property<int>("Status")
|
b.Property<int>("Status")
|
||||||
@ -1753,15 +1734,13 @@ namespace DysonNetwork.Sphere.Migrations
|
|||||||
|
|
||||||
modelBuilder.Entity("DysonNetwork.Sphere.Realm.Realm", b =>
|
modelBuilder.Entity("DysonNetwork.Sphere.Realm.Realm", b =>
|
||||||
{
|
{
|
||||||
b.Property<long>("Id")
|
b.Property<Guid>("Id")
|
||||||
.ValueGeneratedOnAdd()
|
.ValueGeneratedOnAdd()
|
||||||
.HasColumnType("bigint")
|
.HasColumnType("uuid")
|
||||||
.HasColumnName("id");
|
.HasColumnName("id");
|
||||||
|
|
||||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<long>("Id"));
|
b.Property<Guid>("AccountId")
|
||||||
|
.HasColumnType("uuid")
|
||||||
b.Property<long>("AccountId")
|
|
||||||
.HasColumnType("bigint")
|
|
||||||
.HasColumnName("account_id");
|
.HasColumnName("account_id");
|
||||||
|
|
||||||
b.Property<string>("BackgroundId")
|
b.Property<string>("BackgroundId")
|
||||||
@ -1840,12 +1819,12 @@ namespace DysonNetwork.Sphere.Migrations
|
|||||||
|
|
||||||
modelBuilder.Entity("DysonNetwork.Sphere.Realm.RealmMember", b =>
|
modelBuilder.Entity("DysonNetwork.Sphere.Realm.RealmMember", b =>
|
||||||
{
|
{
|
||||||
b.Property<long>("RealmId")
|
b.Property<Guid>("RealmId")
|
||||||
.HasColumnType("bigint")
|
.HasColumnType("uuid")
|
||||||
.HasColumnName("realm_id");
|
.HasColumnName("realm_id");
|
||||||
|
|
||||||
b.Property<long>("AccountId")
|
b.Property<Guid>("AccountId")
|
||||||
.HasColumnType("bigint")
|
.HasColumnType("uuid")
|
||||||
.HasColumnName("account_id");
|
.HasColumnName("account_id");
|
||||||
|
|
||||||
b.Property<Instant>("CreatedAt")
|
b.Property<Instant>("CreatedAt")
|
||||||
@ -1956,8 +1935,8 @@ namespace DysonNetwork.Sphere.Migrations
|
|||||||
.HasColumnType("character varying(128)")
|
.HasColumnType("character varying(128)")
|
||||||
.HasColumnName("prefix");
|
.HasColumnName("prefix");
|
||||||
|
|
||||||
b.Property<long>("PublisherId")
|
b.Property<Guid>("PublisherId")
|
||||||
.HasColumnType("bigint")
|
.HasColumnType("uuid")
|
||||||
.HasColumnName("publisher_id");
|
.HasColumnName("publisher_id");
|
||||||
|
|
||||||
b.Property<Instant>("UpdatedAt")
|
b.Property<Instant>("UpdatedAt")
|
||||||
@ -1980,8 +1959,8 @@ namespace DysonNetwork.Sphere.Migrations
|
|||||||
.HasColumnType("character varying(128)")
|
.HasColumnType("character varying(128)")
|
||||||
.HasColumnName("id");
|
.HasColumnName("id");
|
||||||
|
|
||||||
b.Property<long>("AccountId")
|
b.Property<Guid>("AccountId")
|
||||||
.HasColumnType("bigint")
|
.HasColumnType("uuid")
|
||||||
.HasColumnName("account_id");
|
.HasColumnName("account_id");
|
||||||
|
|
||||||
b.Property<Instant>("CreatedAt")
|
b.Property<Instant>("CreatedAt")
|
||||||
@ -2029,8 +2008,8 @@ namespace DysonNetwork.Sphere.Migrations
|
|||||||
.HasColumnType("character varying(1024)")
|
.HasColumnType("character varying(1024)")
|
||||||
.HasColumnName("name");
|
.HasColumnName("name");
|
||||||
|
|
||||||
b.Property<long?>("PostId")
|
b.Property<Guid?>("PostId")
|
||||||
.HasColumnType("bigint")
|
.HasColumnType("uuid")
|
||||||
.HasColumnName("post_id");
|
.HasColumnName("post_id");
|
||||||
|
|
||||||
b.Property<long>("Size")
|
b.Property<long>("Size")
|
||||||
@ -2075,12 +2054,12 @@ namespace DysonNetwork.Sphere.Migrations
|
|||||||
|
|
||||||
modelBuilder.Entity("PostPostCategory", b =>
|
modelBuilder.Entity("PostPostCategory", b =>
|
||||||
{
|
{
|
||||||
b.Property<long>("CategoriesId")
|
b.Property<Guid>("CategoriesId")
|
||||||
.HasColumnType("bigint")
|
.HasColumnType("uuid")
|
||||||
.HasColumnName("categories_id");
|
.HasColumnName("categories_id");
|
||||||
|
|
||||||
b.Property<long>("PostsId")
|
b.Property<Guid>("PostsId")
|
||||||
.HasColumnType("bigint")
|
.HasColumnType("uuid")
|
||||||
.HasColumnName("posts_id");
|
.HasColumnName("posts_id");
|
||||||
|
|
||||||
b.HasKey("CategoriesId", "PostsId")
|
b.HasKey("CategoriesId", "PostsId")
|
||||||
@ -2094,12 +2073,12 @@ namespace DysonNetwork.Sphere.Migrations
|
|||||||
|
|
||||||
modelBuilder.Entity("PostPostCollection", b =>
|
modelBuilder.Entity("PostPostCollection", b =>
|
||||||
{
|
{
|
||||||
b.Property<long>("CollectionsId")
|
b.Property<Guid>("CollectionsId")
|
||||||
.HasColumnType("bigint")
|
.HasColumnType("uuid")
|
||||||
.HasColumnName("collections_id");
|
.HasColumnName("collections_id");
|
||||||
|
|
||||||
b.Property<long>("PostsId")
|
b.Property<Guid>("PostsId")
|
||||||
.HasColumnType("bigint")
|
.HasColumnType("uuid")
|
||||||
.HasColumnName("posts_id");
|
.HasColumnName("posts_id");
|
||||||
|
|
||||||
b.HasKey("CollectionsId", "PostsId")
|
b.HasKey("CollectionsId", "PostsId")
|
||||||
@ -2113,12 +2092,12 @@ namespace DysonNetwork.Sphere.Migrations
|
|||||||
|
|
||||||
modelBuilder.Entity("PostPostTag", b =>
|
modelBuilder.Entity("PostPostTag", b =>
|
||||||
{
|
{
|
||||||
b.Property<long>("PostsId")
|
b.Property<Guid>("PostsId")
|
||||||
.HasColumnType("bigint")
|
.HasColumnType("uuid")
|
||||||
.HasColumnName("posts_id");
|
.HasColumnName("posts_id");
|
||||||
|
|
||||||
b.Property<long>("TagsId")
|
b.Property<Guid>("TagsId")
|
||||||
.HasColumnType("bigint")
|
.HasColumnType("uuid")
|
||||||
.HasColumnName("tags_id");
|
.HasColumnName("tags_id");
|
||||||
|
|
||||||
b.HasKey("PostsId", "TagsId")
|
b.HasKey("PostsId", "TagsId")
|
@ -1,9 +1,9 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Text.Json;
|
using System.Text.Json;
|
||||||
|
using DysonNetwork.Sphere.Account;
|
||||||
using Microsoft.EntityFrameworkCore.Migrations;
|
using Microsoft.EntityFrameworkCore.Migrations;
|
||||||
using NodaTime;
|
using NodaTime;
|
||||||
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
|
|
||||||
using NpgsqlTypes;
|
using NpgsqlTypes;
|
||||||
|
|
||||||
#nullable disable
|
#nullable disable
|
||||||
@ -20,8 +20,7 @@ namespace DysonNetwork.Sphere.Migrations
|
|||||||
name: "accounts",
|
name: "accounts",
|
||||||
columns: table => new
|
columns: table => new
|
||||||
{
|
{
|
||||||
id = table.Column<long>(type: "bigint", nullable: false)
|
id = table.Column<Guid>(type: "uuid", nullable: false),
|
||||||
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
|
|
||||||
name = table.Column<string>(type: "character varying(256)", maxLength: 256, 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),
|
nick = table.Column<string>(type: "character varying(256)", maxLength: 256, nullable: false),
|
||||||
language = table.Column<string>(type: "character varying(32)", maxLength: 32, 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",
|
name: "post_categories",
|
||||||
columns: table => new
|
columns: table => new
|
||||||
{
|
{
|
||||||
id = table.Column<long>(type: "bigint", nullable: false)
|
id = table.Column<Guid>(type: "uuid", nullable: false),
|
||||||
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
|
|
||||||
slug = table.Column<string>(type: "character varying(128)", maxLength: 128, 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),
|
name = table.Column<string>(type: "character varying(256)", maxLength: 256, nullable: true),
|
||||||
created_at = table.Column<Instant>(type: "timestamp with time zone", nullable: false),
|
created_at = table.Column<Instant>(type: "timestamp with time zone", nullable: false),
|
||||||
@ -72,8 +70,7 @@ namespace DysonNetwork.Sphere.Migrations
|
|||||||
name: "post_tags",
|
name: "post_tags",
|
||||||
columns: table => new
|
columns: table => new
|
||||||
{
|
{
|
||||||
id = table.Column<long>(type: "bigint", nullable: false)
|
id = table.Column<Guid>(type: "uuid", nullable: false),
|
||||||
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
|
|
||||||
slug = table.Column<string>(type: "character varying(128)", maxLength: 128, 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),
|
name = table.Column<string>(type: "character varying(256)", maxLength: 256, nullable: true),
|
||||||
created_at = table.Column<Instant>(type: "timestamp with time zone", nullable: false),
|
created_at = table.Column<Instant>(type: "timestamp with time zone", nullable: false),
|
||||||
@ -89,11 +86,10 @@ namespace DysonNetwork.Sphere.Migrations
|
|||||||
name: "account_auth_factors",
|
name: "account_auth_factors",
|
||||||
columns: table => new
|
columns: table => new
|
||||||
{
|
{
|
||||||
id = table.Column<long>(type: "bigint", nullable: false)
|
id = table.Column<Guid>(type: "uuid", nullable: false),
|
||||||
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
|
|
||||||
type = table.Column<int>(type: "integer", nullable: false),
|
type = table.Column<int>(type: "integer", nullable: false),
|
||||||
secret = table.Column<string>(type: "text", nullable: true),
|
secret = table.Column<string>(type: "character varying(8196)", maxLength: 8196, 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),
|
created_at = table.Column<Instant>(type: "timestamp with time zone", nullable: false),
|
||||||
updated_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)
|
deleted_at = table.Column<Instant>(type: "timestamp with time zone", nullable: true)
|
||||||
@ -109,16 +105,38 @@ namespace DysonNetwork.Sphere.Migrations
|
|||||||
onDelete: ReferentialAction.Cascade);
|
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(
|
migrationBuilder.CreateTable(
|
||||||
name: "account_contacts",
|
name: "account_contacts",
|
||||||
columns: table => new
|
columns: table => new
|
||||||
{
|
{
|
||||||
id = table.Column<long>(type: "bigint", nullable: false)
|
id = table.Column<Guid>(type: "uuid", nullable: false),
|
||||||
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
|
|
||||||
type = table.Column<int>(type: "integer", nullable: false),
|
type = table.Column<int>(type: "integer", nullable: false),
|
||||||
verified_at = table.Column<Instant>(type: "timestamp with time zone", nullable: true),
|
verified_at = table.Column<Instant>(type: "timestamp with time zone", nullable: true),
|
||||||
content = table.Column<string>(type: "character varying(1024)", maxLength: 1024, nullable: false),
|
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),
|
created_at = table.Column<Instant>(type: "timestamp with time zone", nullable: false),
|
||||||
updated_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)
|
deleted_at = table.Column<Instant>(type: "timestamp with time zone", nullable: true)
|
||||||
@ -138,8 +156,8 @@ namespace DysonNetwork.Sphere.Migrations
|
|||||||
name: "account_relationships",
|
name: "account_relationships",
|
||||||
columns: table => new
|
columns: table => new
|
||||||
{
|
{
|
||||||
account_id = table.Column<long>(type: "bigint", nullable: false),
|
account_id = table.Column<Guid>(type: "uuid", nullable: false),
|
||||||
related_id = table.Column<long>(type: "bigint", nullable: false),
|
related_id = table.Column<Guid>(type: "uuid", nullable: false),
|
||||||
expired_at = table.Column<Instant>(type: "timestamp with time zone", nullable: true),
|
expired_at = table.Column<Instant>(type: "timestamp with time zone", nullable: true),
|
||||||
status = table.Column<int>(type: "integer", nullable: false),
|
status = table.Column<int>(type: "integer", nullable: false),
|
||||||
created_at = table.Column<Instant>(type: "timestamp with time zone", 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);
|
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(
|
migrationBuilder.CreateTable(
|
||||||
name: "activities",
|
name: "activities",
|
||||||
columns: table => new
|
columns: table => new
|
||||||
@ -171,7 +215,9 @@ namespace DysonNetwork.Sphere.Migrations
|
|||||||
type = table.Column<string>(type: "character varying(1024)", maxLength: 1024, nullable: false),
|
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),
|
resource_identifier = table.Column<string>(type: "character varying(4096)", maxLength: 4096, nullable: false),
|
||||||
visibility = table.Column<int>(type: "integer", 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),
|
created_at = table.Column<Instant>(type: "timestamp with time zone", nullable: false),
|
||||||
updated_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)
|
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),
|
failed_attempts = table.Column<int>(type: "integer", nullable: false),
|
||||||
platform = table.Column<int>(type: "integer", nullable: false),
|
platform = table.Column<int>(type: "integer", nullable: false),
|
||||||
type = 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),
|
audiences = table.Column<List<string>>(type: "jsonb", nullable: false),
|
||||||
scopes = 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),
|
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),
|
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),
|
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),
|
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),
|
created_at = table.Column<Instant>(type: "timestamp with time zone", nullable: false),
|
||||||
updated_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)
|
deleted_at = table.Column<Instant>(type: "timestamp with time zone", nullable: true)
|
||||||
@ -221,6 +267,32 @@ namespace DysonNetwork.Sphere.Migrations
|
|||||||
onDelete: ReferentialAction.Cascade);
|
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(
|
migrationBuilder.CreateTable(
|
||||||
name: "magic_spells",
|
name: "magic_spells",
|
||||||
columns: table => new
|
columns: table => new
|
||||||
@ -231,7 +303,7 @@ namespace DysonNetwork.Sphere.Migrations
|
|||||||
expires_at = table.Column<Instant>(type: "timestamp with time zone", nullable: true),
|
expires_at = table.Column<Instant>(type: "timestamp with time zone", nullable: true),
|
||||||
affected_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),
|
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),
|
created_at = table.Column<Instant>(type: "timestamp with time zone", nullable: false),
|
||||||
updated_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)
|
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),
|
device_token = table.Column<string>(type: "character varying(4096)", maxLength: 4096, nullable: false),
|
||||||
provider = table.Column<int>(type: "integer", nullable: false),
|
provider = table.Column<int>(type: "integer", nullable: false),
|
||||||
last_used_at = table.Column<Instant>(type: "timestamp with time zone", nullable: true),
|
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),
|
created_at = table.Column<Instant>(type: "timestamp with time zone", nullable: false),
|
||||||
updated_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)
|
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),
|
meta = table.Column<Dictionary<string, object>>(type: "jsonb", nullable: true),
|
||||||
priority = table.Column<int>(type: "integer", nullable: false),
|
priority = table.Column<int>(type: "integer", nullable: false),
|
||||||
viewed_at = table.Column<Instant>(type: "timestamp with time zone", nullable: true),
|
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),
|
created_at = table.Column<Instant>(type: "timestamp with time zone", nullable: false),
|
||||||
updated_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)
|
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),
|
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),
|
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),
|
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),
|
challenge_id = table.Column<Guid>(type: "uuid", nullable: false),
|
||||||
created_at = table.Column<Instant>(type: "timestamp with time zone", 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),
|
updated_at = table.Column<Instant>(type: "timestamp with time zone", nullable: false),
|
||||||
@ -383,7 +455,7 @@ namespace DysonNetwork.Sphere.Migrations
|
|||||||
name: "account_profiles",
|
name: "account_profiles",
|
||||||
columns: table => new
|
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),
|
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),
|
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),
|
last_name = table.Column<string>(type: "character varying(256)", maxLength: 256, nullable: true),
|
||||||
@ -410,8 +482,8 @@ namespace DysonNetwork.Sphere.Migrations
|
|||||||
columns: table => new
|
columns: table => new
|
||||||
{
|
{
|
||||||
id = table.Column<Guid>(type: "uuid", nullable: false),
|
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),
|
||||||
account_id = table.Column<long>(type: "bigint", nullable: false),
|
account_id = table.Column<Guid>(type: "uuid", nullable: false),
|
||||||
nick = table.Column<string>(type: "character varying(1024)", maxLength: 1024, nullable: true),
|
nick = table.Column<string>(type: "character varying(1024)", maxLength: 1024, nullable: true),
|
||||||
role = table.Column<int>(type: "integer", nullable: false),
|
role = table.Column<int>(type: "integer", nullable: false),
|
||||||
notify = 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
|
columns: table => new
|
||||||
{
|
{
|
||||||
id = table.Column<Guid>(type: "uuid", nullable: false),
|
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),
|
meta = table.Column<Dictionary<string, object>>(type: "jsonb", nullable: true),
|
||||||
members_mentioned = table.Column<List<Guid>>(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),
|
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),
|
replied_message_id = table.Column<Guid>(type: "uuid", nullable: true),
|
||||||
forwarded_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),
|
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),
|
created_at = table.Column<Instant>(type: "timestamp with time zone", nullable: false),
|
||||||
updated_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)
|
deleted_at = table.Column<Instant>(type: "timestamp with time zone", nullable: true)
|
||||||
@ -474,6 +547,36 @@ namespace DysonNetwork.Sphere.Migrations
|
|||||||
onDelete: ReferentialAction.Restrict);
|
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(
|
migrationBuilder.CreateTable(
|
||||||
name: "chat_statuses",
|
name: "chat_statuses",
|
||||||
columns: table => new
|
columns: table => new
|
||||||
@ -503,48 +606,41 @@ namespace DysonNetwork.Sphere.Migrations
|
|||||||
});
|
});
|
||||||
|
|
||||||
migrationBuilder.CreateTable(
|
migrationBuilder.CreateTable(
|
||||||
name: "message_reaction",
|
name: "chat_realtime_call",
|
||||||
columns: table => new
|
columns: table => new
|
||||||
{
|
{
|
||||||
id = table.Column<Guid>(type: "uuid", nullable: false),
|
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),
|
sender_id = table.Column<Guid>(type: "uuid", nullable: false),
|
||||||
symbol = table.Column<string>(type: "character varying(256)", maxLength: 256, nullable: false),
|
room_id = table.Column<Guid>(type: "uuid", nullable: false),
|
||||||
attitude = table.Column<int>(type: "integer", nullable: false),
|
|
||||||
created_at = table.Column<Instant>(type: "timestamp with time zone", 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),
|
updated_at = table.Column<Instant>(type: "timestamp with time zone", nullable: false),
|
||||||
deleted_at = table.Column<Instant>(type: "timestamp with time zone", nullable: true)
|
deleted_at = table.Column<Instant>(type: "timestamp with time zone", nullable: true)
|
||||||
},
|
},
|
||||||
constraints: table =>
|
constraints: table =>
|
||||||
{
|
{
|
||||||
table.PrimaryKey("pk_message_reaction", x => x.id);
|
table.PrimaryKey("pk_chat_realtime_call", x => x.id);
|
||||||
table.ForeignKey(
|
table.ForeignKey(
|
||||||
name: "fk_message_reaction_chat_members_sender_id",
|
name: "fk_chat_realtime_call_chat_members_sender_id",
|
||||||
column: x => x.sender_id,
|
column: x => x.sender_id,
|
||||||
principalTable: "chat_members",
|
principalTable: "chat_members",
|
||||||
principalColumn: "id",
|
principalColumn: "id",
|
||||||
onDelete: ReferentialAction.Cascade);
|
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(
|
migrationBuilder.CreateTable(
|
||||||
name: "chat_rooms",
|
name: "chat_rooms",
|
||||||
columns: table => new
|
columns: table => new
|
||||||
{
|
{
|
||||||
id = table.Column<long>(type: "bigint", nullable: false)
|
id = table.Column<Guid>(type: "uuid", nullable: false),
|
||||||
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
|
|
||||||
name = 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),
|
description = table.Column<string>(type: "character varying(4096)", maxLength: 4096, nullable: false),
|
||||||
type = table.Column<int>(type: "integer", nullable: false),
|
type = table.Column<int>(type: "integer", nullable: false),
|
||||||
is_public = table.Column<bool>(type: "boolean", nullable: false),
|
is_public = table.Column<bool>(type: "boolean", nullable: false),
|
||||||
picture_id = table.Column<string>(type: "character varying(128)", nullable: true),
|
picture_id = table.Column<string>(type: "character varying(128)", nullable: true),
|
||||||
background_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),
|
created_at = table.Column<Instant>(type: "timestamp with time zone", nullable: false),
|
||||||
updated_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)
|
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),
|
uploaded_to = table.Column<string>(type: "character varying(128)", maxLength: 128, nullable: true),
|
||||||
has_compression = table.Column<bool>(type: "boolean", nullable: false),
|
has_compression = table.Column<bool>(type: "boolean", nullable: false),
|
||||||
used_count = table.Column<int>(type: "integer", 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),
|
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),
|
created_at = table.Column<Instant>(type: "timestamp with time zone", nullable: false),
|
||||||
updated_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)
|
deleted_at = table.Column<Instant>(type: "timestamp with time zone", nullable: true)
|
||||||
@ -594,49 +690,11 @@ namespace DysonNetwork.Sphere.Migrations
|
|||||||
principalColumn: "id");
|
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(
|
migrationBuilder.CreateTable(
|
||||||
name: "realms",
|
name: "realms",
|
||||||
columns: table => new
|
columns: table => new
|
||||||
{
|
{
|
||||||
id = table.Column<long>(type: "bigint", nullable: false)
|
id = table.Column<Guid>(type: "uuid", nullable: false),
|
||||||
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
|
|
||||||
slug = table.Column<string>(type: "character varying(1024)", maxLength: 1024, 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),
|
name = table.Column<string>(type: "character varying(1024)", maxLength: 1024, nullable: false),
|
||||||
description = table.Column<string>(type: "character varying(4096)", maxLength: 4096, 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),
|
is_public = table.Column<bool>(type: "boolean", nullable: false),
|
||||||
picture_id = table.Column<string>(type: "character varying(128)", nullable: true),
|
picture_id = table.Column<string>(type: "character varying(128)", nullable: true),
|
||||||
background_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),
|
created_at = table.Column<Instant>(type: "timestamp with time zone", nullable: false),
|
||||||
updated_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)
|
deleted_at = table.Column<Instant>(type: "timestamp with time zone", nullable: true)
|
||||||
@ -672,16 +730,86 @@ namespace DysonNetwork.Sphere.Migrations
|
|||||||
principalColumn: "id");
|
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(
|
migrationBuilder.CreateTable(
|
||||||
name: "post_collections",
|
name: "post_collections",
|
||||||
columns: table => new
|
columns: table => new
|
||||||
{
|
{
|
||||||
id = table.Column<long>(type: "bigint", nullable: false)
|
id = table.Column<Guid>(type: "uuid", nullable: false),
|
||||||
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
|
|
||||||
slug = table.Column<string>(type: "character varying(128)", maxLength: 128, 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),
|
name = table.Column<string>(type: "character varying(256)", maxLength: 256, nullable: true),
|
||||||
description = table.Column<string>(type: "character varying(4096)", maxLength: 4096, 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),
|
created_at = table.Column<Instant>(type: "timestamp with time zone", nullable: false),
|
||||||
updated_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)
|
deleted_at = table.Column<Instant>(type: "timestamp with time zone", nullable: true)
|
||||||
@ -701,8 +829,7 @@ namespace DysonNetwork.Sphere.Migrations
|
|||||||
name: "posts",
|
name: "posts",
|
||||||
columns: table => new
|
columns: table => new
|
||||||
{
|
{
|
||||||
id = table.Column<long>(type: "bigint", nullable: false)
|
id = table.Column<Guid>(type: "uuid", nullable: false),
|
||||||
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
|
|
||||||
title = table.Column<string>(type: "character varying(1024)", maxLength: 1024, nullable: true),
|
title = table.Column<string>(type: "character varying(1024)", maxLength: 1024, nullable: true),
|
||||||
description = table.Column<string>(type: "character varying(4096)", maxLength: 4096, 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),
|
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),
|
views_total = table.Column<int>(type: "integer", nullable: false),
|
||||||
upvotes = table.Column<int>(type: "integer", nullable: false),
|
upvotes = table.Column<int>(type: "integer", nullable: false),
|
||||||
downvotes = 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),
|
threaded_post_id = table.Column<Guid>(type: "uuid", nullable: true),
|
||||||
replied_post_id = table.Column<long>(type: "bigint", nullable: true),
|
replied_post_id = table.Column<Guid>(type: "uuid", nullable: true),
|
||||||
forwarded_post_id = table.Column<long>(type: "bigint", nullable: true),
|
forwarded_post_id = table.Column<Guid>(type: "uuid", nullable: true),
|
||||||
search_vector = table.Column<NpgsqlTsVector>(type: "tsvector", nullable: false)
|
search_vector = table.Column<NpgsqlTsVector>(type: "tsvector", nullable: false)
|
||||||
.Annotation("Npgsql:TsVectorConfig", "simple")
|
.Annotation("Npgsql:TsVectorConfig", "simple")
|
||||||
.Annotation("Npgsql:TsVectorProperties", new[] { "title", "description", "content" }),
|
.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),
|
created_at = table.Column<Instant>(type: "timestamp with time zone", nullable: false),
|
||||||
updated_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)
|
deleted_at = table.Column<Instant>(type: "timestamp with time zone", nullable: true)
|
||||||
@ -759,8 +886,8 @@ namespace DysonNetwork.Sphere.Migrations
|
|||||||
name: "publisher_members",
|
name: "publisher_members",
|
||||||
columns: table => new
|
columns: table => new
|
||||||
{
|
{
|
||||||
publisher_id = table.Column<long>(type: "bigint", nullable: false),
|
publisher_id = table.Column<Guid>(type: "uuid", nullable: false),
|
||||||
account_id = table.Column<long>(type: "bigint", nullable: false),
|
account_id = table.Column<Guid>(type: "uuid", nullable: false),
|
||||||
role = table.Column<int>(type: "integer", nullable: false),
|
role = table.Column<int>(type: "integer", nullable: false),
|
||||||
joined_at = table.Column<Instant>(type: "timestamp with time zone", nullable: true),
|
joined_at = table.Column<Instant>(type: "timestamp with time zone", nullable: true),
|
||||||
created_at = table.Column<Instant>(type: "timestamp with time zone", nullable: false),
|
created_at = table.Column<Instant>(type: "timestamp with time zone", nullable: false),
|
||||||
@ -785,30 +912,55 @@ namespace DysonNetwork.Sphere.Migrations
|
|||||||
});
|
});
|
||||||
|
|
||||||
migrationBuilder.CreateTable(
|
migrationBuilder.CreateTable(
|
||||||
name: "realm_members",
|
name: "publisher_subscriptions",
|
||||||
columns: table => new
|
columns: table => new
|
||||||
{
|
{
|
||||||
realm_id = table.Column<long>(type: "bigint", nullable: false),
|
id = table.Column<Guid>(type: "uuid", nullable: false),
|
||||||
account_id = table.Column<long>(type: "bigint", nullable: false),
|
publisher_id = table.Column<Guid>(type: "uuid", nullable: false),
|
||||||
role = table.Column<int>(type: "integer", nullable: false),
|
account_id = table.Column<Guid>(type: "uuid", nullable: false),
|
||||||
joined_at = table.Column<Instant>(type: "timestamp with time zone", nullable: true),
|
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),
|
created_at = table.Column<Instant>(type: "timestamp with time zone", nullable: false),
|
||||||
updated_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)
|
deleted_at = table.Column<Instant>(type: "timestamp with time zone", nullable: true)
|
||||||
},
|
},
|
||||||
constraints: table =>
|
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(
|
table.ForeignKey(
|
||||||
name: "fk_realm_members_accounts_account_id",
|
name: "fk_publisher_subscriptions_accounts_account_id",
|
||||||
column: x => x.account_id,
|
column: x => x.account_id,
|
||||||
principalTable: "accounts",
|
principalTable: "accounts",
|
||||||
principalColumn: "id",
|
principalColumn: "id",
|
||||||
onDelete: ReferentialAction.Cascade);
|
onDelete: ReferentialAction.Cascade);
|
||||||
table.ForeignKey(
|
table.ForeignKey(
|
||||||
name: "fk_realm_members_realms_realm_id",
|
name: "fk_publisher_subscriptions_publishers_publisher_id",
|
||||||
column: x => x.realm_id,
|
column: x => x.publisher_id,
|
||||||
principalTable: "realms",
|
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",
|
principalColumn: "id",
|
||||||
onDelete: ReferentialAction.Cascade);
|
onDelete: ReferentialAction.Cascade);
|
||||||
});
|
});
|
||||||
@ -817,8 +969,8 @@ namespace DysonNetwork.Sphere.Migrations
|
|||||||
name: "post_category_links",
|
name: "post_category_links",
|
||||||
columns: table => new
|
columns: table => new
|
||||||
{
|
{
|
||||||
categories_id = table.Column<long>(type: "bigint", nullable: false),
|
categories_id = table.Column<Guid>(type: "uuid", nullable: false),
|
||||||
posts_id = table.Column<long>(type: "bigint", nullable: false)
|
posts_id = table.Column<Guid>(type: "uuid", nullable: false)
|
||||||
},
|
},
|
||||||
constraints: table =>
|
constraints: table =>
|
||||||
{
|
{
|
||||||
@ -841,8 +993,8 @@ namespace DysonNetwork.Sphere.Migrations
|
|||||||
name: "post_collection_links",
|
name: "post_collection_links",
|
||||||
columns: table => new
|
columns: table => new
|
||||||
{
|
{
|
||||||
collections_id = table.Column<long>(type: "bigint", nullable: false),
|
collections_id = table.Column<Guid>(type: "uuid", nullable: false),
|
||||||
posts_id = table.Column<long>(type: "bigint", nullable: false)
|
posts_id = table.Column<Guid>(type: "uuid", nullable: false)
|
||||||
},
|
},
|
||||||
constraints: table =>
|
constraints: table =>
|
||||||
{
|
{
|
||||||
@ -865,12 +1017,11 @@ namespace DysonNetwork.Sphere.Migrations
|
|||||||
name: "post_reactions",
|
name: "post_reactions",
|
||||||
columns: table => new
|
columns: table => new
|
||||||
{
|
{
|
||||||
id = table.Column<long>(type: "bigint", nullable: false)
|
id = table.Column<Guid>(type: "uuid", nullable: false),
|
||||||
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
|
|
||||||
symbol = table.Column<string>(type: "character varying(256)", maxLength: 256, nullable: false),
|
symbol = table.Column<string>(type: "character varying(256)", maxLength: 256, nullable: false),
|
||||||
attitude = table.Column<int>(type: "integer", nullable: false),
|
attitude = table.Column<int>(type: "integer", nullable: false),
|
||||||
post_id = table.Column<long>(type: "bigint", nullable: false),
|
post_id = table.Column<Guid>(type: "uuid", 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),
|
created_at = table.Column<Instant>(type: "timestamp with time zone", nullable: false),
|
||||||
updated_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)
|
deleted_at = table.Column<Instant>(type: "timestamp with time zone", nullable: true)
|
||||||
@ -896,8 +1047,8 @@ namespace DysonNetwork.Sphere.Migrations
|
|||||||
name: "post_tag_links",
|
name: "post_tag_links",
|
||||||
columns: table => new
|
columns: table => new
|
||||||
{
|
{
|
||||||
posts_id = table.Column<long>(type: "bigint", nullable: false),
|
posts_id = table.Column<Guid>(type: "uuid", nullable: false),
|
||||||
tags_id = table.Column<long>(type: "bigint", nullable: false)
|
tags_id = table.Column<Guid>(type: "uuid", nullable: false)
|
||||||
},
|
},
|
||||||
constraints: table =>
|
constraints: table =>
|
||||||
{
|
{
|
||||||
@ -916,11 +1067,45 @@ namespace DysonNetwork.Sphere.Migrations
|
|||||||
onDelete: ReferentialAction.Cascade);
|
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(
|
migrationBuilder.CreateIndex(
|
||||||
name: "ix_account_auth_factors_account_id",
|
name: "ix_account_auth_factors_account_id",
|
||||||
table: "account_auth_factors",
|
table: "account_auth_factors",
|
||||||
column: "account_id");
|
column: "account_id");
|
||||||
|
|
||||||
|
migrationBuilder.CreateIndex(
|
||||||
|
name: "ix_account_check_in_results_account_id",
|
||||||
|
table: "account_check_in_results",
|
||||||
|
column: "account_id");
|
||||||
|
|
||||||
migrationBuilder.CreateIndex(
|
migrationBuilder.CreateIndex(
|
||||||
name: "ix_account_contacts_account_id",
|
name: "ix_account_contacts_account_id",
|
||||||
table: "account_contacts",
|
table: "account_contacts",
|
||||||
@ -941,6 +1126,11 @@ namespace DysonNetwork.Sphere.Migrations
|
|||||||
table: "account_relationships",
|
table: "account_relationships",
|
||||||
column: "related_id");
|
column: "related_id");
|
||||||
|
|
||||||
|
migrationBuilder.CreateIndex(
|
||||||
|
name: "ix_account_statuses_account_id",
|
||||||
|
table: "account_statuses",
|
||||||
|
column: "account_id");
|
||||||
|
|
||||||
migrationBuilder.CreateIndex(
|
migrationBuilder.CreateIndex(
|
||||||
name: "ix_accounts_name",
|
name: "ix_accounts_name",
|
||||||
table: "accounts",
|
table: "accounts",
|
||||||
@ -967,6 +1157,11 @@ namespace DysonNetwork.Sphere.Migrations
|
|||||||
table: "auth_sessions",
|
table: "auth_sessions",
|
||||||
column: "challenge_id");
|
column: "challenge_id");
|
||||||
|
|
||||||
|
migrationBuilder.CreateIndex(
|
||||||
|
name: "ix_badges_account_id",
|
||||||
|
table: "badges",
|
||||||
|
column: "account_id");
|
||||||
|
|
||||||
migrationBuilder.CreateIndex(
|
migrationBuilder.CreateIndex(
|
||||||
name: "ix_chat_members_account_id",
|
name: "ix_chat_members_account_id",
|
||||||
table: "chat_members",
|
table: "chat_members",
|
||||||
@ -992,6 +1187,26 @@ namespace DysonNetwork.Sphere.Migrations
|
|||||||
table: "chat_messages",
|
table: "chat_messages",
|
||||||
column: "sender_id");
|
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(
|
migrationBuilder.CreateIndex(
|
||||||
name: "ix_chat_rooms_background_id",
|
name: "ix_chat_rooms_background_id",
|
||||||
table: "chat_rooms",
|
table: "chat_rooms",
|
||||||
@ -1038,16 +1253,6 @@ namespace DysonNetwork.Sphere.Migrations
|
|||||||
column: "spell",
|
column: "spell",
|
||||||
unique: true);
|
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(
|
migrationBuilder.CreateIndex(
|
||||||
name: "ix_notification_push_subscriptions_account_id",
|
name: "ix_notification_push_subscriptions_account_id",
|
||||||
table: "notification_push_subscriptions",
|
table: "notification_push_subscriptions",
|
||||||
@ -1142,6 +1347,16 @@ namespace DysonNetwork.Sphere.Migrations
|
|||||||
table: "publisher_members",
|
table: "publisher_members",
|
||||||
column: "account_id");
|
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(
|
migrationBuilder.CreateIndex(
|
||||||
name: "ix_publishers_account_id",
|
name: "ix_publishers_account_id",
|
||||||
table: "publishers",
|
table: "publishers",
|
||||||
@ -1163,6 +1378,11 @@ namespace DysonNetwork.Sphere.Migrations
|
|||||||
table: "publishers",
|
table: "publishers",
|
||||||
column: "picture_id");
|
column: "picture_id");
|
||||||
|
|
||||||
|
migrationBuilder.CreateIndex(
|
||||||
|
name: "ix_publishers_realm_id",
|
||||||
|
table: "publishers",
|
||||||
|
column: "realm_id");
|
||||||
|
|
||||||
migrationBuilder.CreateIndex(
|
migrationBuilder.CreateIndex(
|
||||||
name: "ix_realm_members_account_id",
|
name: "ix_realm_members_account_id",
|
||||||
table: "realm_members",
|
table: "realm_members",
|
||||||
@ -1189,6 +1409,21 @@ namespace DysonNetwork.Sphere.Migrations
|
|||||||
column: "slug",
|
column: "slug",
|
||||||
unique: true);
|
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(
|
migrationBuilder.AddForeignKey(
|
||||||
name: "fk_account_profiles_files_background_id",
|
name: "fk_account_profiles_files_background_id",
|
||||||
table: "account_profiles",
|
table: "account_profiles",
|
||||||
@ -1219,6 +1454,14 @@ namespace DysonNetwork.Sphere.Migrations
|
|||||||
principalColumn: "id",
|
principalColumn: "id",
|
||||||
onDelete: ReferentialAction.Cascade);
|
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(
|
migrationBuilder.AddForeignKey(
|
||||||
name: "fk_chat_rooms_files_background_id",
|
name: "fk_chat_rooms_files_background_id",
|
||||||
table: "chat_rooms",
|
table: "chat_rooms",
|
||||||
@ -1294,6 +1537,9 @@ namespace DysonNetwork.Sphere.Migrations
|
|||||||
migrationBuilder.DropTable(
|
migrationBuilder.DropTable(
|
||||||
name: "account_auth_factors");
|
name: "account_auth_factors");
|
||||||
|
|
||||||
|
migrationBuilder.DropTable(
|
||||||
|
name: "account_check_in_results");
|
||||||
|
|
||||||
migrationBuilder.DropTable(
|
migrationBuilder.DropTable(
|
||||||
name: "account_contacts");
|
name: "account_contacts");
|
||||||
|
|
||||||
@ -1303,21 +1549,30 @@ namespace DysonNetwork.Sphere.Migrations
|
|||||||
migrationBuilder.DropTable(
|
migrationBuilder.DropTable(
|
||||||
name: "account_relationships");
|
name: "account_relationships");
|
||||||
|
|
||||||
|
migrationBuilder.DropTable(
|
||||||
|
name: "account_statuses");
|
||||||
|
|
||||||
migrationBuilder.DropTable(
|
migrationBuilder.DropTable(
|
||||||
name: "activities");
|
name: "activities");
|
||||||
|
|
||||||
migrationBuilder.DropTable(
|
migrationBuilder.DropTable(
|
||||||
name: "auth_sessions");
|
name: "auth_sessions");
|
||||||
|
|
||||||
|
migrationBuilder.DropTable(
|
||||||
|
name: "badges");
|
||||||
|
|
||||||
|
migrationBuilder.DropTable(
|
||||||
|
name: "chat_reactions");
|
||||||
|
|
||||||
|
migrationBuilder.DropTable(
|
||||||
|
name: "chat_realtime_call");
|
||||||
|
|
||||||
migrationBuilder.DropTable(
|
migrationBuilder.DropTable(
|
||||||
name: "chat_statuses");
|
name: "chat_statuses");
|
||||||
|
|
||||||
migrationBuilder.DropTable(
|
migrationBuilder.DropTable(
|
||||||
name: "magic_spells");
|
name: "magic_spells");
|
||||||
|
|
||||||
migrationBuilder.DropTable(
|
|
||||||
name: "message_reaction");
|
|
||||||
|
|
||||||
migrationBuilder.DropTable(
|
migrationBuilder.DropTable(
|
||||||
name: "notification_push_subscriptions");
|
name: "notification_push_subscriptions");
|
||||||
|
|
||||||
@ -1345,9 +1600,15 @@ namespace DysonNetwork.Sphere.Migrations
|
|||||||
migrationBuilder.DropTable(
|
migrationBuilder.DropTable(
|
||||||
name: "publisher_members");
|
name: "publisher_members");
|
||||||
|
|
||||||
|
migrationBuilder.DropTable(
|
||||||
|
name: "publisher_subscriptions");
|
||||||
|
|
||||||
migrationBuilder.DropTable(
|
migrationBuilder.DropTable(
|
||||||
name: "realm_members");
|
name: "realm_members");
|
||||||
|
|
||||||
|
migrationBuilder.DropTable(
|
||||||
|
name: "stickers");
|
||||||
|
|
||||||
migrationBuilder.DropTable(
|
migrationBuilder.DropTable(
|
||||||
name: "auth_challenges");
|
name: "auth_challenges");
|
||||||
|
|
||||||
@ -1363,6 +1624,9 @@ namespace DysonNetwork.Sphere.Migrations
|
|||||||
migrationBuilder.DropTable(
|
migrationBuilder.DropTable(
|
||||||
name: "post_tags");
|
name: "post_tags");
|
||||||
|
|
||||||
|
migrationBuilder.DropTable(
|
||||||
|
name: "sticker_packs");
|
||||||
|
|
||||||
migrationBuilder.DropTable(
|
migrationBuilder.DropTable(
|
||||||
name: "accounts");
|
name: "accounts");
|
||||||
|
|
@ -29,13 +29,11 @@ namespace DysonNetwork.Sphere.Migrations
|
|||||||
|
|
||||||
modelBuilder.Entity("DysonNetwork.Sphere.Account.Account", b =>
|
modelBuilder.Entity("DysonNetwork.Sphere.Account.Account", b =>
|
||||||
{
|
{
|
||||||
b.Property<long>("Id")
|
b.Property<Guid>("Id")
|
||||||
.ValueGeneratedOnAdd()
|
.ValueGeneratedOnAdd()
|
||||||
.HasColumnType("bigint")
|
.HasColumnType("uuid")
|
||||||
.HasColumnName("id");
|
.HasColumnName("id");
|
||||||
|
|
||||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<long>("Id"));
|
|
||||||
|
|
||||||
b.Property<Instant?>("ActivatedAt")
|
b.Property<Instant?>("ActivatedAt")
|
||||||
.HasColumnType("timestamp with time zone")
|
.HasColumnType("timestamp with time zone")
|
||||||
.HasColumnName("activated_at");
|
.HasColumnName("activated_at");
|
||||||
@ -86,15 +84,13 @@ namespace DysonNetwork.Sphere.Migrations
|
|||||||
|
|
||||||
modelBuilder.Entity("DysonNetwork.Sphere.Account.AccountAuthFactor", b =>
|
modelBuilder.Entity("DysonNetwork.Sphere.Account.AccountAuthFactor", b =>
|
||||||
{
|
{
|
||||||
b.Property<long>("Id")
|
b.Property<Guid>("Id")
|
||||||
.ValueGeneratedOnAdd()
|
.ValueGeneratedOnAdd()
|
||||||
.HasColumnType("bigint")
|
.HasColumnType("uuid")
|
||||||
.HasColumnName("id");
|
.HasColumnName("id");
|
||||||
|
|
||||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<long>("Id"));
|
b.Property<Guid>("AccountId")
|
||||||
|
.HasColumnType("uuid")
|
||||||
b.Property<long>("AccountId")
|
|
||||||
.HasColumnType("bigint")
|
|
||||||
.HasColumnName("account_id");
|
.HasColumnName("account_id");
|
||||||
|
|
||||||
b.Property<Instant>("CreatedAt")
|
b.Property<Instant>("CreatedAt")
|
||||||
@ -106,7 +102,8 @@ namespace DysonNetwork.Sphere.Migrations
|
|||||||
.HasColumnName("deleted_at");
|
.HasColumnName("deleted_at");
|
||||||
|
|
||||||
b.Property<string>("Secret")
|
b.Property<string>("Secret")
|
||||||
.HasColumnType("text")
|
.HasMaxLength(8196)
|
||||||
|
.HasColumnType("character varying(8196)")
|
||||||
.HasColumnName("secret");
|
.HasColumnName("secret");
|
||||||
|
|
||||||
b.Property<int>("Type")
|
b.Property<int>("Type")
|
||||||
@ -128,15 +125,13 @@ namespace DysonNetwork.Sphere.Migrations
|
|||||||
|
|
||||||
modelBuilder.Entity("DysonNetwork.Sphere.Account.AccountContact", b =>
|
modelBuilder.Entity("DysonNetwork.Sphere.Account.AccountContact", b =>
|
||||||
{
|
{
|
||||||
b.Property<long>("Id")
|
b.Property<Guid>("Id")
|
||||||
.ValueGeneratedOnAdd()
|
.ValueGeneratedOnAdd()
|
||||||
.HasColumnType("bigint")
|
.HasColumnType("uuid")
|
||||||
.HasColumnName("id");
|
.HasColumnName("id");
|
||||||
|
|
||||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<long>("Id"));
|
b.Property<Guid>("AccountId")
|
||||||
|
.HasColumnType("uuid")
|
||||||
b.Property<long>("AccountId")
|
|
||||||
.HasColumnType("bigint")
|
|
||||||
.HasColumnName("account_id");
|
.HasColumnName("account_id");
|
||||||
|
|
||||||
b.Property<string>("Content")
|
b.Property<string>("Content")
|
||||||
@ -181,8 +176,8 @@ namespace DysonNetwork.Sphere.Migrations
|
|||||||
.HasColumnType("uuid")
|
.HasColumnType("uuid")
|
||||||
.HasColumnName("id");
|
.HasColumnName("id");
|
||||||
|
|
||||||
b.Property<long>("AccountId")
|
b.Property<Guid>("AccountId")
|
||||||
.HasColumnType("bigint")
|
.HasColumnType("uuid")
|
||||||
.HasColumnName("account_id");
|
.HasColumnName("account_id");
|
||||||
|
|
||||||
b.Property<string>("Caption")
|
b.Property<string>("Caption")
|
||||||
@ -238,8 +233,8 @@ namespace DysonNetwork.Sphere.Migrations
|
|||||||
.HasColumnType("uuid")
|
.HasColumnType("uuid")
|
||||||
.HasColumnName("id");
|
.HasColumnName("id");
|
||||||
|
|
||||||
b.Property<long>("AccountId")
|
b.Property<Guid>("AccountId")
|
||||||
.HasColumnType("bigint")
|
.HasColumnType("uuid")
|
||||||
.HasColumnName("account_id");
|
.HasColumnName("account_id");
|
||||||
|
|
||||||
b.Property<Instant>("CreatedAt")
|
b.Property<Instant>("CreatedAt")
|
||||||
@ -279,8 +274,8 @@ namespace DysonNetwork.Sphere.Migrations
|
|||||||
.HasColumnType("uuid")
|
.HasColumnType("uuid")
|
||||||
.HasColumnName("id");
|
.HasColumnName("id");
|
||||||
|
|
||||||
b.Property<long?>("AccountId")
|
b.Property<Guid?>("AccountId")
|
||||||
.HasColumnType("bigint")
|
.HasColumnType("uuid")
|
||||||
.HasColumnName("account_id");
|
.HasColumnName("account_id");
|
||||||
|
|
||||||
b.Property<Instant?>("AffectedAt")
|
b.Property<Instant?>("AffectedAt")
|
||||||
@ -338,8 +333,8 @@ namespace DysonNetwork.Sphere.Migrations
|
|||||||
.HasColumnType("uuid")
|
.HasColumnType("uuid")
|
||||||
.HasColumnName("id");
|
.HasColumnName("id");
|
||||||
|
|
||||||
b.Property<long>("AccountId")
|
b.Property<Guid>("AccountId")
|
||||||
.HasColumnType("bigint")
|
.HasColumnType("uuid")
|
||||||
.HasColumnName("account_id");
|
.HasColumnName("account_id");
|
||||||
|
|
||||||
b.Property<string>("Content")
|
b.Property<string>("Content")
|
||||||
@ -403,8 +398,8 @@ namespace DysonNetwork.Sphere.Migrations
|
|||||||
.HasColumnType("uuid")
|
.HasColumnType("uuid")
|
||||||
.HasColumnName("id");
|
.HasColumnName("id");
|
||||||
|
|
||||||
b.Property<long>("AccountId")
|
b.Property<Guid>("AccountId")
|
||||||
.HasColumnType("bigint")
|
.HasColumnType("uuid")
|
||||||
.HasColumnName("account_id");
|
.HasColumnName("account_id");
|
||||||
|
|
||||||
b.Property<Instant>("CreatedAt")
|
b.Property<Instant>("CreatedAt")
|
||||||
@ -458,8 +453,8 @@ namespace DysonNetwork.Sphere.Migrations
|
|||||||
|
|
||||||
modelBuilder.Entity("DysonNetwork.Sphere.Account.Profile", b =>
|
modelBuilder.Entity("DysonNetwork.Sphere.Account.Profile", b =>
|
||||||
{
|
{
|
||||||
b.Property<long>("Id")
|
b.Property<Guid>("Id")
|
||||||
.HasColumnType("bigint")
|
.HasColumnType("uuid")
|
||||||
.HasColumnName("id");
|
.HasColumnName("id");
|
||||||
|
|
||||||
b.Property<string>("BackgroundId")
|
b.Property<string>("BackgroundId")
|
||||||
@ -516,12 +511,12 @@ namespace DysonNetwork.Sphere.Migrations
|
|||||||
|
|
||||||
modelBuilder.Entity("DysonNetwork.Sphere.Account.Relationship", b =>
|
modelBuilder.Entity("DysonNetwork.Sphere.Account.Relationship", b =>
|
||||||
{
|
{
|
||||||
b.Property<long>("AccountId")
|
b.Property<Guid>("AccountId")
|
||||||
.HasColumnType("bigint")
|
.HasColumnType("uuid")
|
||||||
.HasColumnName("account_id");
|
.HasColumnName("account_id");
|
||||||
|
|
||||||
b.Property<long>("RelatedId")
|
b.Property<Guid>("RelatedId")
|
||||||
.HasColumnType("bigint")
|
.HasColumnType("uuid")
|
||||||
.HasColumnName("related_id");
|
.HasColumnName("related_id");
|
||||||
|
|
||||||
b.Property<Instant>("CreatedAt")
|
b.Property<Instant>("CreatedAt")
|
||||||
@ -560,8 +555,8 @@ namespace DysonNetwork.Sphere.Migrations
|
|||||||
.HasColumnType("uuid")
|
.HasColumnType("uuid")
|
||||||
.HasColumnName("id");
|
.HasColumnName("id");
|
||||||
|
|
||||||
b.Property<long>("AccountId")
|
b.Property<Guid>("AccountId")
|
||||||
.HasColumnType("bigint")
|
.HasColumnType("uuid")
|
||||||
.HasColumnName("account_id");
|
.HasColumnName("account_id");
|
||||||
|
|
||||||
b.Property<int>("Attitude")
|
b.Property<int>("Attitude")
|
||||||
@ -613,8 +608,8 @@ namespace DysonNetwork.Sphere.Migrations
|
|||||||
.HasColumnType("uuid")
|
.HasColumnType("uuid")
|
||||||
.HasColumnName("id");
|
.HasColumnName("id");
|
||||||
|
|
||||||
b.Property<long>("AccountId")
|
b.Property<Guid>("AccountId")
|
||||||
.HasColumnType("bigint")
|
.HasColumnType("uuid")
|
||||||
.HasColumnName("account_id");
|
.HasColumnName("account_id");
|
||||||
|
|
||||||
b.Property<Instant>("CreatedAt")
|
b.Property<Instant>("CreatedAt")
|
||||||
@ -646,7 +641,7 @@ namespace DysonNetwork.Sphere.Migrations
|
|||||||
.HasColumnType("timestamp with time zone")
|
.HasColumnType("timestamp with time zone")
|
||||||
.HasColumnName("updated_at");
|
.HasColumnName("updated_at");
|
||||||
|
|
||||||
b.Property<ICollection<long>>("UsersVisible")
|
b.Property<ICollection<Guid>>("UsersVisible")
|
||||||
.IsRequired()
|
.IsRequired()
|
||||||
.HasColumnType("jsonb")
|
.HasColumnType("jsonb")
|
||||||
.HasColumnName("users_visible");
|
.HasColumnName("users_visible");
|
||||||
@ -671,8 +666,8 @@ namespace DysonNetwork.Sphere.Migrations
|
|||||||
.HasColumnType("uuid")
|
.HasColumnType("uuid")
|
||||||
.HasColumnName("id");
|
.HasColumnName("id");
|
||||||
|
|
||||||
b.Property<long>("AccountId")
|
b.Property<Guid>("AccountId")
|
||||||
.HasColumnType("bigint")
|
.HasColumnType("uuid")
|
||||||
.HasColumnName("account_id");
|
.HasColumnName("account_id");
|
||||||
|
|
||||||
b.Property<List<string>>("Audiences")
|
b.Property<List<string>>("Audiences")
|
||||||
@ -680,7 +675,7 @@ namespace DysonNetwork.Sphere.Migrations
|
|||||||
.HasColumnType("jsonb")
|
.HasColumnType("jsonb")
|
||||||
.HasColumnName("audiences");
|
.HasColumnName("audiences");
|
||||||
|
|
||||||
b.Property<List<long>>("BlacklistFactors")
|
b.Property<List<Guid>>("BlacklistFactors")
|
||||||
.IsRequired()
|
.IsRequired()
|
||||||
.HasColumnType("jsonb")
|
.HasColumnType("jsonb")
|
||||||
.HasColumnName("blacklist_factors");
|
.HasColumnName("blacklist_factors");
|
||||||
@ -762,8 +757,8 @@ namespace DysonNetwork.Sphere.Migrations
|
|||||||
.HasColumnType("uuid")
|
.HasColumnType("uuid")
|
||||||
.HasColumnName("id");
|
.HasColumnName("id");
|
||||||
|
|
||||||
b.Property<long>("AccountId")
|
b.Property<Guid>("AccountId")
|
||||||
.HasColumnType("bigint")
|
.HasColumnType("uuid")
|
||||||
.HasColumnName("account_id");
|
.HasColumnName("account_id");
|
||||||
|
|
||||||
b.Property<Guid>("ChallengeId")
|
b.Property<Guid>("ChallengeId")
|
||||||
@ -814,12 +809,12 @@ namespace DysonNetwork.Sphere.Migrations
|
|||||||
.HasColumnType("uuid")
|
.HasColumnType("uuid")
|
||||||
.HasColumnName("id");
|
.HasColumnName("id");
|
||||||
|
|
||||||
b.Property<long>("AccountId")
|
b.Property<Guid>("AccountId")
|
||||||
.HasColumnType("bigint")
|
.HasColumnType("uuid")
|
||||||
.HasColumnName("account_id");
|
.HasColumnName("account_id");
|
||||||
|
|
||||||
b.Property<long>("ChatRoomId")
|
b.Property<Guid>("ChatRoomId")
|
||||||
.HasColumnType("bigint")
|
.HasColumnType("uuid")
|
||||||
.HasColumnName("chat_room_id");
|
.HasColumnName("chat_room_id");
|
||||||
|
|
||||||
b.Property<Instant>("CreatedAt")
|
b.Property<Instant>("CreatedAt")
|
||||||
@ -869,13 +864,11 @@ namespace DysonNetwork.Sphere.Migrations
|
|||||||
|
|
||||||
modelBuilder.Entity("DysonNetwork.Sphere.Chat.ChatRoom", b =>
|
modelBuilder.Entity("DysonNetwork.Sphere.Chat.ChatRoom", b =>
|
||||||
{
|
{
|
||||||
b.Property<long>("Id")
|
b.Property<Guid>("Id")
|
||||||
.ValueGeneratedOnAdd()
|
.ValueGeneratedOnAdd()
|
||||||
.HasColumnType("bigint")
|
.HasColumnType("uuid")
|
||||||
.HasColumnName("id");
|
.HasColumnName("id");
|
||||||
|
|
||||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<long>("Id"));
|
|
||||||
|
|
||||||
b.Property<string>("BackgroundId")
|
b.Property<string>("BackgroundId")
|
||||||
.HasColumnType("character varying(128)")
|
.HasColumnType("character varying(128)")
|
||||||
.HasColumnName("background_id");
|
.HasColumnName("background_id");
|
||||||
@ -908,8 +901,8 @@ namespace DysonNetwork.Sphere.Migrations
|
|||||||
.HasColumnType("character varying(128)")
|
.HasColumnType("character varying(128)")
|
||||||
.HasColumnName("picture_id");
|
.HasColumnName("picture_id");
|
||||||
|
|
||||||
b.Property<long?>("RealmId")
|
b.Property<Guid?>("RealmId")
|
||||||
.HasColumnType("bigint")
|
.HasColumnType("uuid")
|
||||||
.HasColumnName("realm_id");
|
.HasColumnName("realm_id");
|
||||||
|
|
||||||
b.Property<int>("Type")
|
b.Property<int>("Type")
|
||||||
@ -942,8 +935,8 @@ namespace DysonNetwork.Sphere.Migrations
|
|||||||
.HasColumnType("uuid")
|
.HasColumnType("uuid")
|
||||||
.HasColumnName("id");
|
.HasColumnName("id");
|
||||||
|
|
||||||
b.Property<long>("ChatRoomId")
|
b.Property<Guid>("ChatRoomId")
|
||||||
.HasColumnType("bigint")
|
.HasColumnType("uuid")
|
||||||
.HasColumnName("chat_room_id");
|
.HasColumnName("chat_room_id");
|
||||||
|
|
||||||
b.Property<string>("Content")
|
b.Property<string>("Content")
|
||||||
@ -1119,8 +1112,8 @@ namespace DysonNetwork.Sphere.Migrations
|
|||||||
.HasColumnType("timestamp with time zone")
|
.HasColumnType("timestamp with time zone")
|
||||||
.HasColumnName("ended_at");
|
.HasColumnName("ended_at");
|
||||||
|
|
||||||
b.Property<long>("RoomId")
|
b.Property<Guid>("RoomId")
|
||||||
.HasColumnType("bigint")
|
.HasColumnType("uuid")
|
||||||
.HasColumnName("room_id");
|
.HasColumnName("room_id");
|
||||||
|
|
||||||
b.Property<Guid>("SenderId")
|
b.Property<Guid>("SenderId")
|
||||||
@ -1283,13 +1276,11 @@ namespace DysonNetwork.Sphere.Migrations
|
|||||||
|
|
||||||
modelBuilder.Entity("DysonNetwork.Sphere.Post.Post", b =>
|
modelBuilder.Entity("DysonNetwork.Sphere.Post.Post", b =>
|
||||||
{
|
{
|
||||||
b.Property<long>("Id")
|
b.Property<Guid>("Id")
|
||||||
.ValueGeneratedOnAdd()
|
.ValueGeneratedOnAdd()
|
||||||
.HasColumnType("bigint")
|
.HasColumnType("uuid")
|
||||||
.HasColumnName("id");
|
.HasColumnName("id");
|
||||||
|
|
||||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<long>("Id"));
|
|
||||||
|
|
||||||
b.Property<string>("Content")
|
b.Property<string>("Content")
|
||||||
.HasColumnType("text")
|
.HasColumnType("text")
|
||||||
.HasColumnName("content");
|
.HasColumnName("content");
|
||||||
@ -1315,8 +1306,8 @@ namespace DysonNetwork.Sphere.Migrations
|
|||||||
.HasColumnType("timestamp with time zone")
|
.HasColumnType("timestamp with time zone")
|
||||||
.HasColumnName("edited_at");
|
.HasColumnName("edited_at");
|
||||||
|
|
||||||
b.Property<long?>("ForwardedPostId")
|
b.Property<Guid?>("ForwardedPostId")
|
||||||
.HasColumnType("bigint")
|
.HasColumnType("uuid")
|
||||||
.HasColumnName("forwarded_post_id");
|
.HasColumnName("forwarded_post_id");
|
||||||
|
|
||||||
b.Property<string>("Language")
|
b.Property<string>("Language")
|
||||||
@ -1332,12 +1323,12 @@ namespace DysonNetwork.Sphere.Migrations
|
|||||||
.HasColumnType("timestamp with time zone")
|
.HasColumnType("timestamp with time zone")
|
||||||
.HasColumnName("published_at");
|
.HasColumnName("published_at");
|
||||||
|
|
||||||
b.Property<long>("PublisherId")
|
b.Property<Guid>("PublisherId")
|
||||||
.HasColumnType("bigint")
|
.HasColumnType("uuid")
|
||||||
.HasColumnName("publisher_id");
|
.HasColumnName("publisher_id");
|
||||||
|
|
||||||
b.Property<long?>("RepliedPostId")
|
b.Property<Guid?>("RepliedPostId")
|
||||||
.HasColumnType("bigint")
|
.HasColumnType("uuid")
|
||||||
.HasColumnName("replied_post_id");
|
.HasColumnName("replied_post_id");
|
||||||
|
|
||||||
b.Property<NpgsqlTsVector>("SearchVector")
|
b.Property<NpgsqlTsVector>("SearchVector")
|
||||||
@ -1348,8 +1339,8 @@ namespace DysonNetwork.Sphere.Migrations
|
|||||||
.HasAnnotation("Npgsql:TsVectorConfig", "simple")
|
.HasAnnotation("Npgsql:TsVectorConfig", "simple")
|
||||||
.HasAnnotation("Npgsql:TsVectorProperties", new[] { "Title", "Description", "Content" });
|
.HasAnnotation("Npgsql:TsVectorProperties", new[] { "Title", "Description", "Content" });
|
||||||
|
|
||||||
b.Property<long?>("ThreadedPostId")
|
b.Property<Guid?>("ThreadedPostId")
|
||||||
.HasColumnType("bigint")
|
.HasColumnType("uuid")
|
||||||
.HasColumnName("threaded_post_id");
|
.HasColumnName("threaded_post_id");
|
||||||
|
|
||||||
b.Property<string>("Title")
|
b.Property<string>("Title")
|
||||||
@ -1407,13 +1398,11 @@ namespace DysonNetwork.Sphere.Migrations
|
|||||||
|
|
||||||
modelBuilder.Entity("DysonNetwork.Sphere.Post.PostCategory", b =>
|
modelBuilder.Entity("DysonNetwork.Sphere.Post.PostCategory", b =>
|
||||||
{
|
{
|
||||||
b.Property<long>("Id")
|
b.Property<Guid>("Id")
|
||||||
.ValueGeneratedOnAdd()
|
.ValueGeneratedOnAdd()
|
||||||
.HasColumnType("bigint")
|
.HasColumnType("uuid")
|
||||||
.HasColumnName("id");
|
.HasColumnName("id");
|
||||||
|
|
||||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<long>("Id"));
|
|
||||||
|
|
||||||
b.Property<Instant>("CreatedAt")
|
b.Property<Instant>("CreatedAt")
|
||||||
.HasColumnType("timestamp with time zone")
|
.HasColumnType("timestamp with time zone")
|
||||||
.HasColumnName("created_at");
|
.HasColumnName("created_at");
|
||||||
@ -1445,13 +1434,11 @@ namespace DysonNetwork.Sphere.Migrations
|
|||||||
|
|
||||||
modelBuilder.Entity("DysonNetwork.Sphere.Post.PostCollection", b =>
|
modelBuilder.Entity("DysonNetwork.Sphere.Post.PostCollection", b =>
|
||||||
{
|
{
|
||||||
b.Property<long>("Id")
|
b.Property<Guid>("Id")
|
||||||
.ValueGeneratedOnAdd()
|
.ValueGeneratedOnAdd()
|
||||||
.HasColumnType("bigint")
|
.HasColumnType("uuid")
|
||||||
.HasColumnName("id");
|
.HasColumnName("id");
|
||||||
|
|
||||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<long>("Id"));
|
|
||||||
|
|
||||||
b.Property<Instant>("CreatedAt")
|
b.Property<Instant>("CreatedAt")
|
||||||
.HasColumnType("timestamp with time zone")
|
.HasColumnType("timestamp with time zone")
|
||||||
.HasColumnName("created_at");
|
.HasColumnName("created_at");
|
||||||
@ -1470,8 +1457,8 @@ namespace DysonNetwork.Sphere.Migrations
|
|||||||
.HasColumnType("character varying(256)")
|
.HasColumnType("character varying(256)")
|
||||||
.HasColumnName("name");
|
.HasColumnName("name");
|
||||||
|
|
||||||
b.Property<long>("PublisherId")
|
b.Property<Guid>("PublisherId")
|
||||||
.HasColumnType("bigint")
|
.HasColumnType("uuid")
|
||||||
.HasColumnName("publisher_id");
|
.HasColumnName("publisher_id");
|
||||||
|
|
||||||
b.Property<string>("Slug")
|
b.Property<string>("Slug")
|
||||||
@ -1495,15 +1482,13 @@ namespace DysonNetwork.Sphere.Migrations
|
|||||||
|
|
||||||
modelBuilder.Entity("DysonNetwork.Sphere.Post.PostReaction", b =>
|
modelBuilder.Entity("DysonNetwork.Sphere.Post.PostReaction", b =>
|
||||||
{
|
{
|
||||||
b.Property<long>("Id")
|
b.Property<Guid>("Id")
|
||||||
.ValueGeneratedOnAdd()
|
.ValueGeneratedOnAdd()
|
||||||
.HasColumnType("bigint")
|
.HasColumnType("uuid")
|
||||||
.HasColumnName("id");
|
.HasColumnName("id");
|
||||||
|
|
||||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<long>("Id"));
|
b.Property<Guid>("AccountId")
|
||||||
|
.HasColumnType("uuid")
|
||||||
b.Property<long>("AccountId")
|
|
||||||
.HasColumnType("bigint")
|
|
||||||
.HasColumnName("account_id");
|
.HasColumnName("account_id");
|
||||||
|
|
||||||
b.Property<int>("Attitude")
|
b.Property<int>("Attitude")
|
||||||
@ -1518,8 +1503,8 @@ namespace DysonNetwork.Sphere.Migrations
|
|||||||
.HasColumnType("timestamp with time zone")
|
.HasColumnType("timestamp with time zone")
|
||||||
.HasColumnName("deleted_at");
|
.HasColumnName("deleted_at");
|
||||||
|
|
||||||
b.Property<long>("PostId")
|
b.Property<Guid>("PostId")
|
||||||
.HasColumnType("bigint")
|
.HasColumnType("uuid")
|
||||||
.HasColumnName("post_id");
|
.HasColumnName("post_id");
|
||||||
|
|
||||||
b.Property<string>("Symbol")
|
b.Property<string>("Symbol")
|
||||||
@ -1546,13 +1531,11 @@ namespace DysonNetwork.Sphere.Migrations
|
|||||||
|
|
||||||
modelBuilder.Entity("DysonNetwork.Sphere.Post.PostTag", b =>
|
modelBuilder.Entity("DysonNetwork.Sphere.Post.PostTag", b =>
|
||||||
{
|
{
|
||||||
b.Property<long>("Id")
|
b.Property<Guid>("Id")
|
||||||
.ValueGeneratedOnAdd()
|
.ValueGeneratedOnAdd()
|
||||||
.HasColumnType("bigint")
|
.HasColumnType("uuid")
|
||||||
.HasColumnName("id");
|
.HasColumnName("id");
|
||||||
|
|
||||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<long>("Id"));
|
|
||||||
|
|
||||||
b.Property<Instant>("CreatedAt")
|
b.Property<Instant>("CreatedAt")
|
||||||
.HasColumnType("timestamp with time zone")
|
.HasColumnType("timestamp with time zone")
|
||||||
.HasColumnName("created_at");
|
.HasColumnName("created_at");
|
||||||
@ -1584,15 +1567,13 @@ namespace DysonNetwork.Sphere.Migrations
|
|||||||
|
|
||||||
modelBuilder.Entity("DysonNetwork.Sphere.Post.Publisher", b =>
|
modelBuilder.Entity("DysonNetwork.Sphere.Post.Publisher", b =>
|
||||||
{
|
{
|
||||||
b.Property<long>("Id")
|
b.Property<Guid>("Id")
|
||||||
.ValueGeneratedOnAdd()
|
.ValueGeneratedOnAdd()
|
||||||
.HasColumnType("bigint")
|
.HasColumnType("uuid")
|
||||||
.HasColumnName("id");
|
.HasColumnName("id");
|
||||||
|
|
||||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<long>("Id"));
|
b.Property<Guid?>("AccountId")
|
||||||
|
.HasColumnType("uuid")
|
||||||
b.Property<long?>("AccountId")
|
|
||||||
.HasColumnType("bigint")
|
|
||||||
.HasColumnName("account_id");
|
.HasColumnName("account_id");
|
||||||
|
|
||||||
b.Property<string>("BackgroundId")
|
b.Property<string>("BackgroundId")
|
||||||
@ -1632,8 +1613,8 @@ namespace DysonNetwork.Sphere.Migrations
|
|||||||
.HasColumnType("integer")
|
.HasColumnType("integer")
|
||||||
.HasColumnName("publisher_type");
|
.HasColumnName("publisher_type");
|
||||||
|
|
||||||
b.Property<long?>("RealmId")
|
b.Property<Guid?>("RealmId")
|
||||||
.HasColumnType("bigint")
|
.HasColumnType("uuid")
|
||||||
.HasColumnName("realm_id");
|
.HasColumnName("realm_id");
|
||||||
|
|
||||||
b.Property<Instant>("UpdatedAt")
|
b.Property<Instant>("UpdatedAt")
|
||||||
@ -1664,12 +1645,12 @@ namespace DysonNetwork.Sphere.Migrations
|
|||||||
|
|
||||||
modelBuilder.Entity("DysonNetwork.Sphere.Post.PublisherMember", b =>
|
modelBuilder.Entity("DysonNetwork.Sphere.Post.PublisherMember", b =>
|
||||||
{
|
{
|
||||||
b.Property<long>("PublisherId")
|
b.Property<Guid>("PublisherId")
|
||||||
.HasColumnType("bigint")
|
.HasColumnType("uuid")
|
||||||
.HasColumnName("publisher_id");
|
.HasColumnName("publisher_id");
|
||||||
|
|
||||||
b.Property<long>("AccountId")
|
b.Property<Guid>("AccountId")
|
||||||
.HasColumnType("bigint")
|
.HasColumnType("uuid")
|
||||||
.HasColumnName("account_id");
|
.HasColumnName("account_id");
|
||||||
|
|
||||||
b.Property<Instant>("CreatedAt")
|
b.Property<Instant>("CreatedAt")
|
||||||
@ -1708,8 +1689,8 @@ namespace DysonNetwork.Sphere.Migrations
|
|||||||
.HasColumnType("uuid")
|
.HasColumnType("uuid")
|
||||||
.HasColumnName("id");
|
.HasColumnName("id");
|
||||||
|
|
||||||
b.Property<long>("AccountId")
|
b.Property<Guid>("AccountId")
|
||||||
.HasColumnType("bigint")
|
.HasColumnType("uuid")
|
||||||
.HasColumnName("account_id");
|
.HasColumnName("account_id");
|
||||||
|
|
||||||
b.Property<Instant>("CreatedAt")
|
b.Property<Instant>("CreatedAt")
|
||||||
@ -1720,8 +1701,8 @@ namespace DysonNetwork.Sphere.Migrations
|
|||||||
.HasColumnType("timestamp with time zone")
|
.HasColumnType("timestamp with time zone")
|
||||||
.HasColumnName("deleted_at");
|
.HasColumnName("deleted_at");
|
||||||
|
|
||||||
b.Property<long>("PublisherId")
|
b.Property<Guid>("PublisherId")
|
||||||
.HasColumnType("bigint")
|
.HasColumnType("uuid")
|
||||||
.HasColumnName("publisher_id");
|
.HasColumnName("publisher_id");
|
||||||
|
|
||||||
b.Property<int>("Status")
|
b.Property<int>("Status")
|
||||||
@ -1750,15 +1731,13 @@ namespace DysonNetwork.Sphere.Migrations
|
|||||||
|
|
||||||
modelBuilder.Entity("DysonNetwork.Sphere.Realm.Realm", b =>
|
modelBuilder.Entity("DysonNetwork.Sphere.Realm.Realm", b =>
|
||||||
{
|
{
|
||||||
b.Property<long>("Id")
|
b.Property<Guid>("Id")
|
||||||
.ValueGeneratedOnAdd()
|
.ValueGeneratedOnAdd()
|
||||||
.HasColumnType("bigint")
|
.HasColumnType("uuid")
|
||||||
.HasColumnName("id");
|
.HasColumnName("id");
|
||||||
|
|
||||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<long>("Id"));
|
b.Property<Guid>("AccountId")
|
||||||
|
.HasColumnType("uuid")
|
||||||
b.Property<long>("AccountId")
|
|
||||||
.HasColumnType("bigint")
|
|
||||||
.HasColumnName("account_id");
|
.HasColumnName("account_id");
|
||||||
|
|
||||||
b.Property<string>("BackgroundId")
|
b.Property<string>("BackgroundId")
|
||||||
@ -1837,12 +1816,12 @@ namespace DysonNetwork.Sphere.Migrations
|
|||||||
|
|
||||||
modelBuilder.Entity("DysonNetwork.Sphere.Realm.RealmMember", b =>
|
modelBuilder.Entity("DysonNetwork.Sphere.Realm.RealmMember", b =>
|
||||||
{
|
{
|
||||||
b.Property<long>("RealmId")
|
b.Property<Guid>("RealmId")
|
||||||
.HasColumnType("bigint")
|
.HasColumnType("uuid")
|
||||||
.HasColumnName("realm_id");
|
.HasColumnName("realm_id");
|
||||||
|
|
||||||
b.Property<long>("AccountId")
|
b.Property<Guid>("AccountId")
|
||||||
.HasColumnType("bigint")
|
.HasColumnType("uuid")
|
||||||
.HasColumnName("account_id");
|
.HasColumnName("account_id");
|
||||||
|
|
||||||
b.Property<Instant>("CreatedAt")
|
b.Property<Instant>("CreatedAt")
|
||||||
@ -1953,8 +1932,8 @@ namespace DysonNetwork.Sphere.Migrations
|
|||||||
.HasColumnType("character varying(128)")
|
.HasColumnType("character varying(128)")
|
||||||
.HasColumnName("prefix");
|
.HasColumnName("prefix");
|
||||||
|
|
||||||
b.Property<long>("PublisherId")
|
b.Property<Guid>("PublisherId")
|
||||||
.HasColumnType("bigint")
|
.HasColumnType("uuid")
|
||||||
.HasColumnName("publisher_id");
|
.HasColumnName("publisher_id");
|
||||||
|
|
||||||
b.Property<Instant>("UpdatedAt")
|
b.Property<Instant>("UpdatedAt")
|
||||||
@ -1977,8 +1956,8 @@ namespace DysonNetwork.Sphere.Migrations
|
|||||||
.HasColumnType("character varying(128)")
|
.HasColumnType("character varying(128)")
|
||||||
.HasColumnName("id");
|
.HasColumnName("id");
|
||||||
|
|
||||||
b.Property<long>("AccountId")
|
b.Property<Guid>("AccountId")
|
||||||
.HasColumnType("bigint")
|
.HasColumnType("uuid")
|
||||||
.HasColumnName("account_id");
|
.HasColumnName("account_id");
|
||||||
|
|
||||||
b.Property<Instant>("CreatedAt")
|
b.Property<Instant>("CreatedAt")
|
||||||
@ -2026,8 +2005,8 @@ namespace DysonNetwork.Sphere.Migrations
|
|||||||
.HasColumnType("character varying(1024)")
|
.HasColumnType("character varying(1024)")
|
||||||
.HasColumnName("name");
|
.HasColumnName("name");
|
||||||
|
|
||||||
b.Property<long?>("PostId")
|
b.Property<Guid?>("PostId")
|
||||||
.HasColumnType("bigint")
|
.HasColumnType("uuid")
|
||||||
.HasColumnName("post_id");
|
.HasColumnName("post_id");
|
||||||
|
|
||||||
b.Property<long>("Size")
|
b.Property<long>("Size")
|
||||||
@ -2072,12 +2051,12 @@ namespace DysonNetwork.Sphere.Migrations
|
|||||||
|
|
||||||
modelBuilder.Entity("PostPostCategory", b =>
|
modelBuilder.Entity("PostPostCategory", b =>
|
||||||
{
|
{
|
||||||
b.Property<long>("CategoriesId")
|
b.Property<Guid>("CategoriesId")
|
||||||
.HasColumnType("bigint")
|
.HasColumnType("uuid")
|
||||||
.HasColumnName("categories_id");
|
.HasColumnName("categories_id");
|
||||||
|
|
||||||
b.Property<long>("PostsId")
|
b.Property<Guid>("PostsId")
|
||||||
.HasColumnType("bigint")
|
.HasColumnType("uuid")
|
||||||
.HasColumnName("posts_id");
|
.HasColumnName("posts_id");
|
||||||
|
|
||||||
b.HasKey("CategoriesId", "PostsId")
|
b.HasKey("CategoriesId", "PostsId")
|
||||||
@ -2091,12 +2070,12 @@ namespace DysonNetwork.Sphere.Migrations
|
|||||||
|
|
||||||
modelBuilder.Entity("PostPostCollection", b =>
|
modelBuilder.Entity("PostPostCollection", b =>
|
||||||
{
|
{
|
||||||
b.Property<long>("CollectionsId")
|
b.Property<Guid>("CollectionsId")
|
||||||
.HasColumnType("bigint")
|
.HasColumnType("uuid")
|
||||||
.HasColumnName("collections_id");
|
.HasColumnName("collections_id");
|
||||||
|
|
||||||
b.Property<long>("PostsId")
|
b.Property<Guid>("PostsId")
|
||||||
.HasColumnType("bigint")
|
.HasColumnType("uuid")
|
||||||
.HasColumnName("posts_id");
|
.HasColumnName("posts_id");
|
||||||
|
|
||||||
b.HasKey("CollectionsId", "PostsId")
|
b.HasKey("CollectionsId", "PostsId")
|
||||||
@ -2110,12 +2089,12 @@ namespace DysonNetwork.Sphere.Migrations
|
|||||||
|
|
||||||
modelBuilder.Entity("PostPostTag", b =>
|
modelBuilder.Entity("PostPostTag", b =>
|
||||||
{
|
{
|
||||||
b.Property<long>("PostsId")
|
b.Property<Guid>("PostsId")
|
||||||
.HasColumnType("bigint")
|
.HasColumnType("uuid")
|
||||||
.HasColumnName("posts_id");
|
.HasColumnName("posts_id");
|
||||||
|
|
||||||
b.Property<long>("TagsId")
|
b.Property<Guid>("TagsId")
|
||||||
.HasColumnType("bigint")
|
.HasColumnType("uuid")
|
||||||
.HasColumnName("tags_id");
|
.HasColumnName("tags_id");
|
||||||
|
|
||||||
b.HasKey("PostsId", "TagsId")
|
b.HasKey("PostsId", "TagsId")
|
||||||
|
@ -25,7 +25,7 @@ public enum PostVisibility
|
|||||||
|
|
||||||
public class Post : ModelBase
|
public class Post : ModelBase
|
||||||
{
|
{
|
||||||
public long Id { get; set; }
|
public Guid Id { get; set; }
|
||||||
[MaxLength(1024)] public string? Title { get; set; }
|
[MaxLength(1024)] public string? Title { get; set; }
|
||||||
[MaxLength(4096)] public string? Description { get; set; }
|
[MaxLength(4096)] public string? Description { get; set; }
|
||||||
[MaxLength(128)] public string? Language { get; set; }
|
[MaxLength(128)] public string? Language { get; set; }
|
||||||
@ -45,11 +45,11 @@ public class Post : ModelBase
|
|||||||
public int Downvotes { get; set; }
|
public int Downvotes { get; set; }
|
||||||
[NotMapped] public Dictionary<string, int> ReactionsCount { get; set; } = new();
|
[NotMapped] public Dictionary<string, int> ReactionsCount { get; set; } = new();
|
||||||
|
|
||||||
public long? ThreadedPostId { get; set; }
|
public Guid? ThreadedPostId { get; set; }
|
||||||
public Post? ThreadedPost { get; set; }
|
public Post? ThreadedPost { get; set; }
|
||||||
public long? RepliedPostId { get; set; }
|
public Guid? RepliedPostId { get; set; }
|
||||||
public Post? RepliedPost { get; set; }
|
public Post? RepliedPost { get; set; }
|
||||||
public long? ForwardedPostId { get; set; }
|
public Guid? ForwardedPostId { get; set; }
|
||||||
public Post? ForwardedPost { get; set; }
|
public Post? ForwardedPost { get; set; }
|
||||||
public ICollection<CloudFile> Attachments { get; set; } = new List<CloudFile>();
|
public ICollection<CloudFile> Attachments { get; set; } = new List<CloudFile>();
|
||||||
|
|
||||||
@ -67,7 +67,7 @@ public class Post : ModelBase
|
|||||||
|
|
||||||
public class PostTag : ModelBase
|
public class PostTag : ModelBase
|
||||||
{
|
{
|
||||||
public long Id { get; set; }
|
public Guid Id { get; set; }
|
||||||
[MaxLength(128)] public string Slug { get; set; } = null!;
|
[MaxLength(128)] public string Slug { get; set; } = null!;
|
||||||
[MaxLength(256)] public string? Name { get; set; }
|
[MaxLength(256)] public string? Name { get; set; }
|
||||||
public ICollection<Post> Posts { get; set; } = new List<Post>();
|
public ICollection<Post> Posts { get; set; } = new List<Post>();
|
||||||
@ -75,7 +75,7 @@ public class PostTag : ModelBase
|
|||||||
|
|
||||||
public class PostCategory : ModelBase
|
public class PostCategory : ModelBase
|
||||||
{
|
{
|
||||||
public long Id { get; set; }
|
public Guid Id { get; set; }
|
||||||
[MaxLength(128)] public string Slug { get; set; } = null!;
|
[MaxLength(128)] public string Slug { get; set; } = null!;
|
||||||
[MaxLength(256)] public string? Name { get; set; }
|
[MaxLength(256)] public string? Name { get; set; }
|
||||||
public ICollection<Post> Posts { get; set; } = new List<Post>();
|
public ICollection<Post> Posts { get; set; } = new List<Post>();
|
||||||
@ -83,7 +83,7 @@ public class PostCategory : ModelBase
|
|||||||
|
|
||||||
public class PostCollection : ModelBase
|
public class PostCollection : ModelBase
|
||||||
{
|
{
|
||||||
public long Id { get; set; }
|
public Guid Id { get; set; }
|
||||||
[MaxLength(128)] public string Slug { get; set; } = null!;
|
[MaxLength(128)] public string Slug { get; set; } = null!;
|
||||||
[MaxLength(256)] public string? Name { get; set; }
|
[MaxLength(256)] public string? Name { get; set; }
|
||||||
[MaxLength(4096)] public string? Description { get; set; }
|
[MaxLength(4096)] public string? Description { get; set; }
|
||||||
@ -102,12 +102,12 @@ public enum PostReactionAttitude
|
|||||||
|
|
||||||
public class PostReaction : ModelBase
|
public class PostReaction : ModelBase
|
||||||
{
|
{
|
||||||
public long Id { get; set; }
|
public Guid Id { get; set; }
|
||||||
[MaxLength(256)] public string Symbol { get; set; } = null!;
|
[MaxLength(256)] public string Symbol { get; set; } = null!;
|
||||||
public PostReactionAttitude Attitude { get; set; }
|
public PostReactionAttitude Attitude { get; set; }
|
||||||
|
|
||||||
public long PostId { get; set; }
|
public Guid PostId { get; set; }
|
||||||
[JsonIgnore] public Post Post { get; set; } = null!;
|
[JsonIgnore] public Post Post { get; set; } = null!;
|
||||||
public long AccountId { get; set; }
|
public Guid AccountId { get; set; }
|
||||||
public Account.Account Account { get; set; } = null!;
|
public Account.Account Account { get; set; } = null!;
|
||||||
}
|
}
|
@ -58,8 +58,8 @@ public class PostController(AppDatabase db, PostService ps, RelationshipService
|
|||||||
return Ok(posts);
|
return Ok(posts);
|
||||||
}
|
}
|
||||||
|
|
||||||
[HttpGet("{id:long}")]
|
[HttpGet("{id:guid}")]
|
||||||
public async Task<ActionResult<Post>> GetPost(long id)
|
public async Task<ActionResult<Post>> GetPost(Guid id)
|
||||||
{
|
{
|
||||||
HttpContext.Items.TryGetValue("CurrentUser", out var currentUserValue);
|
HttpContext.Items.TryGetValue("CurrentUser", out var currentUserValue);
|
||||||
var currentUser = currentUserValue as Account.Account;
|
var currentUser = currentUserValue as Account.Account;
|
||||||
@ -83,8 +83,8 @@ public class PostController(AppDatabase db, PostService ps, RelationshipService
|
|||||||
return Ok(post);
|
return Ok(post);
|
||||||
}
|
}
|
||||||
|
|
||||||
[HttpGet("{id:long}/replies")]
|
[HttpGet("{id:guid}/replies")]
|
||||||
public async Task<ActionResult<List<Post>>> ListReplies(long id, [FromQuery] int offset = 0,
|
public async Task<ActionResult<List<Post>>> ListReplies(Guid id, [FromQuery] int offset = 0,
|
||||||
[FromQuery] int take = 20)
|
[FromQuery] int take = 20)
|
||||||
{
|
{
|
||||||
HttpContext.Items.TryGetValue("CurrentUser", out var currentUserValue);
|
HttpContext.Items.TryGetValue("CurrentUser", out var currentUserValue);
|
||||||
@ -137,8 +137,8 @@ public class PostController(AppDatabase db, PostService ps, RelationshipService
|
|||||||
[MaxLength(32)] public List<string>? Attachments { get; set; }
|
[MaxLength(32)] public List<string>? Attachments { get; set; }
|
||||||
public Dictionary<string, object>? Meta { get; set; }
|
public Dictionary<string, object>? Meta { get; set; }
|
||||||
public Instant? PublishedAt { get; set; }
|
public Instant? PublishedAt { get; set; }
|
||||||
public long? RepliedPostId { get; set; }
|
public Guid? RepliedPostId { get; set; }
|
||||||
public long? ForwardedPostId { get; set; }
|
public Guid? ForwardedPostId { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
[HttpPost]
|
[HttpPost]
|
||||||
@ -230,10 +230,10 @@ public class PostController(AppDatabase db, PostService ps, RelationshipService
|
|||||||
public PostReactionAttitude Attitude { get; set; }
|
public PostReactionAttitude Attitude { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
[HttpPost("{id:long}/reactions")]
|
[HttpPost("{id:guid}/reactions")]
|
||||||
[Authorize]
|
[Authorize]
|
||||||
[RequiredPermission("global", "posts.react")]
|
[RequiredPermission("global", "posts.react")]
|
||||||
public async Task<ActionResult<PostReaction>> ReactPost(long id, [FromBody] PostReactionRequest request)
|
public async Task<ActionResult<PostReaction>> ReactPost(Guid id, [FromBody] PostReactionRequest request)
|
||||||
{
|
{
|
||||||
HttpContext.Items.TryGetValue("CurrentUser", out var currentUserValue);
|
HttpContext.Items.TryGetValue("CurrentUser", out var currentUserValue);
|
||||||
if (currentUserValue is not Account.Account currentUser) return Unauthorized();
|
if (currentUserValue is not Account.Account currentUser) return Unauthorized();
|
||||||
@ -265,8 +265,8 @@ public class PostController(AppDatabase db, PostService ps, RelationshipService
|
|||||||
return Ok(reaction);
|
return Ok(reaction);
|
||||||
}
|
}
|
||||||
|
|
||||||
[HttpPatch("{id:long}")]
|
[HttpPatch("{id:guid}")]
|
||||||
public async Task<ActionResult<Post>> UpdatePost(long id, [FromBody] PostRequest request)
|
public async Task<ActionResult<Post>> UpdatePost(Guid id, [FromBody] PostRequest request)
|
||||||
{
|
{
|
||||||
if (HttpContext.Items["CurrentUser"] is not Account.Account currentUser) return Unauthorized();
|
if (HttpContext.Items["CurrentUser"] is not Account.Account currentUser) return Unauthorized();
|
||||||
|
|
||||||
@ -312,8 +312,8 @@ public class PostController(AppDatabase db, PostService ps, RelationshipService
|
|||||||
return Ok(post);
|
return Ok(post);
|
||||||
}
|
}
|
||||||
|
|
||||||
[HttpDelete("{id:long}")]
|
[HttpDelete("{id:guid}")]
|
||||||
public async Task<ActionResult<Post>> DeletePost(long id)
|
public async Task<ActionResult<Post>> DeletePost(Guid id)
|
||||||
{
|
{
|
||||||
if (HttpContext.Items["CurrentUser"] is not Account.Account currentUser) return Unauthorized();
|
if (HttpContext.Items["CurrentUser"] is not Account.Account currentUser) return Unauthorized();
|
||||||
|
|
||||||
|
@ -215,7 +215,7 @@ public class PostService(AppDatabase db, FileService fs, ActivityService act)
|
|||||||
return isRemoving;
|
return isRemoving;
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task<Dictionary<string, int>> GetPostReactionMap(long postId)
|
public async Task<Dictionary<string, int>> GetPostReactionMap(Guid postId)
|
||||||
{
|
{
|
||||||
return await db.Set<PostReaction>()
|
return await db.Set<PostReaction>()
|
||||||
.Where(r => r.PostId == postId)
|
.Where(r => r.PostId == postId)
|
||||||
@ -226,7 +226,7 @@ public class PostService(AppDatabase db, FileService fs, ActivityService act)
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task<Dictionary<long, Dictionary<string, int>>> GetPostReactionMapBatch(List<long> postIds)
|
public async Task<Dictionary<Guid, Dictionary<string, int>>> GetPostReactionMapBatch(List<Guid> postIds)
|
||||||
{
|
{
|
||||||
return await db.Set<PostReaction>()
|
return await db.Set<PostReaction>()
|
||||||
.Where(r => postIds.Contains(r.PostId))
|
.Where(r => postIds.Contains(r.PostId))
|
||||||
@ -245,7 +245,7 @@ public class PostService(AppDatabase db, FileService fs, ActivityService act)
|
|||||||
public static class PostQueryExtensions
|
public static class PostQueryExtensions
|
||||||
{
|
{
|
||||||
public static IQueryable<Post> FilterWithVisibility(this IQueryable<Post> source, Account.Account? currentUser,
|
public static IQueryable<Post> FilterWithVisibility(this IQueryable<Post> source, Account.Account? currentUser,
|
||||||
List<long> userFriends, bool isListing = false)
|
List<Guid> userFriends, bool isListing = false)
|
||||||
{
|
{
|
||||||
var now = Instant.FromDateTimeUtc(DateTime.UtcNow);
|
var now = Instant.FromDateTimeUtc(DateTime.UtcNow);
|
||||||
|
|
||||||
|
@ -16,7 +16,7 @@ public enum PublisherType
|
|||||||
[Index(nameof(Name), IsUnique = true)]
|
[Index(nameof(Name), IsUnique = true)]
|
||||||
public class Publisher : ModelBase
|
public class Publisher : ModelBase
|
||||||
{
|
{
|
||||||
public long Id { get; set; }
|
public Guid Id { get; set; }
|
||||||
public PublisherType PublisherType { get; set; }
|
public PublisherType PublisherType { get; set; }
|
||||||
[MaxLength(256)] public string Name { get; set; } = string.Empty;
|
[MaxLength(256)] public string Name { get; set; } = string.Empty;
|
||||||
[MaxLength(256)] public string Nick { get; set; } = string.Empty;
|
[MaxLength(256)] public string Nick { get; set; } = string.Empty;
|
||||||
@ -34,9 +34,9 @@ public class Publisher : ModelBase
|
|||||||
[JsonIgnore]
|
[JsonIgnore]
|
||||||
public ICollection<PublisherSubscription> Subscriptions { get; set; } = new List<PublisherSubscription>();
|
public ICollection<PublisherSubscription> Subscriptions { get; set; } = new List<PublisherSubscription>();
|
||||||
|
|
||||||
public long? AccountId { get; set; }
|
public Guid? AccountId { get; set; }
|
||||||
[JsonIgnore] public Account.Account? Account { get; set; }
|
[JsonIgnore] public Account.Account? Account { get; set; }
|
||||||
public long? RealmId { get; set; }
|
public Guid? RealmId { get; set; }
|
||||||
[JsonIgnore] public Realm.Realm? Realm { get; set; }
|
[JsonIgnore] public Realm.Realm? Realm { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -50,9 +50,9 @@ public enum PublisherMemberRole
|
|||||||
|
|
||||||
public class PublisherMember : ModelBase
|
public class PublisherMember : ModelBase
|
||||||
{
|
{
|
||||||
public long PublisherId { get; set; }
|
public Guid PublisherId { get; set; }
|
||||||
[JsonIgnore] public Publisher Publisher { get; set; } = null!;
|
[JsonIgnore] public Publisher Publisher { get; set; } = null!;
|
||||||
public long AccountId { get; set; }
|
public Guid AccountId { get; set; }
|
||||||
[JsonIgnore] public Account.Account Account { get; set; } = null!;
|
[JsonIgnore] public Account.Account Account { get; set; } = null!;
|
||||||
|
|
||||||
public PublisherMemberRole Role { get; set; } = PublisherMemberRole.Viewer;
|
public PublisherMemberRole Role { get; set; } = PublisherMemberRole.Viewer;
|
||||||
@ -70,9 +70,9 @@ public class PublisherSubscription : ModelBase
|
|||||||
{
|
{
|
||||||
public Guid Id { get; set; }
|
public Guid Id { get; set; }
|
||||||
|
|
||||||
public long PublisherId { get; set; }
|
public Guid PublisherId { get; set; }
|
||||||
[JsonIgnore] public Publisher Publisher { get; set; } = null!;
|
[JsonIgnore] public Publisher Publisher { get; set; } = null!;
|
||||||
public long AccountId { get; set; }
|
public Guid AccountId { get; set; }
|
||||||
[JsonIgnore] public Account.Account Account { get; set; } = null!;
|
[JsonIgnore] public Account.Account Account { get; set; } = null!;
|
||||||
|
|
||||||
public SubscriptionStatus Status { get; set; } = SubscriptionStatus.Active;
|
public SubscriptionStatus Status { get; set; } = SubscriptionStatus.Active;
|
||||||
|
@ -16,7 +16,7 @@ public class PublisherSubscriptionController(
|
|||||||
public class SubscriptionStatusResponse
|
public class SubscriptionStatusResponse
|
||||||
{
|
{
|
||||||
public bool IsSubscribed { get; set; }
|
public bool IsSubscribed { get; set; }
|
||||||
public long PublisherId { get; set; }
|
public Guid PublisherId { get; set; }
|
||||||
public string PublisherName { get; set; } = string.Empty;
|
public string PublisherName { get; set; } = string.Empty;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -12,7 +12,7 @@ public class PublisherSubscriptionService(AppDatabase db, NotificationService nt
|
|||||||
/// <param name="accountId">The account ID</param>
|
/// <param name="accountId">The account ID</param>
|
||||||
/// <param name="publisherId">The publisher ID</param>
|
/// <param name="publisherId">The publisher ID</param>
|
||||||
/// <returns>True if a subscription exists, false otherwise</returns>
|
/// <returns>True if a subscription exists, false otherwise</returns>
|
||||||
public async Task<bool> SubscriptionExistsAsync(long accountId, long publisherId)
|
public async Task<bool> SubscriptionExistsAsync(Guid accountId, Guid publisherId)
|
||||||
{
|
{
|
||||||
return await db.PublisherSubscriptions
|
return await db.PublisherSubscriptions
|
||||||
.AnyAsync(ps => ps.AccountId == accountId &&
|
.AnyAsync(ps => ps.AccountId == accountId &&
|
||||||
@ -26,7 +26,7 @@ public class PublisherSubscriptionService(AppDatabase db, NotificationService nt
|
|||||||
/// <param name="accountId">The account ID</param>
|
/// <param name="accountId">The account ID</param>
|
||||||
/// <param name="publisherId">The publisher ID</param>
|
/// <param name="publisherId">The publisher ID</param>
|
||||||
/// <returns>The subscription or null if not found</returns>
|
/// <returns>The subscription or null if not found</returns>
|
||||||
public async Task<PublisherSubscription?> GetSubscriptionAsync(long accountId, long publisherId)
|
public async Task<PublisherSubscription?> GetSubscriptionAsync(Guid accountId, Guid publisherId)
|
||||||
{
|
{
|
||||||
return await db.PublisherSubscriptions
|
return await db.PublisherSubscriptions
|
||||||
.Include(ps => ps.Publisher)
|
.Include(ps => ps.Publisher)
|
||||||
@ -95,7 +95,7 @@ public class PublisherSubscriptionService(AppDatabase db, NotificationService nt
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="accountId">The account ID</param>
|
/// <param name="accountId">The account ID</param>
|
||||||
/// <returns>A list of active subscriptions</returns>
|
/// <returns>A list of active subscriptions</returns>
|
||||||
public async Task<List<PublisherSubscription>> GetAccountSubscriptionsAsync(long accountId)
|
public async Task<List<PublisherSubscription>> GetAccountSubscriptionsAsync(Guid accountId)
|
||||||
{
|
{
|
||||||
return await db.PublisherSubscriptions
|
return await db.PublisherSubscriptions
|
||||||
.Include(ps => ps.Publisher)
|
.Include(ps => ps.Publisher)
|
||||||
@ -108,7 +108,7 @@ public class PublisherSubscriptionService(AppDatabase db, NotificationService nt
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="publisherId">The publisher ID</param>
|
/// <param name="publisherId">The publisher ID</param>
|
||||||
/// <returns>A list of active subscriptions</returns>
|
/// <returns>A list of active subscriptions</returns>
|
||||||
public async Task<List<PublisherSubscription>> GetPublisherSubscribersAsync(long publisherId)
|
public async Task<List<PublisherSubscription>> GetPublisherSubscribersAsync(Guid publisherId)
|
||||||
{
|
{
|
||||||
return await db.PublisherSubscriptions
|
return await db.PublisherSubscriptions
|
||||||
.Include(ps => ps.Account)
|
.Include(ps => ps.Account)
|
||||||
@ -124,8 +124,8 @@ public class PublisherSubscriptionService(AppDatabase db, NotificationService nt
|
|||||||
/// <param name="tier">Optional subscription tier</param>
|
/// <param name="tier">Optional subscription tier</param>
|
||||||
/// <returns>The created subscription</returns>
|
/// <returns>The created subscription</returns>
|
||||||
public async Task<PublisherSubscription> CreateSubscriptionAsync(
|
public async Task<PublisherSubscription> CreateSubscriptionAsync(
|
||||||
long accountId,
|
Guid accountId,
|
||||||
long publisherId,
|
Guid publisherId,
|
||||||
int tier = 0
|
int tier = 0
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
@ -166,7 +166,7 @@ public class PublisherSubscriptionService(AppDatabase db, NotificationService nt
|
|||||||
/// <param name="accountId">The account ID</param>
|
/// <param name="accountId">The account ID</param>
|
||||||
/// <param name="publisherId">The publisher ID</param>
|
/// <param name="publisherId">The publisher ID</param>
|
||||||
/// <returns>True if the subscription was cancelled, false if it wasn't found</returns>
|
/// <returns>True if the subscription was cancelled, false if it wasn't found</returns>
|
||||||
public async Task<bool> CancelSubscriptionAsync(long accountId, long publisherId)
|
public async Task<bool> CancelSubscriptionAsync(Guid accountId, Guid publisherId)
|
||||||
{
|
{
|
||||||
var subscription = await GetSubscriptionAsync(accountId, publisherId);
|
var subscription = await GetSubscriptionAsync(accountId, publisherId);
|
||||||
if (subscription is not { Status: SubscriptionStatus.Active })
|
if (subscription is not { Status: SubscriptionStatus.Active })
|
||||||
|
@ -10,7 +10,7 @@ namespace DysonNetwork.Sphere.Realm;
|
|||||||
[Index(nameof(Slug), IsUnique = true)]
|
[Index(nameof(Slug), IsUnique = true)]
|
||||||
public class Realm : ModelBase
|
public class Realm : ModelBase
|
||||||
{
|
{
|
||||||
public long Id { get; set; }
|
public Guid Id { get; set; }
|
||||||
[MaxLength(1024)] public string Slug { get; set; } = string.Empty;
|
[MaxLength(1024)] public string Slug { get; set; } = string.Empty;
|
||||||
[MaxLength(1024)] public string Name { get; set; } = string.Empty;
|
[MaxLength(1024)] public string Name { get; set; } = string.Empty;
|
||||||
[MaxLength(4096)] public string Description { get; set; } = string.Empty;
|
[MaxLength(4096)] public string Description { get; set; } = string.Empty;
|
||||||
@ -27,7 +27,7 @@ public class Realm : ModelBase
|
|||||||
[JsonIgnore] public ICollection<RealmMember> Members { get; set; } = new List<RealmMember>();
|
[JsonIgnore] public ICollection<RealmMember> Members { get; set; } = new List<RealmMember>();
|
||||||
[JsonIgnore] public ICollection<ChatRoom> ChatRooms { get; set; } = new List<ChatRoom>();
|
[JsonIgnore] public ICollection<ChatRoom> ChatRooms { get; set; } = new List<ChatRoom>();
|
||||||
|
|
||||||
public long AccountId { get; set; }
|
public Guid AccountId { get; set; }
|
||||||
[JsonIgnore] public Account.Account Account { get; set; } = null!;
|
[JsonIgnore] public Account.Account Account { get; set; } = null!;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -40,9 +40,9 @@ public enum RealmMemberRole
|
|||||||
|
|
||||||
public class RealmMember : ModelBase
|
public class RealmMember : ModelBase
|
||||||
{
|
{
|
||||||
public long RealmId { get; set; }
|
public Guid RealmId { get; set; }
|
||||||
public Realm Realm { get; set; } = null!;
|
public Realm Realm { get; set; } = null!;
|
||||||
public long AccountId { get; set; }
|
public Guid AccountId { get; set; }
|
||||||
public Account.Account Account { get; set; } = null!;
|
public Account.Account Account { get; set; } = null!;
|
||||||
|
|
||||||
public RealmMemberRole Role { get; set; } = RealmMemberRole.Normal;
|
public RealmMemberRole Role { get; set; } = RealmMemberRole.Normal;
|
||||||
|
@ -58,7 +58,7 @@ public class RealmController(AppDatabase db, RealmService rs, FileService fs) :
|
|||||||
|
|
||||||
public class RealmMemberRequest
|
public class RealmMemberRequest
|
||||||
{
|
{
|
||||||
[Required] public long RelatedUserId { get; set; }
|
[Required] public Guid RelatedUserId { get; set; }
|
||||||
[Required] public RealmMemberRole Role { get; set; }
|
[Required] public RealmMemberRole Role { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -22,7 +22,7 @@ public class StickerPack : ModelBase
|
|||||||
[MaxLength(4096)] public string Description { get; set; } = string.Empty;
|
[MaxLength(4096)] public string Description { get; set; } = string.Empty;
|
||||||
[MaxLength(128)] public string Prefix { get; set; } = null!;
|
[MaxLength(128)] public string Prefix { get; set; } = null!;
|
||||||
|
|
||||||
public long PublisherId { get; set; }
|
public Guid PublisherId { get; set; }
|
||||||
public Post.Publisher Publisher { get; set; } = null!;
|
public Post.Publisher Publisher { get; set; } = null!;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -41,7 +41,7 @@ public class CloudFile : ModelBase
|
|||||||
public int UsedCount { get; set; } = 0;
|
public int UsedCount { get; set; } = 0;
|
||||||
|
|
||||||
[JsonIgnore] public Account.Account Account { get; set; } = null!;
|
[JsonIgnore] public Account.Account Account { get; set; } = null!;
|
||||||
public long AccountId { get; set; }
|
public Guid AccountId { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public enum CloudFileSensitiveMark
|
public enum CloudFileSensitiveMark
|
||||||
|
@ -55,7 +55,7 @@ public class FileService(
|
|||||||
case "image":
|
case "image":
|
||||||
stream.Position = 0;
|
stream.Position = 0;
|
||||||
// We still need ImageSharp for blurhash calculation
|
// We still need ImageSharp for blurhash calculation
|
||||||
using (var imageSharp = await SixLabors.ImageSharp.Image.LoadAsync<Rgba32>(stream))
|
using (var imageSharp = await Image.LoadAsync<Rgba32>(stream))
|
||||||
{
|
{
|
||||||
var blurhash = Blurhasher.Encode(imageSharp, 3, 3);
|
var blurhash = Blurhasher.Encode(imageSharp, 3, 3);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user