diff --git a/DysonNetwork.Sphere/Account/Account.cs b/DysonNetwork.Sphere/Account/Account.cs index a19e967..26a4728 100644 --- a/DysonNetwork.Sphere/Account/Account.cs +++ b/DysonNetwork.Sphere/Account/Account.cs @@ -9,7 +9,7 @@ namespace DysonNetwork.Sphere.Account; [Index(nameof(Name), IsUnique = true)] 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 Nick { 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 long Id { get; set; } + public Guid Id { get; set; } [MaxLength(256)] public string? FirstName { get; set; } [MaxLength(256)] public string? MiddleName { get; set; } [MaxLength(256)] public string? LastName { get; set; } @@ -46,7 +46,7 @@ public class Profile : ModelBase public class AccountContact : ModelBase { - public long Id { get; set; } + public Guid Id { get; set; } public AccountContactType Type { get; set; } public Instant? VerifiedAt { get; set; } [MaxLength(1024)] public string Content { get; set; } = string.Empty; @@ -63,9 +63,9 @@ public enum AccountContactType public class AccountAuthFactor : ModelBase { - public long Id { get; set; } + public Guid Id { 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!; diff --git a/DysonNetwork.Sphere/Account/AccountEventService.cs b/DysonNetwork.Sphere/Account/AccountEventService.cs index 6629d2e..6a119da 100644 --- a/DysonNetwork.Sphere/Account/AccountEventService.cs +++ b/DysonNetwork.Sphere/Account/AccountEventService.cs @@ -19,13 +19,13 @@ public class AccountEventService( private static readonly Random Random = new(); private const string StatusCacheKey = "account_status_"; - public void PurgeStatusCache(long userId) + public void PurgeStatusCache(Guid userId) { var cacheKey = $"{StatusCacheKey}{userId}"; cache.Remove(cacheKey); } - public async Task GetStatus(long userId) + public async Task GetStatus(Guid userId) { var cacheKey = $"{StatusCacheKey}{userId}"; if (cache.TryGetValue(cacheKey, out Status? cachedStatus)) diff --git a/DysonNetwork.Sphere/Account/Badge.cs b/DysonNetwork.Sphere/Account/Badge.cs index ea4e12b..41b1d94 100644 --- a/DysonNetwork.Sphere/Account/Badge.cs +++ b/DysonNetwork.Sphere/Account/Badge.cs @@ -14,6 +14,6 @@ public class Badge : ModelBase [Column(TypeName = "jsonb")] public Dictionary Meta { get; set; } = new(); public Instant? ExpiredAt { get; set; } - public long AccountId { get; set; } + public Guid AccountId { get; set; } [JsonIgnore] public Account Account { get; set; } = null!; } \ No newline at end of file diff --git a/DysonNetwork.Sphere/Account/Event.cs b/DysonNetwork.Sphere/Account/Event.cs index b7aa935..f2a9a7e 100644 --- a/DysonNetwork.Sphere/Account/Event.cs +++ b/DysonNetwork.Sphere/Account/Event.cs @@ -22,7 +22,7 @@ public class Status : ModelBase [MaxLength(1024)] public string? Label { get; set; } public Instant? ClearedAt { get; set; } - public long AccountId { get; set; } + public Guid AccountId { get; set; } public Account Account { get; set; } = null!; } @@ -41,7 +41,7 @@ public class CheckInResult : ModelBase public CheckInResultLevel Level { get; set; } [Column(TypeName = "jsonb")] public ICollection Tips { get; set; } = new List(); - public long AccountId { get; set; } + public Guid AccountId { get; set; } public Account Account { get; set; } = null!; } diff --git a/DysonNetwork.Sphere/Account/MagicSpell.cs b/DysonNetwork.Sphere/Account/MagicSpell.cs index 286ea50..0d14612 100644 --- a/DysonNetwork.Sphere/Account/MagicSpell.cs +++ b/DysonNetwork.Sphere/Account/MagicSpell.cs @@ -25,6 +25,6 @@ public class MagicSpell : ModelBase public Instant? AffectedAt { get; set; } [Column(TypeName = "jsonb")] public Dictionary Meta { get; set; } - public long? AccountId { get; set; } + public Guid? AccountId { get; set; } public Account? Account { get; set; } } \ No newline at end of file diff --git a/DysonNetwork.Sphere/Account/Notification.cs b/DysonNetwork.Sphere/Account/Notification.cs index 2a0ab55..1351f7e 100644 --- a/DysonNetwork.Sphere/Account/Notification.cs +++ b/DysonNetwork.Sphere/Account/Notification.cs @@ -17,7 +17,7 @@ public class Notification : ModelBase public int Priority { get; set; } = 10; public Instant? ViewedAt { get; set; } - public long AccountId { get; set; } + public Guid AccountId { get; set; } [JsonIgnore] public Account Account { get; set; } = null!; } @@ -37,6 +37,6 @@ public class NotificationPushSubscription : ModelBase public NotificationPushProvider Provider { get; set; } public Instant? LastUsedAt { get; set; } - public long AccountId { get; set; } + public Guid AccountId { get; set; } [JsonIgnore] public Account Account { get; set; } = null!; } \ No newline at end of file diff --git a/DysonNetwork.Sphere/Account/Relationship.cs b/DysonNetwork.Sphere/Account/Relationship.cs index 25dd11a..0dd6a0d 100644 --- a/DysonNetwork.Sphere/Account/Relationship.cs +++ b/DysonNetwork.Sphere/Account/Relationship.cs @@ -11,9 +11,9 @@ public enum RelationshipStatus public class Relationship : ModelBase { - public long AccountId { get; set; } + public Guid AccountId { get; set; } public Account Account { get; set; } = null!; - public long RelatedId { get; set; } + public Guid RelatedId { get; set; } public Account Related { get; set; } = null!; public Instant? ExpiredAt { get; set; } diff --git a/DysonNetwork.Sphere/Account/RelationshipService.cs b/DysonNetwork.Sphere/Account/RelationshipService.cs index 310dc97..c235c97 100644 --- a/DysonNetwork.Sphere/Account/RelationshipService.cs +++ b/DysonNetwork.Sphere/Account/RelationshipService.cs @@ -124,9 +124,9 @@ public class RelationshipService(AppDatabase db, PermissionService pm, IMemoryCa return relationship; } - public async Task> ListAccountFriends(Account account) + public async Task> ListAccountFriends(Account account) { - if (!cache.TryGetValue($"UserFriends_{account.Id}", out List? friends)) + if (!cache.TryGetValue($"UserFriends_{account.Id}", out List? friends)) { friends = await db.AccountRelationships .Where(r => r.RelatedId == account.Id) diff --git a/DysonNetwork.Sphere/Activity/Activity.cs b/DysonNetwork.Sphere/Activity/Activity.cs index 6f274b8..9f949dd 100644 --- a/DysonNetwork.Sphere/Activity/Activity.cs +++ b/DysonNetwork.Sphere/Activity/Activity.cs @@ -17,9 +17,9 @@ public class Activity : ModelBase [MaxLength(4096)] public string ResourceIdentifier { get; set; } = null!; public ActivityVisibility Visibility { get; set; } = ActivityVisibility.Public; [Column(TypeName = "jsonb")] public Dictionary Meta { get; set; } = new(); - [Column(TypeName = "jsonb")] public ICollection UsersVisible { get; set; } = new List(); + [Column(TypeName = "jsonb")] public ICollection UsersVisible { get; set; } = new List(); - public long AccountId { get; set; } + public Guid AccountId { get; set; } public Account.Account Account { get; set; } = null!; [NotMapped] public object? Data { get; set; } diff --git a/DysonNetwork.Sphere/Activity/ActivityService.cs b/DysonNetwork.Sphere/Activity/ActivityService.cs index dd09648..781be7f 100644 --- a/DysonNetwork.Sphere/Activity/ActivityService.cs +++ b/DysonNetwork.Sphere/Activity/ActivityService.cs @@ -1,19 +1,18 @@ using DysonNetwork.Sphere.Post; using Microsoft.EntityFrameworkCore; -using NodaTime; namespace DysonNetwork.Sphere.Activity; public class ActivityReaderService(AppDatabase db, PostService ps) { public async Task> LoadActivityData(List input, Account.Account? currentUser, - List userFriends) + List userFriends) { if (input.Count == 0) return input; var postsId = input .Where(e => e.ResourceIdentifier.StartsWith("posts/")) - .Select(e => long.Parse(e.ResourceIdentifier.Split("/").Last())) + .Select(e => Guid.Parse(e.ResourceIdentifier.Split("/").Last())) .Distinct() .ToList(); if (postsId.Count > 0) @@ -40,7 +39,7 @@ public class ActivityReaderService(AppDatabase db, PostService ps) { var resourceIdentifier = item.ResourceIdentifier; 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) { item.Data = post; @@ -109,7 +108,7 @@ public class ActivityService(AppDatabase db) string type, string identifier, ActivityVisibility visibility = ActivityVisibility.Public, - List? visibleUsers = null + List? visibleUsers = null ) { var activity = new Activity @@ -158,7 +157,7 @@ public class ActivityService(AppDatabase db) public static class ActivityQueryExtensions { public static IQueryable FilterWithVisibility(this IQueryable source, - Account.Account? currentUser, List userFriends) + Account.Account? currentUser, List userFriends) { if (currentUser is null) return source.Where(e => e.Visibility == ActivityVisibility.Public); diff --git a/DysonNetwork.Sphere/Auth/AuthController.cs b/DysonNetwork.Sphere/Auth/AuthController.cs index b4460fb..f157a31 100644 --- a/DysonNetwork.Sphere/Auth/AuthController.cs +++ b/DysonNetwork.Sphere/Auth/AuthController.cs @@ -78,8 +78,8 @@ public class AuthController( : challenge.Account.AuthFactors.ToList(); } - [HttpPost("challenge/{id}/factors/{factorId:long}")] - public async Task RequestFactorCode([FromRoute] Guid id, [FromRoute] long factorId) + [HttpPost("challenge/{id}/factors/{factorId:guid}")] + public async Task RequestFactorCode([FromRoute] Guid id, [FromRoute] Guid factorId) { var challenge = await db.AuthChallenges .Include(e => e.Account) diff --git a/DysonNetwork.Sphere/Auth/Session.cs b/DysonNetwork.Sphere/Auth/Session.cs index d44263a..6b46306 100644 --- a/DysonNetwork.Sphere/Auth/Session.cs +++ b/DysonNetwork.Sphere/Auth/Session.cs @@ -43,7 +43,7 @@ public class Challenge : ModelBase public int FailedAttempts { get; set; } public ChallengePlatform Platform { get; set; } = ChallengePlatform.Unidentified; public ChallengeType Type { get; set; } = ChallengeType.Login; - [Column(TypeName = "jsonb")] public List BlacklistFactors { get; set; } = new(); + [Column(TypeName = "jsonb")] public List BlacklistFactors { get; set; } = new(); [Column(TypeName = "jsonb")] public List Audiences { get; set; } = new(); [Column(TypeName = "jsonb")] public List Scopes { get; set; } = new(); [MaxLength(128)] public string? IpAddress { get; set; } @@ -51,7 +51,7 @@ public class Challenge : ModelBase [MaxLength(256)] public string? DeviceId { 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!; public Challenge Normalize() diff --git a/DysonNetwork.Sphere/Chat/ChatController.cs b/DysonNetwork.Sphere/Chat/ChatController.cs index 9943104..46eeeb7 100644 --- a/DysonNetwork.Sphere/Chat/ChatController.cs +++ b/DysonNetwork.Sphere/Chat/ChatController.cs @@ -16,7 +16,7 @@ public partial class ChatController(AppDatabase db, ChatService cs) : Controller public class MarkMessageReadRequest { public Guid MessageId { get; set; } - public long ChatRoomId { get; set; } + public Guid ChatRoomId { get; set; } } public class SendMessageRequest @@ -29,8 +29,8 @@ public partial class ChatController(AppDatabase db, ChatService cs) : Controller public Guid? ForwardedMessageId { get; set; } } - [HttpGet("{roomId:long}/messages")] - public async Task>> ListMessages(long roomId, [FromQuery] int offset, [FromQuery] int take = 20) + [HttpGet("{roomId:guid}/messages")] + public async Task>> ListMessages(Guid roomId, [FromQuery] int offset, [FromQuery] int take = 20) { var currentUser = HttpContext.Items["CurrentUser"] as Account.Account; @@ -67,8 +67,8 @@ public partial class ChatController(AppDatabase db, ChatService cs) : Controller return Ok(messages); } - [HttpGet("{roomId:long}/messages/{messageId:guid}")] - public async Task> GetMessage(long roomId, Guid messageId) + [HttpGet("{roomId:guid}/messages/{messageId:guid}")] + public async Task> GetMessage(Guid roomId, Guid messageId) { 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_-]+)")] private static partial Regex MentionRegex(); - [HttpPost("{roomId:long}/messages")] + [HttpPost("{roomId:guid}/messages")] [Authorize] [RequiredPermission("global", "chat.messages.create")] - public async Task SendMessage([FromBody] SendMessageRequest request, long roomId) + public async Task SendMessage([FromBody] SendMessageRequest request, Guid roomId) { if (HttpContext.Items["CurrentUser"] is not Account.Account currentUser) return Unauthorized(); 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] - public async Task UpdateMessage([FromBody] SendMessageRequest request, long roomId, Guid messageId) + public async Task UpdateMessage([FromBody] SendMessageRequest request, Guid roomId, Guid messageId) { 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); } - [HttpDelete("{roomId:long}/messages/{messageId:guid}")] + [HttpDelete("{roomId:guid}/messages/{messageId:guid}")] [Authorize] - public async Task DeleteMessage(long roomId, Guid messageId) + public async Task DeleteMessage(Guid roomId, Guid messageId) { 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; } } - [HttpPost("{roomId:long}/sync")] - public async Task> GetSyncData([FromBody] SyncRequest request, long roomId) + [HttpPost("{roomId:guid}/sync")] + public async Task> GetSyncData([FromBody] SyncRequest request, Guid roomId) { if (HttpContext.Items["CurrentUser"] is not Account.Account currentUser) return Unauthorized(); diff --git a/DysonNetwork.Sphere/Chat/ChatRoom.cs b/DysonNetwork.Sphere/Chat/ChatRoom.cs index d26733b..258384f 100644 --- a/DysonNetwork.Sphere/Chat/ChatRoom.cs +++ b/DysonNetwork.Sphere/Chat/ChatRoom.cs @@ -14,7 +14,7 @@ public enum ChatRoomType public class ChatRoom : ModelBase { - public long Id { get; set; } + public Guid Id { get; set; } [MaxLength(1024)] public string Name { get; set; } = string.Empty; [MaxLength(4096)] public string Description { get; set; } = string.Empty; public ChatRoomType Type { get; set; } @@ -27,7 +27,7 @@ public class ChatRoom : ModelBase [JsonIgnore] public ICollection Members { get; set; } = new List(); - public long? RealmId { get; set; } + public Guid? RealmId { get; set; } public Realm.Realm? Realm { get; set; } [NotMapped] @@ -53,9 +53,9 @@ public enum ChatMemberNotify public class ChatMember : ModelBase { public Guid Id { get; set; } - public long ChatRoomId { get; set; } + public Guid ChatRoomId { get; set; } public ChatRoom ChatRoom { get; set; } = null!; - public long AccountId { get; set; } + public Guid AccountId { get; set; } public Account.Account Account { get; set; } = null!; [MaxLength(1024)] public string? Nick { get; set; } @@ -69,8 +69,8 @@ public class ChatMember : ModelBase public class ChatMemberTransmissionObject : ModelBase { public Guid Id { get; set; } - public long ChatRoomId { get; set; } - public long AccountId { get; set; } + public Guid ChatRoomId { get; set; } + public Guid AccountId { get; set; } public Account.Account Account { get; set; } = null!; [MaxLength(1024)] public string? Nick { get; set; } diff --git a/DysonNetwork.Sphere/Chat/ChatRoomController.cs b/DysonNetwork.Sphere/Chat/ChatRoomController.cs index a3b1043..eaf918f 100644 --- a/DysonNetwork.Sphere/Chat/ChatRoomController.cs +++ b/DysonNetwork.Sphere/Chat/ChatRoomController.cs @@ -12,8 +12,8 @@ namespace DysonNetwork.Sphere.Chat; [Route("/chat")] public class ChatRoomController(AppDatabase db, FileService fs, ChatRoomService crs) : ControllerBase { - [HttpGet("{id:long}")] - public async Task> GetChatRoom(long id) + [HttpGet("{id:guid}")] + public async Task> GetChatRoom(Guid id) { var chatRoom = await db.ChatRooms .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.Profile) .ToDictionaryAsync(m => m.ChatRoomId, m => m) - : new Dictionary(); + : new Dictionary(); // Map the results var result = chatRooms.Select(r => @@ -75,7 +75,7 @@ public class ChatRoomController(AppDatabase db, FileService fs, ChatRoomService public class DirectMessageRequest { - [Required] public long RelatedUserId { get; set; } + [Required] public Guid RelatedUserId { get; set; } } [HttpPost("direct")] @@ -139,7 +139,7 @@ public class ChatRoomController(AppDatabase db, FileService fs, ChatRoomService [MaxLength(4096)] public string? Description { get; set; } public string? PictureId { get; set; } public string? BackgroundId { get; set; } - public long? RealmId { get; set; } + public Guid? RealmId { get; set; } } [HttpPost] @@ -202,8 +202,8 @@ public class ChatRoomController(AppDatabase db, FileService fs, ChatRoomService } - [HttpPatch("{id:long}")] - public async Task> UpdateChatRoom(long id, [FromBody] ChatRoomRequest request) + [HttpPatch("{id:guid}")] + public async Task> UpdateChatRoom(Guid id, [FromBody] ChatRoomRequest request) { 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); } - [HttpDelete("{id:long}")] - public async Task DeleteChatRoom(long id) + [HttpDelete("{id:guid}")] + public async Task DeleteChatRoom(Guid id) { 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(); } - [HttpGet("{roomId:long}/members/me")] + [HttpGet("{roomId:guid}/members/me")] [Authorize] - public async Task> GetRoomIdentity(long roomId) + public async Task> GetRoomIdentity(Guid roomId) { if (HttpContext.Items["CurrentUser"] is not Account.Account currentUser) return Unauthorized(); @@ -334,8 +334,8 @@ public class ChatRoomController(AppDatabase db, FileService fs, ChatRoomService return Ok(member); } - [HttpGet("{roomId:long}/members")] - public async Task>> ListMembers(long roomId, [FromQuery] int take = 20, + [HttpGet("{roomId:guid}/members")] + public async Task>> ListMembers(Guid roomId, [FromQuery] int take = 20, [FromQuery] int skip = 0) { var currentUser = HttpContext.Items["CurrentUser"] as Account.Account; @@ -371,13 +371,13 @@ public class ChatRoomController(AppDatabase db, FileService fs, ChatRoomService public class ChatMemberRequest { - [Required] public long RelatedUserId { get; set; } + [Required] public Guid RelatedUserId { get; set; } [Required] public ChatMemberRole Role { get; set; } } - [HttpPost("invites/{roomId:long}")] + [HttpPost("invites/{roomId:guid}")] [Authorize] - public async Task> InviteMember(long roomId, + public async Task> InviteMember(Guid roomId, [FromBody] ChatMemberRequest request) { 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(); } - [HttpPost("invites/{roomId:long}/accept")] + [HttpPost("invites/{roomId:guid}/accept")] [Authorize] - public async Task> AcceptChatInvite(long roomId) + public async Task> AcceptChatInvite(Guid roomId) { if (HttpContext.Items["CurrentUser"] is not Account.Account currentUser) return Unauthorized(); var userId = currentUser.Id; @@ -469,9 +469,9 @@ public class ChatRoomController(AppDatabase db, FileService fs, ChatRoomService return Ok(member); } - [HttpPost("invites/{roomId:long}/decline")] + [HttpPost("invites/{roomId:guid}/decline")] [Authorize] - public async Task DeclineChatInvite(long roomId) + public async Task DeclineChatInvite(Guid roomId) { if (HttpContext.Items["CurrentUser"] is not Account.Account currentUser) return Unauthorized(); var userId = currentUser.Id; @@ -489,9 +489,9 @@ public class ChatRoomController(AppDatabase db, FileService fs, ChatRoomService return NoContent(); } - [HttpPatch("{roomId:long}/members/{memberId:long}/role")] + [HttpPatch("{roomId:guid}/members/{memberId:guid}/role")] [Authorize] - public async Task> UpdateChatMemberRole(long roomId, long memberId, + public async Task> UpdateChatMemberRole(Guid roomId, Guid memberId, [FromBody] ChatMemberRequest request) { 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(); } - [HttpDelete("{roomId:long}/members/{memberId:long}")] + [HttpDelete("{roomId:guid}/members/{memberId:guid}")] [Authorize] - public async Task RemoveChatMember(long roomId, long memberId) + public async Task RemoveChatMember(Guid roomId, Guid memberId) { 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(); } - [HttpDelete("{roomId:long}/members/me")] + [HttpDelete("{roomId:guid}/members/me")] [Authorize] - public async Task LeaveChat(long roomId) + public async Task LeaveChat(Guid roomId) { if (HttpContext.Items["CurrentUser"] is not Account.Account currentUser) return Unauthorized(); diff --git a/DysonNetwork.Sphere/Chat/ChatService.cs b/DysonNetwork.Sphere/Chat/ChatService.cs index d3109db..7358dcd 100644 --- a/DysonNetwork.Sphere/Chat/ChatService.cs +++ b/DysonNetwork.Sphere/Chat/ChatService.cs @@ -59,7 +59,7 @@ public class ChatService(AppDatabase db, IServiceScopeFactory scopeFactory) 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 .FirstOrDefaultAsync(x => x.MessageId == messageId && x.Sender.AccountId == userId); @@ -81,13 +81,13 @@ public class ChatService(AppDatabase db, IServiceScopeFactory scopeFactory) await db.SaveChangesAsync(); } - public async Task GetMessageReadStatus(Guid messageId, long userId) + public async Task GetMessageReadStatus(Guid messageId, Guid userId) { return await db.ChatStatuses .AnyAsync(x => x.MessageId == messageId && x.Sender.AccountId == userId); } - public async Task CountUnreadMessage(long userId, long chatRoomId) + public async Task CountUnreadMessage(Guid userId, Guid chatRoomId) { var messages = await db.ChatMessages .Where(m => m.ChatRoomId == chatRoomId) @@ -101,7 +101,7 @@ public class ChatService(AppDatabase db, IServiceScopeFactory scopeFactory) return messages.Count(m => !m.IsRead); } - public async Task> CountUnreadMessagesForJoinedRoomsAsync(long userId) + public async Task> CountUnreadMessagesForJoinedRoomsAsync(Guid userId) { var userRooms = await db.ChatMembers .Where(m => m.AccountId == userId) @@ -149,7 +149,7 @@ public class ChatService(AppDatabase db, IServiceScopeFactory scopeFactory) return call; } - public async Task EndCallAsync(long roomId) + public async Task EndCallAsync(Guid roomId) { var call = await GetCallOngoingAsync(roomId); 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); } - public async Task GetCallOngoingAsync(long roomId) + public async Task GetCallOngoingAsync(Guid roomId) { return await db.ChatRealtimeCall .Where(c => c.RoomId == roomId) @@ -180,7 +180,7 @@ public class ChatService(AppDatabase db, IServiceScopeFactory scopeFactory) .FirstOrDefaultAsync(); } - public async Task GetSyncDataAsync(long roomId, long lastSyncTimestamp) + public async Task GetSyncDataAsync(Guid roomId, long lastSyncTimestamp) { var timestamp = Instant.FromUnixTimeMilliseconds(lastSyncTimestamp); var changes = await db.ChatMessages diff --git a/DysonNetwork.Sphere/Chat/Message.cs b/DysonNetwork.Sphere/Chat/Message.cs index bd4ce42..1771a3a 100644 --- a/DysonNetwork.Sphere/Chat/Message.cs +++ b/DysonNetwork.Sphere/Chat/Message.cs @@ -27,7 +27,7 @@ public class Message : ModelBase public Guid SenderId { get; set; } public ChatMember Sender { get; set; } = null!; - public long ChatRoomId { get; set; } + public Guid ChatRoomId { get; set; } [JsonIgnore] public ChatRoom ChatRoom { get; set; } = null!; public Message Clone() diff --git a/DysonNetwork.Sphere/Chat/RealtimeCall.cs b/DysonNetwork.Sphere/Chat/RealtimeCall.cs index b053bc2..1c9d1af 100644 --- a/DysonNetwork.Sphere/Chat/RealtimeCall.cs +++ b/DysonNetwork.Sphere/Chat/RealtimeCall.cs @@ -10,6 +10,6 @@ public class RealtimeCall : ModelBase public Guid SenderId { get; set; } public ChatMember Sender { get; set; } = null!; - public long RoomId { get; set; } + public Guid RoomId { get; set; } public ChatRoom Room { get; set; } = null!; } \ No newline at end of file diff --git a/DysonNetwork.Sphere/Chat/RealtimeCallController.cs b/DysonNetwork.Sphere/Chat/RealtimeCallController.cs index 41e85b8..c70ea1b 100644 --- a/DysonNetwork.Sphere/Chat/RealtimeCallController.cs +++ b/DysonNetwork.Sphere/Chat/RealtimeCallController.cs @@ -32,9 +32,9 @@ public class RealtimeCallController(IConfiguration configuration, AppDatabase db public string Token { get; set; } = null!; } - [HttpGet("{roomId:long}")] + [HttpGet("{roomId:guid}")] [Authorize] - public async Task> GetToken(long roomId) + public async Task> GetToken(Guid roomId) { 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] - public async Task StartCall(long roomId) + public async Task StartCall(Guid roomId) { 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); } - [HttpDelete("{roomId:long}")] + [HttpDelete("{roomId:guid}")] [Authorize] - public async Task EndCall(long roomId) + public async Task EndCall(Guid roomId) { if (HttpContext.Items["CurrentUser"] is not Account.Account currentUser) return Unauthorized(); diff --git a/DysonNetwork.Sphere/Connection/WebSocketService.cs b/DysonNetwork.Sphere/Connection/WebSocketService.cs index 27fa6f7..65de6ed 100644 --- a/DysonNetwork.Sphere/Connection/WebSocketService.cs +++ b/DysonNetwork.Sphere/Connection/WebSocketService.cs @@ -13,12 +13,12 @@ public class WebSocketService } private static readonly ConcurrentDictionary< - (long AccountId, string DeviceId), + (Guid AccountId, string DeviceId), (WebSocket Socket, CancellationTokenSource Cts) > ActiveConnections = new(); public bool TryAdd( - (long AccountId, string DeviceId) key, + (Guid AccountId, string DeviceId) key, WebSocket socket, CancellationTokenSource cts ) @@ -29,7 +29,7 @@ public class WebSocketService 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; data.Socket.CloseAsync( @@ -41,12 +41,12 @@ public class WebSocketService ActiveConnections.TryRemove(key, out _); } - public bool GetAccountIsConnected(long accountId) + public bool GetAccountIsConnected(Guid 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 packetBytes = packet.ToBytes(); diff --git a/DysonNetwork.Sphere/DysonNetwork.Sphere.csproj b/DysonNetwork.Sphere/DysonNetwork.Sphere.csproj index 3f3e8f5..009a3cc 100644 --- a/DysonNetwork.Sphere/DysonNetwork.Sphere.csproj +++ b/DysonNetwork.Sphere/DysonNetwork.Sphere.csproj @@ -55,7 +55,6 @@ - diff --git a/DysonNetwork.Sphere/Migrations/20250504170705_InitialMigration.Designer.cs b/DysonNetwork.Sphere/Migrations/20250504170705_InitialMigration.Designer.cs deleted file mode 100644 index 6351f5b..0000000 --- a/DysonNetwork.Sphere/Migrations/20250504170705_InitialMigration.Designer.cs +++ /dev/null @@ -1,2363 +0,0 @@ -// -using System; -using System.Collections.Generic; -using System.Text.Json; -using DysonNetwork.Sphere; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using NodaTime; -using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; -using NpgsqlTypes; - -#nullable disable - -namespace DysonNetwork.Sphere.Migrations -{ - [DbContext(typeof(AppDatabase))] - [Migration("20250504170705_InitialMigration")] - partial class InitialMigration - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "9.0.3") - .HasAnnotation("Relational:MaxIdentifierLength", 63); - - NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); - - modelBuilder.Entity("DysonNetwork.Sphere.Account.Account", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ActivatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("activated_at"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property("IsSuperuser") - .HasColumnType("boolean") - .HasColumnName("is_superuser"); - - b.Property("Language") - .IsRequired() - .HasMaxLength(32) - .HasColumnType("character varying(32)") - .HasColumnName("language"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(256) - .HasColumnType("character varying(256)") - .HasColumnName("name"); - - b.Property("Nick") - .IsRequired() - .HasMaxLength(256) - .HasColumnType("character varying(256)") - .HasColumnName("nick"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.HasKey("Id") - .HasName("pk_accounts"); - - b.HasIndex("Name") - .IsUnique() - .HasDatabaseName("ix_accounts_name"); - - b.ToTable("accounts", (string)null); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Account.AccountAuthFactor", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AccountId") - .HasColumnType("bigint") - .HasColumnName("account_id"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property("Secret") - .HasColumnType("text") - .HasColumnName("secret"); - - b.Property("Type") - .HasColumnType("integer") - .HasColumnName("type"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.HasKey("Id") - .HasName("pk_account_auth_factors"); - - b.HasIndex("AccountId") - .HasDatabaseName("ix_account_auth_factors_account_id"); - - b.ToTable("account_auth_factors", (string)null); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Account.AccountContact", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AccountId") - .HasColumnType("bigint") - .HasColumnName("account_id"); - - b.Property("Content") - .IsRequired() - .HasMaxLength(1024) - .HasColumnType("character varying(1024)") - .HasColumnName("content"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property("Type") - .HasColumnType("integer") - .HasColumnName("type"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.Property("VerifiedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("verified_at"); - - b.HasKey("Id") - .HasName("pk_account_contacts"); - - b.HasIndex("AccountId") - .HasDatabaseName("ix_account_contacts_account_id"); - - b.ToTable("account_contacts", (string)null); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Account.MagicSpell", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uuid") - .HasColumnName("id"); - - b.Property("AccountId") - .HasColumnType("bigint") - .HasColumnName("account_id"); - - b.Property("AffectedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("affected_at"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property("ExpiresAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("expires_at"); - - b.Property>("Meta") - .IsRequired() - .HasColumnType("jsonb") - .HasColumnName("meta"); - - b.Property("Spell") - .IsRequired() - .HasMaxLength(1024) - .HasColumnType("character varying(1024)") - .HasColumnName("spell"); - - b.Property("Type") - .HasColumnType("integer") - .HasColumnName("type"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.HasKey("Id") - .HasName("pk_magic_spells"); - - b.HasIndex("AccountId") - .HasDatabaseName("ix_magic_spells_account_id"); - - b.HasIndex("Spell") - .IsUnique() - .HasDatabaseName("ix_magic_spells_spell"); - - b.ToTable("magic_spells", (string)null); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Account.Notification", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uuid") - .HasColumnName("id"); - - b.Property("AccountId") - .HasColumnType("bigint") - .HasColumnName("account_id"); - - b.Property("Content") - .HasMaxLength(4096) - .HasColumnType("character varying(4096)") - .HasColumnName("content"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property>("Meta") - .HasColumnType("jsonb") - .HasColumnName("meta"); - - b.Property("Priority") - .HasColumnType("integer") - .HasColumnName("priority"); - - b.Property("Subtitle") - .HasMaxLength(2048) - .HasColumnType("character varying(2048)") - .HasColumnName("subtitle"); - - b.Property("Title") - .HasMaxLength(1024) - .HasColumnType("character varying(1024)") - .HasColumnName("title"); - - b.Property("Topic") - .IsRequired() - .HasMaxLength(1024) - .HasColumnType("character varying(1024)") - .HasColumnName("topic"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.Property("ViewedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("viewed_at"); - - b.HasKey("Id") - .HasName("pk_notifications"); - - b.HasIndex("AccountId") - .HasDatabaseName("ix_notifications_account_id"); - - b.ToTable("notifications", (string)null); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Account.NotificationPushSubscription", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uuid") - .HasColumnName("id"); - - b.Property("AccountId") - .HasColumnType("bigint") - .HasColumnName("account_id"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property("DeviceId") - .IsRequired() - .HasMaxLength(4096) - .HasColumnType("character varying(4096)") - .HasColumnName("device_id"); - - b.Property("DeviceToken") - .IsRequired() - .HasMaxLength(4096) - .HasColumnType("character varying(4096)") - .HasColumnName("device_token"); - - b.Property("LastUsedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("last_used_at"); - - b.Property("Provider") - .HasColumnType("integer") - .HasColumnName("provider"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.HasKey("Id") - .HasName("pk_notification_push_subscriptions"); - - b.HasIndex("AccountId") - .HasDatabaseName("ix_notification_push_subscriptions_account_id"); - - b.HasIndex("DeviceId") - .IsUnique() - .HasDatabaseName("ix_notification_push_subscriptions_device_id"); - - b.HasIndex("DeviceToken") - .IsUnique() - .HasDatabaseName("ix_notification_push_subscriptions_device_token"); - - b.ToTable("notification_push_subscriptions", (string)null); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Account.Profile", b => - { - b.Property("Id") - .HasColumnType("bigint") - .HasColumnName("id"); - - b.Property("BackgroundId") - .HasColumnType("character varying(128)") - .HasColumnName("background_id"); - - b.Property("Bio") - .HasMaxLength(4096) - .HasColumnType("character varying(4096)") - .HasColumnName("bio"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property("FirstName") - .HasMaxLength(256) - .HasColumnType("character varying(256)") - .HasColumnName("first_name"); - - b.Property("LastName") - .HasMaxLength(256) - .HasColumnType("character varying(256)") - .HasColumnName("last_name"); - - b.Property("MiddleName") - .HasMaxLength(256) - .HasColumnType("character varying(256)") - .HasColumnName("middle_name"); - - b.Property("PictureId") - .HasColumnType("character varying(128)") - .HasColumnName("picture_id"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.HasKey("Id") - .HasName("pk_account_profiles"); - - b.HasIndex("BackgroundId") - .HasDatabaseName("ix_account_profiles_background_id"); - - b.HasIndex("PictureId") - .HasDatabaseName("ix_account_profiles_picture_id"); - - b.ToTable("account_profiles", (string)null); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Account.Relationship", b => - { - b.Property("AccountId") - .HasColumnType("bigint") - .HasColumnName("account_id"); - - b.Property("RelatedId") - .HasColumnType("bigint") - .HasColumnName("related_id"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property("ExpiredAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("expired_at"); - - b.Property("Status") - .HasColumnType("integer") - .HasColumnName("status"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.HasKey("AccountId", "RelatedId") - .HasName("pk_account_relationships"); - - b.HasIndex("RelatedId") - .HasDatabaseName("ix_account_relationships_related_id"); - - b.ToTable("account_relationships", (string)null); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Activity.Activity", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uuid") - .HasColumnName("id"); - - b.Property("AccountId") - .HasColumnType("bigint") - .HasColumnName("account_id"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property("ResourceIdentifier") - .IsRequired() - .HasMaxLength(4096) - .HasColumnType("character varying(4096)") - .HasColumnName("resource_identifier"); - - b.Property("Type") - .IsRequired() - .HasMaxLength(1024) - .HasColumnType("character varying(1024)") - .HasColumnName("type"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.Property("Visibility") - .HasColumnType("integer") - .HasColumnName("visibility"); - - b.HasKey("Id") - .HasName("pk_activities"); - - b.HasIndex("AccountId") - .HasDatabaseName("ix_activities_account_id"); - - b.ToTable("activities", (string)null); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Auth.Challenge", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uuid") - .HasColumnName("id"); - - b.Property("AccountId") - .HasColumnType("bigint") - .HasColumnName("account_id"); - - b.Property>("Audiences") - .IsRequired() - .HasColumnType("jsonb") - .HasColumnName("audiences"); - - b.Property>("BlacklistFactors") - .IsRequired() - .HasColumnType("jsonb") - .HasColumnName("blacklist_factors"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property("DeviceId") - .HasMaxLength(256) - .HasColumnType("character varying(256)") - .HasColumnName("device_id"); - - b.Property("ExpiredAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("expired_at"); - - b.Property("FailedAttempts") - .HasColumnType("integer") - .HasColumnName("failed_attempts"); - - b.Property("IpAddress") - .HasMaxLength(128) - .HasColumnType("character varying(128)") - .HasColumnName("ip_address"); - - b.Property("Nonce") - .HasMaxLength(1024) - .HasColumnType("character varying(1024)") - .HasColumnName("nonce"); - - b.Property("Platform") - .HasColumnType("integer") - .HasColumnName("platform"); - - b.Property>("Scopes") - .IsRequired() - .HasColumnType("jsonb") - .HasColumnName("scopes"); - - b.Property("StepRemain") - .HasColumnType("integer") - .HasColumnName("step_remain"); - - b.Property("StepTotal") - .HasColumnType("integer") - .HasColumnName("step_total"); - - b.Property("Type") - .HasColumnType("integer") - .HasColumnName("type"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.Property("UserAgent") - .HasMaxLength(512) - .HasColumnType("character varying(512)") - .HasColumnName("user_agent"); - - b.HasKey("Id") - .HasName("pk_auth_challenges"); - - b.HasIndex("AccountId") - .HasDatabaseName("ix_auth_challenges_account_id"); - - b.ToTable("auth_challenges", (string)null); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Auth.Session", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uuid") - .HasColumnName("id"); - - b.Property("AccountId") - .HasColumnType("bigint") - .HasColumnName("account_id"); - - b.Property("ChallengeId") - .HasColumnType("uuid") - .HasColumnName("challenge_id"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property("ExpiredAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("expired_at"); - - b.Property("Label") - .HasMaxLength(1024) - .HasColumnType("character varying(1024)") - .HasColumnName("label"); - - b.Property("LastGrantedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("last_granted_at"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.HasKey("Id") - .HasName("pk_auth_sessions"); - - b.HasIndex("AccountId") - .HasDatabaseName("ix_auth_sessions_account_id"); - - b.HasIndex("ChallengeId") - .HasDatabaseName("ix_auth_sessions_challenge_id"); - - b.ToTable("auth_sessions", (string)null); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Chat.ChatMember", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uuid") - .HasColumnName("id"); - - b.Property("AccountId") - .HasColumnType("bigint") - .HasColumnName("account_id"); - - b.Property("ChatRoomId") - .HasColumnType("bigint") - .HasColumnName("chat_room_id"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property("IsBot") - .HasColumnType("boolean") - .HasColumnName("is_bot"); - - b.Property("JoinedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("joined_at"); - - b.Property("Nick") - .HasMaxLength(1024) - .HasColumnType("character varying(1024)") - .HasColumnName("nick"); - - b.Property("Notify") - .HasColumnType("integer") - .HasColumnName("notify"); - - b.Property("Role") - .HasColumnType("integer") - .HasColumnName("role"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.HasKey("Id") - .HasName("pk_chat_members"); - - b.HasAlternateKey("ChatRoomId", "AccountId") - .HasName("ak_chat_members_chat_room_id_account_id"); - - b.HasIndex("AccountId") - .HasDatabaseName("ix_chat_members_account_id"); - - b.ToTable("chat_members", (string)null); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Chat.ChatRoom", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("BackgroundId") - .HasColumnType("character varying(128)") - .HasColumnName("background_id"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property("Description") - .IsRequired() - .HasMaxLength(4096) - .HasColumnType("character varying(4096)") - .HasColumnName("description"); - - b.Property("IsPublic") - .HasColumnType("boolean") - .HasColumnName("is_public"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(1024) - .HasColumnType("character varying(1024)") - .HasColumnName("name"); - - b.Property("PictureId") - .HasColumnType("character varying(128)") - .HasColumnName("picture_id"); - - b.Property("RealmId") - .HasColumnType("bigint") - .HasColumnName("realm_id"); - - b.Property("Type") - .HasColumnType("integer") - .HasColumnName("type"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.HasKey("Id") - .HasName("pk_chat_rooms"); - - b.HasIndex("BackgroundId") - .HasDatabaseName("ix_chat_rooms_background_id"); - - b.HasIndex("PictureId") - .HasDatabaseName("ix_chat_rooms_picture_id"); - - b.HasIndex("RealmId") - .HasDatabaseName("ix_chat_rooms_realm_id"); - - b.ToTable("chat_rooms", (string)null); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Chat.Message", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uuid") - .HasColumnName("id"); - - b.Property("ChatRoomId") - .HasColumnType("bigint") - .HasColumnName("chat_room_id"); - - b.Property("Content") - .IsRequired() - .HasMaxLength(4096) - .HasColumnType("character varying(4096)") - .HasColumnName("content"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property("EditedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("edited_at"); - - b.Property("ForwardedMessageId") - .HasColumnType("uuid") - .HasColumnName("forwarded_message_id"); - - b.Property>("MembersMentioned") - .HasColumnType("jsonb") - .HasColumnName("members_mentioned"); - - b.Property>("Meta") - .HasColumnType("jsonb") - .HasColumnName("meta"); - - b.Property("Nonce") - .IsRequired() - .HasMaxLength(36) - .HasColumnType("character varying(36)") - .HasColumnName("nonce"); - - b.Property("RepliedMessageId") - .HasColumnType("uuid") - .HasColumnName("replied_message_id"); - - b.Property("SenderId") - .HasColumnType("uuid") - .HasColumnName("sender_id"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.HasKey("Id") - .HasName("pk_chat_messages"); - - b.HasIndex("ChatRoomId") - .HasDatabaseName("ix_chat_messages_chat_room_id"); - - b.HasIndex("ForwardedMessageId") - .HasDatabaseName("ix_chat_messages_forwarded_message_id"); - - b.HasIndex("RepliedMessageId") - .HasDatabaseName("ix_chat_messages_replied_message_id"); - - b.HasIndex("SenderId") - .HasDatabaseName("ix_chat_messages_sender_id"); - - b.ToTable("chat_messages", (string)null); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Chat.MessageReaction", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uuid") - .HasColumnName("id"); - - b.Property("Attitude") - .HasColumnType("integer") - .HasColumnName("attitude"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property("MessageId") - .HasColumnType("uuid") - .HasColumnName("message_id"); - - b.Property("SenderId") - .HasColumnType("uuid") - .HasColumnName("sender_id"); - - b.Property("Symbol") - .IsRequired() - .HasMaxLength(256) - .HasColumnType("character varying(256)") - .HasColumnName("symbol"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.HasKey("Id") - .HasName("pk_message_reaction"); - - b.HasIndex("MessageId") - .HasDatabaseName("ix_message_reaction_message_id"); - - b.HasIndex("SenderId") - .HasDatabaseName("ix_message_reaction_sender_id"); - - b.ToTable("message_reaction", (string)null); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Chat.MessageStatus", b => - { - b.Property("MessageId") - .HasColumnType("uuid") - .HasColumnName("message_id"); - - b.Property("SenderId") - .HasColumnType("uuid") - .HasColumnName("sender_id"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property("ReadAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("read_at"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.HasKey("MessageId", "SenderId") - .HasName("pk_chat_statuses"); - - b.HasIndex("SenderId") - .HasDatabaseName("ix_chat_statuses_sender_id"); - - b.ToTable("chat_statuses", (string)null); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Permission.PermissionGroup", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uuid") - .HasColumnName("id"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property("Key") - .IsRequired() - .HasMaxLength(1024) - .HasColumnType("character varying(1024)") - .HasColumnName("key"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.HasKey("Id") - .HasName("pk_permission_groups"); - - b.ToTable("permission_groups", (string)null); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Permission.PermissionGroupMember", b => - { - b.Property("GroupId") - .HasColumnType("uuid") - .HasColumnName("group_id"); - - b.Property("Actor") - .HasMaxLength(1024) - .HasColumnType("character varying(1024)") - .HasColumnName("actor"); - - b.Property("AffectedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("affected_at"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property("ExpiredAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("expired_at"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.HasKey("GroupId", "Actor") - .HasName("pk_permission_group_members"); - - b.ToTable("permission_group_members", (string)null); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Permission.PermissionNode", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uuid") - .HasColumnName("id"); - - b.Property("Actor") - .IsRequired() - .HasMaxLength(1024) - .HasColumnType("character varying(1024)") - .HasColumnName("actor"); - - b.Property("AffectedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("affected_at"); - - b.Property("Area") - .IsRequired() - .HasMaxLength(1024) - .HasColumnType("character varying(1024)") - .HasColumnName("area"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property("ExpiredAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("expired_at"); - - b.Property("GroupId") - .HasColumnType("uuid") - .HasColumnName("group_id"); - - b.Property("Key") - .IsRequired() - .HasMaxLength(1024) - .HasColumnType("character varying(1024)") - .HasColumnName("key"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.Property("Value") - .IsRequired() - .HasColumnType("jsonb") - .HasColumnName("value"); - - b.HasKey("Id") - .HasName("pk_permission_nodes"); - - b.HasIndex("GroupId") - .HasDatabaseName("ix_permission_nodes_group_id"); - - b.HasIndex("Key", "Area", "Actor") - .HasDatabaseName("ix_permission_nodes_key_area_actor"); - - b.ToTable("permission_nodes", (string)null); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Post.Post", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Content") - .HasColumnType("text") - .HasColumnName("content"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property("Description") - .HasMaxLength(4096) - .HasColumnType("character varying(4096)") - .HasColumnName("description"); - - b.Property("Downvotes") - .HasColumnType("integer") - .HasColumnName("downvotes"); - - b.Property("EditedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("edited_at"); - - b.Property("ForwardedPostId") - .HasColumnType("bigint") - .HasColumnName("forwarded_post_id"); - - b.Property("Language") - .HasMaxLength(128) - .HasColumnType("character varying(128)") - .HasColumnName("language"); - - b.Property>("Meta") - .HasColumnType("jsonb") - .HasColumnName("meta"); - - b.Property("PublishedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("published_at"); - - b.Property("PublisherId") - .HasColumnType("bigint") - .HasColumnName("publisher_id"); - - b.Property("RepliedPostId") - .HasColumnType("bigint") - .HasColumnName("replied_post_id"); - - b.Property("SearchVector") - .IsRequired() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("tsvector") - .HasColumnName("search_vector") - .HasAnnotation("Npgsql:TsVectorConfig", "simple") - .HasAnnotation("Npgsql:TsVectorProperties", new[] { "Title", "Description", "Content" }); - - b.Property("ThreadedPostId") - .HasColumnType("bigint") - .HasColumnName("threaded_post_id"); - - b.Property("Title") - .HasMaxLength(1024) - .HasColumnType("character varying(1024)") - .HasColumnName("title"); - - b.Property("Type") - .HasColumnType("integer") - .HasColumnName("type"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.Property("Upvotes") - .HasColumnType("integer") - .HasColumnName("upvotes"); - - b.Property("ViewsTotal") - .HasColumnType("integer") - .HasColumnName("views_total"); - - b.Property("ViewsUnique") - .HasColumnType("integer") - .HasColumnName("views_unique"); - - b.Property("Visibility") - .HasColumnType("integer") - .HasColumnName("visibility"); - - b.HasKey("Id") - .HasName("pk_posts"); - - b.HasIndex("ForwardedPostId") - .HasDatabaseName("ix_posts_forwarded_post_id"); - - b.HasIndex("PublisherId") - .HasDatabaseName("ix_posts_publisher_id"); - - b.HasIndex("RepliedPostId") - .HasDatabaseName("ix_posts_replied_post_id"); - - b.HasIndex("SearchVector") - .HasDatabaseName("ix_posts_search_vector"); - - NpgsqlIndexBuilderExtensions.HasMethod(b.HasIndex("SearchVector"), "GIN"); - - b.HasIndex("ThreadedPostId") - .IsUnique() - .HasDatabaseName("ix_posts_threaded_post_id"); - - b.ToTable("posts", (string)null); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Post.PostCategory", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property("Name") - .HasMaxLength(256) - .HasColumnType("character varying(256)") - .HasColumnName("name"); - - b.Property("Slug") - .IsRequired() - .HasMaxLength(128) - .HasColumnType("character varying(128)") - .HasColumnName("slug"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.HasKey("Id") - .HasName("pk_post_categories"); - - b.ToTable("post_categories", (string)null); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Post.PostCollection", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property("Description") - .HasMaxLength(4096) - .HasColumnType("character varying(4096)") - .HasColumnName("description"); - - b.Property("Name") - .HasMaxLength(256) - .HasColumnType("character varying(256)") - .HasColumnName("name"); - - b.Property("PublisherId") - .HasColumnType("bigint") - .HasColumnName("publisher_id"); - - b.Property("Slug") - .IsRequired() - .HasMaxLength(128) - .HasColumnType("character varying(128)") - .HasColumnName("slug"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.HasKey("Id") - .HasName("pk_post_collections"); - - b.HasIndex("PublisherId") - .HasDatabaseName("ix_post_collections_publisher_id"); - - b.ToTable("post_collections", (string)null); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Post.PostReaction", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AccountId") - .HasColumnType("bigint") - .HasColumnName("account_id"); - - b.Property("Attitude") - .HasColumnType("integer") - .HasColumnName("attitude"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property("PostId") - .HasColumnType("bigint") - .HasColumnName("post_id"); - - b.Property("Symbol") - .IsRequired() - .HasMaxLength(256) - .HasColumnType("character varying(256)") - .HasColumnName("symbol"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.HasKey("Id") - .HasName("pk_post_reactions"); - - b.HasIndex("AccountId") - .HasDatabaseName("ix_post_reactions_account_id"); - - b.HasIndex("PostId") - .HasDatabaseName("ix_post_reactions_post_id"); - - b.ToTable("post_reactions", (string)null); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Post.PostTag", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property("Name") - .HasMaxLength(256) - .HasColumnType("character varying(256)") - .HasColumnName("name"); - - b.Property("Slug") - .IsRequired() - .HasMaxLength(128) - .HasColumnType("character varying(128)") - .HasColumnName("slug"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.HasKey("Id") - .HasName("pk_post_tags"); - - b.ToTable("post_tags", (string)null); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Post.Publisher", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AccountId") - .HasColumnType("bigint") - .HasColumnName("account_id"); - - b.Property("BackgroundId") - .HasColumnType("character varying(128)") - .HasColumnName("background_id"); - - b.Property("Bio") - .HasMaxLength(4096) - .HasColumnType("character varying(4096)") - .HasColumnName("bio"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(256) - .HasColumnType("character varying(256)") - .HasColumnName("name"); - - b.Property("Nick") - .IsRequired() - .HasMaxLength(256) - .HasColumnType("character varying(256)") - .HasColumnName("nick"); - - b.Property("PictureId") - .HasColumnType("character varying(128)") - .HasColumnName("picture_id"); - - b.Property("PublisherType") - .HasColumnType("integer") - .HasColumnName("publisher_type"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.HasKey("Id") - .HasName("pk_publishers"); - - b.HasIndex("AccountId") - .HasDatabaseName("ix_publishers_account_id"); - - b.HasIndex("BackgroundId") - .HasDatabaseName("ix_publishers_background_id"); - - b.HasIndex("Name") - .IsUnique() - .HasDatabaseName("ix_publishers_name"); - - b.HasIndex("PictureId") - .HasDatabaseName("ix_publishers_picture_id"); - - b.ToTable("publishers", (string)null); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Post.PublisherMember", b => - { - b.Property("PublisherId") - .HasColumnType("bigint") - .HasColumnName("publisher_id"); - - b.Property("AccountId") - .HasColumnType("bigint") - .HasColumnName("account_id"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property("JoinedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("joined_at"); - - b.Property("Role") - .HasColumnType("integer") - .HasColumnName("role"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.HasKey("PublisherId", "AccountId") - .HasName("pk_publisher_members"); - - b.HasIndex("AccountId") - .HasDatabaseName("ix_publisher_members_account_id"); - - b.ToTable("publisher_members", (string)null); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Realm.Realm", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AccountId") - .HasColumnType("bigint") - .HasColumnName("account_id"); - - b.Property("BackgroundId") - .HasColumnType("character varying(128)") - .HasColumnName("background_id"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property("Description") - .IsRequired() - .HasMaxLength(4096) - .HasColumnType("character varying(4096)") - .HasColumnName("description"); - - b.Property("IsCommunity") - .HasColumnType("boolean") - .HasColumnName("is_community"); - - b.Property("IsPublic") - .HasColumnType("boolean") - .HasColumnName("is_public"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(1024) - .HasColumnType("character varying(1024)") - .HasColumnName("name"); - - b.Property("PictureId") - .HasColumnType("character varying(128)") - .HasColumnName("picture_id"); - - b.Property("Slug") - .IsRequired() - .HasMaxLength(1024) - .HasColumnType("character varying(1024)") - .HasColumnName("slug"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.Property("VerifiedAs") - .HasMaxLength(4096) - .HasColumnType("character varying(4096)") - .HasColumnName("verified_as"); - - b.Property("VerifiedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("verified_at"); - - b.HasKey("Id") - .HasName("pk_realms"); - - b.HasIndex("AccountId") - .HasDatabaseName("ix_realms_account_id"); - - b.HasIndex("BackgroundId") - .HasDatabaseName("ix_realms_background_id"); - - b.HasIndex("PictureId") - .HasDatabaseName("ix_realms_picture_id"); - - b.HasIndex("Slug") - .IsUnique() - .HasDatabaseName("ix_realms_slug"); - - b.ToTable("realms", (string)null); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Realm.RealmMember", b => - { - b.Property("RealmId") - .HasColumnType("bigint") - .HasColumnName("realm_id"); - - b.Property("AccountId") - .HasColumnType("bigint") - .HasColumnName("account_id"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property("JoinedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("joined_at"); - - b.Property("Role") - .HasColumnType("integer") - .HasColumnName("role"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.HasKey("RealmId", "AccountId") - .HasName("pk_realm_members"); - - b.HasIndex("AccountId") - .HasDatabaseName("ix_realm_members_account_id"); - - b.ToTable("realm_members", (string)null); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Storage.CloudFile", b => - { - b.Property("Id") - .HasMaxLength(128) - .HasColumnType("character varying(128)") - .HasColumnName("id"); - - b.Property("AccountId") - .HasColumnType("bigint") - .HasColumnName("account_id"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property("Description") - .HasMaxLength(4096) - .HasColumnType("character varying(4096)") - .HasColumnName("description"); - - b.Property("ExpiredAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("expired_at"); - - b.Property>("FileMeta") - .HasColumnType("jsonb") - .HasColumnName("file_meta"); - - b.Property("HasCompression") - .HasColumnType("boolean") - .HasColumnName("has_compression"); - - b.Property("Hash") - .HasMaxLength(256) - .HasColumnType("character varying(256)") - .HasColumnName("hash"); - - b.Property("MessageId") - .HasColumnType("uuid") - .HasColumnName("message_id"); - - b.Property("MimeType") - .HasMaxLength(256) - .HasColumnType("character varying(256)") - .HasColumnName("mime_type"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(1024) - .HasColumnType("character varying(1024)") - .HasColumnName("name"); - - b.Property("PostId") - .HasColumnType("bigint") - .HasColumnName("post_id"); - - b.Property("Size") - .HasColumnType("bigint") - .HasColumnName("size"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.Property("UploadedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("uploaded_at"); - - b.Property("UploadedTo") - .HasMaxLength(128) - .HasColumnType("character varying(128)") - .HasColumnName("uploaded_to"); - - b.Property("UsedCount") - .HasColumnType("integer") - .HasColumnName("used_count"); - - b.Property>("UserMeta") - .HasColumnType("jsonb") - .HasColumnName("user_meta"); - - b.HasKey("Id") - .HasName("pk_files"); - - b.HasIndex("AccountId") - .HasDatabaseName("ix_files_account_id"); - - b.HasIndex("MessageId") - .HasDatabaseName("ix_files_message_id"); - - b.HasIndex("PostId") - .HasDatabaseName("ix_files_post_id"); - - b.ToTable("files", (string)null); - }); - - modelBuilder.Entity("PostPostCategory", b => - { - b.Property("CategoriesId") - .HasColumnType("bigint") - .HasColumnName("categories_id"); - - b.Property("PostsId") - .HasColumnType("bigint") - .HasColumnName("posts_id"); - - b.HasKey("CategoriesId", "PostsId") - .HasName("pk_post_category_links"); - - b.HasIndex("PostsId") - .HasDatabaseName("ix_post_category_links_posts_id"); - - b.ToTable("post_category_links", (string)null); - }); - - modelBuilder.Entity("PostPostCollection", b => - { - b.Property("CollectionsId") - .HasColumnType("bigint") - .HasColumnName("collections_id"); - - b.Property("PostsId") - .HasColumnType("bigint") - .HasColumnName("posts_id"); - - b.HasKey("CollectionsId", "PostsId") - .HasName("pk_post_collection_links"); - - b.HasIndex("PostsId") - .HasDatabaseName("ix_post_collection_links_posts_id"); - - b.ToTable("post_collection_links", (string)null); - }); - - modelBuilder.Entity("PostPostTag", b => - { - b.Property("PostsId") - .HasColumnType("bigint") - .HasColumnName("posts_id"); - - b.Property("TagsId") - .HasColumnType("bigint") - .HasColumnName("tags_id"); - - b.HasKey("PostsId", "TagsId") - .HasName("pk_post_tag_links"); - - b.HasIndex("TagsId") - .HasDatabaseName("ix_post_tag_links_tags_id"); - - b.ToTable("post_tag_links", (string)null); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Account.AccountAuthFactor", b => - { - b.HasOne("DysonNetwork.Sphere.Account.Account", "Account") - .WithMany("AuthFactors") - .HasForeignKey("AccountId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_account_auth_factors_accounts_account_id"); - - b.Navigation("Account"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Account.AccountContact", b => - { - b.HasOne("DysonNetwork.Sphere.Account.Account", "Account") - .WithMany("Contacts") - .HasForeignKey("AccountId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_account_contacts_accounts_account_id"); - - b.Navigation("Account"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Account.MagicSpell", b => - { - b.HasOne("DysonNetwork.Sphere.Account.Account", "Account") - .WithMany() - .HasForeignKey("AccountId") - .HasConstraintName("fk_magic_spells_accounts_account_id"); - - b.Navigation("Account"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Account.Notification", b => - { - b.HasOne("DysonNetwork.Sphere.Account.Account", "Account") - .WithMany() - .HasForeignKey("AccountId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_notifications_accounts_account_id"); - - b.Navigation("Account"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Account.NotificationPushSubscription", b => - { - b.HasOne("DysonNetwork.Sphere.Account.Account", "Account") - .WithMany() - .HasForeignKey("AccountId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_notification_push_subscriptions_accounts_account_id"); - - b.Navigation("Account"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Account.Profile", b => - { - b.HasOne("DysonNetwork.Sphere.Storage.CloudFile", "Background") - .WithMany() - .HasForeignKey("BackgroundId") - .HasConstraintName("fk_account_profiles_files_background_id"); - - b.HasOne("DysonNetwork.Sphere.Account.Account", "Account") - .WithOne("Profile") - .HasForeignKey("DysonNetwork.Sphere.Account.Profile", "Id") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_account_profiles_accounts_id"); - - b.HasOne("DysonNetwork.Sphere.Storage.CloudFile", "Picture") - .WithMany() - .HasForeignKey("PictureId") - .HasConstraintName("fk_account_profiles_files_picture_id"); - - b.Navigation("Account"); - - b.Navigation("Background"); - - b.Navigation("Picture"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Account.Relationship", b => - { - b.HasOne("DysonNetwork.Sphere.Account.Account", "Account") - .WithMany("OutgoingRelationships") - .HasForeignKey("AccountId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_account_relationships_accounts_account_id"); - - b.HasOne("DysonNetwork.Sphere.Account.Account", "Related") - .WithMany("IncomingRelationships") - .HasForeignKey("RelatedId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_account_relationships_accounts_related_id"); - - b.Navigation("Account"); - - b.Navigation("Related"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Activity.Activity", b => - { - b.HasOne("DysonNetwork.Sphere.Account.Account", "Account") - .WithMany() - .HasForeignKey("AccountId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_activities_accounts_account_id"); - - b.Navigation("Account"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Auth.Challenge", b => - { - b.HasOne("DysonNetwork.Sphere.Account.Account", "Account") - .WithMany("Challenges") - .HasForeignKey("AccountId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_auth_challenges_accounts_account_id"); - - b.Navigation("Account"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Auth.Session", b => - { - b.HasOne("DysonNetwork.Sphere.Account.Account", "Account") - .WithMany("Sessions") - .HasForeignKey("AccountId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_auth_sessions_accounts_account_id"); - - b.HasOne("DysonNetwork.Sphere.Auth.Challenge", "Challenge") - .WithMany() - .HasForeignKey("ChallengeId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_auth_sessions_auth_challenges_challenge_id"); - - b.Navigation("Account"); - - b.Navigation("Challenge"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Chat.ChatMember", b => - { - b.HasOne("DysonNetwork.Sphere.Account.Account", "Account") - .WithMany() - .HasForeignKey("AccountId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_chat_members_accounts_account_id"); - - b.HasOne("DysonNetwork.Sphere.Chat.ChatRoom", "ChatRoom") - .WithMany("Members") - .HasForeignKey("ChatRoomId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_chat_members_chat_rooms_chat_room_id"); - - b.Navigation("Account"); - - b.Navigation("ChatRoom"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Chat.ChatRoom", b => - { - b.HasOne("DysonNetwork.Sphere.Storage.CloudFile", "Background") - .WithMany() - .HasForeignKey("BackgroundId") - .HasConstraintName("fk_chat_rooms_files_background_id"); - - b.HasOne("DysonNetwork.Sphere.Storage.CloudFile", "Picture") - .WithMany() - .HasForeignKey("PictureId") - .HasConstraintName("fk_chat_rooms_files_picture_id"); - - b.HasOne("DysonNetwork.Sphere.Realm.Realm", "Realm") - .WithMany("ChatRooms") - .HasForeignKey("RealmId") - .HasConstraintName("fk_chat_rooms_realms_realm_id"); - - b.Navigation("Background"); - - b.Navigation("Picture"); - - b.Navigation("Realm"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Chat.Message", b => - { - b.HasOne("DysonNetwork.Sphere.Chat.ChatRoom", "ChatRoom") - .WithMany() - .HasForeignKey("ChatRoomId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_chat_messages_chat_rooms_chat_room_id"); - - b.HasOne("DysonNetwork.Sphere.Chat.Message", "ForwardedMessage") - .WithMany() - .HasForeignKey("ForwardedMessageId") - .OnDelete(DeleteBehavior.Restrict) - .HasConstraintName("fk_chat_messages_chat_messages_forwarded_message_id"); - - b.HasOne("DysonNetwork.Sphere.Chat.Message", "RepliedMessage") - .WithMany() - .HasForeignKey("RepliedMessageId") - .OnDelete(DeleteBehavior.Restrict) - .HasConstraintName("fk_chat_messages_chat_messages_replied_message_id"); - - b.HasOne("DysonNetwork.Sphere.Chat.ChatMember", "Sender") - .WithMany() - .HasForeignKey("SenderId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_chat_messages_chat_members_sender_id"); - - b.Navigation("ChatRoom"); - - b.Navigation("ForwardedMessage"); - - b.Navigation("RepliedMessage"); - - b.Navigation("Sender"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Chat.MessageReaction", b => - { - b.HasOne("DysonNetwork.Sphere.Chat.Message", "Message") - .WithMany("Reactions") - .HasForeignKey("MessageId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_message_reaction_chat_messages_message_id"); - - b.HasOne("DysonNetwork.Sphere.Chat.ChatMember", "Sender") - .WithMany() - .HasForeignKey("SenderId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_message_reaction_chat_members_sender_id"); - - b.Navigation("Message"); - - b.Navigation("Sender"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Chat.MessageStatus", b => - { - b.HasOne("DysonNetwork.Sphere.Chat.Message", "Message") - .WithMany("Statuses") - .HasForeignKey("MessageId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_chat_statuses_chat_messages_message_id"); - - b.HasOne("DysonNetwork.Sphere.Chat.ChatMember", "Sender") - .WithMany() - .HasForeignKey("SenderId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_chat_statuses_chat_members_sender_id"); - - b.Navigation("Message"); - - b.Navigation("Sender"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Permission.PermissionGroupMember", b => - { - b.HasOne("DysonNetwork.Sphere.Permission.PermissionGroup", "Group") - .WithMany("Members") - .HasForeignKey("GroupId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_permission_group_members_permission_groups_group_id"); - - b.Navigation("Group"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Permission.PermissionNode", b => - { - b.HasOne("DysonNetwork.Sphere.Permission.PermissionGroup", "Group") - .WithMany("Nodes") - .HasForeignKey("GroupId") - .HasConstraintName("fk_permission_nodes_permission_groups_group_id"); - - b.Navigation("Group"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Post.Post", b => - { - b.HasOne("DysonNetwork.Sphere.Post.Post", "ForwardedPost") - .WithMany() - .HasForeignKey("ForwardedPostId") - .OnDelete(DeleteBehavior.Restrict) - .HasConstraintName("fk_posts_posts_forwarded_post_id"); - - b.HasOne("DysonNetwork.Sphere.Post.Publisher", "Publisher") - .WithMany("Posts") - .HasForeignKey("PublisherId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_posts_publishers_publisher_id"); - - b.HasOne("DysonNetwork.Sphere.Post.Post", "RepliedPost") - .WithMany() - .HasForeignKey("RepliedPostId") - .OnDelete(DeleteBehavior.Restrict) - .HasConstraintName("fk_posts_posts_replied_post_id"); - - b.HasOne("DysonNetwork.Sphere.Post.Post", "ThreadedPost") - .WithOne() - .HasForeignKey("DysonNetwork.Sphere.Post.Post", "ThreadedPostId") - .HasConstraintName("fk_posts_posts_threaded_post_id"); - - b.Navigation("ForwardedPost"); - - b.Navigation("Publisher"); - - b.Navigation("RepliedPost"); - - b.Navigation("ThreadedPost"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Post.PostCollection", b => - { - b.HasOne("DysonNetwork.Sphere.Post.Publisher", "Publisher") - .WithMany("Collections") - .HasForeignKey("PublisherId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_post_collections_publishers_publisher_id"); - - b.Navigation("Publisher"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Post.PostReaction", b => - { - b.HasOne("DysonNetwork.Sphere.Account.Account", "Account") - .WithMany() - .HasForeignKey("AccountId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_post_reactions_accounts_account_id"); - - b.HasOne("DysonNetwork.Sphere.Post.Post", "Post") - .WithMany("Reactions") - .HasForeignKey("PostId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_post_reactions_posts_post_id"); - - b.Navigation("Account"); - - b.Navigation("Post"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Post.Publisher", b => - { - b.HasOne("DysonNetwork.Sphere.Account.Account", "Account") - .WithMany() - .HasForeignKey("AccountId") - .HasConstraintName("fk_publishers_accounts_account_id"); - - b.HasOne("DysonNetwork.Sphere.Storage.CloudFile", "Background") - .WithMany() - .HasForeignKey("BackgroundId") - .HasConstraintName("fk_publishers_files_background_id"); - - b.HasOne("DysonNetwork.Sphere.Storage.CloudFile", "Picture") - .WithMany() - .HasForeignKey("PictureId") - .HasConstraintName("fk_publishers_files_picture_id"); - - b.Navigation("Account"); - - b.Navigation("Background"); - - b.Navigation("Picture"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Post.PublisherMember", b => - { - b.HasOne("DysonNetwork.Sphere.Account.Account", "Account") - .WithMany() - .HasForeignKey("AccountId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_publisher_members_accounts_account_id"); - - b.HasOne("DysonNetwork.Sphere.Post.Publisher", "Publisher") - .WithMany("Members") - .HasForeignKey("PublisherId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_publisher_members_publishers_publisher_id"); - - b.Navigation("Account"); - - b.Navigation("Publisher"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Realm.Realm", b => - { - b.HasOne("DysonNetwork.Sphere.Account.Account", "Account") - .WithMany() - .HasForeignKey("AccountId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_realms_accounts_account_id"); - - b.HasOne("DysonNetwork.Sphere.Storage.CloudFile", "Background") - .WithMany() - .HasForeignKey("BackgroundId") - .HasConstraintName("fk_realms_files_background_id"); - - b.HasOne("DysonNetwork.Sphere.Storage.CloudFile", "Picture") - .WithMany() - .HasForeignKey("PictureId") - .HasConstraintName("fk_realms_files_picture_id"); - - b.Navigation("Account"); - - b.Navigation("Background"); - - b.Navigation("Picture"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Realm.RealmMember", b => - { - b.HasOne("DysonNetwork.Sphere.Account.Account", "Account") - .WithMany() - .HasForeignKey("AccountId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_realm_members_accounts_account_id"); - - b.HasOne("DysonNetwork.Sphere.Realm.Realm", "Realm") - .WithMany("Members") - .HasForeignKey("RealmId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_realm_members_realms_realm_id"); - - b.Navigation("Account"); - - b.Navigation("Realm"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Storage.CloudFile", b => - { - b.HasOne("DysonNetwork.Sphere.Account.Account", "Account") - .WithMany() - .HasForeignKey("AccountId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_files_accounts_account_id"); - - b.HasOne("DysonNetwork.Sphere.Chat.Message", null) - .WithMany("Attachments") - .HasForeignKey("MessageId") - .HasConstraintName("fk_files_chat_messages_message_id"); - - b.HasOne("DysonNetwork.Sphere.Post.Post", null) - .WithMany("Attachments") - .HasForeignKey("PostId") - .HasConstraintName("fk_files_posts_post_id"); - - b.Navigation("Account"); - }); - - modelBuilder.Entity("PostPostCategory", b => - { - b.HasOne("DysonNetwork.Sphere.Post.PostCategory", null) - .WithMany() - .HasForeignKey("CategoriesId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_post_category_links_post_categories_categories_id"); - - b.HasOne("DysonNetwork.Sphere.Post.Post", null) - .WithMany() - .HasForeignKey("PostsId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_post_category_links_posts_posts_id"); - }); - - modelBuilder.Entity("PostPostCollection", b => - { - b.HasOne("DysonNetwork.Sphere.Post.PostCollection", null) - .WithMany() - .HasForeignKey("CollectionsId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_post_collection_links_post_collections_collections_id"); - - b.HasOne("DysonNetwork.Sphere.Post.Post", null) - .WithMany() - .HasForeignKey("PostsId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_post_collection_links_posts_posts_id"); - }); - - modelBuilder.Entity("PostPostTag", b => - { - b.HasOne("DysonNetwork.Sphere.Post.Post", null) - .WithMany() - .HasForeignKey("PostsId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_post_tag_links_posts_posts_id"); - - b.HasOne("DysonNetwork.Sphere.Post.PostTag", null) - .WithMany() - .HasForeignKey("TagsId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_post_tag_links_post_tags_tags_id"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Account.Account", b => - { - b.Navigation("AuthFactors"); - - b.Navigation("Challenges"); - - b.Navigation("Contacts"); - - b.Navigation("IncomingRelationships"); - - b.Navigation("OutgoingRelationships"); - - b.Navigation("Profile") - .IsRequired(); - - b.Navigation("Sessions"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Chat.ChatRoom", b => - { - b.Navigation("Members"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Chat.Message", b => - { - b.Navigation("Attachments"); - - b.Navigation("Reactions"); - - b.Navigation("Statuses"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Permission.PermissionGroup", b => - { - b.Navigation("Members"); - - b.Navigation("Nodes"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Post.Post", b => - { - b.Navigation("Attachments"); - - b.Navigation("Reactions"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Post.Publisher", b => - { - b.Navigation("Collections"); - - b.Navigation("Members"); - - b.Navigation("Posts"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Realm.Realm", b => - { - b.Navigation("ChatRooms"); - - b.Navigation("Members"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/DysonNetwork.Sphere/Migrations/20250505050854_NoIdeaHowToNameThis.Designer.cs b/DysonNetwork.Sphere/Migrations/20250505050854_NoIdeaHowToNameThis.Designer.cs deleted file mode 100644 index 2825fd1..0000000 --- a/DysonNetwork.Sphere/Migrations/20250505050854_NoIdeaHowToNameThis.Designer.cs +++ /dev/null @@ -1,2363 +0,0 @@ -// -using System; -using System.Collections.Generic; -using System.Text.Json; -using DysonNetwork.Sphere; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using NodaTime; -using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; -using NpgsqlTypes; - -#nullable disable - -namespace DysonNetwork.Sphere.Migrations -{ - [DbContext(typeof(AppDatabase))] - [Migration("20250505050854_NoIdeaHowToNameThis")] - partial class NoIdeaHowToNameThis - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "9.0.3") - .HasAnnotation("Relational:MaxIdentifierLength", 63); - - NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); - - modelBuilder.Entity("DysonNetwork.Sphere.Account.Account", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ActivatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("activated_at"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property("IsSuperuser") - .HasColumnType("boolean") - .HasColumnName("is_superuser"); - - b.Property("Language") - .IsRequired() - .HasMaxLength(32) - .HasColumnType("character varying(32)") - .HasColumnName("language"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(256) - .HasColumnType("character varying(256)") - .HasColumnName("name"); - - b.Property("Nick") - .IsRequired() - .HasMaxLength(256) - .HasColumnType("character varying(256)") - .HasColumnName("nick"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.HasKey("Id") - .HasName("pk_accounts"); - - b.HasIndex("Name") - .IsUnique() - .HasDatabaseName("ix_accounts_name"); - - b.ToTable("accounts", (string)null); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Account.AccountAuthFactor", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AccountId") - .HasColumnType("bigint") - .HasColumnName("account_id"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property("Secret") - .HasColumnType("text") - .HasColumnName("secret"); - - b.Property("Type") - .HasColumnType("integer") - .HasColumnName("type"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.HasKey("Id") - .HasName("pk_account_auth_factors"); - - b.HasIndex("AccountId") - .HasDatabaseName("ix_account_auth_factors_account_id"); - - b.ToTable("account_auth_factors", (string)null); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Account.AccountContact", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AccountId") - .HasColumnType("bigint") - .HasColumnName("account_id"); - - b.Property("Content") - .IsRequired() - .HasMaxLength(1024) - .HasColumnType("character varying(1024)") - .HasColumnName("content"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property("Type") - .HasColumnType("integer") - .HasColumnName("type"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.Property("VerifiedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("verified_at"); - - b.HasKey("Id") - .HasName("pk_account_contacts"); - - b.HasIndex("AccountId") - .HasDatabaseName("ix_account_contacts_account_id"); - - b.ToTable("account_contacts", (string)null); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Account.MagicSpell", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uuid") - .HasColumnName("id"); - - b.Property("AccountId") - .HasColumnType("bigint") - .HasColumnName("account_id"); - - b.Property("AffectedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("affected_at"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property("ExpiresAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("expires_at"); - - b.Property>("Meta") - .IsRequired() - .HasColumnType("jsonb") - .HasColumnName("meta"); - - b.Property("Spell") - .IsRequired() - .HasMaxLength(1024) - .HasColumnType("character varying(1024)") - .HasColumnName("spell"); - - b.Property("Type") - .HasColumnType("integer") - .HasColumnName("type"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.HasKey("Id") - .HasName("pk_magic_spells"); - - b.HasIndex("AccountId") - .HasDatabaseName("ix_magic_spells_account_id"); - - b.HasIndex("Spell") - .IsUnique() - .HasDatabaseName("ix_magic_spells_spell"); - - b.ToTable("magic_spells", (string)null); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Account.Notification", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uuid") - .HasColumnName("id"); - - b.Property("AccountId") - .HasColumnType("bigint") - .HasColumnName("account_id"); - - b.Property("Content") - .HasMaxLength(4096) - .HasColumnType("character varying(4096)") - .HasColumnName("content"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property>("Meta") - .HasColumnType("jsonb") - .HasColumnName("meta"); - - b.Property("Priority") - .HasColumnType("integer") - .HasColumnName("priority"); - - b.Property("Subtitle") - .HasMaxLength(2048) - .HasColumnType("character varying(2048)") - .HasColumnName("subtitle"); - - b.Property("Title") - .HasMaxLength(1024) - .HasColumnType("character varying(1024)") - .HasColumnName("title"); - - b.Property("Topic") - .IsRequired() - .HasMaxLength(1024) - .HasColumnType("character varying(1024)") - .HasColumnName("topic"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.Property("ViewedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("viewed_at"); - - b.HasKey("Id") - .HasName("pk_notifications"); - - b.HasIndex("AccountId") - .HasDatabaseName("ix_notifications_account_id"); - - b.ToTable("notifications", (string)null); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Account.NotificationPushSubscription", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uuid") - .HasColumnName("id"); - - b.Property("AccountId") - .HasColumnType("bigint") - .HasColumnName("account_id"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property("DeviceId") - .IsRequired() - .HasMaxLength(4096) - .HasColumnType("character varying(4096)") - .HasColumnName("device_id"); - - b.Property("DeviceToken") - .IsRequired() - .HasMaxLength(4096) - .HasColumnType("character varying(4096)") - .HasColumnName("device_token"); - - b.Property("LastUsedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("last_used_at"); - - b.Property("Provider") - .HasColumnType("integer") - .HasColumnName("provider"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.HasKey("Id") - .HasName("pk_notification_push_subscriptions"); - - b.HasIndex("AccountId") - .HasDatabaseName("ix_notification_push_subscriptions_account_id"); - - b.HasIndex("DeviceId") - .IsUnique() - .HasDatabaseName("ix_notification_push_subscriptions_device_id"); - - b.HasIndex("DeviceToken") - .IsUnique() - .HasDatabaseName("ix_notification_push_subscriptions_device_token"); - - b.ToTable("notification_push_subscriptions", (string)null); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Account.Profile", b => - { - b.Property("Id") - .HasColumnType("bigint") - .HasColumnName("id"); - - b.Property("BackgroundId") - .HasColumnType("character varying(128)") - .HasColumnName("background_id"); - - b.Property("Bio") - .HasMaxLength(4096) - .HasColumnType("character varying(4096)") - .HasColumnName("bio"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property("FirstName") - .HasMaxLength(256) - .HasColumnType("character varying(256)") - .HasColumnName("first_name"); - - b.Property("LastName") - .HasMaxLength(256) - .HasColumnType("character varying(256)") - .HasColumnName("last_name"); - - b.Property("MiddleName") - .HasMaxLength(256) - .HasColumnType("character varying(256)") - .HasColumnName("middle_name"); - - b.Property("PictureId") - .HasColumnType("character varying(128)") - .HasColumnName("picture_id"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.HasKey("Id") - .HasName("pk_account_profiles"); - - b.HasIndex("BackgroundId") - .HasDatabaseName("ix_account_profiles_background_id"); - - b.HasIndex("PictureId") - .HasDatabaseName("ix_account_profiles_picture_id"); - - b.ToTable("account_profiles", (string)null); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Account.Relationship", b => - { - b.Property("AccountId") - .HasColumnType("bigint") - .HasColumnName("account_id"); - - b.Property("RelatedId") - .HasColumnType("bigint") - .HasColumnName("related_id"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property("ExpiredAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("expired_at"); - - b.Property("Status") - .HasColumnType("integer") - .HasColumnName("status"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.HasKey("AccountId", "RelatedId") - .HasName("pk_account_relationships"); - - b.HasIndex("RelatedId") - .HasDatabaseName("ix_account_relationships_related_id"); - - b.ToTable("account_relationships", (string)null); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Activity.Activity", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uuid") - .HasColumnName("id"); - - b.Property("AccountId") - .HasColumnType("bigint") - .HasColumnName("account_id"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property("ResourceIdentifier") - .IsRequired() - .HasMaxLength(4096) - .HasColumnType("character varying(4096)") - .HasColumnName("resource_identifier"); - - b.Property("Type") - .IsRequired() - .HasMaxLength(1024) - .HasColumnType("character varying(1024)") - .HasColumnName("type"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.Property("Visibility") - .HasColumnType("integer") - .HasColumnName("visibility"); - - b.HasKey("Id") - .HasName("pk_activities"); - - b.HasIndex("AccountId") - .HasDatabaseName("ix_activities_account_id"); - - b.ToTable("activities", (string)null); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Auth.Challenge", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uuid") - .HasColumnName("id"); - - b.Property("AccountId") - .HasColumnType("bigint") - .HasColumnName("account_id"); - - b.Property>("Audiences") - .IsRequired() - .HasColumnType("jsonb") - .HasColumnName("audiences"); - - b.Property>("BlacklistFactors") - .IsRequired() - .HasColumnType("jsonb") - .HasColumnName("blacklist_factors"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property("DeviceId") - .HasMaxLength(256) - .HasColumnType("character varying(256)") - .HasColumnName("device_id"); - - b.Property("ExpiredAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("expired_at"); - - b.Property("FailedAttempts") - .HasColumnType("integer") - .HasColumnName("failed_attempts"); - - b.Property("IpAddress") - .HasMaxLength(128) - .HasColumnType("character varying(128)") - .HasColumnName("ip_address"); - - b.Property("Nonce") - .HasMaxLength(1024) - .HasColumnType("character varying(1024)") - .HasColumnName("nonce"); - - b.Property("Platform") - .HasColumnType("integer") - .HasColumnName("platform"); - - b.Property>("Scopes") - .IsRequired() - .HasColumnType("jsonb") - .HasColumnName("scopes"); - - b.Property("StepRemain") - .HasColumnType("integer") - .HasColumnName("step_remain"); - - b.Property("StepTotal") - .HasColumnType("integer") - .HasColumnName("step_total"); - - b.Property("Type") - .HasColumnType("integer") - .HasColumnName("type"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.Property("UserAgent") - .HasMaxLength(512) - .HasColumnType("character varying(512)") - .HasColumnName("user_agent"); - - b.HasKey("Id") - .HasName("pk_auth_challenges"); - - b.HasIndex("AccountId") - .HasDatabaseName("ix_auth_challenges_account_id"); - - b.ToTable("auth_challenges", (string)null); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Auth.Session", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uuid") - .HasColumnName("id"); - - b.Property("AccountId") - .HasColumnType("bigint") - .HasColumnName("account_id"); - - b.Property("ChallengeId") - .HasColumnType("uuid") - .HasColumnName("challenge_id"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property("ExpiredAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("expired_at"); - - b.Property("Label") - .HasMaxLength(1024) - .HasColumnType("character varying(1024)") - .HasColumnName("label"); - - b.Property("LastGrantedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("last_granted_at"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.HasKey("Id") - .HasName("pk_auth_sessions"); - - b.HasIndex("AccountId") - .HasDatabaseName("ix_auth_sessions_account_id"); - - b.HasIndex("ChallengeId") - .HasDatabaseName("ix_auth_sessions_challenge_id"); - - b.ToTable("auth_sessions", (string)null); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Chat.ChatMember", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uuid") - .HasColumnName("id"); - - b.Property("AccountId") - .HasColumnType("bigint") - .HasColumnName("account_id"); - - b.Property("ChatRoomId") - .HasColumnType("bigint") - .HasColumnName("chat_room_id"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property("IsBot") - .HasColumnType("boolean") - .HasColumnName("is_bot"); - - b.Property("JoinedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("joined_at"); - - b.Property("Nick") - .HasMaxLength(1024) - .HasColumnType("character varying(1024)") - .HasColumnName("nick"); - - b.Property("Notify") - .HasColumnType("integer") - .HasColumnName("notify"); - - b.Property("Role") - .HasColumnType("integer") - .HasColumnName("role"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.HasKey("Id") - .HasName("pk_chat_members"); - - b.HasAlternateKey("ChatRoomId", "AccountId") - .HasName("ak_chat_members_chat_room_id_account_id"); - - b.HasIndex("AccountId") - .HasDatabaseName("ix_chat_members_account_id"); - - b.ToTable("chat_members", (string)null); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Chat.ChatRoom", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("BackgroundId") - .HasColumnType("character varying(128)") - .HasColumnName("background_id"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property("Description") - .IsRequired() - .HasMaxLength(4096) - .HasColumnType("character varying(4096)") - .HasColumnName("description"); - - b.Property("IsPublic") - .HasColumnType("boolean") - .HasColumnName("is_public"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(1024) - .HasColumnType("character varying(1024)") - .HasColumnName("name"); - - b.Property("PictureId") - .HasColumnType("character varying(128)") - .HasColumnName("picture_id"); - - b.Property("RealmId") - .HasColumnType("bigint") - .HasColumnName("realm_id"); - - b.Property("Type") - .HasColumnType("integer") - .HasColumnName("type"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.HasKey("Id") - .HasName("pk_chat_rooms"); - - b.HasIndex("BackgroundId") - .HasDatabaseName("ix_chat_rooms_background_id"); - - b.HasIndex("PictureId") - .HasDatabaseName("ix_chat_rooms_picture_id"); - - b.HasIndex("RealmId") - .HasDatabaseName("ix_chat_rooms_realm_id"); - - b.ToTable("chat_rooms", (string)null); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Chat.Message", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uuid") - .HasColumnName("id"); - - b.Property("ChatRoomId") - .HasColumnType("bigint") - .HasColumnName("chat_room_id"); - - b.Property("Content") - .IsRequired() - .HasMaxLength(4096) - .HasColumnType("character varying(4096)") - .HasColumnName("content"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property("EditedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("edited_at"); - - b.Property("ForwardedMessageId") - .HasColumnType("uuid") - .HasColumnName("forwarded_message_id"); - - b.Property>("MembersMentioned") - .HasColumnType("jsonb") - .HasColumnName("members_mentioned"); - - b.Property>("Meta") - .HasColumnType("jsonb") - .HasColumnName("meta"); - - b.Property("Nonce") - .IsRequired() - .HasMaxLength(36) - .HasColumnType("character varying(36)") - .HasColumnName("nonce"); - - b.Property("RepliedMessageId") - .HasColumnType("uuid") - .HasColumnName("replied_message_id"); - - b.Property("SenderId") - .HasColumnType("uuid") - .HasColumnName("sender_id"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.HasKey("Id") - .HasName("pk_chat_messages"); - - b.HasIndex("ChatRoomId") - .HasDatabaseName("ix_chat_messages_chat_room_id"); - - b.HasIndex("ForwardedMessageId") - .HasDatabaseName("ix_chat_messages_forwarded_message_id"); - - b.HasIndex("RepliedMessageId") - .HasDatabaseName("ix_chat_messages_replied_message_id"); - - b.HasIndex("SenderId") - .HasDatabaseName("ix_chat_messages_sender_id"); - - b.ToTable("chat_messages", (string)null); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Chat.MessageReaction", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uuid") - .HasColumnName("id"); - - b.Property("Attitude") - .HasColumnType("integer") - .HasColumnName("attitude"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property("MessageId") - .HasColumnType("uuid") - .HasColumnName("message_id"); - - b.Property("SenderId") - .HasColumnType("uuid") - .HasColumnName("sender_id"); - - b.Property("Symbol") - .IsRequired() - .HasMaxLength(256) - .HasColumnType("character varying(256)") - .HasColumnName("symbol"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.HasKey("Id") - .HasName("pk_chat_reactions"); - - b.HasIndex("MessageId") - .HasDatabaseName("ix_chat_reactions_message_id"); - - b.HasIndex("SenderId") - .HasDatabaseName("ix_chat_reactions_sender_id"); - - b.ToTable("chat_reactions", (string)null); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Chat.MessageStatus", b => - { - b.Property("MessageId") - .HasColumnType("uuid") - .HasColumnName("message_id"); - - b.Property("SenderId") - .HasColumnType("uuid") - .HasColumnName("sender_id"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property("ReadAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("read_at"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.HasKey("MessageId", "SenderId") - .HasName("pk_chat_statuses"); - - b.HasIndex("SenderId") - .HasDatabaseName("ix_chat_statuses_sender_id"); - - b.ToTable("chat_statuses", (string)null); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Permission.PermissionGroup", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uuid") - .HasColumnName("id"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property("Key") - .IsRequired() - .HasMaxLength(1024) - .HasColumnType("character varying(1024)") - .HasColumnName("key"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.HasKey("Id") - .HasName("pk_permission_groups"); - - b.ToTable("permission_groups", (string)null); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Permission.PermissionGroupMember", b => - { - b.Property("GroupId") - .HasColumnType("uuid") - .HasColumnName("group_id"); - - b.Property("Actor") - .HasMaxLength(1024) - .HasColumnType("character varying(1024)") - .HasColumnName("actor"); - - b.Property("AffectedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("affected_at"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property("ExpiredAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("expired_at"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.HasKey("GroupId", "Actor") - .HasName("pk_permission_group_members"); - - b.ToTable("permission_group_members", (string)null); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Permission.PermissionNode", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uuid") - .HasColumnName("id"); - - b.Property("Actor") - .IsRequired() - .HasMaxLength(1024) - .HasColumnType("character varying(1024)") - .HasColumnName("actor"); - - b.Property("AffectedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("affected_at"); - - b.Property("Area") - .IsRequired() - .HasMaxLength(1024) - .HasColumnType("character varying(1024)") - .HasColumnName("area"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property("ExpiredAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("expired_at"); - - b.Property("GroupId") - .HasColumnType("uuid") - .HasColumnName("group_id"); - - b.Property("Key") - .IsRequired() - .HasMaxLength(1024) - .HasColumnType("character varying(1024)") - .HasColumnName("key"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.Property("Value") - .IsRequired() - .HasColumnType("jsonb") - .HasColumnName("value"); - - b.HasKey("Id") - .HasName("pk_permission_nodes"); - - b.HasIndex("GroupId") - .HasDatabaseName("ix_permission_nodes_group_id"); - - b.HasIndex("Key", "Area", "Actor") - .HasDatabaseName("ix_permission_nodes_key_area_actor"); - - b.ToTable("permission_nodes", (string)null); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Post.Post", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Content") - .HasColumnType("text") - .HasColumnName("content"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property("Description") - .HasMaxLength(4096) - .HasColumnType("character varying(4096)") - .HasColumnName("description"); - - b.Property("Downvotes") - .HasColumnType("integer") - .HasColumnName("downvotes"); - - b.Property("EditedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("edited_at"); - - b.Property("ForwardedPostId") - .HasColumnType("bigint") - .HasColumnName("forwarded_post_id"); - - b.Property("Language") - .HasMaxLength(128) - .HasColumnType("character varying(128)") - .HasColumnName("language"); - - b.Property>("Meta") - .HasColumnType("jsonb") - .HasColumnName("meta"); - - b.Property("PublishedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("published_at"); - - b.Property("PublisherId") - .HasColumnType("bigint") - .HasColumnName("publisher_id"); - - b.Property("RepliedPostId") - .HasColumnType("bigint") - .HasColumnName("replied_post_id"); - - b.Property("SearchVector") - .IsRequired() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("tsvector") - .HasColumnName("search_vector") - .HasAnnotation("Npgsql:TsVectorConfig", "simple") - .HasAnnotation("Npgsql:TsVectorProperties", new[] { "Title", "Description", "Content" }); - - b.Property("ThreadedPostId") - .HasColumnType("bigint") - .HasColumnName("threaded_post_id"); - - b.Property("Title") - .HasMaxLength(1024) - .HasColumnType("character varying(1024)") - .HasColumnName("title"); - - b.Property("Type") - .HasColumnType("integer") - .HasColumnName("type"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.Property("Upvotes") - .HasColumnType("integer") - .HasColumnName("upvotes"); - - b.Property("ViewsTotal") - .HasColumnType("integer") - .HasColumnName("views_total"); - - b.Property("ViewsUnique") - .HasColumnType("integer") - .HasColumnName("views_unique"); - - b.Property("Visibility") - .HasColumnType("integer") - .HasColumnName("visibility"); - - b.HasKey("Id") - .HasName("pk_posts"); - - b.HasIndex("ForwardedPostId") - .HasDatabaseName("ix_posts_forwarded_post_id"); - - b.HasIndex("PublisherId") - .HasDatabaseName("ix_posts_publisher_id"); - - b.HasIndex("RepliedPostId") - .HasDatabaseName("ix_posts_replied_post_id"); - - b.HasIndex("SearchVector") - .HasDatabaseName("ix_posts_search_vector"); - - NpgsqlIndexBuilderExtensions.HasMethod(b.HasIndex("SearchVector"), "GIN"); - - b.HasIndex("ThreadedPostId") - .IsUnique() - .HasDatabaseName("ix_posts_threaded_post_id"); - - b.ToTable("posts", (string)null); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Post.PostCategory", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property("Name") - .HasMaxLength(256) - .HasColumnType("character varying(256)") - .HasColumnName("name"); - - b.Property("Slug") - .IsRequired() - .HasMaxLength(128) - .HasColumnType("character varying(128)") - .HasColumnName("slug"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.HasKey("Id") - .HasName("pk_post_categories"); - - b.ToTable("post_categories", (string)null); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Post.PostCollection", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property("Description") - .HasMaxLength(4096) - .HasColumnType("character varying(4096)") - .HasColumnName("description"); - - b.Property("Name") - .HasMaxLength(256) - .HasColumnType("character varying(256)") - .HasColumnName("name"); - - b.Property("PublisherId") - .HasColumnType("bigint") - .HasColumnName("publisher_id"); - - b.Property("Slug") - .IsRequired() - .HasMaxLength(128) - .HasColumnType("character varying(128)") - .HasColumnName("slug"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.HasKey("Id") - .HasName("pk_post_collections"); - - b.HasIndex("PublisherId") - .HasDatabaseName("ix_post_collections_publisher_id"); - - b.ToTable("post_collections", (string)null); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Post.PostReaction", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AccountId") - .HasColumnType("bigint") - .HasColumnName("account_id"); - - b.Property("Attitude") - .HasColumnType("integer") - .HasColumnName("attitude"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property("PostId") - .HasColumnType("bigint") - .HasColumnName("post_id"); - - b.Property("Symbol") - .IsRequired() - .HasMaxLength(256) - .HasColumnType("character varying(256)") - .HasColumnName("symbol"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.HasKey("Id") - .HasName("pk_post_reactions"); - - b.HasIndex("AccountId") - .HasDatabaseName("ix_post_reactions_account_id"); - - b.HasIndex("PostId") - .HasDatabaseName("ix_post_reactions_post_id"); - - b.ToTable("post_reactions", (string)null); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Post.PostTag", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property("Name") - .HasMaxLength(256) - .HasColumnType("character varying(256)") - .HasColumnName("name"); - - b.Property("Slug") - .IsRequired() - .HasMaxLength(128) - .HasColumnType("character varying(128)") - .HasColumnName("slug"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.HasKey("Id") - .HasName("pk_post_tags"); - - b.ToTable("post_tags", (string)null); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Post.Publisher", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AccountId") - .HasColumnType("bigint") - .HasColumnName("account_id"); - - b.Property("BackgroundId") - .HasColumnType("character varying(128)") - .HasColumnName("background_id"); - - b.Property("Bio") - .HasMaxLength(4096) - .HasColumnType("character varying(4096)") - .HasColumnName("bio"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(256) - .HasColumnType("character varying(256)") - .HasColumnName("name"); - - b.Property("Nick") - .IsRequired() - .HasMaxLength(256) - .HasColumnType("character varying(256)") - .HasColumnName("nick"); - - b.Property("PictureId") - .HasColumnType("character varying(128)") - .HasColumnName("picture_id"); - - b.Property("PublisherType") - .HasColumnType("integer") - .HasColumnName("publisher_type"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.HasKey("Id") - .HasName("pk_publishers"); - - b.HasIndex("AccountId") - .HasDatabaseName("ix_publishers_account_id"); - - b.HasIndex("BackgroundId") - .HasDatabaseName("ix_publishers_background_id"); - - b.HasIndex("Name") - .IsUnique() - .HasDatabaseName("ix_publishers_name"); - - b.HasIndex("PictureId") - .HasDatabaseName("ix_publishers_picture_id"); - - b.ToTable("publishers", (string)null); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Post.PublisherMember", b => - { - b.Property("PublisherId") - .HasColumnType("bigint") - .HasColumnName("publisher_id"); - - b.Property("AccountId") - .HasColumnType("bigint") - .HasColumnName("account_id"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property("JoinedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("joined_at"); - - b.Property("Role") - .HasColumnType("integer") - .HasColumnName("role"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.HasKey("PublisherId", "AccountId") - .HasName("pk_publisher_members"); - - b.HasIndex("AccountId") - .HasDatabaseName("ix_publisher_members_account_id"); - - b.ToTable("publisher_members", (string)null); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Realm.Realm", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AccountId") - .HasColumnType("bigint") - .HasColumnName("account_id"); - - b.Property("BackgroundId") - .HasColumnType("character varying(128)") - .HasColumnName("background_id"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property("Description") - .IsRequired() - .HasMaxLength(4096) - .HasColumnType("character varying(4096)") - .HasColumnName("description"); - - b.Property("IsCommunity") - .HasColumnType("boolean") - .HasColumnName("is_community"); - - b.Property("IsPublic") - .HasColumnType("boolean") - .HasColumnName("is_public"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(1024) - .HasColumnType("character varying(1024)") - .HasColumnName("name"); - - b.Property("PictureId") - .HasColumnType("character varying(128)") - .HasColumnName("picture_id"); - - b.Property("Slug") - .IsRequired() - .HasMaxLength(1024) - .HasColumnType("character varying(1024)") - .HasColumnName("slug"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.Property("VerifiedAs") - .HasMaxLength(4096) - .HasColumnType("character varying(4096)") - .HasColumnName("verified_as"); - - b.Property("VerifiedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("verified_at"); - - b.HasKey("Id") - .HasName("pk_realms"); - - b.HasIndex("AccountId") - .HasDatabaseName("ix_realms_account_id"); - - b.HasIndex("BackgroundId") - .HasDatabaseName("ix_realms_background_id"); - - b.HasIndex("PictureId") - .HasDatabaseName("ix_realms_picture_id"); - - b.HasIndex("Slug") - .IsUnique() - .HasDatabaseName("ix_realms_slug"); - - b.ToTable("realms", (string)null); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Realm.RealmMember", b => - { - b.Property("RealmId") - .HasColumnType("bigint") - .HasColumnName("realm_id"); - - b.Property("AccountId") - .HasColumnType("bigint") - .HasColumnName("account_id"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property("JoinedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("joined_at"); - - b.Property("Role") - .HasColumnType("integer") - .HasColumnName("role"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.HasKey("RealmId", "AccountId") - .HasName("pk_realm_members"); - - b.HasIndex("AccountId") - .HasDatabaseName("ix_realm_members_account_id"); - - b.ToTable("realm_members", (string)null); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Storage.CloudFile", b => - { - b.Property("Id") - .HasMaxLength(128) - .HasColumnType("character varying(128)") - .HasColumnName("id"); - - b.Property("AccountId") - .HasColumnType("bigint") - .HasColumnName("account_id"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property("Description") - .HasMaxLength(4096) - .HasColumnType("character varying(4096)") - .HasColumnName("description"); - - b.Property("ExpiredAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("expired_at"); - - b.Property>("FileMeta") - .HasColumnType("jsonb") - .HasColumnName("file_meta"); - - b.Property("HasCompression") - .HasColumnType("boolean") - .HasColumnName("has_compression"); - - b.Property("Hash") - .HasMaxLength(256) - .HasColumnType("character varying(256)") - .HasColumnName("hash"); - - b.Property("MessageId") - .HasColumnType("uuid") - .HasColumnName("message_id"); - - b.Property("MimeType") - .HasMaxLength(256) - .HasColumnType("character varying(256)") - .HasColumnName("mime_type"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(1024) - .HasColumnType("character varying(1024)") - .HasColumnName("name"); - - b.Property("PostId") - .HasColumnType("bigint") - .HasColumnName("post_id"); - - b.Property("Size") - .HasColumnType("bigint") - .HasColumnName("size"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.Property("UploadedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("uploaded_at"); - - b.Property("UploadedTo") - .HasMaxLength(128) - .HasColumnType("character varying(128)") - .HasColumnName("uploaded_to"); - - b.Property("UsedCount") - .HasColumnType("integer") - .HasColumnName("used_count"); - - b.Property>("UserMeta") - .HasColumnType("jsonb") - .HasColumnName("user_meta"); - - b.HasKey("Id") - .HasName("pk_files"); - - b.HasIndex("AccountId") - .HasDatabaseName("ix_files_account_id"); - - b.HasIndex("MessageId") - .HasDatabaseName("ix_files_message_id"); - - b.HasIndex("PostId") - .HasDatabaseName("ix_files_post_id"); - - b.ToTable("files", (string)null); - }); - - modelBuilder.Entity("PostPostCategory", b => - { - b.Property("CategoriesId") - .HasColumnType("bigint") - .HasColumnName("categories_id"); - - b.Property("PostsId") - .HasColumnType("bigint") - .HasColumnName("posts_id"); - - b.HasKey("CategoriesId", "PostsId") - .HasName("pk_post_category_links"); - - b.HasIndex("PostsId") - .HasDatabaseName("ix_post_category_links_posts_id"); - - b.ToTable("post_category_links", (string)null); - }); - - modelBuilder.Entity("PostPostCollection", b => - { - b.Property("CollectionsId") - .HasColumnType("bigint") - .HasColumnName("collections_id"); - - b.Property("PostsId") - .HasColumnType("bigint") - .HasColumnName("posts_id"); - - b.HasKey("CollectionsId", "PostsId") - .HasName("pk_post_collection_links"); - - b.HasIndex("PostsId") - .HasDatabaseName("ix_post_collection_links_posts_id"); - - b.ToTable("post_collection_links", (string)null); - }); - - modelBuilder.Entity("PostPostTag", b => - { - b.Property("PostsId") - .HasColumnType("bigint") - .HasColumnName("posts_id"); - - b.Property("TagsId") - .HasColumnType("bigint") - .HasColumnName("tags_id"); - - b.HasKey("PostsId", "TagsId") - .HasName("pk_post_tag_links"); - - b.HasIndex("TagsId") - .HasDatabaseName("ix_post_tag_links_tags_id"); - - b.ToTable("post_tag_links", (string)null); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Account.AccountAuthFactor", b => - { - b.HasOne("DysonNetwork.Sphere.Account.Account", "Account") - .WithMany("AuthFactors") - .HasForeignKey("AccountId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_account_auth_factors_accounts_account_id"); - - b.Navigation("Account"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Account.AccountContact", b => - { - b.HasOne("DysonNetwork.Sphere.Account.Account", "Account") - .WithMany("Contacts") - .HasForeignKey("AccountId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_account_contacts_accounts_account_id"); - - b.Navigation("Account"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Account.MagicSpell", b => - { - b.HasOne("DysonNetwork.Sphere.Account.Account", "Account") - .WithMany() - .HasForeignKey("AccountId") - .HasConstraintName("fk_magic_spells_accounts_account_id"); - - b.Navigation("Account"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Account.Notification", b => - { - b.HasOne("DysonNetwork.Sphere.Account.Account", "Account") - .WithMany() - .HasForeignKey("AccountId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_notifications_accounts_account_id"); - - b.Navigation("Account"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Account.NotificationPushSubscription", b => - { - b.HasOne("DysonNetwork.Sphere.Account.Account", "Account") - .WithMany() - .HasForeignKey("AccountId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_notification_push_subscriptions_accounts_account_id"); - - b.Navigation("Account"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Account.Profile", b => - { - b.HasOne("DysonNetwork.Sphere.Storage.CloudFile", "Background") - .WithMany() - .HasForeignKey("BackgroundId") - .HasConstraintName("fk_account_profiles_files_background_id"); - - b.HasOne("DysonNetwork.Sphere.Account.Account", "Account") - .WithOne("Profile") - .HasForeignKey("DysonNetwork.Sphere.Account.Profile", "Id") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_account_profiles_accounts_id"); - - b.HasOne("DysonNetwork.Sphere.Storage.CloudFile", "Picture") - .WithMany() - .HasForeignKey("PictureId") - .HasConstraintName("fk_account_profiles_files_picture_id"); - - b.Navigation("Account"); - - b.Navigation("Background"); - - b.Navigation("Picture"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Account.Relationship", b => - { - b.HasOne("DysonNetwork.Sphere.Account.Account", "Account") - .WithMany("OutgoingRelationships") - .HasForeignKey("AccountId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_account_relationships_accounts_account_id"); - - b.HasOne("DysonNetwork.Sphere.Account.Account", "Related") - .WithMany("IncomingRelationships") - .HasForeignKey("RelatedId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_account_relationships_accounts_related_id"); - - b.Navigation("Account"); - - b.Navigation("Related"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Activity.Activity", b => - { - b.HasOne("DysonNetwork.Sphere.Account.Account", "Account") - .WithMany() - .HasForeignKey("AccountId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_activities_accounts_account_id"); - - b.Navigation("Account"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Auth.Challenge", b => - { - b.HasOne("DysonNetwork.Sphere.Account.Account", "Account") - .WithMany("Challenges") - .HasForeignKey("AccountId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_auth_challenges_accounts_account_id"); - - b.Navigation("Account"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Auth.Session", b => - { - b.HasOne("DysonNetwork.Sphere.Account.Account", "Account") - .WithMany("Sessions") - .HasForeignKey("AccountId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_auth_sessions_accounts_account_id"); - - b.HasOne("DysonNetwork.Sphere.Auth.Challenge", "Challenge") - .WithMany() - .HasForeignKey("ChallengeId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_auth_sessions_auth_challenges_challenge_id"); - - b.Navigation("Account"); - - b.Navigation("Challenge"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Chat.ChatMember", b => - { - b.HasOne("DysonNetwork.Sphere.Account.Account", "Account") - .WithMany() - .HasForeignKey("AccountId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_chat_members_accounts_account_id"); - - b.HasOne("DysonNetwork.Sphere.Chat.ChatRoom", "ChatRoom") - .WithMany("Members") - .HasForeignKey("ChatRoomId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_chat_members_chat_rooms_chat_room_id"); - - b.Navigation("Account"); - - b.Navigation("ChatRoom"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Chat.ChatRoom", b => - { - b.HasOne("DysonNetwork.Sphere.Storage.CloudFile", "Background") - .WithMany() - .HasForeignKey("BackgroundId") - .HasConstraintName("fk_chat_rooms_files_background_id"); - - b.HasOne("DysonNetwork.Sphere.Storage.CloudFile", "Picture") - .WithMany() - .HasForeignKey("PictureId") - .HasConstraintName("fk_chat_rooms_files_picture_id"); - - b.HasOne("DysonNetwork.Sphere.Realm.Realm", "Realm") - .WithMany("ChatRooms") - .HasForeignKey("RealmId") - .HasConstraintName("fk_chat_rooms_realms_realm_id"); - - b.Navigation("Background"); - - b.Navigation("Picture"); - - b.Navigation("Realm"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Chat.Message", b => - { - b.HasOne("DysonNetwork.Sphere.Chat.ChatRoom", "ChatRoom") - .WithMany() - .HasForeignKey("ChatRoomId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_chat_messages_chat_rooms_chat_room_id"); - - b.HasOne("DysonNetwork.Sphere.Chat.Message", "ForwardedMessage") - .WithMany() - .HasForeignKey("ForwardedMessageId") - .OnDelete(DeleteBehavior.Restrict) - .HasConstraintName("fk_chat_messages_chat_messages_forwarded_message_id"); - - b.HasOne("DysonNetwork.Sphere.Chat.Message", "RepliedMessage") - .WithMany() - .HasForeignKey("RepliedMessageId") - .OnDelete(DeleteBehavior.Restrict) - .HasConstraintName("fk_chat_messages_chat_messages_replied_message_id"); - - b.HasOne("DysonNetwork.Sphere.Chat.ChatMember", "Sender") - .WithMany() - .HasForeignKey("SenderId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_chat_messages_chat_members_sender_id"); - - b.Navigation("ChatRoom"); - - b.Navigation("ForwardedMessage"); - - b.Navigation("RepliedMessage"); - - b.Navigation("Sender"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Chat.MessageReaction", b => - { - b.HasOne("DysonNetwork.Sphere.Chat.Message", "Message") - .WithMany("Reactions") - .HasForeignKey("MessageId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_chat_reactions_chat_messages_message_id"); - - b.HasOne("DysonNetwork.Sphere.Chat.ChatMember", "Sender") - .WithMany() - .HasForeignKey("SenderId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_chat_reactions_chat_members_sender_id"); - - b.Navigation("Message"); - - b.Navigation("Sender"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Chat.MessageStatus", b => - { - b.HasOne("DysonNetwork.Sphere.Chat.Message", "Message") - .WithMany("Statuses") - .HasForeignKey("MessageId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_chat_statuses_chat_messages_message_id"); - - b.HasOne("DysonNetwork.Sphere.Chat.ChatMember", "Sender") - .WithMany() - .HasForeignKey("SenderId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_chat_statuses_chat_members_sender_id"); - - b.Navigation("Message"); - - b.Navigation("Sender"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Permission.PermissionGroupMember", b => - { - b.HasOne("DysonNetwork.Sphere.Permission.PermissionGroup", "Group") - .WithMany("Members") - .HasForeignKey("GroupId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_permission_group_members_permission_groups_group_id"); - - b.Navigation("Group"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Permission.PermissionNode", b => - { - b.HasOne("DysonNetwork.Sphere.Permission.PermissionGroup", "Group") - .WithMany("Nodes") - .HasForeignKey("GroupId") - .HasConstraintName("fk_permission_nodes_permission_groups_group_id"); - - b.Navigation("Group"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Post.Post", b => - { - b.HasOne("DysonNetwork.Sphere.Post.Post", "ForwardedPost") - .WithMany() - .HasForeignKey("ForwardedPostId") - .OnDelete(DeleteBehavior.Restrict) - .HasConstraintName("fk_posts_posts_forwarded_post_id"); - - b.HasOne("DysonNetwork.Sphere.Post.Publisher", "Publisher") - .WithMany("Posts") - .HasForeignKey("PublisherId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_posts_publishers_publisher_id"); - - b.HasOne("DysonNetwork.Sphere.Post.Post", "RepliedPost") - .WithMany() - .HasForeignKey("RepliedPostId") - .OnDelete(DeleteBehavior.Restrict) - .HasConstraintName("fk_posts_posts_replied_post_id"); - - b.HasOne("DysonNetwork.Sphere.Post.Post", "ThreadedPost") - .WithOne() - .HasForeignKey("DysonNetwork.Sphere.Post.Post", "ThreadedPostId") - .HasConstraintName("fk_posts_posts_threaded_post_id"); - - b.Navigation("ForwardedPost"); - - b.Navigation("Publisher"); - - b.Navigation("RepliedPost"); - - b.Navigation("ThreadedPost"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Post.PostCollection", b => - { - b.HasOne("DysonNetwork.Sphere.Post.Publisher", "Publisher") - .WithMany("Collections") - .HasForeignKey("PublisherId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_post_collections_publishers_publisher_id"); - - b.Navigation("Publisher"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Post.PostReaction", b => - { - b.HasOne("DysonNetwork.Sphere.Account.Account", "Account") - .WithMany() - .HasForeignKey("AccountId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_post_reactions_accounts_account_id"); - - b.HasOne("DysonNetwork.Sphere.Post.Post", "Post") - .WithMany("Reactions") - .HasForeignKey("PostId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_post_reactions_posts_post_id"); - - b.Navigation("Account"); - - b.Navigation("Post"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Post.Publisher", b => - { - b.HasOne("DysonNetwork.Sphere.Account.Account", "Account") - .WithMany() - .HasForeignKey("AccountId") - .HasConstraintName("fk_publishers_accounts_account_id"); - - b.HasOne("DysonNetwork.Sphere.Storage.CloudFile", "Background") - .WithMany() - .HasForeignKey("BackgroundId") - .HasConstraintName("fk_publishers_files_background_id"); - - b.HasOne("DysonNetwork.Sphere.Storage.CloudFile", "Picture") - .WithMany() - .HasForeignKey("PictureId") - .HasConstraintName("fk_publishers_files_picture_id"); - - b.Navigation("Account"); - - b.Navigation("Background"); - - b.Navigation("Picture"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Post.PublisherMember", b => - { - b.HasOne("DysonNetwork.Sphere.Account.Account", "Account") - .WithMany() - .HasForeignKey("AccountId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_publisher_members_accounts_account_id"); - - b.HasOne("DysonNetwork.Sphere.Post.Publisher", "Publisher") - .WithMany("Members") - .HasForeignKey("PublisherId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_publisher_members_publishers_publisher_id"); - - b.Navigation("Account"); - - b.Navigation("Publisher"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Realm.Realm", b => - { - b.HasOne("DysonNetwork.Sphere.Account.Account", "Account") - .WithMany() - .HasForeignKey("AccountId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_realms_accounts_account_id"); - - b.HasOne("DysonNetwork.Sphere.Storage.CloudFile", "Background") - .WithMany() - .HasForeignKey("BackgroundId") - .HasConstraintName("fk_realms_files_background_id"); - - b.HasOne("DysonNetwork.Sphere.Storage.CloudFile", "Picture") - .WithMany() - .HasForeignKey("PictureId") - .HasConstraintName("fk_realms_files_picture_id"); - - b.Navigation("Account"); - - b.Navigation("Background"); - - b.Navigation("Picture"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Realm.RealmMember", b => - { - b.HasOne("DysonNetwork.Sphere.Account.Account", "Account") - .WithMany() - .HasForeignKey("AccountId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_realm_members_accounts_account_id"); - - b.HasOne("DysonNetwork.Sphere.Realm.Realm", "Realm") - .WithMany("Members") - .HasForeignKey("RealmId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_realm_members_realms_realm_id"); - - b.Navigation("Account"); - - b.Navigation("Realm"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Storage.CloudFile", b => - { - b.HasOne("DysonNetwork.Sphere.Account.Account", "Account") - .WithMany() - .HasForeignKey("AccountId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_files_accounts_account_id"); - - b.HasOne("DysonNetwork.Sphere.Chat.Message", null) - .WithMany("Attachments") - .HasForeignKey("MessageId") - .HasConstraintName("fk_files_chat_messages_message_id"); - - b.HasOne("DysonNetwork.Sphere.Post.Post", null) - .WithMany("Attachments") - .HasForeignKey("PostId") - .HasConstraintName("fk_files_posts_post_id"); - - b.Navigation("Account"); - }); - - modelBuilder.Entity("PostPostCategory", b => - { - b.HasOne("DysonNetwork.Sphere.Post.PostCategory", null) - .WithMany() - .HasForeignKey("CategoriesId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_post_category_links_post_categories_categories_id"); - - b.HasOne("DysonNetwork.Sphere.Post.Post", null) - .WithMany() - .HasForeignKey("PostsId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_post_category_links_posts_posts_id"); - }); - - modelBuilder.Entity("PostPostCollection", b => - { - b.HasOne("DysonNetwork.Sphere.Post.PostCollection", null) - .WithMany() - .HasForeignKey("CollectionsId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_post_collection_links_post_collections_collections_id"); - - b.HasOne("DysonNetwork.Sphere.Post.Post", null) - .WithMany() - .HasForeignKey("PostsId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_post_collection_links_posts_posts_id"); - }); - - modelBuilder.Entity("PostPostTag", b => - { - b.HasOne("DysonNetwork.Sphere.Post.Post", null) - .WithMany() - .HasForeignKey("PostsId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_post_tag_links_posts_posts_id"); - - b.HasOne("DysonNetwork.Sphere.Post.PostTag", null) - .WithMany() - .HasForeignKey("TagsId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_post_tag_links_post_tags_tags_id"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Account.Account", b => - { - b.Navigation("AuthFactors"); - - b.Navigation("Challenges"); - - b.Navigation("Contacts"); - - b.Navigation("IncomingRelationships"); - - b.Navigation("OutgoingRelationships"); - - b.Navigation("Profile") - .IsRequired(); - - b.Navigation("Sessions"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Chat.ChatRoom", b => - { - b.Navigation("Members"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Chat.Message", b => - { - b.Navigation("Attachments"); - - b.Navigation("Reactions"); - - b.Navigation("Statuses"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Permission.PermissionGroup", b => - { - b.Navigation("Members"); - - b.Navigation("Nodes"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Post.Post", b => - { - b.Navigation("Attachments"); - - b.Navigation("Reactions"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Post.Publisher", b => - { - b.Navigation("Collections"); - - b.Navigation("Members"); - - b.Navigation("Posts"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Realm.Realm", b => - { - b.Navigation("ChatRooms"); - - b.Navigation("Members"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/DysonNetwork.Sphere/Migrations/20250505050854_NoIdeaHowToNameThis.cs b/DysonNetwork.Sphere/Migrations/20250505050854_NoIdeaHowToNameThis.cs deleted file mode 100644 index 0e1d296..0000000 --- a/DysonNetwork.Sphere/Migrations/20250505050854_NoIdeaHowToNameThis.cs +++ /dev/null @@ -1,112 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace DysonNetwork.Sphere.Migrations -{ - /// - public partial class NoIdeaHowToNameThis : Migration - { - /// - 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); - } - - /// - 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); - } - } -} diff --git a/DysonNetwork.Sphere/Migrations/20250506164731_AddChatRealtimeCall.Designer.cs b/DysonNetwork.Sphere/Migrations/20250506164731_AddChatRealtimeCall.Designer.cs deleted file mode 100644 index 97e4875..0000000 --- a/DysonNetwork.Sphere/Migrations/20250506164731_AddChatRealtimeCall.Designer.cs +++ /dev/null @@ -1,2435 +0,0 @@ -// -using System; -using System.Collections.Generic; -using System.Text.Json; -using DysonNetwork.Sphere; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using NodaTime; -using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; -using NpgsqlTypes; - -#nullable disable - -namespace DysonNetwork.Sphere.Migrations -{ - [DbContext(typeof(AppDatabase))] - [Migration("20250506164731_AddChatRealtimeCall")] - partial class AddChatRealtimeCall - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "9.0.3") - .HasAnnotation("Relational:MaxIdentifierLength", 63); - - NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); - - modelBuilder.Entity("DysonNetwork.Sphere.Account.Account", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ActivatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("activated_at"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property("IsSuperuser") - .HasColumnType("boolean") - .HasColumnName("is_superuser"); - - b.Property("Language") - .IsRequired() - .HasMaxLength(32) - .HasColumnType("character varying(32)") - .HasColumnName("language"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(256) - .HasColumnType("character varying(256)") - .HasColumnName("name"); - - b.Property("Nick") - .IsRequired() - .HasMaxLength(256) - .HasColumnType("character varying(256)") - .HasColumnName("nick"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.HasKey("Id") - .HasName("pk_accounts"); - - b.HasIndex("Name") - .IsUnique() - .HasDatabaseName("ix_accounts_name"); - - b.ToTable("accounts", (string)null); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Account.AccountAuthFactor", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AccountId") - .HasColumnType("bigint") - .HasColumnName("account_id"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property("Secret") - .HasColumnType("text") - .HasColumnName("secret"); - - b.Property("Type") - .HasColumnType("integer") - .HasColumnName("type"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.HasKey("Id") - .HasName("pk_account_auth_factors"); - - b.HasIndex("AccountId") - .HasDatabaseName("ix_account_auth_factors_account_id"); - - b.ToTable("account_auth_factors", (string)null); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Account.AccountContact", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AccountId") - .HasColumnType("bigint") - .HasColumnName("account_id"); - - b.Property("Content") - .IsRequired() - .HasMaxLength(1024) - .HasColumnType("character varying(1024)") - .HasColumnName("content"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property("Type") - .HasColumnType("integer") - .HasColumnName("type"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.Property("VerifiedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("verified_at"); - - b.HasKey("Id") - .HasName("pk_account_contacts"); - - b.HasIndex("AccountId") - .HasDatabaseName("ix_account_contacts_account_id"); - - b.ToTable("account_contacts", (string)null); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Account.MagicSpell", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uuid") - .HasColumnName("id"); - - b.Property("AccountId") - .HasColumnType("bigint") - .HasColumnName("account_id"); - - b.Property("AffectedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("affected_at"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property("ExpiresAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("expires_at"); - - b.Property>("Meta") - .IsRequired() - .HasColumnType("jsonb") - .HasColumnName("meta"); - - b.Property("Spell") - .IsRequired() - .HasMaxLength(1024) - .HasColumnType("character varying(1024)") - .HasColumnName("spell"); - - b.Property("Type") - .HasColumnType("integer") - .HasColumnName("type"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.HasKey("Id") - .HasName("pk_magic_spells"); - - b.HasIndex("AccountId") - .HasDatabaseName("ix_magic_spells_account_id"); - - b.HasIndex("Spell") - .IsUnique() - .HasDatabaseName("ix_magic_spells_spell"); - - b.ToTable("magic_spells", (string)null); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Account.Notification", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uuid") - .HasColumnName("id"); - - b.Property("AccountId") - .HasColumnType("bigint") - .HasColumnName("account_id"); - - b.Property("Content") - .HasMaxLength(4096) - .HasColumnType("character varying(4096)") - .HasColumnName("content"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property>("Meta") - .HasColumnType("jsonb") - .HasColumnName("meta"); - - b.Property("Priority") - .HasColumnType("integer") - .HasColumnName("priority"); - - b.Property("Subtitle") - .HasMaxLength(2048) - .HasColumnType("character varying(2048)") - .HasColumnName("subtitle"); - - b.Property("Title") - .HasMaxLength(1024) - .HasColumnType("character varying(1024)") - .HasColumnName("title"); - - b.Property("Topic") - .IsRequired() - .HasMaxLength(1024) - .HasColumnType("character varying(1024)") - .HasColumnName("topic"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.Property("ViewedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("viewed_at"); - - b.HasKey("Id") - .HasName("pk_notifications"); - - b.HasIndex("AccountId") - .HasDatabaseName("ix_notifications_account_id"); - - b.ToTable("notifications", (string)null); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Account.NotificationPushSubscription", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uuid") - .HasColumnName("id"); - - b.Property("AccountId") - .HasColumnType("bigint") - .HasColumnName("account_id"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property("DeviceId") - .IsRequired() - .HasMaxLength(4096) - .HasColumnType("character varying(4096)") - .HasColumnName("device_id"); - - b.Property("DeviceToken") - .IsRequired() - .HasMaxLength(4096) - .HasColumnType("character varying(4096)") - .HasColumnName("device_token"); - - b.Property("LastUsedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("last_used_at"); - - b.Property("Provider") - .HasColumnType("integer") - .HasColumnName("provider"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.HasKey("Id") - .HasName("pk_notification_push_subscriptions"); - - b.HasIndex("AccountId") - .HasDatabaseName("ix_notification_push_subscriptions_account_id"); - - b.HasIndex("DeviceId") - .IsUnique() - .HasDatabaseName("ix_notification_push_subscriptions_device_id"); - - b.HasIndex("DeviceToken") - .IsUnique() - .HasDatabaseName("ix_notification_push_subscriptions_device_token"); - - b.ToTable("notification_push_subscriptions", (string)null); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Account.Profile", b => - { - b.Property("Id") - .HasColumnType("bigint") - .HasColumnName("id"); - - b.Property("BackgroundId") - .HasColumnType("character varying(128)") - .HasColumnName("background_id"); - - b.Property("Bio") - .HasMaxLength(4096) - .HasColumnType("character varying(4096)") - .HasColumnName("bio"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property("FirstName") - .HasMaxLength(256) - .HasColumnType("character varying(256)") - .HasColumnName("first_name"); - - b.Property("LastName") - .HasMaxLength(256) - .HasColumnType("character varying(256)") - .HasColumnName("last_name"); - - b.Property("MiddleName") - .HasMaxLength(256) - .HasColumnType("character varying(256)") - .HasColumnName("middle_name"); - - b.Property("PictureId") - .HasColumnType("character varying(128)") - .HasColumnName("picture_id"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.HasKey("Id") - .HasName("pk_account_profiles"); - - b.HasIndex("BackgroundId") - .HasDatabaseName("ix_account_profiles_background_id"); - - b.HasIndex("PictureId") - .HasDatabaseName("ix_account_profiles_picture_id"); - - b.ToTable("account_profiles", (string)null); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Account.Relationship", b => - { - b.Property("AccountId") - .HasColumnType("bigint") - .HasColumnName("account_id"); - - b.Property("RelatedId") - .HasColumnType("bigint") - .HasColumnName("related_id"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property("ExpiredAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("expired_at"); - - b.Property("Status") - .HasColumnType("integer") - .HasColumnName("status"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.HasKey("AccountId", "RelatedId") - .HasName("pk_account_relationships"); - - b.HasIndex("RelatedId") - .HasDatabaseName("ix_account_relationships_related_id"); - - b.ToTable("account_relationships", (string)null); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Activity.Activity", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uuid") - .HasColumnName("id"); - - b.Property("AccountId") - .HasColumnType("bigint") - .HasColumnName("account_id"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property("ResourceIdentifier") - .IsRequired() - .HasMaxLength(4096) - .HasColumnType("character varying(4096)") - .HasColumnName("resource_identifier"); - - b.Property("Type") - .IsRequired() - .HasMaxLength(1024) - .HasColumnType("character varying(1024)") - .HasColumnName("type"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.Property("Visibility") - .HasColumnType("integer") - .HasColumnName("visibility"); - - b.HasKey("Id") - .HasName("pk_activities"); - - b.HasIndex("AccountId") - .HasDatabaseName("ix_activities_account_id"); - - b.ToTable("activities", (string)null); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Auth.Challenge", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uuid") - .HasColumnName("id"); - - b.Property("AccountId") - .HasColumnType("bigint") - .HasColumnName("account_id"); - - b.Property>("Audiences") - .IsRequired() - .HasColumnType("jsonb") - .HasColumnName("audiences"); - - b.Property>("BlacklistFactors") - .IsRequired() - .HasColumnType("jsonb") - .HasColumnName("blacklist_factors"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property("DeviceId") - .HasMaxLength(256) - .HasColumnType("character varying(256)") - .HasColumnName("device_id"); - - b.Property("ExpiredAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("expired_at"); - - b.Property("FailedAttempts") - .HasColumnType("integer") - .HasColumnName("failed_attempts"); - - b.Property("IpAddress") - .HasMaxLength(128) - .HasColumnType("character varying(128)") - .HasColumnName("ip_address"); - - b.Property("Nonce") - .HasMaxLength(1024) - .HasColumnType("character varying(1024)") - .HasColumnName("nonce"); - - b.Property("Platform") - .HasColumnType("integer") - .HasColumnName("platform"); - - b.Property>("Scopes") - .IsRequired() - .HasColumnType("jsonb") - .HasColumnName("scopes"); - - b.Property("StepRemain") - .HasColumnType("integer") - .HasColumnName("step_remain"); - - b.Property("StepTotal") - .HasColumnType("integer") - .HasColumnName("step_total"); - - b.Property("Type") - .HasColumnType("integer") - .HasColumnName("type"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.Property("UserAgent") - .HasMaxLength(512) - .HasColumnType("character varying(512)") - .HasColumnName("user_agent"); - - b.HasKey("Id") - .HasName("pk_auth_challenges"); - - b.HasIndex("AccountId") - .HasDatabaseName("ix_auth_challenges_account_id"); - - b.ToTable("auth_challenges", (string)null); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Auth.Session", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uuid") - .HasColumnName("id"); - - b.Property("AccountId") - .HasColumnType("bigint") - .HasColumnName("account_id"); - - b.Property("ChallengeId") - .HasColumnType("uuid") - .HasColumnName("challenge_id"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property("ExpiredAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("expired_at"); - - b.Property("Label") - .HasMaxLength(1024) - .HasColumnType("character varying(1024)") - .HasColumnName("label"); - - b.Property("LastGrantedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("last_granted_at"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.HasKey("Id") - .HasName("pk_auth_sessions"); - - b.HasIndex("AccountId") - .HasDatabaseName("ix_auth_sessions_account_id"); - - b.HasIndex("ChallengeId") - .HasDatabaseName("ix_auth_sessions_challenge_id"); - - b.ToTable("auth_sessions", (string)null); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Chat.ChatMember", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uuid") - .HasColumnName("id"); - - b.Property("AccountId") - .HasColumnType("bigint") - .HasColumnName("account_id"); - - b.Property("ChatRoomId") - .HasColumnType("bigint") - .HasColumnName("chat_room_id"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property("IsBot") - .HasColumnType("boolean") - .HasColumnName("is_bot"); - - b.Property("JoinedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("joined_at"); - - b.Property("Nick") - .HasMaxLength(1024) - .HasColumnType("character varying(1024)") - .HasColumnName("nick"); - - b.Property("Notify") - .HasColumnType("integer") - .HasColumnName("notify"); - - b.Property("Role") - .HasColumnType("integer") - .HasColumnName("role"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.HasKey("Id") - .HasName("pk_chat_members"); - - b.HasAlternateKey("ChatRoomId", "AccountId") - .HasName("ak_chat_members_chat_room_id_account_id"); - - b.HasIndex("AccountId") - .HasDatabaseName("ix_chat_members_account_id"); - - b.ToTable("chat_members", (string)null); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Chat.ChatRoom", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("BackgroundId") - .HasColumnType("character varying(128)") - .HasColumnName("background_id"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property("Description") - .IsRequired() - .HasMaxLength(4096) - .HasColumnType("character varying(4096)") - .HasColumnName("description"); - - b.Property("IsPublic") - .HasColumnType("boolean") - .HasColumnName("is_public"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(1024) - .HasColumnType("character varying(1024)") - .HasColumnName("name"); - - b.Property("PictureId") - .HasColumnType("character varying(128)") - .HasColumnName("picture_id"); - - b.Property("RealmId") - .HasColumnType("bigint") - .HasColumnName("realm_id"); - - b.Property("Type") - .HasColumnType("integer") - .HasColumnName("type"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.HasKey("Id") - .HasName("pk_chat_rooms"); - - b.HasIndex("BackgroundId") - .HasDatabaseName("ix_chat_rooms_background_id"); - - b.HasIndex("PictureId") - .HasDatabaseName("ix_chat_rooms_picture_id"); - - b.HasIndex("RealmId") - .HasDatabaseName("ix_chat_rooms_realm_id"); - - b.ToTable("chat_rooms", (string)null); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Chat.Message", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uuid") - .HasColumnName("id"); - - b.Property("ChatRoomId") - .HasColumnType("bigint") - .HasColumnName("chat_room_id"); - - b.Property("Content") - .HasMaxLength(4096) - .HasColumnType("character varying(4096)") - .HasColumnName("content"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property("EditedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("edited_at"); - - b.Property("ForwardedMessageId") - .HasColumnType("uuid") - .HasColumnName("forwarded_message_id"); - - b.Property>("MembersMentioned") - .HasColumnType("jsonb") - .HasColumnName("members_mentioned"); - - b.Property>("Meta") - .HasColumnType("jsonb") - .HasColumnName("meta"); - - b.Property("Nonce") - .IsRequired() - .HasMaxLength(36) - .HasColumnType("character varying(36)") - .HasColumnName("nonce"); - - b.Property("RepliedMessageId") - .HasColumnType("uuid") - .HasColumnName("replied_message_id"); - - b.Property("SenderId") - .HasColumnType("uuid") - .HasColumnName("sender_id"); - - b.Property("Type") - .IsRequired() - .HasColumnType("text") - .HasColumnName("type"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.HasKey("Id") - .HasName("pk_chat_messages"); - - b.HasIndex("ChatRoomId") - .HasDatabaseName("ix_chat_messages_chat_room_id"); - - b.HasIndex("ForwardedMessageId") - .HasDatabaseName("ix_chat_messages_forwarded_message_id"); - - b.HasIndex("RepliedMessageId") - .HasDatabaseName("ix_chat_messages_replied_message_id"); - - b.HasIndex("SenderId") - .HasDatabaseName("ix_chat_messages_sender_id"); - - b.ToTable("chat_messages", (string)null); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Chat.MessageReaction", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uuid") - .HasColumnName("id"); - - b.Property("Attitude") - .HasColumnType("integer") - .HasColumnName("attitude"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property("MessageId") - .HasColumnType("uuid") - .HasColumnName("message_id"); - - b.Property("SenderId") - .HasColumnType("uuid") - .HasColumnName("sender_id"); - - b.Property("Symbol") - .IsRequired() - .HasMaxLength(256) - .HasColumnType("character varying(256)") - .HasColumnName("symbol"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.HasKey("Id") - .HasName("pk_chat_reactions"); - - b.HasIndex("MessageId") - .HasDatabaseName("ix_chat_reactions_message_id"); - - b.HasIndex("SenderId") - .HasDatabaseName("ix_chat_reactions_sender_id"); - - b.ToTable("chat_reactions", (string)null); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Chat.MessageStatus", b => - { - b.Property("MessageId") - .HasColumnType("uuid") - .HasColumnName("message_id"); - - b.Property("SenderId") - .HasColumnType("uuid") - .HasColumnName("sender_id"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property("ReadAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("read_at"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.HasKey("MessageId", "SenderId") - .HasName("pk_chat_statuses"); - - b.HasIndex("SenderId") - .HasDatabaseName("ix_chat_statuses_sender_id"); - - b.ToTable("chat_statuses", (string)null); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Chat.RealtimeCall", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uuid") - .HasColumnName("id"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property("EndedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("ended_at"); - - b.Property("RoomId") - .HasColumnType("bigint") - .HasColumnName("room_id"); - - b.Property("SenderId") - .HasColumnType("uuid") - .HasColumnName("sender_id"); - - b.Property("Title") - .HasColumnType("text") - .HasColumnName("title"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.HasKey("Id") - .HasName("pk_chat_realtime_call"); - - b.HasIndex("RoomId") - .HasDatabaseName("ix_chat_realtime_call_room_id"); - - b.HasIndex("SenderId") - .HasDatabaseName("ix_chat_realtime_call_sender_id"); - - b.ToTable("chat_realtime_call", (string)null); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Permission.PermissionGroup", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uuid") - .HasColumnName("id"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property("Key") - .IsRequired() - .HasMaxLength(1024) - .HasColumnType("character varying(1024)") - .HasColumnName("key"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.HasKey("Id") - .HasName("pk_permission_groups"); - - b.ToTable("permission_groups", (string)null); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Permission.PermissionGroupMember", b => - { - b.Property("GroupId") - .HasColumnType("uuid") - .HasColumnName("group_id"); - - b.Property("Actor") - .HasMaxLength(1024) - .HasColumnType("character varying(1024)") - .HasColumnName("actor"); - - b.Property("AffectedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("affected_at"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property("ExpiredAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("expired_at"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.HasKey("GroupId", "Actor") - .HasName("pk_permission_group_members"); - - b.ToTable("permission_group_members", (string)null); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Permission.PermissionNode", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uuid") - .HasColumnName("id"); - - b.Property("Actor") - .IsRequired() - .HasMaxLength(1024) - .HasColumnType("character varying(1024)") - .HasColumnName("actor"); - - b.Property("AffectedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("affected_at"); - - b.Property("Area") - .IsRequired() - .HasMaxLength(1024) - .HasColumnType("character varying(1024)") - .HasColumnName("area"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property("ExpiredAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("expired_at"); - - b.Property("GroupId") - .HasColumnType("uuid") - .HasColumnName("group_id"); - - b.Property("Key") - .IsRequired() - .HasMaxLength(1024) - .HasColumnType("character varying(1024)") - .HasColumnName("key"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.Property("Value") - .IsRequired() - .HasColumnType("jsonb") - .HasColumnName("value"); - - b.HasKey("Id") - .HasName("pk_permission_nodes"); - - b.HasIndex("GroupId") - .HasDatabaseName("ix_permission_nodes_group_id"); - - b.HasIndex("Key", "Area", "Actor") - .HasDatabaseName("ix_permission_nodes_key_area_actor"); - - b.ToTable("permission_nodes", (string)null); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Post.Post", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Content") - .HasColumnType("text") - .HasColumnName("content"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property("Description") - .HasMaxLength(4096) - .HasColumnType("character varying(4096)") - .HasColumnName("description"); - - b.Property("Downvotes") - .HasColumnType("integer") - .HasColumnName("downvotes"); - - b.Property("EditedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("edited_at"); - - b.Property("ForwardedPostId") - .HasColumnType("bigint") - .HasColumnName("forwarded_post_id"); - - b.Property("Language") - .HasMaxLength(128) - .HasColumnType("character varying(128)") - .HasColumnName("language"); - - b.Property>("Meta") - .HasColumnType("jsonb") - .HasColumnName("meta"); - - b.Property("PublishedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("published_at"); - - b.Property("PublisherId") - .HasColumnType("bigint") - .HasColumnName("publisher_id"); - - b.Property("RepliedPostId") - .HasColumnType("bigint") - .HasColumnName("replied_post_id"); - - b.Property("SearchVector") - .IsRequired() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("tsvector") - .HasColumnName("search_vector") - .HasAnnotation("Npgsql:TsVectorConfig", "simple") - .HasAnnotation("Npgsql:TsVectorProperties", new[] { "Title", "Description", "Content" }); - - b.Property("ThreadedPostId") - .HasColumnType("bigint") - .HasColumnName("threaded_post_id"); - - b.Property("Title") - .HasMaxLength(1024) - .HasColumnType("character varying(1024)") - .HasColumnName("title"); - - b.Property("Type") - .HasColumnType("integer") - .HasColumnName("type"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.Property("Upvotes") - .HasColumnType("integer") - .HasColumnName("upvotes"); - - b.Property("ViewsTotal") - .HasColumnType("integer") - .HasColumnName("views_total"); - - b.Property("ViewsUnique") - .HasColumnType("integer") - .HasColumnName("views_unique"); - - b.Property("Visibility") - .HasColumnType("integer") - .HasColumnName("visibility"); - - b.HasKey("Id") - .HasName("pk_posts"); - - b.HasIndex("ForwardedPostId") - .HasDatabaseName("ix_posts_forwarded_post_id"); - - b.HasIndex("PublisherId") - .HasDatabaseName("ix_posts_publisher_id"); - - b.HasIndex("RepliedPostId") - .HasDatabaseName("ix_posts_replied_post_id"); - - b.HasIndex("SearchVector") - .HasDatabaseName("ix_posts_search_vector"); - - NpgsqlIndexBuilderExtensions.HasMethod(b.HasIndex("SearchVector"), "GIN"); - - b.HasIndex("ThreadedPostId") - .IsUnique() - .HasDatabaseName("ix_posts_threaded_post_id"); - - b.ToTable("posts", (string)null); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Post.PostCategory", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property("Name") - .HasMaxLength(256) - .HasColumnType("character varying(256)") - .HasColumnName("name"); - - b.Property("Slug") - .IsRequired() - .HasMaxLength(128) - .HasColumnType("character varying(128)") - .HasColumnName("slug"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.HasKey("Id") - .HasName("pk_post_categories"); - - b.ToTable("post_categories", (string)null); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Post.PostCollection", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property("Description") - .HasMaxLength(4096) - .HasColumnType("character varying(4096)") - .HasColumnName("description"); - - b.Property("Name") - .HasMaxLength(256) - .HasColumnType("character varying(256)") - .HasColumnName("name"); - - b.Property("PublisherId") - .HasColumnType("bigint") - .HasColumnName("publisher_id"); - - b.Property("Slug") - .IsRequired() - .HasMaxLength(128) - .HasColumnType("character varying(128)") - .HasColumnName("slug"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.HasKey("Id") - .HasName("pk_post_collections"); - - b.HasIndex("PublisherId") - .HasDatabaseName("ix_post_collections_publisher_id"); - - b.ToTable("post_collections", (string)null); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Post.PostReaction", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AccountId") - .HasColumnType("bigint") - .HasColumnName("account_id"); - - b.Property("Attitude") - .HasColumnType("integer") - .HasColumnName("attitude"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property("PostId") - .HasColumnType("bigint") - .HasColumnName("post_id"); - - b.Property("Symbol") - .IsRequired() - .HasMaxLength(256) - .HasColumnType("character varying(256)") - .HasColumnName("symbol"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.HasKey("Id") - .HasName("pk_post_reactions"); - - b.HasIndex("AccountId") - .HasDatabaseName("ix_post_reactions_account_id"); - - b.HasIndex("PostId") - .HasDatabaseName("ix_post_reactions_post_id"); - - b.ToTable("post_reactions", (string)null); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Post.PostTag", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property("Name") - .HasMaxLength(256) - .HasColumnType("character varying(256)") - .HasColumnName("name"); - - b.Property("Slug") - .IsRequired() - .HasMaxLength(128) - .HasColumnType("character varying(128)") - .HasColumnName("slug"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.HasKey("Id") - .HasName("pk_post_tags"); - - b.ToTable("post_tags", (string)null); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Post.Publisher", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AccountId") - .HasColumnType("bigint") - .HasColumnName("account_id"); - - b.Property("BackgroundId") - .HasColumnType("character varying(128)") - .HasColumnName("background_id"); - - b.Property("Bio") - .HasMaxLength(4096) - .HasColumnType("character varying(4096)") - .HasColumnName("bio"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(256) - .HasColumnType("character varying(256)") - .HasColumnName("name"); - - b.Property("Nick") - .IsRequired() - .HasMaxLength(256) - .HasColumnType("character varying(256)") - .HasColumnName("nick"); - - b.Property("PictureId") - .HasColumnType("character varying(128)") - .HasColumnName("picture_id"); - - b.Property("PublisherType") - .HasColumnType("integer") - .HasColumnName("publisher_type"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.HasKey("Id") - .HasName("pk_publishers"); - - b.HasIndex("AccountId") - .HasDatabaseName("ix_publishers_account_id"); - - b.HasIndex("BackgroundId") - .HasDatabaseName("ix_publishers_background_id"); - - b.HasIndex("Name") - .IsUnique() - .HasDatabaseName("ix_publishers_name"); - - b.HasIndex("PictureId") - .HasDatabaseName("ix_publishers_picture_id"); - - b.ToTable("publishers", (string)null); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Post.PublisherMember", b => - { - b.Property("PublisherId") - .HasColumnType("bigint") - .HasColumnName("publisher_id"); - - b.Property("AccountId") - .HasColumnType("bigint") - .HasColumnName("account_id"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property("JoinedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("joined_at"); - - b.Property("Role") - .HasColumnType("integer") - .HasColumnName("role"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.HasKey("PublisherId", "AccountId") - .HasName("pk_publisher_members"); - - b.HasIndex("AccountId") - .HasDatabaseName("ix_publisher_members_account_id"); - - b.ToTable("publisher_members", (string)null); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Realm.Realm", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AccountId") - .HasColumnType("bigint") - .HasColumnName("account_id"); - - b.Property("BackgroundId") - .HasColumnType("character varying(128)") - .HasColumnName("background_id"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property("Description") - .IsRequired() - .HasMaxLength(4096) - .HasColumnType("character varying(4096)") - .HasColumnName("description"); - - b.Property("IsCommunity") - .HasColumnType("boolean") - .HasColumnName("is_community"); - - b.Property("IsPublic") - .HasColumnType("boolean") - .HasColumnName("is_public"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(1024) - .HasColumnType("character varying(1024)") - .HasColumnName("name"); - - b.Property("PictureId") - .HasColumnType("character varying(128)") - .HasColumnName("picture_id"); - - b.Property("Slug") - .IsRequired() - .HasMaxLength(1024) - .HasColumnType("character varying(1024)") - .HasColumnName("slug"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.Property("VerifiedAs") - .HasMaxLength(4096) - .HasColumnType("character varying(4096)") - .HasColumnName("verified_as"); - - b.Property("VerifiedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("verified_at"); - - b.HasKey("Id") - .HasName("pk_realms"); - - b.HasIndex("AccountId") - .HasDatabaseName("ix_realms_account_id"); - - b.HasIndex("BackgroundId") - .HasDatabaseName("ix_realms_background_id"); - - b.HasIndex("PictureId") - .HasDatabaseName("ix_realms_picture_id"); - - b.HasIndex("Slug") - .IsUnique() - .HasDatabaseName("ix_realms_slug"); - - b.ToTable("realms", (string)null); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Realm.RealmMember", b => - { - b.Property("RealmId") - .HasColumnType("bigint") - .HasColumnName("realm_id"); - - b.Property("AccountId") - .HasColumnType("bigint") - .HasColumnName("account_id"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property("JoinedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("joined_at"); - - b.Property("Role") - .HasColumnType("integer") - .HasColumnName("role"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.HasKey("RealmId", "AccountId") - .HasName("pk_realm_members"); - - b.HasIndex("AccountId") - .HasDatabaseName("ix_realm_members_account_id"); - - b.ToTable("realm_members", (string)null); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Storage.CloudFile", b => - { - b.Property("Id") - .HasMaxLength(128) - .HasColumnType("character varying(128)") - .HasColumnName("id"); - - b.Property("AccountId") - .HasColumnType("bigint") - .HasColumnName("account_id"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property("Description") - .HasMaxLength(4096) - .HasColumnType("character varying(4096)") - .HasColumnName("description"); - - b.Property("ExpiredAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("expired_at"); - - b.Property>("FileMeta") - .HasColumnType("jsonb") - .HasColumnName("file_meta"); - - b.Property("HasCompression") - .HasColumnType("boolean") - .HasColumnName("has_compression"); - - b.Property("Hash") - .HasMaxLength(256) - .HasColumnType("character varying(256)") - .HasColumnName("hash"); - - b.Property("MessageId") - .HasColumnType("uuid") - .HasColumnName("message_id"); - - b.Property("MimeType") - .HasMaxLength(256) - .HasColumnType("character varying(256)") - .HasColumnName("mime_type"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(1024) - .HasColumnType("character varying(1024)") - .HasColumnName("name"); - - b.Property("PostId") - .HasColumnType("bigint") - .HasColumnName("post_id"); - - b.Property("Size") - .HasColumnType("bigint") - .HasColumnName("size"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.Property("UploadedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("uploaded_at"); - - b.Property("UploadedTo") - .HasMaxLength(128) - .HasColumnType("character varying(128)") - .HasColumnName("uploaded_to"); - - b.Property("UsedCount") - .HasColumnType("integer") - .HasColumnName("used_count"); - - b.Property>("UserMeta") - .HasColumnType("jsonb") - .HasColumnName("user_meta"); - - b.HasKey("Id") - .HasName("pk_files"); - - b.HasIndex("AccountId") - .HasDatabaseName("ix_files_account_id"); - - b.HasIndex("MessageId") - .HasDatabaseName("ix_files_message_id"); - - b.HasIndex("PostId") - .HasDatabaseName("ix_files_post_id"); - - b.ToTable("files", (string)null); - }); - - modelBuilder.Entity("PostPostCategory", b => - { - b.Property("CategoriesId") - .HasColumnType("bigint") - .HasColumnName("categories_id"); - - b.Property("PostsId") - .HasColumnType("bigint") - .HasColumnName("posts_id"); - - b.HasKey("CategoriesId", "PostsId") - .HasName("pk_post_category_links"); - - b.HasIndex("PostsId") - .HasDatabaseName("ix_post_category_links_posts_id"); - - b.ToTable("post_category_links", (string)null); - }); - - modelBuilder.Entity("PostPostCollection", b => - { - b.Property("CollectionsId") - .HasColumnType("bigint") - .HasColumnName("collections_id"); - - b.Property("PostsId") - .HasColumnType("bigint") - .HasColumnName("posts_id"); - - b.HasKey("CollectionsId", "PostsId") - .HasName("pk_post_collection_links"); - - b.HasIndex("PostsId") - .HasDatabaseName("ix_post_collection_links_posts_id"); - - b.ToTable("post_collection_links", (string)null); - }); - - modelBuilder.Entity("PostPostTag", b => - { - b.Property("PostsId") - .HasColumnType("bigint") - .HasColumnName("posts_id"); - - b.Property("TagsId") - .HasColumnType("bigint") - .HasColumnName("tags_id"); - - b.HasKey("PostsId", "TagsId") - .HasName("pk_post_tag_links"); - - b.HasIndex("TagsId") - .HasDatabaseName("ix_post_tag_links_tags_id"); - - b.ToTable("post_tag_links", (string)null); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Account.AccountAuthFactor", b => - { - b.HasOne("DysonNetwork.Sphere.Account.Account", "Account") - .WithMany("AuthFactors") - .HasForeignKey("AccountId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_account_auth_factors_accounts_account_id"); - - b.Navigation("Account"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Account.AccountContact", b => - { - b.HasOne("DysonNetwork.Sphere.Account.Account", "Account") - .WithMany("Contacts") - .HasForeignKey("AccountId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_account_contacts_accounts_account_id"); - - b.Navigation("Account"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Account.MagicSpell", b => - { - b.HasOne("DysonNetwork.Sphere.Account.Account", "Account") - .WithMany() - .HasForeignKey("AccountId") - .HasConstraintName("fk_magic_spells_accounts_account_id"); - - b.Navigation("Account"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Account.Notification", b => - { - b.HasOne("DysonNetwork.Sphere.Account.Account", "Account") - .WithMany() - .HasForeignKey("AccountId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_notifications_accounts_account_id"); - - b.Navigation("Account"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Account.NotificationPushSubscription", b => - { - b.HasOne("DysonNetwork.Sphere.Account.Account", "Account") - .WithMany() - .HasForeignKey("AccountId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_notification_push_subscriptions_accounts_account_id"); - - b.Navigation("Account"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Account.Profile", b => - { - b.HasOne("DysonNetwork.Sphere.Storage.CloudFile", "Background") - .WithMany() - .HasForeignKey("BackgroundId") - .HasConstraintName("fk_account_profiles_files_background_id"); - - b.HasOne("DysonNetwork.Sphere.Account.Account", "Account") - .WithOne("Profile") - .HasForeignKey("DysonNetwork.Sphere.Account.Profile", "Id") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_account_profiles_accounts_id"); - - b.HasOne("DysonNetwork.Sphere.Storage.CloudFile", "Picture") - .WithMany() - .HasForeignKey("PictureId") - .HasConstraintName("fk_account_profiles_files_picture_id"); - - b.Navigation("Account"); - - b.Navigation("Background"); - - b.Navigation("Picture"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Account.Relationship", b => - { - b.HasOne("DysonNetwork.Sphere.Account.Account", "Account") - .WithMany("OutgoingRelationships") - .HasForeignKey("AccountId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_account_relationships_accounts_account_id"); - - b.HasOne("DysonNetwork.Sphere.Account.Account", "Related") - .WithMany("IncomingRelationships") - .HasForeignKey("RelatedId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_account_relationships_accounts_related_id"); - - b.Navigation("Account"); - - b.Navigation("Related"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Activity.Activity", b => - { - b.HasOne("DysonNetwork.Sphere.Account.Account", "Account") - .WithMany() - .HasForeignKey("AccountId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_activities_accounts_account_id"); - - b.Navigation("Account"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Auth.Challenge", b => - { - b.HasOne("DysonNetwork.Sphere.Account.Account", "Account") - .WithMany("Challenges") - .HasForeignKey("AccountId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_auth_challenges_accounts_account_id"); - - b.Navigation("Account"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Auth.Session", b => - { - b.HasOne("DysonNetwork.Sphere.Account.Account", "Account") - .WithMany("Sessions") - .HasForeignKey("AccountId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_auth_sessions_accounts_account_id"); - - b.HasOne("DysonNetwork.Sphere.Auth.Challenge", "Challenge") - .WithMany() - .HasForeignKey("ChallengeId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_auth_sessions_auth_challenges_challenge_id"); - - b.Navigation("Account"); - - b.Navigation("Challenge"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Chat.ChatMember", b => - { - b.HasOne("DysonNetwork.Sphere.Account.Account", "Account") - .WithMany() - .HasForeignKey("AccountId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_chat_members_accounts_account_id"); - - b.HasOne("DysonNetwork.Sphere.Chat.ChatRoom", "ChatRoom") - .WithMany("Members") - .HasForeignKey("ChatRoomId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_chat_members_chat_rooms_chat_room_id"); - - b.Navigation("Account"); - - b.Navigation("ChatRoom"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Chat.ChatRoom", b => - { - b.HasOne("DysonNetwork.Sphere.Storage.CloudFile", "Background") - .WithMany() - .HasForeignKey("BackgroundId") - .HasConstraintName("fk_chat_rooms_files_background_id"); - - b.HasOne("DysonNetwork.Sphere.Storage.CloudFile", "Picture") - .WithMany() - .HasForeignKey("PictureId") - .HasConstraintName("fk_chat_rooms_files_picture_id"); - - b.HasOne("DysonNetwork.Sphere.Realm.Realm", "Realm") - .WithMany("ChatRooms") - .HasForeignKey("RealmId") - .HasConstraintName("fk_chat_rooms_realms_realm_id"); - - b.Navigation("Background"); - - b.Navigation("Picture"); - - b.Navigation("Realm"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Chat.Message", b => - { - b.HasOne("DysonNetwork.Sphere.Chat.ChatRoom", "ChatRoom") - .WithMany() - .HasForeignKey("ChatRoomId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_chat_messages_chat_rooms_chat_room_id"); - - b.HasOne("DysonNetwork.Sphere.Chat.Message", "ForwardedMessage") - .WithMany() - .HasForeignKey("ForwardedMessageId") - .OnDelete(DeleteBehavior.Restrict) - .HasConstraintName("fk_chat_messages_chat_messages_forwarded_message_id"); - - b.HasOne("DysonNetwork.Sphere.Chat.Message", "RepliedMessage") - .WithMany() - .HasForeignKey("RepliedMessageId") - .OnDelete(DeleteBehavior.Restrict) - .HasConstraintName("fk_chat_messages_chat_messages_replied_message_id"); - - b.HasOne("DysonNetwork.Sphere.Chat.ChatMember", "Sender") - .WithMany() - .HasForeignKey("SenderId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_chat_messages_chat_members_sender_id"); - - b.Navigation("ChatRoom"); - - b.Navigation("ForwardedMessage"); - - b.Navigation("RepliedMessage"); - - b.Navigation("Sender"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Chat.MessageReaction", b => - { - b.HasOne("DysonNetwork.Sphere.Chat.Message", "Message") - .WithMany("Reactions") - .HasForeignKey("MessageId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_chat_reactions_chat_messages_message_id"); - - b.HasOne("DysonNetwork.Sphere.Chat.ChatMember", "Sender") - .WithMany() - .HasForeignKey("SenderId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_chat_reactions_chat_members_sender_id"); - - b.Navigation("Message"); - - b.Navigation("Sender"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Chat.MessageStatus", b => - { - b.HasOne("DysonNetwork.Sphere.Chat.Message", "Message") - .WithMany("Statuses") - .HasForeignKey("MessageId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_chat_statuses_chat_messages_message_id"); - - b.HasOne("DysonNetwork.Sphere.Chat.ChatMember", "Sender") - .WithMany() - .HasForeignKey("SenderId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_chat_statuses_chat_members_sender_id"); - - b.Navigation("Message"); - - b.Navigation("Sender"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Chat.RealtimeCall", b => - { - b.HasOne("DysonNetwork.Sphere.Chat.ChatRoom", "Room") - .WithMany() - .HasForeignKey("RoomId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_chat_realtime_call_chat_rooms_room_id"); - - b.HasOne("DysonNetwork.Sphere.Chat.ChatMember", "Sender") - .WithMany() - .HasForeignKey("SenderId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_chat_realtime_call_chat_members_sender_id"); - - b.Navigation("Room"); - - b.Navigation("Sender"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Permission.PermissionGroupMember", b => - { - b.HasOne("DysonNetwork.Sphere.Permission.PermissionGroup", "Group") - .WithMany("Members") - .HasForeignKey("GroupId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_permission_group_members_permission_groups_group_id"); - - b.Navigation("Group"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Permission.PermissionNode", b => - { - b.HasOne("DysonNetwork.Sphere.Permission.PermissionGroup", "Group") - .WithMany("Nodes") - .HasForeignKey("GroupId") - .HasConstraintName("fk_permission_nodes_permission_groups_group_id"); - - b.Navigation("Group"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Post.Post", b => - { - b.HasOne("DysonNetwork.Sphere.Post.Post", "ForwardedPost") - .WithMany() - .HasForeignKey("ForwardedPostId") - .OnDelete(DeleteBehavior.Restrict) - .HasConstraintName("fk_posts_posts_forwarded_post_id"); - - b.HasOne("DysonNetwork.Sphere.Post.Publisher", "Publisher") - .WithMany("Posts") - .HasForeignKey("PublisherId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_posts_publishers_publisher_id"); - - b.HasOne("DysonNetwork.Sphere.Post.Post", "RepliedPost") - .WithMany() - .HasForeignKey("RepliedPostId") - .OnDelete(DeleteBehavior.Restrict) - .HasConstraintName("fk_posts_posts_replied_post_id"); - - b.HasOne("DysonNetwork.Sphere.Post.Post", "ThreadedPost") - .WithOne() - .HasForeignKey("DysonNetwork.Sphere.Post.Post", "ThreadedPostId") - .HasConstraintName("fk_posts_posts_threaded_post_id"); - - b.Navigation("ForwardedPost"); - - b.Navigation("Publisher"); - - b.Navigation("RepliedPost"); - - b.Navigation("ThreadedPost"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Post.PostCollection", b => - { - b.HasOne("DysonNetwork.Sphere.Post.Publisher", "Publisher") - .WithMany("Collections") - .HasForeignKey("PublisherId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_post_collections_publishers_publisher_id"); - - b.Navigation("Publisher"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Post.PostReaction", b => - { - b.HasOne("DysonNetwork.Sphere.Account.Account", "Account") - .WithMany() - .HasForeignKey("AccountId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_post_reactions_accounts_account_id"); - - b.HasOne("DysonNetwork.Sphere.Post.Post", "Post") - .WithMany("Reactions") - .HasForeignKey("PostId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_post_reactions_posts_post_id"); - - b.Navigation("Account"); - - b.Navigation("Post"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Post.Publisher", b => - { - b.HasOne("DysonNetwork.Sphere.Account.Account", "Account") - .WithMany() - .HasForeignKey("AccountId") - .HasConstraintName("fk_publishers_accounts_account_id"); - - b.HasOne("DysonNetwork.Sphere.Storage.CloudFile", "Background") - .WithMany() - .HasForeignKey("BackgroundId") - .HasConstraintName("fk_publishers_files_background_id"); - - b.HasOne("DysonNetwork.Sphere.Storage.CloudFile", "Picture") - .WithMany() - .HasForeignKey("PictureId") - .HasConstraintName("fk_publishers_files_picture_id"); - - b.Navigation("Account"); - - b.Navigation("Background"); - - b.Navigation("Picture"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Post.PublisherMember", b => - { - b.HasOne("DysonNetwork.Sphere.Account.Account", "Account") - .WithMany() - .HasForeignKey("AccountId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_publisher_members_accounts_account_id"); - - b.HasOne("DysonNetwork.Sphere.Post.Publisher", "Publisher") - .WithMany("Members") - .HasForeignKey("PublisherId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_publisher_members_publishers_publisher_id"); - - b.Navigation("Account"); - - b.Navigation("Publisher"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Realm.Realm", b => - { - b.HasOne("DysonNetwork.Sphere.Account.Account", "Account") - .WithMany() - .HasForeignKey("AccountId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_realms_accounts_account_id"); - - b.HasOne("DysonNetwork.Sphere.Storage.CloudFile", "Background") - .WithMany() - .HasForeignKey("BackgroundId") - .HasConstraintName("fk_realms_files_background_id"); - - b.HasOne("DysonNetwork.Sphere.Storage.CloudFile", "Picture") - .WithMany() - .HasForeignKey("PictureId") - .HasConstraintName("fk_realms_files_picture_id"); - - b.Navigation("Account"); - - b.Navigation("Background"); - - b.Navigation("Picture"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Realm.RealmMember", b => - { - b.HasOne("DysonNetwork.Sphere.Account.Account", "Account") - .WithMany() - .HasForeignKey("AccountId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_realm_members_accounts_account_id"); - - b.HasOne("DysonNetwork.Sphere.Realm.Realm", "Realm") - .WithMany("Members") - .HasForeignKey("RealmId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_realm_members_realms_realm_id"); - - b.Navigation("Account"); - - b.Navigation("Realm"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Storage.CloudFile", b => - { - b.HasOne("DysonNetwork.Sphere.Account.Account", "Account") - .WithMany() - .HasForeignKey("AccountId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_files_accounts_account_id"); - - b.HasOne("DysonNetwork.Sphere.Chat.Message", null) - .WithMany("Attachments") - .HasForeignKey("MessageId") - .HasConstraintName("fk_files_chat_messages_message_id"); - - b.HasOne("DysonNetwork.Sphere.Post.Post", null) - .WithMany("Attachments") - .HasForeignKey("PostId") - .HasConstraintName("fk_files_posts_post_id"); - - b.Navigation("Account"); - }); - - modelBuilder.Entity("PostPostCategory", b => - { - b.HasOne("DysonNetwork.Sphere.Post.PostCategory", null) - .WithMany() - .HasForeignKey("CategoriesId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_post_category_links_post_categories_categories_id"); - - b.HasOne("DysonNetwork.Sphere.Post.Post", null) - .WithMany() - .HasForeignKey("PostsId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_post_category_links_posts_posts_id"); - }); - - modelBuilder.Entity("PostPostCollection", b => - { - b.HasOne("DysonNetwork.Sphere.Post.PostCollection", null) - .WithMany() - .HasForeignKey("CollectionsId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_post_collection_links_post_collections_collections_id"); - - b.HasOne("DysonNetwork.Sphere.Post.Post", null) - .WithMany() - .HasForeignKey("PostsId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_post_collection_links_posts_posts_id"); - }); - - modelBuilder.Entity("PostPostTag", b => - { - b.HasOne("DysonNetwork.Sphere.Post.Post", null) - .WithMany() - .HasForeignKey("PostsId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_post_tag_links_posts_posts_id"); - - b.HasOne("DysonNetwork.Sphere.Post.PostTag", null) - .WithMany() - .HasForeignKey("TagsId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_post_tag_links_post_tags_tags_id"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Account.Account", b => - { - b.Navigation("AuthFactors"); - - b.Navigation("Challenges"); - - b.Navigation("Contacts"); - - b.Navigation("IncomingRelationships"); - - b.Navigation("OutgoingRelationships"); - - b.Navigation("Profile") - .IsRequired(); - - b.Navigation("Sessions"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Chat.ChatRoom", b => - { - b.Navigation("Members"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Chat.Message", b => - { - b.Navigation("Attachments"); - - b.Navigation("Reactions"); - - b.Navigation("Statuses"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Permission.PermissionGroup", b => - { - b.Navigation("Members"); - - b.Navigation("Nodes"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Post.Post", b => - { - b.Navigation("Attachments"); - - b.Navigation("Reactions"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Post.Publisher", b => - { - b.Navigation("Collections"); - - b.Navigation("Members"); - - b.Navigation("Posts"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Realm.Realm", b => - { - b.Navigation("ChatRooms"); - - b.Navigation("Members"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/DysonNetwork.Sphere/Migrations/20250506164731_AddChatRealtimeCall.cs b/DysonNetwork.Sphere/Migrations/20250506164731_AddChatRealtimeCall.cs deleted file mode 100644 index af9af1e..0000000 --- a/DysonNetwork.Sphere/Migrations/20250506164731_AddChatRealtimeCall.cs +++ /dev/null @@ -1,96 +0,0 @@ -using System; -using Microsoft.EntityFrameworkCore.Migrations; -using NodaTime; - -#nullable disable - -namespace DysonNetwork.Sphere.Migrations -{ - /// - public partial class AddChatRealtimeCall : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.AlterColumn( - name: "content", - table: "chat_messages", - type: "character varying(4096)", - maxLength: 4096, - nullable: true, - oldClrType: typeof(string), - oldType: "character varying(4096)", - oldMaxLength: 4096); - - migrationBuilder.AddColumn( - name: "type", - table: "chat_messages", - type: "text", - nullable: false, - defaultValue: ""); - - migrationBuilder.CreateTable( - name: "chat_realtime_call", - columns: table => new - { - id = table.Column(type: "uuid", nullable: false), - title = table.Column(type: "text", nullable: true), - ended_at = table.Column(type: "timestamp with time zone", nullable: true), - sender_id = table.Column(type: "uuid", nullable: false), - room_id = table.Column(type: "bigint", nullable: false), - created_at = table.Column(type: "timestamp with time zone", nullable: false), - updated_at = table.Column(type: "timestamp with time zone", nullable: false), - deleted_at = table.Column(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"); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropTable( - name: "chat_realtime_call"); - - migrationBuilder.DropColumn( - name: "type", - table: "chat_messages"); - - migrationBuilder.AlterColumn( - 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); - } - } -} diff --git a/DysonNetwork.Sphere/Migrations/20250506172100_AddAccountStatuses.Designer.cs b/DysonNetwork.Sphere/Migrations/20250506172100_AddAccountStatuses.Designer.cs deleted file mode 100644 index 7e74961..0000000 --- a/DysonNetwork.Sphere/Migrations/20250506172100_AddAccountStatuses.Designer.cs +++ /dev/null @@ -1,2500 +0,0 @@ -// -using System; -using System.Collections.Generic; -using System.Text.Json; -using DysonNetwork.Sphere; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using NodaTime; -using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; -using NpgsqlTypes; - -#nullable disable - -namespace DysonNetwork.Sphere.Migrations -{ - [DbContext(typeof(AppDatabase))] - [Migration("20250506172100_AddAccountStatuses")] - partial class AddAccountStatuses - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "9.0.3") - .HasAnnotation("Relational:MaxIdentifierLength", 63); - - NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); - - modelBuilder.Entity("DysonNetwork.Sphere.Account.Account", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ActivatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("activated_at"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property("IsSuperuser") - .HasColumnType("boolean") - .HasColumnName("is_superuser"); - - b.Property("Language") - .IsRequired() - .HasMaxLength(32) - .HasColumnType("character varying(32)") - .HasColumnName("language"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(256) - .HasColumnType("character varying(256)") - .HasColumnName("name"); - - b.Property("Nick") - .IsRequired() - .HasMaxLength(256) - .HasColumnType("character varying(256)") - .HasColumnName("nick"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.HasKey("Id") - .HasName("pk_accounts"); - - b.HasIndex("Name") - .IsUnique() - .HasDatabaseName("ix_accounts_name"); - - b.ToTable("accounts", (string)null); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Account.AccountAuthFactor", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AccountId") - .HasColumnType("bigint") - .HasColumnName("account_id"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property("Secret") - .HasColumnType("text") - .HasColumnName("secret"); - - b.Property("Type") - .HasColumnType("integer") - .HasColumnName("type"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.HasKey("Id") - .HasName("pk_account_auth_factors"); - - b.HasIndex("AccountId") - .HasDatabaseName("ix_account_auth_factors_account_id"); - - b.ToTable("account_auth_factors", (string)null); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Account.AccountContact", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AccountId") - .HasColumnType("bigint") - .HasColumnName("account_id"); - - b.Property("Content") - .IsRequired() - .HasMaxLength(1024) - .HasColumnType("character varying(1024)") - .HasColumnName("content"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property("Type") - .HasColumnType("integer") - .HasColumnName("type"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.Property("VerifiedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("verified_at"); - - b.HasKey("Id") - .HasName("pk_account_contacts"); - - b.HasIndex("AccountId") - .HasDatabaseName("ix_account_contacts_account_id"); - - b.ToTable("account_contacts", (string)null); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Account.MagicSpell", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uuid") - .HasColumnName("id"); - - b.Property("AccountId") - .HasColumnType("bigint") - .HasColumnName("account_id"); - - b.Property("AffectedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("affected_at"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property("ExpiresAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("expires_at"); - - b.Property>("Meta") - .IsRequired() - .HasColumnType("jsonb") - .HasColumnName("meta"); - - b.Property("Spell") - .IsRequired() - .HasMaxLength(1024) - .HasColumnType("character varying(1024)") - .HasColumnName("spell"); - - b.Property("Type") - .HasColumnType("integer") - .HasColumnName("type"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.HasKey("Id") - .HasName("pk_magic_spells"); - - b.HasIndex("AccountId") - .HasDatabaseName("ix_magic_spells_account_id"); - - b.HasIndex("Spell") - .IsUnique() - .HasDatabaseName("ix_magic_spells_spell"); - - b.ToTable("magic_spells", (string)null); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Account.Notification", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uuid") - .HasColumnName("id"); - - b.Property("AccountId") - .HasColumnType("bigint") - .HasColumnName("account_id"); - - b.Property("Content") - .HasMaxLength(4096) - .HasColumnType("character varying(4096)") - .HasColumnName("content"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property>("Meta") - .HasColumnType("jsonb") - .HasColumnName("meta"); - - b.Property("Priority") - .HasColumnType("integer") - .HasColumnName("priority"); - - b.Property("Subtitle") - .HasMaxLength(2048) - .HasColumnType("character varying(2048)") - .HasColumnName("subtitle"); - - b.Property("Title") - .HasMaxLength(1024) - .HasColumnType("character varying(1024)") - .HasColumnName("title"); - - b.Property("Topic") - .IsRequired() - .HasMaxLength(1024) - .HasColumnType("character varying(1024)") - .HasColumnName("topic"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.Property("ViewedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("viewed_at"); - - b.HasKey("Id") - .HasName("pk_notifications"); - - b.HasIndex("AccountId") - .HasDatabaseName("ix_notifications_account_id"); - - b.ToTable("notifications", (string)null); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Account.NotificationPushSubscription", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uuid") - .HasColumnName("id"); - - b.Property("AccountId") - .HasColumnType("bigint") - .HasColumnName("account_id"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property("DeviceId") - .IsRequired() - .HasMaxLength(4096) - .HasColumnType("character varying(4096)") - .HasColumnName("device_id"); - - b.Property("DeviceToken") - .IsRequired() - .HasMaxLength(4096) - .HasColumnType("character varying(4096)") - .HasColumnName("device_token"); - - b.Property("LastUsedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("last_used_at"); - - b.Property("Provider") - .HasColumnType("integer") - .HasColumnName("provider"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.HasKey("Id") - .HasName("pk_notification_push_subscriptions"); - - b.HasIndex("AccountId") - .HasDatabaseName("ix_notification_push_subscriptions_account_id"); - - b.HasIndex("DeviceId") - .IsUnique() - .HasDatabaseName("ix_notification_push_subscriptions_device_id"); - - b.HasIndex("DeviceToken") - .IsUnique() - .HasDatabaseName("ix_notification_push_subscriptions_device_token"); - - b.ToTable("notification_push_subscriptions", (string)null); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Account.Profile", b => - { - b.Property("Id") - .HasColumnType("bigint") - .HasColumnName("id"); - - b.Property("BackgroundId") - .HasColumnType("character varying(128)") - .HasColumnName("background_id"); - - b.Property("Bio") - .HasMaxLength(4096) - .HasColumnType("character varying(4096)") - .HasColumnName("bio"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property("FirstName") - .HasMaxLength(256) - .HasColumnType("character varying(256)") - .HasColumnName("first_name"); - - b.Property("LastName") - .HasMaxLength(256) - .HasColumnType("character varying(256)") - .HasColumnName("last_name"); - - b.Property("MiddleName") - .HasMaxLength(256) - .HasColumnType("character varying(256)") - .HasColumnName("middle_name"); - - b.Property("PictureId") - .HasColumnType("character varying(128)") - .HasColumnName("picture_id"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.HasKey("Id") - .HasName("pk_account_profiles"); - - b.HasIndex("BackgroundId") - .HasDatabaseName("ix_account_profiles_background_id"); - - b.HasIndex("PictureId") - .HasDatabaseName("ix_account_profiles_picture_id"); - - b.ToTable("account_profiles", (string)null); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Account.Relationship", b => - { - b.Property("AccountId") - .HasColumnType("bigint") - .HasColumnName("account_id"); - - b.Property("RelatedId") - .HasColumnType("bigint") - .HasColumnName("related_id"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property("ExpiredAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("expired_at"); - - b.Property("Status") - .HasColumnType("integer") - .HasColumnName("status"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.HasKey("AccountId", "RelatedId") - .HasName("pk_account_relationships"); - - b.HasIndex("RelatedId") - .HasDatabaseName("ix_account_relationships_related_id"); - - b.ToTable("account_relationships", (string)null); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Account.Status", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uuid") - .HasColumnName("id"); - - b.Property("AccountId") - .HasColumnType("bigint") - .HasColumnName("account_id"); - - b.Property("Attitude") - .HasColumnType("integer") - .HasColumnName("attitude"); - - b.Property("ClearedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("cleared_at"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property("IsInvisible") - .HasColumnType("boolean") - .HasColumnName("is_invisible"); - - b.Property("IsNotDisturb") - .HasColumnType("boolean") - .HasColumnName("is_not_disturb"); - - b.Property("Label") - .HasMaxLength(1024) - .HasColumnType("character varying(1024)") - .HasColumnName("label"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.HasKey("Id") - .HasName("pk_account_statuses"); - - b.HasIndex("AccountId") - .HasDatabaseName("ix_account_statuses_account_id"); - - b.ToTable("account_statuses", (string)null); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Activity.Activity", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uuid") - .HasColumnName("id"); - - b.Property("AccountId") - .HasColumnType("bigint") - .HasColumnName("account_id"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property("ResourceIdentifier") - .IsRequired() - .HasMaxLength(4096) - .HasColumnType("character varying(4096)") - .HasColumnName("resource_identifier"); - - b.Property("Type") - .IsRequired() - .HasMaxLength(1024) - .HasColumnType("character varying(1024)") - .HasColumnName("type"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.Property("Visibility") - .HasColumnType("integer") - .HasColumnName("visibility"); - - b.HasKey("Id") - .HasName("pk_activities"); - - b.HasIndex("AccountId") - .HasDatabaseName("ix_activities_account_id"); - - b.ToTable("activities", (string)null); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Auth.Challenge", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uuid") - .HasColumnName("id"); - - b.Property("AccountId") - .HasColumnType("bigint") - .HasColumnName("account_id"); - - b.Property>("Audiences") - .IsRequired() - .HasColumnType("jsonb") - .HasColumnName("audiences"); - - b.Property>("BlacklistFactors") - .IsRequired() - .HasColumnType("jsonb") - .HasColumnName("blacklist_factors"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property("DeviceId") - .HasMaxLength(256) - .HasColumnType("character varying(256)") - .HasColumnName("device_id"); - - b.Property("ExpiredAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("expired_at"); - - b.Property("FailedAttempts") - .HasColumnType("integer") - .HasColumnName("failed_attempts"); - - b.Property("IpAddress") - .HasMaxLength(128) - .HasColumnType("character varying(128)") - .HasColumnName("ip_address"); - - b.Property("Nonce") - .HasMaxLength(1024) - .HasColumnType("character varying(1024)") - .HasColumnName("nonce"); - - b.Property("Platform") - .HasColumnType("integer") - .HasColumnName("platform"); - - b.Property>("Scopes") - .IsRequired() - .HasColumnType("jsonb") - .HasColumnName("scopes"); - - b.Property("StepRemain") - .HasColumnType("integer") - .HasColumnName("step_remain"); - - b.Property("StepTotal") - .HasColumnType("integer") - .HasColumnName("step_total"); - - b.Property("Type") - .HasColumnType("integer") - .HasColumnName("type"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.Property("UserAgent") - .HasMaxLength(512) - .HasColumnType("character varying(512)") - .HasColumnName("user_agent"); - - b.HasKey("Id") - .HasName("pk_auth_challenges"); - - b.HasIndex("AccountId") - .HasDatabaseName("ix_auth_challenges_account_id"); - - b.ToTable("auth_challenges", (string)null); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Auth.Session", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uuid") - .HasColumnName("id"); - - b.Property("AccountId") - .HasColumnType("bigint") - .HasColumnName("account_id"); - - b.Property("ChallengeId") - .HasColumnType("uuid") - .HasColumnName("challenge_id"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property("ExpiredAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("expired_at"); - - b.Property("Label") - .HasMaxLength(1024) - .HasColumnType("character varying(1024)") - .HasColumnName("label"); - - b.Property("LastGrantedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("last_granted_at"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.HasKey("Id") - .HasName("pk_auth_sessions"); - - b.HasIndex("AccountId") - .HasDatabaseName("ix_auth_sessions_account_id"); - - b.HasIndex("ChallengeId") - .HasDatabaseName("ix_auth_sessions_challenge_id"); - - b.ToTable("auth_sessions", (string)null); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Chat.ChatMember", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uuid") - .HasColumnName("id"); - - b.Property("AccountId") - .HasColumnType("bigint") - .HasColumnName("account_id"); - - b.Property("ChatRoomId") - .HasColumnType("bigint") - .HasColumnName("chat_room_id"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property("IsBot") - .HasColumnType("boolean") - .HasColumnName("is_bot"); - - b.Property("JoinedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("joined_at"); - - b.Property("Nick") - .HasMaxLength(1024) - .HasColumnType("character varying(1024)") - .HasColumnName("nick"); - - b.Property("Notify") - .HasColumnType("integer") - .HasColumnName("notify"); - - b.Property("Role") - .HasColumnType("integer") - .HasColumnName("role"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.HasKey("Id") - .HasName("pk_chat_members"); - - b.HasAlternateKey("ChatRoomId", "AccountId") - .HasName("ak_chat_members_chat_room_id_account_id"); - - b.HasIndex("AccountId") - .HasDatabaseName("ix_chat_members_account_id"); - - b.ToTable("chat_members", (string)null); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Chat.ChatRoom", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("BackgroundId") - .HasColumnType("character varying(128)") - .HasColumnName("background_id"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property("Description") - .IsRequired() - .HasMaxLength(4096) - .HasColumnType("character varying(4096)") - .HasColumnName("description"); - - b.Property("IsPublic") - .HasColumnType("boolean") - .HasColumnName("is_public"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(1024) - .HasColumnType("character varying(1024)") - .HasColumnName("name"); - - b.Property("PictureId") - .HasColumnType("character varying(128)") - .HasColumnName("picture_id"); - - b.Property("RealmId") - .HasColumnType("bigint") - .HasColumnName("realm_id"); - - b.Property("Type") - .HasColumnType("integer") - .HasColumnName("type"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.HasKey("Id") - .HasName("pk_chat_rooms"); - - b.HasIndex("BackgroundId") - .HasDatabaseName("ix_chat_rooms_background_id"); - - b.HasIndex("PictureId") - .HasDatabaseName("ix_chat_rooms_picture_id"); - - b.HasIndex("RealmId") - .HasDatabaseName("ix_chat_rooms_realm_id"); - - b.ToTable("chat_rooms", (string)null); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Chat.Message", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uuid") - .HasColumnName("id"); - - b.Property("ChatRoomId") - .HasColumnType("bigint") - .HasColumnName("chat_room_id"); - - b.Property("Content") - .HasMaxLength(4096) - .HasColumnType("character varying(4096)") - .HasColumnName("content"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property("EditedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("edited_at"); - - b.Property("ForwardedMessageId") - .HasColumnType("uuid") - .HasColumnName("forwarded_message_id"); - - b.Property>("MembersMentioned") - .HasColumnType("jsonb") - .HasColumnName("members_mentioned"); - - b.Property>("Meta") - .HasColumnType("jsonb") - .HasColumnName("meta"); - - b.Property("Nonce") - .IsRequired() - .HasMaxLength(36) - .HasColumnType("character varying(36)") - .HasColumnName("nonce"); - - b.Property("RepliedMessageId") - .HasColumnType("uuid") - .HasColumnName("replied_message_id"); - - b.Property("SenderId") - .HasColumnType("uuid") - .HasColumnName("sender_id"); - - b.Property("Type") - .IsRequired() - .HasColumnType("text") - .HasColumnName("type"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.HasKey("Id") - .HasName("pk_chat_messages"); - - b.HasIndex("ChatRoomId") - .HasDatabaseName("ix_chat_messages_chat_room_id"); - - b.HasIndex("ForwardedMessageId") - .HasDatabaseName("ix_chat_messages_forwarded_message_id"); - - b.HasIndex("RepliedMessageId") - .HasDatabaseName("ix_chat_messages_replied_message_id"); - - b.HasIndex("SenderId") - .HasDatabaseName("ix_chat_messages_sender_id"); - - b.ToTable("chat_messages", (string)null); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Chat.MessageReaction", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uuid") - .HasColumnName("id"); - - b.Property("Attitude") - .HasColumnType("integer") - .HasColumnName("attitude"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property("MessageId") - .HasColumnType("uuid") - .HasColumnName("message_id"); - - b.Property("SenderId") - .HasColumnType("uuid") - .HasColumnName("sender_id"); - - b.Property("Symbol") - .IsRequired() - .HasMaxLength(256) - .HasColumnType("character varying(256)") - .HasColumnName("symbol"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.HasKey("Id") - .HasName("pk_chat_reactions"); - - b.HasIndex("MessageId") - .HasDatabaseName("ix_chat_reactions_message_id"); - - b.HasIndex("SenderId") - .HasDatabaseName("ix_chat_reactions_sender_id"); - - b.ToTable("chat_reactions", (string)null); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Chat.MessageStatus", b => - { - b.Property("MessageId") - .HasColumnType("uuid") - .HasColumnName("message_id"); - - b.Property("SenderId") - .HasColumnType("uuid") - .HasColumnName("sender_id"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property("ReadAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("read_at"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.HasKey("MessageId", "SenderId") - .HasName("pk_chat_statuses"); - - b.HasIndex("SenderId") - .HasDatabaseName("ix_chat_statuses_sender_id"); - - b.ToTable("chat_statuses", (string)null); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Chat.RealtimeCall", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uuid") - .HasColumnName("id"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property("EndedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("ended_at"); - - b.Property("RoomId") - .HasColumnType("bigint") - .HasColumnName("room_id"); - - b.Property("SenderId") - .HasColumnType("uuid") - .HasColumnName("sender_id"); - - b.Property("Title") - .HasColumnType("text") - .HasColumnName("title"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.HasKey("Id") - .HasName("pk_chat_realtime_call"); - - b.HasIndex("RoomId") - .HasDatabaseName("ix_chat_realtime_call_room_id"); - - b.HasIndex("SenderId") - .HasDatabaseName("ix_chat_realtime_call_sender_id"); - - b.ToTable("chat_realtime_call", (string)null); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Permission.PermissionGroup", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uuid") - .HasColumnName("id"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property("Key") - .IsRequired() - .HasMaxLength(1024) - .HasColumnType("character varying(1024)") - .HasColumnName("key"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.HasKey("Id") - .HasName("pk_permission_groups"); - - b.ToTable("permission_groups", (string)null); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Permission.PermissionGroupMember", b => - { - b.Property("GroupId") - .HasColumnType("uuid") - .HasColumnName("group_id"); - - b.Property("Actor") - .HasMaxLength(1024) - .HasColumnType("character varying(1024)") - .HasColumnName("actor"); - - b.Property("AffectedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("affected_at"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property("ExpiredAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("expired_at"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.HasKey("GroupId", "Actor") - .HasName("pk_permission_group_members"); - - b.ToTable("permission_group_members", (string)null); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Permission.PermissionNode", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uuid") - .HasColumnName("id"); - - b.Property("Actor") - .IsRequired() - .HasMaxLength(1024) - .HasColumnType("character varying(1024)") - .HasColumnName("actor"); - - b.Property("AffectedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("affected_at"); - - b.Property("Area") - .IsRequired() - .HasMaxLength(1024) - .HasColumnType("character varying(1024)") - .HasColumnName("area"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property("ExpiredAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("expired_at"); - - b.Property("GroupId") - .HasColumnType("uuid") - .HasColumnName("group_id"); - - b.Property("Key") - .IsRequired() - .HasMaxLength(1024) - .HasColumnType("character varying(1024)") - .HasColumnName("key"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.Property("Value") - .IsRequired() - .HasColumnType("jsonb") - .HasColumnName("value"); - - b.HasKey("Id") - .HasName("pk_permission_nodes"); - - b.HasIndex("GroupId") - .HasDatabaseName("ix_permission_nodes_group_id"); - - b.HasIndex("Key", "Area", "Actor") - .HasDatabaseName("ix_permission_nodes_key_area_actor"); - - b.ToTable("permission_nodes", (string)null); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Post.Post", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Content") - .HasColumnType("text") - .HasColumnName("content"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property("Description") - .HasMaxLength(4096) - .HasColumnType("character varying(4096)") - .HasColumnName("description"); - - b.Property("Downvotes") - .HasColumnType("integer") - .HasColumnName("downvotes"); - - b.Property("EditedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("edited_at"); - - b.Property("ForwardedPostId") - .HasColumnType("bigint") - .HasColumnName("forwarded_post_id"); - - b.Property("Language") - .HasMaxLength(128) - .HasColumnType("character varying(128)") - .HasColumnName("language"); - - b.Property>("Meta") - .HasColumnType("jsonb") - .HasColumnName("meta"); - - b.Property("PublishedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("published_at"); - - b.Property("PublisherId") - .HasColumnType("bigint") - .HasColumnName("publisher_id"); - - b.Property("RepliedPostId") - .HasColumnType("bigint") - .HasColumnName("replied_post_id"); - - b.Property("SearchVector") - .IsRequired() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("tsvector") - .HasColumnName("search_vector") - .HasAnnotation("Npgsql:TsVectorConfig", "simple") - .HasAnnotation("Npgsql:TsVectorProperties", new[] { "Title", "Description", "Content" }); - - b.Property("ThreadedPostId") - .HasColumnType("bigint") - .HasColumnName("threaded_post_id"); - - b.Property("Title") - .HasMaxLength(1024) - .HasColumnType("character varying(1024)") - .HasColumnName("title"); - - b.Property("Type") - .HasColumnType("integer") - .HasColumnName("type"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.Property("Upvotes") - .HasColumnType("integer") - .HasColumnName("upvotes"); - - b.Property("ViewsTotal") - .HasColumnType("integer") - .HasColumnName("views_total"); - - b.Property("ViewsUnique") - .HasColumnType("integer") - .HasColumnName("views_unique"); - - b.Property("Visibility") - .HasColumnType("integer") - .HasColumnName("visibility"); - - b.HasKey("Id") - .HasName("pk_posts"); - - b.HasIndex("ForwardedPostId") - .HasDatabaseName("ix_posts_forwarded_post_id"); - - b.HasIndex("PublisherId") - .HasDatabaseName("ix_posts_publisher_id"); - - b.HasIndex("RepliedPostId") - .HasDatabaseName("ix_posts_replied_post_id"); - - b.HasIndex("SearchVector") - .HasDatabaseName("ix_posts_search_vector"); - - NpgsqlIndexBuilderExtensions.HasMethod(b.HasIndex("SearchVector"), "GIN"); - - b.HasIndex("ThreadedPostId") - .IsUnique() - .HasDatabaseName("ix_posts_threaded_post_id"); - - b.ToTable("posts", (string)null); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Post.PostCategory", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property("Name") - .HasMaxLength(256) - .HasColumnType("character varying(256)") - .HasColumnName("name"); - - b.Property("Slug") - .IsRequired() - .HasMaxLength(128) - .HasColumnType("character varying(128)") - .HasColumnName("slug"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.HasKey("Id") - .HasName("pk_post_categories"); - - b.ToTable("post_categories", (string)null); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Post.PostCollection", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property("Description") - .HasMaxLength(4096) - .HasColumnType("character varying(4096)") - .HasColumnName("description"); - - b.Property("Name") - .HasMaxLength(256) - .HasColumnType("character varying(256)") - .HasColumnName("name"); - - b.Property("PublisherId") - .HasColumnType("bigint") - .HasColumnName("publisher_id"); - - b.Property("Slug") - .IsRequired() - .HasMaxLength(128) - .HasColumnType("character varying(128)") - .HasColumnName("slug"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.HasKey("Id") - .HasName("pk_post_collections"); - - b.HasIndex("PublisherId") - .HasDatabaseName("ix_post_collections_publisher_id"); - - b.ToTable("post_collections", (string)null); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Post.PostReaction", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AccountId") - .HasColumnType("bigint") - .HasColumnName("account_id"); - - b.Property("Attitude") - .HasColumnType("integer") - .HasColumnName("attitude"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property("PostId") - .HasColumnType("bigint") - .HasColumnName("post_id"); - - b.Property("Symbol") - .IsRequired() - .HasMaxLength(256) - .HasColumnType("character varying(256)") - .HasColumnName("symbol"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.HasKey("Id") - .HasName("pk_post_reactions"); - - b.HasIndex("AccountId") - .HasDatabaseName("ix_post_reactions_account_id"); - - b.HasIndex("PostId") - .HasDatabaseName("ix_post_reactions_post_id"); - - b.ToTable("post_reactions", (string)null); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Post.PostTag", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property("Name") - .HasMaxLength(256) - .HasColumnType("character varying(256)") - .HasColumnName("name"); - - b.Property("Slug") - .IsRequired() - .HasMaxLength(128) - .HasColumnType("character varying(128)") - .HasColumnName("slug"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.HasKey("Id") - .HasName("pk_post_tags"); - - b.ToTable("post_tags", (string)null); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Post.Publisher", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AccountId") - .HasColumnType("bigint") - .HasColumnName("account_id"); - - b.Property("BackgroundId") - .HasColumnType("character varying(128)") - .HasColumnName("background_id"); - - b.Property("Bio") - .HasMaxLength(4096) - .HasColumnType("character varying(4096)") - .HasColumnName("bio"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(256) - .HasColumnType("character varying(256)") - .HasColumnName("name"); - - b.Property("Nick") - .IsRequired() - .HasMaxLength(256) - .HasColumnType("character varying(256)") - .HasColumnName("nick"); - - b.Property("PictureId") - .HasColumnType("character varying(128)") - .HasColumnName("picture_id"); - - b.Property("PublisherType") - .HasColumnType("integer") - .HasColumnName("publisher_type"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.HasKey("Id") - .HasName("pk_publishers"); - - b.HasIndex("AccountId") - .HasDatabaseName("ix_publishers_account_id"); - - b.HasIndex("BackgroundId") - .HasDatabaseName("ix_publishers_background_id"); - - b.HasIndex("Name") - .IsUnique() - .HasDatabaseName("ix_publishers_name"); - - b.HasIndex("PictureId") - .HasDatabaseName("ix_publishers_picture_id"); - - b.ToTable("publishers", (string)null); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Post.PublisherMember", b => - { - b.Property("PublisherId") - .HasColumnType("bigint") - .HasColumnName("publisher_id"); - - b.Property("AccountId") - .HasColumnType("bigint") - .HasColumnName("account_id"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property("JoinedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("joined_at"); - - b.Property("Role") - .HasColumnType("integer") - .HasColumnName("role"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.HasKey("PublisherId", "AccountId") - .HasName("pk_publisher_members"); - - b.HasIndex("AccountId") - .HasDatabaseName("ix_publisher_members_account_id"); - - b.ToTable("publisher_members", (string)null); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Realm.Realm", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AccountId") - .HasColumnType("bigint") - .HasColumnName("account_id"); - - b.Property("BackgroundId") - .HasColumnType("character varying(128)") - .HasColumnName("background_id"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property("Description") - .IsRequired() - .HasMaxLength(4096) - .HasColumnType("character varying(4096)") - .HasColumnName("description"); - - b.Property("IsCommunity") - .HasColumnType("boolean") - .HasColumnName("is_community"); - - b.Property("IsPublic") - .HasColumnType("boolean") - .HasColumnName("is_public"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(1024) - .HasColumnType("character varying(1024)") - .HasColumnName("name"); - - b.Property("PictureId") - .HasColumnType("character varying(128)") - .HasColumnName("picture_id"); - - b.Property("Slug") - .IsRequired() - .HasMaxLength(1024) - .HasColumnType("character varying(1024)") - .HasColumnName("slug"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.Property("VerifiedAs") - .HasMaxLength(4096) - .HasColumnType("character varying(4096)") - .HasColumnName("verified_as"); - - b.Property("VerifiedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("verified_at"); - - b.HasKey("Id") - .HasName("pk_realms"); - - b.HasIndex("AccountId") - .HasDatabaseName("ix_realms_account_id"); - - b.HasIndex("BackgroundId") - .HasDatabaseName("ix_realms_background_id"); - - b.HasIndex("PictureId") - .HasDatabaseName("ix_realms_picture_id"); - - b.HasIndex("Slug") - .IsUnique() - .HasDatabaseName("ix_realms_slug"); - - b.ToTable("realms", (string)null); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Realm.RealmMember", b => - { - b.Property("RealmId") - .HasColumnType("bigint") - .HasColumnName("realm_id"); - - b.Property("AccountId") - .HasColumnType("bigint") - .HasColumnName("account_id"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property("JoinedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("joined_at"); - - b.Property("Role") - .HasColumnType("integer") - .HasColumnName("role"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.HasKey("RealmId", "AccountId") - .HasName("pk_realm_members"); - - b.HasIndex("AccountId") - .HasDatabaseName("ix_realm_members_account_id"); - - b.ToTable("realm_members", (string)null); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Storage.CloudFile", b => - { - b.Property("Id") - .HasMaxLength(128) - .HasColumnType("character varying(128)") - .HasColumnName("id"); - - b.Property("AccountId") - .HasColumnType("bigint") - .HasColumnName("account_id"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property("Description") - .HasMaxLength(4096) - .HasColumnType("character varying(4096)") - .HasColumnName("description"); - - b.Property("ExpiredAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("expired_at"); - - b.Property>("FileMeta") - .HasColumnType("jsonb") - .HasColumnName("file_meta"); - - b.Property("HasCompression") - .HasColumnType("boolean") - .HasColumnName("has_compression"); - - b.Property("Hash") - .HasMaxLength(256) - .HasColumnType("character varying(256)") - .HasColumnName("hash"); - - b.Property("MessageId") - .HasColumnType("uuid") - .HasColumnName("message_id"); - - b.Property("MimeType") - .HasMaxLength(256) - .HasColumnType("character varying(256)") - .HasColumnName("mime_type"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(1024) - .HasColumnType("character varying(1024)") - .HasColumnName("name"); - - b.Property("PostId") - .HasColumnType("bigint") - .HasColumnName("post_id"); - - b.Property("Size") - .HasColumnType("bigint") - .HasColumnName("size"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.Property("UploadedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("uploaded_at"); - - b.Property("UploadedTo") - .HasMaxLength(128) - .HasColumnType("character varying(128)") - .HasColumnName("uploaded_to"); - - b.Property("UsedCount") - .HasColumnType("integer") - .HasColumnName("used_count"); - - b.Property>("UserMeta") - .HasColumnType("jsonb") - .HasColumnName("user_meta"); - - b.HasKey("Id") - .HasName("pk_files"); - - b.HasIndex("AccountId") - .HasDatabaseName("ix_files_account_id"); - - b.HasIndex("MessageId") - .HasDatabaseName("ix_files_message_id"); - - b.HasIndex("PostId") - .HasDatabaseName("ix_files_post_id"); - - b.ToTable("files", (string)null); - }); - - modelBuilder.Entity("PostPostCategory", b => - { - b.Property("CategoriesId") - .HasColumnType("bigint") - .HasColumnName("categories_id"); - - b.Property("PostsId") - .HasColumnType("bigint") - .HasColumnName("posts_id"); - - b.HasKey("CategoriesId", "PostsId") - .HasName("pk_post_category_links"); - - b.HasIndex("PostsId") - .HasDatabaseName("ix_post_category_links_posts_id"); - - b.ToTable("post_category_links", (string)null); - }); - - modelBuilder.Entity("PostPostCollection", b => - { - b.Property("CollectionsId") - .HasColumnType("bigint") - .HasColumnName("collections_id"); - - b.Property("PostsId") - .HasColumnType("bigint") - .HasColumnName("posts_id"); - - b.HasKey("CollectionsId", "PostsId") - .HasName("pk_post_collection_links"); - - b.HasIndex("PostsId") - .HasDatabaseName("ix_post_collection_links_posts_id"); - - b.ToTable("post_collection_links", (string)null); - }); - - modelBuilder.Entity("PostPostTag", b => - { - b.Property("PostsId") - .HasColumnType("bigint") - .HasColumnName("posts_id"); - - b.Property("TagsId") - .HasColumnType("bigint") - .HasColumnName("tags_id"); - - b.HasKey("PostsId", "TagsId") - .HasName("pk_post_tag_links"); - - b.HasIndex("TagsId") - .HasDatabaseName("ix_post_tag_links_tags_id"); - - b.ToTable("post_tag_links", (string)null); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Account.AccountAuthFactor", b => - { - b.HasOne("DysonNetwork.Sphere.Account.Account", "Account") - .WithMany("AuthFactors") - .HasForeignKey("AccountId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_account_auth_factors_accounts_account_id"); - - b.Navigation("Account"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Account.AccountContact", b => - { - b.HasOne("DysonNetwork.Sphere.Account.Account", "Account") - .WithMany("Contacts") - .HasForeignKey("AccountId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_account_contacts_accounts_account_id"); - - b.Navigation("Account"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Account.MagicSpell", b => - { - b.HasOne("DysonNetwork.Sphere.Account.Account", "Account") - .WithMany() - .HasForeignKey("AccountId") - .HasConstraintName("fk_magic_spells_accounts_account_id"); - - b.Navigation("Account"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Account.Notification", b => - { - b.HasOne("DysonNetwork.Sphere.Account.Account", "Account") - .WithMany() - .HasForeignKey("AccountId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_notifications_accounts_account_id"); - - b.Navigation("Account"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Account.NotificationPushSubscription", b => - { - b.HasOne("DysonNetwork.Sphere.Account.Account", "Account") - .WithMany() - .HasForeignKey("AccountId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_notification_push_subscriptions_accounts_account_id"); - - b.Navigation("Account"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Account.Profile", b => - { - b.HasOne("DysonNetwork.Sphere.Storage.CloudFile", "Background") - .WithMany() - .HasForeignKey("BackgroundId") - .HasConstraintName("fk_account_profiles_files_background_id"); - - b.HasOne("DysonNetwork.Sphere.Account.Account", "Account") - .WithOne("Profile") - .HasForeignKey("DysonNetwork.Sphere.Account.Profile", "Id") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_account_profiles_accounts_id"); - - b.HasOne("DysonNetwork.Sphere.Storage.CloudFile", "Picture") - .WithMany() - .HasForeignKey("PictureId") - .HasConstraintName("fk_account_profiles_files_picture_id"); - - b.Navigation("Account"); - - b.Navigation("Background"); - - b.Navigation("Picture"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Account.Relationship", b => - { - b.HasOne("DysonNetwork.Sphere.Account.Account", "Account") - .WithMany("OutgoingRelationships") - .HasForeignKey("AccountId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_account_relationships_accounts_account_id"); - - b.HasOne("DysonNetwork.Sphere.Account.Account", "Related") - .WithMany("IncomingRelationships") - .HasForeignKey("RelatedId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_account_relationships_accounts_related_id"); - - b.Navigation("Account"); - - b.Navigation("Related"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Account.Status", b => - { - b.HasOne("DysonNetwork.Sphere.Account.Account", "Account") - .WithMany() - .HasForeignKey("AccountId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_account_statuses_accounts_account_id"); - - b.Navigation("Account"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Activity.Activity", b => - { - b.HasOne("DysonNetwork.Sphere.Account.Account", "Account") - .WithMany() - .HasForeignKey("AccountId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_activities_accounts_account_id"); - - b.Navigation("Account"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Auth.Challenge", b => - { - b.HasOne("DysonNetwork.Sphere.Account.Account", "Account") - .WithMany("Challenges") - .HasForeignKey("AccountId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_auth_challenges_accounts_account_id"); - - b.Navigation("Account"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Auth.Session", b => - { - b.HasOne("DysonNetwork.Sphere.Account.Account", "Account") - .WithMany("Sessions") - .HasForeignKey("AccountId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_auth_sessions_accounts_account_id"); - - b.HasOne("DysonNetwork.Sphere.Auth.Challenge", "Challenge") - .WithMany() - .HasForeignKey("ChallengeId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_auth_sessions_auth_challenges_challenge_id"); - - b.Navigation("Account"); - - b.Navigation("Challenge"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Chat.ChatMember", b => - { - b.HasOne("DysonNetwork.Sphere.Account.Account", "Account") - .WithMany() - .HasForeignKey("AccountId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_chat_members_accounts_account_id"); - - b.HasOne("DysonNetwork.Sphere.Chat.ChatRoom", "ChatRoom") - .WithMany("Members") - .HasForeignKey("ChatRoomId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_chat_members_chat_rooms_chat_room_id"); - - b.Navigation("Account"); - - b.Navigation("ChatRoom"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Chat.ChatRoom", b => - { - b.HasOne("DysonNetwork.Sphere.Storage.CloudFile", "Background") - .WithMany() - .HasForeignKey("BackgroundId") - .HasConstraintName("fk_chat_rooms_files_background_id"); - - b.HasOne("DysonNetwork.Sphere.Storage.CloudFile", "Picture") - .WithMany() - .HasForeignKey("PictureId") - .HasConstraintName("fk_chat_rooms_files_picture_id"); - - b.HasOne("DysonNetwork.Sphere.Realm.Realm", "Realm") - .WithMany("ChatRooms") - .HasForeignKey("RealmId") - .HasConstraintName("fk_chat_rooms_realms_realm_id"); - - b.Navigation("Background"); - - b.Navigation("Picture"); - - b.Navigation("Realm"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Chat.Message", b => - { - b.HasOne("DysonNetwork.Sphere.Chat.ChatRoom", "ChatRoom") - .WithMany() - .HasForeignKey("ChatRoomId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_chat_messages_chat_rooms_chat_room_id"); - - b.HasOne("DysonNetwork.Sphere.Chat.Message", "ForwardedMessage") - .WithMany() - .HasForeignKey("ForwardedMessageId") - .OnDelete(DeleteBehavior.Restrict) - .HasConstraintName("fk_chat_messages_chat_messages_forwarded_message_id"); - - b.HasOne("DysonNetwork.Sphere.Chat.Message", "RepliedMessage") - .WithMany() - .HasForeignKey("RepliedMessageId") - .OnDelete(DeleteBehavior.Restrict) - .HasConstraintName("fk_chat_messages_chat_messages_replied_message_id"); - - b.HasOne("DysonNetwork.Sphere.Chat.ChatMember", "Sender") - .WithMany() - .HasForeignKey("SenderId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_chat_messages_chat_members_sender_id"); - - b.Navigation("ChatRoom"); - - b.Navigation("ForwardedMessage"); - - b.Navigation("RepliedMessage"); - - b.Navigation("Sender"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Chat.MessageReaction", b => - { - b.HasOne("DysonNetwork.Sphere.Chat.Message", "Message") - .WithMany("Reactions") - .HasForeignKey("MessageId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_chat_reactions_chat_messages_message_id"); - - b.HasOne("DysonNetwork.Sphere.Chat.ChatMember", "Sender") - .WithMany() - .HasForeignKey("SenderId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_chat_reactions_chat_members_sender_id"); - - b.Navigation("Message"); - - b.Navigation("Sender"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Chat.MessageStatus", b => - { - b.HasOne("DysonNetwork.Sphere.Chat.Message", "Message") - .WithMany("Statuses") - .HasForeignKey("MessageId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_chat_statuses_chat_messages_message_id"); - - b.HasOne("DysonNetwork.Sphere.Chat.ChatMember", "Sender") - .WithMany() - .HasForeignKey("SenderId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_chat_statuses_chat_members_sender_id"); - - b.Navigation("Message"); - - b.Navigation("Sender"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Chat.RealtimeCall", b => - { - b.HasOne("DysonNetwork.Sphere.Chat.ChatRoom", "Room") - .WithMany() - .HasForeignKey("RoomId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_chat_realtime_call_chat_rooms_room_id"); - - b.HasOne("DysonNetwork.Sphere.Chat.ChatMember", "Sender") - .WithMany() - .HasForeignKey("SenderId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_chat_realtime_call_chat_members_sender_id"); - - b.Navigation("Room"); - - b.Navigation("Sender"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Permission.PermissionGroupMember", b => - { - b.HasOne("DysonNetwork.Sphere.Permission.PermissionGroup", "Group") - .WithMany("Members") - .HasForeignKey("GroupId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_permission_group_members_permission_groups_group_id"); - - b.Navigation("Group"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Permission.PermissionNode", b => - { - b.HasOne("DysonNetwork.Sphere.Permission.PermissionGroup", "Group") - .WithMany("Nodes") - .HasForeignKey("GroupId") - .HasConstraintName("fk_permission_nodes_permission_groups_group_id"); - - b.Navigation("Group"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Post.Post", b => - { - b.HasOne("DysonNetwork.Sphere.Post.Post", "ForwardedPost") - .WithMany() - .HasForeignKey("ForwardedPostId") - .OnDelete(DeleteBehavior.Restrict) - .HasConstraintName("fk_posts_posts_forwarded_post_id"); - - b.HasOne("DysonNetwork.Sphere.Post.Publisher", "Publisher") - .WithMany("Posts") - .HasForeignKey("PublisherId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_posts_publishers_publisher_id"); - - b.HasOne("DysonNetwork.Sphere.Post.Post", "RepliedPost") - .WithMany() - .HasForeignKey("RepliedPostId") - .OnDelete(DeleteBehavior.Restrict) - .HasConstraintName("fk_posts_posts_replied_post_id"); - - b.HasOne("DysonNetwork.Sphere.Post.Post", "ThreadedPost") - .WithOne() - .HasForeignKey("DysonNetwork.Sphere.Post.Post", "ThreadedPostId") - .HasConstraintName("fk_posts_posts_threaded_post_id"); - - b.Navigation("ForwardedPost"); - - b.Navigation("Publisher"); - - b.Navigation("RepliedPost"); - - b.Navigation("ThreadedPost"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Post.PostCollection", b => - { - b.HasOne("DysonNetwork.Sphere.Post.Publisher", "Publisher") - .WithMany("Collections") - .HasForeignKey("PublisherId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_post_collections_publishers_publisher_id"); - - b.Navigation("Publisher"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Post.PostReaction", b => - { - b.HasOne("DysonNetwork.Sphere.Account.Account", "Account") - .WithMany() - .HasForeignKey("AccountId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_post_reactions_accounts_account_id"); - - b.HasOne("DysonNetwork.Sphere.Post.Post", "Post") - .WithMany("Reactions") - .HasForeignKey("PostId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_post_reactions_posts_post_id"); - - b.Navigation("Account"); - - b.Navigation("Post"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Post.Publisher", b => - { - b.HasOne("DysonNetwork.Sphere.Account.Account", "Account") - .WithMany() - .HasForeignKey("AccountId") - .HasConstraintName("fk_publishers_accounts_account_id"); - - b.HasOne("DysonNetwork.Sphere.Storage.CloudFile", "Background") - .WithMany() - .HasForeignKey("BackgroundId") - .HasConstraintName("fk_publishers_files_background_id"); - - b.HasOne("DysonNetwork.Sphere.Storage.CloudFile", "Picture") - .WithMany() - .HasForeignKey("PictureId") - .HasConstraintName("fk_publishers_files_picture_id"); - - b.Navigation("Account"); - - b.Navigation("Background"); - - b.Navigation("Picture"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Post.PublisherMember", b => - { - b.HasOne("DysonNetwork.Sphere.Account.Account", "Account") - .WithMany() - .HasForeignKey("AccountId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_publisher_members_accounts_account_id"); - - b.HasOne("DysonNetwork.Sphere.Post.Publisher", "Publisher") - .WithMany("Members") - .HasForeignKey("PublisherId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_publisher_members_publishers_publisher_id"); - - b.Navigation("Account"); - - b.Navigation("Publisher"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Realm.Realm", b => - { - b.HasOne("DysonNetwork.Sphere.Account.Account", "Account") - .WithMany() - .HasForeignKey("AccountId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_realms_accounts_account_id"); - - b.HasOne("DysonNetwork.Sphere.Storage.CloudFile", "Background") - .WithMany() - .HasForeignKey("BackgroundId") - .HasConstraintName("fk_realms_files_background_id"); - - b.HasOne("DysonNetwork.Sphere.Storage.CloudFile", "Picture") - .WithMany() - .HasForeignKey("PictureId") - .HasConstraintName("fk_realms_files_picture_id"); - - b.Navigation("Account"); - - b.Navigation("Background"); - - b.Navigation("Picture"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Realm.RealmMember", b => - { - b.HasOne("DysonNetwork.Sphere.Account.Account", "Account") - .WithMany() - .HasForeignKey("AccountId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_realm_members_accounts_account_id"); - - b.HasOne("DysonNetwork.Sphere.Realm.Realm", "Realm") - .WithMany("Members") - .HasForeignKey("RealmId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_realm_members_realms_realm_id"); - - b.Navigation("Account"); - - b.Navigation("Realm"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Storage.CloudFile", b => - { - b.HasOne("DysonNetwork.Sphere.Account.Account", "Account") - .WithMany() - .HasForeignKey("AccountId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_files_accounts_account_id"); - - b.HasOne("DysonNetwork.Sphere.Chat.Message", null) - .WithMany("Attachments") - .HasForeignKey("MessageId") - .HasConstraintName("fk_files_chat_messages_message_id"); - - b.HasOne("DysonNetwork.Sphere.Post.Post", null) - .WithMany("Attachments") - .HasForeignKey("PostId") - .HasConstraintName("fk_files_posts_post_id"); - - b.Navigation("Account"); - }); - - modelBuilder.Entity("PostPostCategory", b => - { - b.HasOne("DysonNetwork.Sphere.Post.PostCategory", null) - .WithMany() - .HasForeignKey("CategoriesId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_post_category_links_post_categories_categories_id"); - - b.HasOne("DysonNetwork.Sphere.Post.Post", null) - .WithMany() - .HasForeignKey("PostsId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_post_category_links_posts_posts_id"); - }); - - modelBuilder.Entity("PostPostCollection", b => - { - b.HasOne("DysonNetwork.Sphere.Post.PostCollection", null) - .WithMany() - .HasForeignKey("CollectionsId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_post_collection_links_post_collections_collections_id"); - - b.HasOne("DysonNetwork.Sphere.Post.Post", null) - .WithMany() - .HasForeignKey("PostsId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_post_collection_links_posts_posts_id"); - }); - - modelBuilder.Entity("PostPostTag", b => - { - b.HasOne("DysonNetwork.Sphere.Post.Post", null) - .WithMany() - .HasForeignKey("PostsId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_post_tag_links_posts_posts_id"); - - b.HasOne("DysonNetwork.Sphere.Post.PostTag", null) - .WithMany() - .HasForeignKey("TagsId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_post_tag_links_post_tags_tags_id"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Account.Account", b => - { - b.Navigation("AuthFactors"); - - b.Navigation("Challenges"); - - b.Navigation("Contacts"); - - b.Navigation("IncomingRelationships"); - - b.Navigation("OutgoingRelationships"); - - b.Navigation("Profile") - .IsRequired(); - - b.Navigation("Sessions"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Chat.ChatRoom", b => - { - b.Navigation("Members"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Chat.Message", b => - { - b.Navigation("Attachments"); - - b.Navigation("Reactions"); - - b.Navigation("Statuses"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Permission.PermissionGroup", b => - { - b.Navigation("Members"); - - b.Navigation("Nodes"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Post.Post", b => - { - b.Navigation("Attachments"); - - b.Navigation("Reactions"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Post.Publisher", b => - { - b.Navigation("Collections"); - - b.Navigation("Members"); - - b.Navigation("Posts"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Realm.Realm", b => - { - b.Navigation("ChatRooms"); - - b.Navigation("Members"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/DysonNetwork.Sphere/Migrations/20250506172100_AddAccountStatuses.cs b/DysonNetwork.Sphere/Migrations/20250506172100_AddAccountStatuses.cs deleted file mode 100644 index c9edbc5..0000000 --- a/DysonNetwork.Sphere/Migrations/20250506172100_AddAccountStatuses.cs +++ /dev/null @@ -1,54 +0,0 @@ -using System; -using Microsoft.EntityFrameworkCore.Migrations; -using NodaTime; - -#nullable disable - -namespace DysonNetwork.Sphere.Migrations -{ - /// - public partial class AddAccountStatuses : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.CreateTable( - name: "account_statuses", - columns: table => new - { - id = table.Column(type: "uuid", nullable: false), - attitude = table.Column(type: "integer", nullable: false), - is_invisible = table.Column(type: "boolean", nullable: false), - is_not_disturb = table.Column(type: "boolean", nullable: false), - label = table.Column(type: "character varying(1024)", maxLength: 1024, nullable: true), - cleared_at = table.Column(type: "timestamp with time zone", nullable: true), - account_id = table.Column(type: "bigint", nullable: false), - created_at = table.Column(type: "timestamp with time zone", nullable: false), - updated_at = table.Column(type: "timestamp with time zone", nullable: false), - deleted_at = table.Column(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"); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropTable( - name: "account_statuses"); - } - } -} diff --git a/DysonNetwork.Sphere/Migrations/20250507175552_AddAccountCheckIn.Designer.cs b/DysonNetwork.Sphere/Migrations/20250507175552_AddAccountCheckIn.Designer.cs deleted file mode 100644 index b0a261c..0000000 --- a/DysonNetwork.Sphere/Migrations/20250507175552_AddAccountCheckIn.Designer.cs +++ /dev/null @@ -1,2554 +0,0 @@ -// -using System; -using System.Collections.Generic; -using System.Text.Json; -using DysonNetwork.Sphere; -using DysonNetwork.Sphere.Account; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using NodaTime; -using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; -using NpgsqlTypes; - -#nullable disable - -namespace DysonNetwork.Sphere.Migrations -{ - [DbContext(typeof(AppDatabase))] - [Migration("20250507175552_AddAccountCheckIn")] - partial class AddAccountCheckIn - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "9.0.3") - .HasAnnotation("Relational:MaxIdentifierLength", 63); - - NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); - - modelBuilder.Entity("DysonNetwork.Sphere.Account.Account", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ActivatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("activated_at"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property("IsSuperuser") - .HasColumnType("boolean") - .HasColumnName("is_superuser"); - - b.Property("Language") - .IsRequired() - .HasMaxLength(32) - .HasColumnType("character varying(32)") - .HasColumnName("language"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(256) - .HasColumnType("character varying(256)") - .HasColumnName("name"); - - b.Property("Nick") - .IsRequired() - .HasMaxLength(256) - .HasColumnType("character varying(256)") - .HasColumnName("nick"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.HasKey("Id") - .HasName("pk_accounts"); - - b.HasIndex("Name") - .IsUnique() - .HasDatabaseName("ix_accounts_name"); - - b.ToTable("accounts", (string)null); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Account.AccountAuthFactor", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AccountId") - .HasColumnType("bigint") - .HasColumnName("account_id"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property("Secret") - .HasColumnType("text") - .HasColumnName("secret"); - - b.Property("Type") - .HasColumnType("integer") - .HasColumnName("type"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.HasKey("Id") - .HasName("pk_account_auth_factors"); - - b.HasIndex("AccountId") - .HasDatabaseName("ix_account_auth_factors_account_id"); - - b.ToTable("account_auth_factors", (string)null); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Account.AccountContact", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AccountId") - .HasColumnType("bigint") - .HasColumnName("account_id"); - - b.Property("Content") - .IsRequired() - .HasMaxLength(1024) - .HasColumnType("character varying(1024)") - .HasColumnName("content"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property("Type") - .HasColumnType("integer") - .HasColumnName("type"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.Property("VerifiedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("verified_at"); - - b.HasKey("Id") - .HasName("pk_account_contacts"); - - b.HasIndex("AccountId") - .HasDatabaseName("ix_account_contacts_account_id"); - - b.ToTable("account_contacts", (string)null); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Account.CheckInResult", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uuid") - .HasColumnName("id"); - - b.Property("AccountId") - .HasColumnType("bigint") - .HasColumnName("account_id"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property("Level") - .HasColumnType("integer") - .HasColumnName("level"); - - b.Property>("Tips") - .IsRequired() - .HasColumnType("jsonb") - .HasColumnName("tips"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.HasKey("Id") - .HasName("pk_account_check_in_results"); - - b.HasIndex("AccountId") - .HasDatabaseName("ix_account_check_in_results_account_id"); - - b.ToTable("account_check_in_results", (string)null); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Account.MagicSpell", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uuid") - .HasColumnName("id"); - - b.Property("AccountId") - .HasColumnType("bigint") - .HasColumnName("account_id"); - - b.Property("AffectedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("affected_at"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property("ExpiresAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("expires_at"); - - b.Property>("Meta") - .IsRequired() - .HasColumnType("jsonb") - .HasColumnName("meta"); - - b.Property("Spell") - .IsRequired() - .HasMaxLength(1024) - .HasColumnType("character varying(1024)") - .HasColumnName("spell"); - - b.Property("Type") - .HasColumnType("integer") - .HasColumnName("type"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.HasKey("Id") - .HasName("pk_magic_spells"); - - b.HasIndex("AccountId") - .HasDatabaseName("ix_magic_spells_account_id"); - - b.HasIndex("Spell") - .IsUnique() - .HasDatabaseName("ix_magic_spells_spell"); - - b.ToTable("magic_spells", (string)null); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Account.Notification", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uuid") - .HasColumnName("id"); - - b.Property("AccountId") - .HasColumnType("bigint") - .HasColumnName("account_id"); - - b.Property("Content") - .HasMaxLength(4096) - .HasColumnType("character varying(4096)") - .HasColumnName("content"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property>("Meta") - .HasColumnType("jsonb") - .HasColumnName("meta"); - - b.Property("Priority") - .HasColumnType("integer") - .HasColumnName("priority"); - - b.Property("Subtitle") - .HasMaxLength(2048) - .HasColumnType("character varying(2048)") - .HasColumnName("subtitle"); - - b.Property("Title") - .HasMaxLength(1024) - .HasColumnType("character varying(1024)") - .HasColumnName("title"); - - b.Property("Topic") - .IsRequired() - .HasMaxLength(1024) - .HasColumnType("character varying(1024)") - .HasColumnName("topic"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.Property("ViewedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("viewed_at"); - - b.HasKey("Id") - .HasName("pk_notifications"); - - b.HasIndex("AccountId") - .HasDatabaseName("ix_notifications_account_id"); - - b.ToTable("notifications", (string)null); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Account.NotificationPushSubscription", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uuid") - .HasColumnName("id"); - - b.Property("AccountId") - .HasColumnType("bigint") - .HasColumnName("account_id"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property("DeviceId") - .IsRequired() - .HasMaxLength(4096) - .HasColumnType("character varying(4096)") - .HasColumnName("device_id"); - - b.Property("DeviceToken") - .IsRequired() - .HasMaxLength(4096) - .HasColumnType("character varying(4096)") - .HasColumnName("device_token"); - - b.Property("LastUsedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("last_used_at"); - - b.Property("Provider") - .HasColumnType("integer") - .HasColumnName("provider"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.HasKey("Id") - .HasName("pk_notification_push_subscriptions"); - - b.HasIndex("AccountId") - .HasDatabaseName("ix_notification_push_subscriptions_account_id"); - - b.HasIndex("DeviceId") - .IsUnique() - .HasDatabaseName("ix_notification_push_subscriptions_device_id"); - - b.HasIndex("DeviceToken") - .IsUnique() - .HasDatabaseName("ix_notification_push_subscriptions_device_token"); - - b.ToTable("notification_push_subscriptions", (string)null); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Account.Profile", b => - { - b.Property("Id") - .HasColumnType("bigint") - .HasColumnName("id"); - - b.Property("BackgroundId") - .HasColumnType("character varying(128)") - .HasColumnName("background_id"); - - b.Property("Bio") - .HasMaxLength(4096) - .HasColumnType("character varying(4096)") - .HasColumnName("bio"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property("FirstName") - .HasMaxLength(256) - .HasColumnType("character varying(256)") - .HasColumnName("first_name"); - - b.Property("LastName") - .HasMaxLength(256) - .HasColumnType("character varying(256)") - .HasColumnName("last_name"); - - b.Property("MiddleName") - .HasMaxLength(256) - .HasColumnType("character varying(256)") - .HasColumnName("middle_name"); - - b.Property("PictureId") - .HasColumnType("character varying(128)") - .HasColumnName("picture_id"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.HasKey("Id") - .HasName("pk_account_profiles"); - - b.HasIndex("BackgroundId") - .HasDatabaseName("ix_account_profiles_background_id"); - - b.HasIndex("PictureId") - .HasDatabaseName("ix_account_profiles_picture_id"); - - b.ToTable("account_profiles", (string)null); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Account.Relationship", b => - { - b.Property("AccountId") - .HasColumnType("bigint") - .HasColumnName("account_id"); - - b.Property("RelatedId") - .HasColumnType("bigint") - .HasColumnName("related_id"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property("ExpiredAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("expired_at"); - - b.Property("Status") - .HasColumnType("integer") - .HasColumnName("status"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.HasKey("AccountId", "RelatedId") - .HasName("pk_account_relationships"); - - b.HasIndex("RelatedId") - .HasDatabaseName("ix_account_relationships_related_id"); - - b.ToTable("account_relationships", (string)null); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Account.Status", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uuid") - .HasColumnName("id"); - - b.Property("AccountId") - .HasColumnType("bigint") - .HasColumnName("account_id"); - - b.Property("Attitude") - .HasColumnType("integer") - .HasColumnName("attitude"); - - b.Property("ClearedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("cleared_at"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property("IsInvisible") - .HasColumnType("boolean") - .HasColumnName("is_invisible"); - - b.Property("IsNotDisturb") - .HasColumnType("boolean") - .HasColumnName("is_not_disturb"); - - b.Property("Label") - .HasMaxLength(1024) - .HasColumnType("character varying(1024)") - .HasColumnName("label"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.HasKey("Id") - .HasName("pk_account_statuses"); - - b.HasIndex("AccountId") - .HasDatabaseName("ix_account_statuses_account_id"); - - b.ToTable("account_statuses", (string)null); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Activity.Activity", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uuid") - .HasColumnName("id"); - - b.Property("AccountId") - .HasColumnType("bigint") - .HasColumnName("account_id"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property("ResourceIdentifier") - .IsRequired() - .HasMaxLength(4096) - .HasColumnType("character varying(4096)") - .HasColumnName("resource_identifier"); - - b.Property("Type") - .IsRequired() - .HasMaxLength(1024) - .HasColumnType("character varying(1024)") - .HasColumnName("type"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.Property("Visibility") - .HasColumnType("integer") - .HasColumnName("visibility"); - - b.HasKey("Id") - .HasName("pk_activities"); - - b.HasIndex("AccountId") - .HasDatabaseName("ix_activities_account_id"); - - b.ToTable("activities", (string)null); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Auth.Challenge", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uuid") - .HasColumnName("id"); - - b.Property("AccountId") - .HasColumnType("bigint") - .HasColumnName("account_id"); - - b.Property>("Audiences") - .IsRequired() - .HasColumnType("jsonb") - .HasColumnName("audiences"); - - b.Property>("BlacklistFactors") - .IsRequired() - .HasColumnType("jsonb") - .HasColumnName("blacklist_factors"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property("DeviceId") - .HasMaxLength(256) - .HasColumnType("character varying(256)") - .HasColumnName("device_id"); - - b.Property("ExpiredAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("expired_at"); - - b.Property("FailedAttempts") - .HasColumnType("integer") - .HasColumnName("failed_attempts"); - - b.Property("IpAddress") - .HasMaxLength(128) - .HasColumnType("character varying(128)") - .HasColumnName("ip_address"); - - b.Property("Nonce") - .HasMaxLength(1024) - .HasColumnType("character varying(1024)") - .HasColumnName("nonce"); - - b.Property("Platform") - .HasColumnType("integer") - .HasColumnName("platform"); - - b.Property>("Scopes") - .IsRequired() - .HasColumnType("jsonb") - .HasColumnName("scopes"); - - b.Property("StepRemain") - .HasColumnType("integer") - .HasColumnName("step_remain"); - - b.Property("StepTotal") - .HasColumnType("integer") - .HasColumnName("step_total"); - - b.Property("Type") - .HasColumnType("integer") - .HasColumnName("type"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.Property("UserAgent") - .HasMaxLength(512) - .HasColumnType("character varying(512)") - .HasColumnName("user_agent"); - - b.HasKey("Id") - .HasName("pk_auth_challenges"); - - b.HasIndex("AccountId") - .HasDatabaseName("ix_auth_challenges_account_id"); - - b.ToTable("auth_challenges", (string)null); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Auth.Session", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uuid") - .HasColumnName("id"); - - b.Property("AccountId") - .HasColumnType("bigint") - .HasColumnName("account_id"); - - b.Property("ChallengeId") - .HasColumnType("uuid") - .HasColumnName("challenge_id"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property("ExpiredAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("expired_at"); - - b.Property("Label") - .HasMaxLength(1024) - .HasColumnType("character varying(1024)") - .HasColumnName("label"); - - b.Property("LastGrantedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("last_granted_at"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.HasKey("Id") - .HasName("pk_auth_sessions"); - - b.HasIndex("AccountId") - .HasDatabaseName("ix_auth_sessions_account_id"); - - b.HasIndex("ChallengeId") - .HasDatabaseName("ix_auth_sessions_challenge_id"); - - b.ToTable("auth_sessions", (string)null); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Chat.ChatMember", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uuid") - .HasColumnName("id"); - - b.Property("AccountId") - .HasColumnType("bigint") - .HasColumnName("account_id"); - - b.Property("ChatRoomId") - .HasColumnType("bigint") - .HasColumnName("chat_room_id"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property("IsBot") - .HasColumnType("boolean") - .HasColumnName("is_bot"); - - b.Property("JoinedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("joined_at"); - - b.Property("Nick") - .HasMaxLength(1024) - .HasColumnType("character varying(1024)") - .HasColumnName("nick"); - - b.Property("Notify") - .HasColumnType("integer") - .HasColumnName("notify"); - - b.Property("Role") - .HasColumnType("integer") - .HasColumnName("role"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.HasKey("Id") - .HasName("pk_chat_members"); - - b.HasAlternateKey("ChatRoomId", "AccountId") - .HasName("ak_chat_members_chat_room_id_account_id"); - - b.HasIndex("AccountId") - .HasDatabaseName("ix_chat_members_account_id"); - - b.ToTable("chat_members", (string)null); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Chat.ChatRoom", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("BackgroundId") - .HasColumnType("character varying(128)") - .HasColumnName("background_id"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property("Description") - .IsRequired() - .HasMaxLength(4096) - .HasColumnType("character varying(4096)") - .HasColumnName("description"); - - b.Property("IsPublic") - .HasColumnType("boolean") - .HasColumnName("is_public"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(1024) - .HasColumnType("character varying(1024)") - .HasColumnName("name"); - - b.Property("PictureId") - .HasColumnType("character varying(128)") - .HasColumnName("picture_id"); - - b.Property("RealmId") - .HasColumnType("bigint") - .HasColumnName("realm_id"); - - b.Property("Type") - .HasColumnType("integer") - .HasColumnName("type"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.HasKey("Id") - .HasName("pk_chat_rooms"); - - b.HasIndex("BackgroundId") - .HasDatabaseName("ix_chat_rooms_background_id"); - - b.HasIndex("PictureId") - .HasDatabaseName("ix_chat_rooms_picture_id"); - - b.HasIndex("RealmId") - .HasDatabaseName("ix_chat_rooms_realm_id"); - - b.ToTable("chat_rooms", (string)null); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Chat.Message", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uuid") - .HasColumnName("id"); - - b.Property("ChatRoomId") - .HasColumnType("bigint") - .HasColumnName("chat_room_id"); - - b.Property("Content") - .HasMaxLength(4096) - .HasColumnType("character varying(4096)") - .HasColumnName("content"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property("EditedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("edited_at"); - - b.Property("ForwardedMessageId") - .HasColumnType("uuid") - .HasColumnName("forwarded_message_id"); - - b.Property>("MembersMentioned") - .HasColumnType("jsonb") - .HasColumnName("members_mentioned"); - - b.Property>("Meta") - .HasColumnType("jsonb") - .HasColumnName("meta"); - - b.Property("Nonce") - .IsRequired() - .HasMaxLength(36) - .HasColumnType("character varying(36)") - .HasColumnName("nonce"); - - b.Property("RepliedMessageId") - .HasColumnType("uuid") - .HasColumnName("replied_message_id"); - - b.Property("SenderId") - .HasColumnType("uuid") - .HasColumnName("sender_id"); - - b.Property("Type") - .IsRequired() - .HasColumnType("text") - .HasColumnName("type"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.HasKey("Id") - .HasName("pk_chat_messages"); - - b.HasIndex("ChatRoomId") - .HasDatabaseName("ix_chat_messages_chat_room_id"); - - b.HasIndex("ForwardedMessageId") - .HasDatabaseName("ix_chat_messages_forwarded_message_id"); - - b.HasIndex("RepliedMessageId") - .HasDatabaseName("ix_chat_messages_replied_message_id"); - - b.HasIndex("SenderId") - .HasDatabaseName("ix_chat_messages_sender_id"); - - b.ToTable("chat_messages", (string)null); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Chat.MessageReaction", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uuid") - .HasColumnName("id"); - - b.Property("Attitude") - .HasColumnType("integer") - .HasColumnName("attitude"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property("MessageId") - .HasColumnType("uuid") - .HasColumnName("message_id"); - - b.Property("SenderId") - .HasColumnType("uuid") - .HasColumnName("sender_id"); - - b.Property("Symbol") - .IsRequired() - .HasMaxLength(256) - .HasColumnType("character varying(256)") - .HasColumnName("symbol"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.HasKey("Id") - .HasName("pk_chat_reactions"); - - b.HasIndex("MessageId") - .HasDatabaseName("ix_chat_reactions_message_id"); - - b.HasIndex("SenderId") - .HasDatabaseName("ix_chat_reactions_sender_id"); - - b.ToTable("chat_reactions", (string)null); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Chat.MessageStatus", b => - { - b.Property("MessageId") - .HasColumnType("uuid") - .HasColumnName("message_id"); - - b.Property("SenderId") - .HasColumnType("uuid") - .HasColumnName("sender_id"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property("ReadAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("read_at"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.HasKey("MessageId", "SenderId") - .HasName("pk_chat_statuses"); - - b.HasIndex("SenderId") - .HasDatabaseName("ix_chat_statuses_sender_id"); - - b.ToTable("chat_statuses", (string)null); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Chat.RealtimeCall", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uuid") - .HasColumnName("id"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property("EndedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("ended_at"); - - b.Property("RoomId") - .HasColumnType("bigint") - .HasColumnName("room_id"); - - b.Property("SenderId") - .HasColumnType("uuid") - .HasColumnName("sender_id"); - - b.Property("Title") - .HasColumnType("text") - .HasColumnName("title"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.HasKey("Id") - .HasName("pk_chat_realtime_call"); - - b.HasIndex("RoomId") - .HasDatabaseName("ix_chat_realtime_call_room_id"); - - b.HasIndex("SenderId") - .HasDatabaseName("ix_chat_realtime_call_sender_id"); - - b.ToTable("chat_realtime_call", (string)null); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Permission.PermissionGroup", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uuid") - .HasColumnName("id"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property("Key") - .IsRequired() - .HasMaxLength(1024) - .HasColumnType("character varying(1024)") - .HasColumnName("key"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.HasKey("Id") - .HasName("pk_permission_groups"); - - b.ToTable("permission_groups", (string)null); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Permission.PermissionGroupMember", b => - { - b.Property("GroupId") - .HasColumnType("uuid") - .HasColumnName("group_id"); - - b.Property("Actor") - .HasMaxLength(1024) - .HasColumnType("character varying(1024)") - .HasColumnName("actor"); - - b.Property("AffectedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("affected_at"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property("ExpiredAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("expired_at"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.HasKey("GroupId", "Actor") - .HasName("pk_permission_group_members"); - - b.ToTable("permission_group_members", (string)null); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Permission.PermissionNode", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uuid") - .HasColumnName("id"); - - b.Property("Actor") - .IsRequired() - .HasMaxLength(1024) - .HasColumnType("character varying(1024)") - .HasColumnName("actor"); - - b.Property("AffectedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("affected_at"); - - b.Property("Area") - .IsRequired() - .HasMaxLength(1024) - .HasColumnType("character varying(1024)") - .HasColumnName("area"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property("ExpiredAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("expired_at"); - - b.Property("GroupId") - .HasColumnType("uuid") - .HasColumnName("group_id"); - - b.Property("Key") - .IsRequired() - .HasMaxLength(1024) - .HasColumnType("character varying(1024)") - .HasColumnName("key"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.Property("Value") - .IsRequired() - .HasColumnType("jsonb") - .HasColumnName("value"); - - b.HasKey("Id") - .HasName("pk_permission_nodes"); - - b.HasIndex("GroupId") - .HasDatabaseName("ix_permission_nodes_group_id"); - - b.HasIndex("Key", "Area", "Actor") - .HasDatabaseName("ix_permission_nodes_key_area_actor"); - - b.ToTable("permission_nodes", (string)null); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Post.Post", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Content") - .HasColumnType("text") - .HasColumnName("content"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property("Description") - .HasMaxLength(4096) - .HasColumnType("character varying(4096)") - .HasColumnName("description"); - - b.Property("Downvotes") - .HasColumnType("integer") - .HasColumnName("downvotes"); - - b.Property("EditedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("edited_at"); - - b.Property("ForwardedPostId") - .HasColumnType("bigint") - .HasColumnName("forwarded_post_id"); - - b.Property("Language") - .HasMaxLength(128) - .HasColumnType("character varying(128)") - .HasColumnName("language"); - - b.Property>("Meta") - .HasColumnType("jsonb") - .HasColumnName("meta"); - - b.Property("PublishedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("published_at"); - - b.Property("PublisherId") - .HasColumnType("bigint") - .HasColumnName("publisher_id"); - - b.Property("RepliedPostId") - .HasColumnType("bigint") - .HasColumnName("replied_post_id"); - - b.Property("SearchVector") - .IsRequired() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("tsvector") - .HasColumnName("search_vector") - .HasAnnotation("Npgsql:TsVectorConfig", "simple") - .HasAnnotation("Npgsql:TsVectorProperties", new[] { "Title", "Description", "Content" }); - - b.Property("ThreadedPostId") - .HasColumnType("bigint") - .HasColumnName("threaded_post_id"); - - b.Property("Title") - .HasMaxLength(1024) - .HasColumnType("character varying(1024)") - .HasColumnName("title"); - - b.Property("Type") - .HasColumnType("integer") - .HasColumnName("type"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.Property("Upvotes") - .HasColumnType("integer") - .HasColumnName("upvotes"); - - b.Property("ViewsTotal") - .HasColumnType("integer") - .HasColumnName("views_total"); - - b.Property("ViewsUnique") - .HasColumnType("integer") - .HasColumnName("views_unique"); - - b.Property("Visibility") - .HasColumnType("integer") - .HasColumnName("visibility"); - - b.HasKey("Id") - .HasName("pk_posts"); - - b.HasIndex("ForwardedPostId") - .HasDatabaseName("ix_posts_forwarded_post_id"); - - b.HasIndex("PublisherId") - .HasDatabaseName("ix_posts_publisher_id"); - - b.HasIndex("RepliedPostId") - .HasDatabaseName("ix_posts_replied_post_id"); - - b.HasIndex("SearchVector") - .HasDatabaseName("ix_posts_search_vector"); - - NpgsqlIndexBuilderExtensions.HasMethod(b.HasIndex("SearchVector"), "GIN"); - - b.HasIndex("ThreadedPostId") - .IsUnique() - .HasDatabaseName("ix_posts_threaded_post_id"); - - b.ToTable("posts", (string)null); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Post.PostCategory", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property("Name") - .HasMaxLength(256) - .HasColumnType("character varying(256)") - .HasColumnName("name"); - - b.Property("Slug") - .IsRequired() - .HasMaxLength(128) - .HasColumnType("character varying(128)") - .HasColumnName("slug"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.HasKey("Id") - .HasName("pk_post_categories"); - - b.ToTable("post_categories", (string)null); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Post.PostCollection", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property("Description") - .HasMaxLength(4096) - .HasColumnType("character varying(4096)") - .HasColumnName("description"); - - b.Property("Name") - .HasMaxLength(256) - .HasColumnType("character varying(256)") - .HasColumnName("name"); - - b.Property("PublisherId") - .HasColumnType("bigint") - .HasColumnName("publisher_id"); - - b.Property("Slug") - .IsRequired() - .HasMaxLength(128) - .HasColumnType("character varying(128)") - .HasColumnName("slug"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.HasKey("Id") - .HasName("pk_post_collections"); - - b.HasIndex("PublisherId") - .HasDatabaseName("ix_post_collections_publisher_id"); - - b.ToTable("post_collections", (string)null); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Post.PostReaction", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AccountId") - .HasColumnType("bigint") - .HasColumnName("account_id"); - - b.Property("Attitude") - .HasColumnType("integer") - .HasColumnName("attitude"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property("PostId") - .HasColumnType("bigint") - .HasColumnName("post_id"); - - b.Property("Symbol") - .IsRequired() - .HasMaxLength(256) - .HasColumnType("character varying(256)") - .HasColumnName("symbol"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.HasKey("Id") - .HasName("pk_post_reactions"); - - b.HasIndex("AccountId") - .HasDatabaseName("ix_post_reactions_account_id"); - - b.HasIndex("PostId") - .HasDatabaseName("ix_post_reactions_post_id"); - - b.ToTable("post_reactions", (string)null); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Post.PostTag", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property("Name") - .HasMaxLength(256) - .HasColumnType("character varying(256)") - .HasColumnName("name"); - - b.Property("Slug") - .IsRequired() - .HasMaxLength(128) - .HasColumnType("character varying(128)") - .HasColumnName("slug"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.HasKey("Id") - .HasName("pk_post_tags"); - - b.ToTable("post_tags", (string)null); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Post.Publisher", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AccountId") - .HasColumnType("bigint") - .HasColumnName("account_id"); - - b.Property("BackgroundId") - .HasColumnType("character varying(128)") - .HasColumnName("background_id"); - - b.Property("Bio") - .HasMaxLength(4096) - .HasColumnType("character varying(4096)") - .HasColumnName("bio"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(256) - .HasColumnType("character varying(256)") - .HasColumnName("name"); - - b.Property("Nick") - .IsRequired() - .HasMaxLength(256) - .HasColumnType("character varying(256)") - .HasColumnName("nick"); - - b.Property("PictureId") - .HasColumnType("character varying(128)") - .HasColumnName("picture_id"); - - b.Property("PublisherType") - .HasColumnType("integer") - .HasColumnName("publisher_type"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.HasKey("Id") - .HasName("pk_publishers"); - - b.HasIndex("AccountId") - .HasDatabaseName("ix_publishers_account_id"); - - b.HasIndex("BackgroundId") - .HasDatabaseName("ix_publishers_background_id"); - - b.HasIndex("Name") - .IsUnique() - .HasDatabaseName("ix_publishers_name"); - - b.HasIndex("PictureId") - .HasDatabaseName("ix_publishers_picture_id"); - - b.ToTable("publishers", (string)null); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Post.PublisherMember", b => - { - b.Property("PublisherId") - .HasColumnType("bigint") - .HasColumnName("publisher_id"); - - b.Property("AccountId") - .HasColumnType("bigint") - .HasColumnName("account_id"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property("JoinedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("joined_at"); - - b.Property("Role") - .HasColumnType("integer") - .HasColumnName("role"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.HasKey("PublisherId", "AccountId") - .HasName("pk_publisher_members"); - - b.HasIndex("AccountId") - .HasDatabaseName("ix_publisher_members_account_id"); - - b.ToTable("publisher_members", (string)null); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Realm.Realm", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AccountId") - .HasColumnType("bigint") - .HasColumnName("account_id"); - - b.Property("BackgroundId") - .HasColumnType("character varying(128)") - .HasColumnName("background_id"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property("Description") - .IsRequired() - .HasMaxLength(4096) - .HasColumnType("character varying(4096)") - .HasColumnName("description"); - - b.Property("IsCommunity") - .HasColumnType("boolean") - .HasColumnName("is_community"); - - b.Property("IsPublic") - .HasColumnType("boolean") - .HasColumnName("is_public"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(1024) - .HasColumnType("character varying(1024)") - .HasColumnName("name"); - - b.Property("PictureId") - .HasColumnType("character varying(128)") - .HasColumnName("picture_id"); - - b.Property("Slug") - .IsRequired() - .HasMaxLength(1024) - .HasColumnType("character varying(1024)") - .HasColumnName("slug"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.Property("VerifiedAs") - .HasMaxLength(4096) - .HasColumnType("character varying(4096)") - .HasColumnName("verified_as"); - - b.Property("VerifiedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("verified_at"); - - b.HasKey("Id") - .HasName("pk_realms"); - - b.HasIndex("AccountId") - .HasDatabaseName("ix_realms_account_id"); - - b.HasIndex("BackgroundId") - .HasDatabaseName("ix_realms_background_id"); - - b.HasIndex("PictureId") - .HasDatabaseName("ix_realms_picture_id"); - - b.HasIndex("Slug") - .IsUnique() - .HasDatabaseName("ix_realms_slug"); - - b.ToTable("realms", (string)null); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Realm.RealmMember", b => - { - b.Property("RealmId") - .HasColumnType("bigint") - .HasColumnName("realm_id"); - - b.Property("AccountId") - .HasColumnType("bigint") - .HasColumnName("account_id"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property("JoinedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("joined_at"); - - b.Property("Role") - .HasColumnType("integer") - .HasColumnName("role"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.HasKey("RealmId", "AccountId") - .HasName("pk_realm_members"); - - b.HasIndex("AccountId") - .HasDatabaseName("ix_realm_members_account_id"); - - b.ToTable("realm_members", (string)null); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Storage.CloudFile", b => - { - b.Property("Id") - .HasMaxLength(128) - .HasColumnType("character varying(128)") - .HasColumnName("id"); - - b.Property("AccountId") - .HasColumnType("bigint") - .HasColumnName("account_id"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property("Description") - .HasMaxLength(4096) - .HasColumnType("character varying(4096)") - .HasColumnName("description"); - - b.Property("ExpiredAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("expired_at"); - - b.Property>("FileMeta") - .HasColumnType("jsonb") - .HasColumnName("file_meta"); - - b.Property("HasCompression") - .HasColumnType("boolean") - .HasColumnName("has_compression"); - - b.Property("Hash") - .HasMaxLength(256) - .HasColumnType("character varying(256)") - .HasColumnName("hash"); - - b.Property("MessageId") - .HasColumnType("uuid") - .HasColumnName("message_id"); - - b.Property("MimeType") - .HasMaxLength(256) - .HasColumnType("character varying(256)") - .HasColumnName("mime_type"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(1024) - .HasColumnType("character varying(1024)") - .HasColumnName("name"); - - b.Property("PostId") - .HasColumnType("bigint") - .HasColumnName("post_id"); - - b.Property("Size") - .HasColumnType("bigint") - .HasColumnName("size"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.Property("UploadedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("uploaded_at"); - - b.Property("UploadedTo") - .HasMaxLength(128) - .HasColumnType("character varying(128)") - .HasColumnName("uploaded_to"); - - b.Property("UsedCount") - .HasColumnType("integer") - .HasColumnName("used_count"); - - b.Property>("UserMeta") - .HasColumnType("jsonb") - .HasColumnName("user_meta"); - - b.HasKey("Id") - .HasName("pk_files"); - - b.HasIndex("AccountId") - .HasDatabaseName("ix_files_account_id"); - - b.HasIndex("MessageId") - .HasDatabaseName("ix_files_message_id"); - - b.HasIndex("PostId") - .HasDatabaseName("ix_files_post_id"); - - b.ToTable("files", (string)null); - }); - - modelBuilder.Entity("PostPostCategory", b => - { - b.Property("CategoriesId") - .HasColumnType("bigint") - .HasColumnName("categories_id"); - - b.Property("PostsId") - .HasColumnType("bigint") - .HasColumnName("posts_id"); - - b.HasKey("CategoriesId", "PostsId") - .HasName("pk_post_category_links"); - - b.HasIndex("PostsId") - .HasDatabaseName("ix_post_category_links_posts_id"); - - b.ToTable("post_category_links", (string)null); - }); - - modelBuilder.Entity("PostPostCollection", b => - { - b.Property("CollectionsId") - .HasColumnType("bigint") - .HasColumnName("collections_id"); - - b.Property("PostsId") - .HasColumnType("bigint") - .HasColumnName("posts_id"); - - b.HasKey("CollectionsId", "PostsId") - .HasName("pk_post_collection_links"); - - b.HasIndex("PostsId") - .HasDatabaseName("ix_post_collection_links_posts_id"); - - b.ToTable("post_collection_links", (string)null); - }); - - modelBuilder.Entity("PostPostTag", b => - { - b.Property("PostsId") - .HasColumnType("bigint") - .HasColumnName("posts_id"); - - b.Property("TagsId") - .HasColumnType("bigint") - .HasColumnName("tags_id"); - - b.HasKey("PostsId", "TagsId") - .HasName("pk_post_tag_links"); - - b.HasIndex("TagsId") - .HasDatabaseName("ix_post_tag_links_tags_id"); - - b.ToTable("post_tag_links", (string)null); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Account.AccountAuthFactor", b => - { - b.HasOne("DysonNetwork.Sphere.Account.Account", "Account") - .WithMany("AuthFactors") - .HasForeignKey("AccountId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_account_auth_factors_accounts_account_id"); - - b.Navigation("Account"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Account.AccountContact", b => - { - b.HasOne("DysonNetwork.Sphere.Account.Account", "Account") - .WithMany("Contacts") - .HasForeignKey("AccountId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_account_contacts_accounts_account_id"); - - b.Navigation("Account"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Account.CheckInResult", b => - { - b.HasOne("DysonNetwork.Sphere.Account.Account", "Account") - .WithMany() - .HasForeignKey("AccountId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_account_check_in_results_accounts_account_id"); - - b.Navigation("Account"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Account.MagicSpell", b => - { - b.HasOne("DysonNetwork.Sphere.Account.Account", "Account") - .WithMany() - .HasForeignKey("AccountId") - .HasConstraintName("fk_magic_spells_accounts_account_id"); - - b.Navigation("Account"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Account.Notification", b => - { - b.HasOne("DysonNetwork.Sphere.Account.Account", "Account") - .WithMany() - .HasForeignKey("AccountId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_notifications_accounts_account_id"); - - b.Navigation("Account"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Account.NotificationPushSubscription", b => - { - b.HasOne("DysonNetwork.Sphere.Account.Account", "Account") - .WithMany() - .HasForeignKey("AccountId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_notification_push_subscriptions_accounts_account_id"); - - b.Navigation("Account"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Account.Profile", b => - { - b.HasOne("DysonNetwork.Sphere.Storage.CloudFile", "Background") - .WithMany() - .HasForeignKey("BackgroundId") - .HasConstraintName("fk_account_profiles_files_background_id"); - - b.HasOne("DysonNetwork.Sphere.Account.Account", "Account") - .WithOne("Profile") - .HasForeignKey("DysonNetwork.Sphere.Account.Profile", "Id") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_account_profiles_accounts_id"); - - b.HasOne("DysonNetwork.Sphere.Storage.CloudFile", "Picture") - .WithMany() - .HasForeignKey("PictureId") - .HasConstraintName("fk_account_profiles_files_picture_id"); - - b.Navigation("Account"); - - b.Navigation("Background"); - - b.Navigation("Picture"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Account.Relationship", b => - { - b.HasOne("DysonNetwork.Sphere.Account.Account", "Account") - .WithMany("OutgoingRelationships") - .HasForeignKey("AccountId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_account_relationships_accounts_account_id"); - - b.HasOne("DysonNetwork.Sphere.Account.Account", "Related") - .WithMany("IncomingRelationships") - .HasForeignKey("RelatedId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_account_relationships_accounts_related_id"); - - b.Navigation("Account"); - - b.Navigation("Related"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Account.Status", b => - { - b.HasOne("DysonNetwork.Sphere.Account.Account", "Account") - .WithMany() - .HasForeignKey("AccountId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_account_statuses_accounts_account_id"); - - b.Navigation("Account"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Activity.Activity", b => - { - b.HasOne("DysonNetwork.Sphere.Account.Account", "Account") - .WithMany() - .HasForeignKey("AccountId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_activities_accounts_account_id"); - - b.Navigation("Account"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Auth.Challenge", b => - { - b.HasOne("DysonNetwork.Sphere.Account.Account", "Account") - .WithMany("Challenges") - .HasForeignKey("AccountId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_auth_challenges_accounts_account_id"); - - b.Navigation("Account"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Auth.Session", b => - { - b.HasOne("DysonNetwork.Sphere.Account.Account", "Account") - .WithMany("Sessions") - .HasForeignKey("AccountId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_auth_sessions_accounts_account_id"); - - b.HasOne("DysonNetwork.Sphere.Auth.Challenge", "Challenge") - .WithMany() - .HasForeignKey("ChallengeId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_auth_sessions_auth_challenges_challenge_id"); - - b.Navigation("Account"); - - b.Navigation("Challenge"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Chat.ChatMember", b => - { - b.HasOne("DysonNetwork.Sphere.Account.Account", "Account") - .WithMany() - .HasForeignKey("AccountId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_chat_members_accounts_account_id"); - - b.HasOne("DysonNetwork.Sphere.Chat.ChatRoom", "ChatRoom") - .WithMany("Members") - .HasForeignKey("ChatRoomId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_chat_members_chat_rooms_chat_room_id"); - - b.Navigation("Account"); - - b.Navigation("ChatRoom"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Chat.ChatRoom", b => - { - b.HasOne("DysonNetwork.Sphere.Storage.CloudFile", "Background") - .WithMany() - .HasForeignKey("BackgroundId") - .HasConstraintName("fk_chat_rooms_files_background_id"); - - b.HasOne("DysonNetwork.Sphere.Storage.CloudFile", "Picture") - .WithMany() - .HasForeignKey("PictureId") - .HasConstraintName("fk_chat_rooms_files_picture_id"); - - b.HasOne("DysonNetwork.Sphere.Realm.Realm", "Realm") - .WithMany("ChatRooms") - .HasForeignKey("RealmId") - .HasConstraintName("fk_chat_rooms_realms_realm_id"); - - b.Navigation("Background"); - - b.Navigation("Picture"); - - b.Navigation("Realm"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Chat.Message", b => - { - b.HasOne("DysonNetwork.Sphere.Chat.ChatRoom", "ChatRoom") - .WithMany() - .HasForeignKey("ChatRoomId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_chat_messages_chat_rooms_chat_room_id"); - - b.HasOne("DysonNetwork.Sphere.Chat.Message", "ForwardedMessage") - .WithMany() - .HasForeignKey("ForwardedMessageId") - .OnDelete(DeleteBehavior.Restrict) - .HasConstraintName("fk_chat_messages_chat_messages_forwarded_message_id"); - - b.HasOne("DysonNetwork.Sphere.Chat.Message", "RepliedMessage") - .WithMany() - .HasForeignKey("RepliedMessageId") - .OnDelete(DeleteBehavior.Restrict) - .HasConstraintName("fk_chat_messages_chat_messages_replied_message_id"); - - b.HasOne("DysonNetwork.Sphere.Chat.ChatMember", "Sender") - .WithMany() - .HasForeignKey("SenderId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_chat_messages_chat_members_sender_id"); - - b.Navigation("ChatRoom"); - - b.Navigation("ForwardedMessage"); - - b.Navigation("RepliedMessage"); - - b.Navigation("Sender"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Chat.MessageReaction", b => - { - b.HasOne("DysonNetwork.Sphere.Chat.Message", "Message") - .WithMany("Reactions") - .HasForeignKey("MessageId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_chat_reactions_chat_messages_message_id"); - - b.HasOne("DysonNetwork.Sphere.Chat.ChatMember", "Sender") - .WithMany() - .HasForeignKey("SenderId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_chat_reactions_chat_members_sender_id"); - - b.Navigation("Message"); - - b.Navigation("Sender"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Chat.MessageStatus", b => - { - b.HasOne("DysonNetwork.Sphere.Chat.Message", "Message") - .WithMany("Statuses") - .HasForeignKey("MessageId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_chat_statuses_chat_messages_message_id"); - - b.HasOne("DysonNetwork.Sphere.Chat.ChatMember", "Sender") - .WithMany() - .HasForeignKey("SenderId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_chat_statuses_chat_members_sender_id"); - - b.Navigation("Message"); - - b.Navigation("Sender"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Chat.RealtimeCall", b => - { - b.HasOne("DysonNetwork.Sphere.Chat.ChatRoom", "Room") - .WithMany() - .HasForeignKey("RoomId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_chat_realtime_call_chat_rooms_room_id"); - - b.HasOne("DysonNetwork.Sphere.Chat.ChatMember", "Sender") - .WithMany() - .HasForeignKey("SenderId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_chat_realtime_call_chat_members_sender_id"); - - b.Navigation("Room"); - - b.Navigation("Sender"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Permission.PermissionGroupMember", b => - { - b.HasOne("DysonNetwork.Sphere.Permission.PermissionGroup", "Group") - .WithMany("Members") - .HasForeignKey("GroupId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_permission_group_members_permission_groups_group_id"); - - b.Navigation("Group"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Permission.PermissionNode", b => - { - b.HasOne("DysonNetwork.Sphere.Permission.PermissionGroup", "Group") - .WithMany("Nodes") - .HasForeignKey("GroupId") - .HasConstraintName("fk_permission_nodes_permission_groups_group_id"); - - b.Navigation("Group"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Post.Post", b => - { - b.HasOne("DysonNetwork.Sphere.Post.Post", "ForwardedPost") - .WithMany() - .HasForeignKey("ForwardedPostId") - .OnDelete(DeleteBehavior.Restrict) - .HasConstraintName("fk_posts_posts_forwarded_post_id"); - - b.HasOne("DysonNetwork.Sphere.Post.Publisher", "Publisher") - .WithMany("Posts") - .HasForeignKey("PublisherId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_posts_publishers_publisher_id"); - - b.HasOne("DysonNetwork.Sphere.Post.Post", "RepliedPost") - .WithMany() - .HasForeignKey("RepliedPostId") - .OnDelete(DeleteBehavior.Restrict) - .HasConstraintName("fk_posts_posts_replied_post_id"); - - b.HasOne("DysonNetwork.Sphere.Post.Post", "ThreadedPost") - .WithOne() - .HasForeignKey("DysonNetwork.Sphere.Post.Post", "ThreadedPostId") - .HasConstraintName("fk_posts_posts_threaded_post_id"); - - b.Navigation("ForwardedPost"); - - b.Navigation("Publisher"); - - b.Navigation("RepliedPost"); - - b.Navigation("ThreadedPost"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Post.PostCollection", b => - { - b.HasOne("DysonNetwork.Sphere.Post.Publisher", "Publisher") - .WithMany("Collections") - .HasForeignKey("PublisherId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_post_collections_publishers_publisher_id"); - - b.Navigation("Publisher"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Post.PostReaction", b => - { - b.HasOne("DysonNetwork.Sphere.Account.Account", "Account") - .WithMany() - .HasForeignKey("AccountId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_post_reactions_accounts_account_id"); - - b.HasOne("DysonNetwork.Sphere.Post.Post", "Post") - .WithMany("Reactions") - .HasForeignKey("PostId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_post_reactions_posts_post_id"); - - b.Navigation("Account"); - - b.Navigation("Post"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Post.Publisher", b => - { - b.HasOne("DysonNetwork.Sphere.Account.Account", "Account") - .WithMany() - .HasForeignKey("AccountId") - .HasConstraintName("fk_publishers_accounts_account_id"); - - b.HasOne("DysonNetwork.Sphere.Storage.CloudFile", "Background") - .WithMany() - .HasForeignKey("BackgroundId") - .HasConstraintName("fk_publishers_files_background_id"); - - b.HasOne("DysonNetwork.Sphere.Storage.CloudFile", "Picture") - .WithMany() - .HasForeignKey("PictureId") - .HasConstraintName("fk_publishers_files_picture_id"); - - b.Navigation("Account"); - - b.Navigation("Background"); - - b.Navigation("Picture"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Post.PublisherMember", b => - { - b.HasOne("DysonNetwork.Sphere.Account.Account", "Account") - .WithMany() - .HasForeignKey("AccountId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_publisher_members_accounts_account_id"); - - b.HasOne("DysonNetwork.Sphere.Post.Publisher", "Publisher") - .WithMany("Members") - .HasForeignKey("PublisherId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_publisher_members_publishers_publisher_id"); - - b.Navigation("Account"); - - b.Navigation("Publisher"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Realm.Realm", b => - { - b.HasOne("DysonNetwork.Sphere.Account.Account", "Account") - .WithMany() - .HasForeignKey("AccountId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_realms_accounts_account_id"); - - b.HasOne("DysonNetwork.Sphere.Storage.CloudFile", "Background") - .WithMany() - .HasForeignKey("BackgroundId") - .HasConstraintName("fk_realms_files_background_id"); - - b.HasOne("DysonNetwork.Sphere.Storage.CloudFile", "Picture") - .WithMany() - .HasForeignKey("PictureId") - .HasConstraintName("fk_realms_files_picture_id"); - - b.Navigation("Account"); - - b.Navigation("Background"); - - b.Navigation("Picture"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Realm.RealmMember", b => - { - b.HasOne("DysonNetwork.Sphere.Account.Account", "Account") - .WithMany() - .HasForeignKey("AccountId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_realm_members_accounts_account_id"); - - b.HasOne("DysonNetwork.Sphere.Realm.Realm", "Realm") - .WithMany("Members") - .HasForeignKey("RealmId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_realm_members_realms_realm_id"); - - b.Navigation("Account"); - - b.Navigation("Realm"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Storage.CloudFile", b => - { - b.HasOne("DysonNetwork.Sphere.Account.Account", "Account") - .WithMany() - .HasForeignKey("AccountId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_files_accounts_account_id"); - - b.HasOne("DysonNetwork.Sphere.Chat.Message", null) - .WithMany("Attachments") - .HasForeignKey("MessageId") - .HasConstraintName("fk_files_chat_messages_message_id"); - - b.HasOne("DysonNetwork.Sphere.Post.Post", null) - .WithMany("Attachments") - .HasForeignKey("PostId") - .HasConstraintName("fk_files_posts_post_id"); - - b.Navigation("Account"); - }); - - modelBuilder.Entity("PostPostCategory", b => - { - b.HasOne("DysonNetwork.Sphere.Post.PostCategory", null) - .WithMany() - .HasForeignKey("CategoriesId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_post_category_links_post_categories_categories_id"); - - b.HasOne("DysonNetwork.Sphere.Post.Post", null) - .WithMany() - .HasForeignKey("PostsId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_post_category_links_posts_posts_id"); - }); - - modelBuilder.Entity("PostPostCollection", b => - { - b.HasOne("DysonNetwork.Sphere.Post.PostCollection", null) - .WithMany() - .HasForeignKey("CollectionsId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_post_collection_links_post_collections_collections_id"); - - b.HasOne("DysonNetwork.Sphere.Post.Post", null) - .WithMany() - .HasForeignKey("PostsId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_post_collection_links_posts_posts_id"); - }); - - modelBuilder.Entity("PostPostTag", b => - { - b.HasOne("DysonNetwork.Sphere.Post.Post", null) - .WithMany() - .HasForeignKey("PostsId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_post_tag_links_posts_posts_id"); - - b.HasOne("DysonNetwork.Sphere.Post.PostTag", null) - .WithMany() - .HasForeignKey("TagsId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_post_tag_links_post_tags_tags_id"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Account.Account", b => - { - b.Navigation("AuthFactors"); - - b.Navigation("Challenges"); - - b.Navigation("Contacts"); - - b.Navigation("IncomingRelationships"); - - b.Navigation("OutgoingRelationships"); - - b.Navigation("Profile") - .IsRequired(); - - b.Navigation("Sessions"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Chat.ChatRoom", b => - { - b.Navigation("Members"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Chat.Message", b => - { - b.Navigation("Attachments"); - - b.Navigation("Reactions"); - - b.Navigation("Statuses"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Permission.PermissionGroup", b => - { - b.Navigation("Members"); - - b.Navigation("Nodes"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Post.Post", b => - { - b.Navigation("Attachments"); - - b.Navigation("Reactions"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Post.Publisher", b => - { - b.Navigation("Collections"); - - b.Navigation("Members"); - - b.Navigation("Posts"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Realm.Realm", b => - { - b.Navigation("ChatRooms"); - - b.Navigation("Members"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/DysonNetwork.Sphere/Migrations/20250507175552_AddAccountCheckIn.cs b/DysonNetwork.Sphere/Migrations/20250507175552_AddAccountCheckIn.cs deleted file mode 100644 index e373e4c..0000000 --- a/DysonNetwork.Sphere/Migrations/20250507175552_AddAccountCheckIn.cs +++ /dev/null @@ -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 -{ - /// - public partial class AddAccountCheckIn : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.CreateTable( - name: "account_check_in_results", - columns: table => new - { - id = table.Column(type: "uuid", nullable: false), - level = table.Column(type: "integer", nullable: false), - tips = table.Column>(type: "jsonb", nullable: false), - account_id = table.Column(type: "bigint", nullable: false), - created_at = table.Column(type: "timestamp with time zone", nullable: false), - updated_at = table.Column(type: "timestamp with time zone", nullable: false), - deleted_at = table.Column(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"); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropTable( - name: "account_check_in_results"); - } - } -} diff --git a/DysonNetwork.Sphere/Migrations/20250508140200_DontKnowHowToNameThing.Designer.cs b/DysonNetwork.Sphere/Migrations/20250508140200_DontKnowHowToNameThing.Designer.cs deleted file mode 100644 index 0098680..0000000 --- a/DysonNetwork.Sphere/Migrations/20250508140200_DontKnowHowToNameThing.Designer.cs +++ /dev/null @@ -1,2564 +0,0 @@ -// -using System; -using System.Collections.Generic; -using System.Text.Json; -using DysonNetwork.Sphere; -using DysonNetwork.Sphere.Account; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using NodaTime; -using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; -using NpgsqlTypes; - -#nullable disable - -namespace DysonNetwork.Sphere.Migrations -{ - [DbContext(typeof(AppDatabase))] - [Migration("20250508140200_DontKnowHowToNameThing")] - partial class DontKnowHowToNameThing - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "9.0.3") - .HasAnnotation("Relational:MaxIdentifierLength", 63); - - NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); - - modelBuilder.Entity("DysonNetwork.Sphere.Account.Account", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ActivatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("activated_at"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property("IsSuperuser") - .HasColumnType("boolean") - .HasColumnName("is_superuser"); - - b.Property("Language") - .IsRequired() - .HasMaxLength(32) - .HasColumnType("character varying(32)") - .HasColumnName("language"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(256) - .HasColumnType("character varying(256)") - .HasColumnName("name"); - - b.Property("Nick") - .IsRequired() - .HasMaxLength(256) - .HasColumnType("character varying(256)") - .HasColumnName("nick"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.HasKey("Id") - .HasName("pk_accounts"); - - b.HasIndex("Name") - .IsUnique() - .HasDatabaseName("ix_accounts_name"); - - b.ToTable("accounts", (string)null); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Account.AccountAuthFactor", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AccountId") - .HasColumnType("bigint") - .HasColumnName("account_id"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property("Secret") - .HasColumnType("text") - .HasColumnName("secret"); - - b.Property("Type") - .HasColumnType("integer") - .HasColumnName("type"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.HasKey("Id") - .HasName("pk_account_auth_factors"); - - b.HasIndex("AccountId") - .HasDatabaseName("ix_account_auth_factors_account_id"); - - b.ToTable("account_auth_factors", (string)null); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Account.AccountContact", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AccountId") - .HasColumnType("bigint") - .HasColumnName("account_id"); - - b.Property("Content") - .IsRequired() - .HasMaxLength(1024) - .HasColumnType("character varying(1024)") - .HasColumnName("content"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property("Type") - .HasColumnType("integer") - .HasColumnName("type"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.Property("VerifiedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("verified_at"); - - b.HasKey("Id") - .HasName("pk_account_contacts"); - - b.HasIndex("AccountId") - .HasDatabaseName("ix_account_contacts_account_id"); - - b.ToTable("account_contacts", (string)null); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Account.CheckInResult", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uuid") - .HasColumnName("id"); - - b.Property("AccountId") - .HasColumnType("bigint") - .HasColumnName("account_id"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property("Level") - .HasColumnType("integer") - .HasColumnName("level"); - - b.Property>("Tips") - .IsRequired() - .HasColumnType("jsonb") - .HasColumnName("tips"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.HasKey("Id") - .HasName("pk_account_check_in_results"); - - b.HasIndex("AccountId") - .HasDatabaseName("ix_account_check_in_results_account_id"); - - b.ToTable("account_check_in_results", (string)null); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Account.MagicSpell", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uuid") - .HasColumnName("id"); - - b.Property("AccountId") - .HasColumnType("bigint") - .HasColumnName("account_id"); - - b.Property("AffectedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("affected_at"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property("ExpiresAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("expires_at"); - - b.Property>("Meta") - .IsRequired() - .HasColumnType("jsonb") - .HasColumnName("meta"); - - b.Property("Spell") - .IsRequired() - .HasMaxLength(1024) - .HasColumnType("character varying(1024)") - .HasColumnName("spell"); - - b.Property("Type") - .HasColumnType("integer") - .HasColumnName("type"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.HasKey("Id") - .HasName("pk_magic_spells"); - - b.HasIndex("AccountId") - .HasDatabaseName("ix_magic_spells_account_id"); - - b.HasIndex("Spell") - .IsUnique() - .HasDatabaseName("ix_magic_spells_spell"); - - b.ToTable("magic_spells", (string)null); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Account.Notification", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uuid") - .HasColumnName("id"); - - b.Property("AccountId") - .HasColumnType("bigint") - .HasColumnName("account_id"); - - b.Property("Content") - .HasMaxLength(4096) - .HasColumnType("character varying(4096)") - .HasColumnName("content"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property>("Meta") - .HasColumnType("jsonb") - .HasColumnName("meta"); - - b.Property("Priority") - .HasColumnType("integer") - .HasColumnName("priority"); - - b.Property("Subtitle") - .HasMaxLength(2048) - .HasColumnType("character varying(2048)") - .HasColumnName("subtitle"); - - b.Property("Title") - .HasMaxLength(1024) - .HasColumnType("character varying(1024)") - .HasColumnName("title"); - - b.Property("Topic") - .IsRequired() - .HasMaxLength(1024) - .HasColumnType("character varying(1024)") - .HasColumnName("topic"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.Property("ViewedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("viewed_at"); - - b.HasKey("Id") - .HasName("pk_notifications"); - - b.HasIndex("AccountId") - .HasDatabaseName("ix_notifications_account_id"); - - b.ToTable("notifications", (string)null); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Account.NotificationPushSubscription", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uuid") - .HasColumnName("id"); - - b.Property("AccountId") - .HasColumnType("bigint") - .HasColumnName("account_id"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property("DeviceId") - .IsRequired() - .HasMaxLength(4096) - .HasColumnType("character varying(4096)") - .HasColumnName("device_id"); - - b.Property("DeviceToken") - .IsRequired() - .HasMaxLength(4096) - .HasColumnType("character varying(4096)") - .HasColumnName("device_token"); - - b.Property("LastUsedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("last_used_at"); - - b.Property("Provider") - .HasColumnType("integer") - .HasColumnName("provider"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.HasKey("Id") - .HasName("pk_notification_push_subscriptions"); - - b.HasIndex("AccountId") - .HasDatabaseName("ix_notification_push_subscriptions_account_id"); - - b.HasIndex("DeviceId") - .IsUnique() - .HasDatabaseName("ix_notification_push_subscriptions_device_id"); - - b.HasIndex("DeviceToken") - .IsUnique() - .HasDatabaseName("ix_notification_push_subscriptions_device_token"); - - b.ToTable("notification_push_subscriptions", (string)null); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Account.Profile", b => - { - b.Property("Id") - .HasColumnType("bigint") - .HasColumnName("id"); - - b.Property("BackgroundId") - .HasColumnType("character varying(128)") - .HasColumnName("background_id"); - - b.Property("Bio") - .HasMaxLength(4096) - .HasColumnType("character varying(4096)") - .HasColumnName("bio"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property("FirstName") - .HasMaxLength(256) - .HasColumnType("character varying(256)") - .HasColumnName("first_name"); - - b.Property("LastName") - .HasMaxLength(256) - .HasColumnType("character varying(256)") - .HasColumnName("last_name"); - - b.Property("MiddleName") - .HasMaxLength(256) - .HasColumnType("character varying(256)") - .HasColumnName("middle_name"); - - b.Property("PictureId") - .HasColumnType("character varying(128)") - .HasColumnName("picture_id"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.HasKey("Id") - .HasName("pk_account_profiles"); - - b.HasIndex("BackgroundId") - .HasDatabaseName("ix_account_profiles_background_id"); - - b.HasIndex("PictureId") - .HasDatabaseName("ix_account_profiles_picture_id"); - - b.ToTable("account_profiles", (string)null); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Account.Relationship", b => - { - b.Property("AccountId") - .HasColumnType("bigint") - .HasColumnName("account_id"); - - b.Property("RelatedId") - .HasColumnType("bigint") - .HasColumnName("related_id"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property("ExpiredAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("expired_at"); - - b.Property("Status") - .HasColumnType("integer") - .HasColumnName("status"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.HasKey("AccountId", "RelatedId") - .HasName("pk_account_relationships"); - - b.HasIndex("RelatedId") - .HasDatabaseName("ix_account_relationships_related_id"); - - b.ToTable("account_relationships", (string)null); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Account.Status", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uuid") - .HasColumnName("id"); - - b.Property("AccountId") - .HasColumnType("bigint") - .HasColumnName("account_id"); - - b.Property("Attitude") - .HasColumnType("integer") - .HasColumnName("attitude"); - - b.Property("ClearedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("cleared_at"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property("IsInvisible") - .HasColumnType("boolean") - .HasColumnName("is_invisible"); - - b.Property("IsNotDisturb") - .HasColumnType("boolean") - .HasColumnName("is_not_disturb"); - - b.Property("Label") - .HasMaxLength(1024) - .HasColumnType("character varying(1024)") - .HasColumnName("label"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.HasKey("Id") - .HasName("pk_account_statuses"); - - b.HasIndex("AccountId") - .HasDatabaseName("ix_account_statuses_account_id"); - - b.ToTable("account_statuses", (string)null); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Activity.Activity", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uuid") - .HasColumnName("id"); - - b.Property("AccountId") - .HasColumnType("bigint") - .HasColumnName("account_id"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property>("Meta") - .IsRequired() - .HasColumnType("jsonb") - .HasColumnName("meta"); - - b.Property("ResourceIdentifier") - .IsRequired() - .HasMaxLength(4096) - .HasColumnType("character varying(4096)") - .HasColumnName("resource_identifier"); - - b.Property("Type") - .IsRequired() - .HasMaxLength(1024) - .HasColumnType("character varying(1024)") - .HasColumnName("type"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.Property>("UsersVisible") - .IsRequired() - .HasColumnType("jsonb") - .HasColumnName("users_visible"); - - b.Property("Visibility") - .HasColumnType("integer") - .HasColumnName("visibility"); - - b.HasKey("Id") - .HasName("pk_activities"); - - b.HasIndex("AccountId") - .HasDatabaseName("ix_activities_account_id"); - - b.ToTable("activities", (string)null); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Auth.Challenge", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uuid") - .HasColumnName("id"); - - b.Property("AccountId") - .HasColumnType("bigint") - .HasColumnName("account_id"); - - b.Property>("Audiences") - .IsRequired() - .HasColumnType("jsonb") - .HasColumnName("audiences"); - - b.Property>("BlacklistFactors") - .IsRequired() - .HasColumnType("jsonb") - .HasColumnName("blacklist_factors"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property("DeviceId") - .HasMaxLength(256) - .HasColumnType("character varying(256)") - .HasColumnName("device_id"); - - b.Property("ExpiredAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("expired_at"); - - b.Property("FailedAttempts") - .HasColumnType("integer") - .HasColumnName("failed_attempts"); - - b.Property("IpAddress") - .HasMaxLength(128) - .HasColumnType("character varying(128)") - .HasColumnName("ip_address"); - - b.Property("Nonce") - .HasMaxLength(1024) - .HasColumnType("character varying(1024)") - .HasColumnName("nonce"); - - b.Property("Platform") - .HasColumnType("integer") - .HasColumnName("platform"); - - b.Property>("Scopes") - .IsRequired() - .HasColumnType("jsonb") - .HasColumnName("scopes"); - - b.Property("StepRemain") - .HasColumnType("integer") - .HasColumnName("step_remain"); - - b.Property("StepTotal") - .HasColumnType("integer") - .HasColumnName("step_total"); - - b.Property("Type") - .HasColumnType("integer") - .HasColumnName("type"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.Property("UserAgent") - .HasMaxLength(512) - .HasColumnType("character varying(512)") - .HasColumnName("user_agent"); - - b.HasKey("Id") - .HasName("pk_auth_challenges"); - - b.HasIndex("AccountId") - .HasDatabaseName("ix_auth_challenges_account_id"); - - b.ToTable("auth_challenges", (string)null); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Auth.Session", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uuid") - .HasColumnName("id"); - - b.Property("AccountId") - .HasColumnType("bigint") - .HasColumnName("account_id"); - - b.Property("ChallengeId") - .HasColumnType("uuid") - .HasColumnName("challenge_id"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property("ExpiredAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("expired_at"); - - b.Property("Label") - .HasMaxLength(1024) - .HasColumnType("character varying(1024)") - .HasColumnName("label"); - - b.Property("LastGrantedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("last_granted_at"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.HasKey("Id") - .HasName("pk_auth_sessions"); - - b.HasIndex("AccountId") - .HasDatabaseName("ix_auth_sessions_account_id"); - - b.HasIndex("ChallengeId") - .HasDatabaseName("ix_auth_sessions_challenge_id"); - - b.ToTable("auth_sessions", (string)null); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Chat.ChatMember", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uuid") - .HasColumnName("id"); - - b.Property("AccountId") - .HasColumnType("bigint") - .HasColumnName("account_id"); - - b.Property("ChatRoomId") - .HasColumnType("bigint") - .HasColumnName("chat_room_id"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property("IsBot") - .HasColumnType("boolean") - .HasColumnName("is_bot"); - - b.Property("JoinedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("joined_at"); - - b.Property("Nick") - .HasMaxLength(1024) - .HasColumnType("character varying(1024)") - .HasColumnName("nick"); - - b.Property("Notify") - .HasColumnType("integer") - .HasColumnName("notify"); - - b.Property("Role") - .HasColumnType("integer") - .HasColumnName("role"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.HasKey("Id") - .HasName("pk_chat_members"); - - b.HasAlternateKey("ChatRoomId", "AccountId") - .HasName("ak_chat_members_chat_room_id_account_id"); - - b.HasIndex("AccountId") - .HasDatabaseName("ix_chat_members_account_id"); - - b.ToTable("chat_members", (string)null); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Chat.ChatRoom", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("BackgroundId") - .HasColumnType("character varying(128)") - .HasColumnName("background_id"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property("Description") - .IsRequired() - .HasMaxLength(4096) - .HasColumnType("character varying(4096)") - .HasColumnName("description"); - - b.Property("IsPublic") - .HasColumnType("boolean") - .HasColumnName("is_public"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(1024) - .HasColumnType("character varying(1024)") - .HasColumnName("name"); - - b.Property("PictureId") - .HasColumnType("character varying(128)") - .HasColumnName("picture_id"); - - b.Property("RealmId") - .HasColumnType("bigint") - .HasColumnName("realm_id"); - - b.Property("Type") - .HasColumnType("integer") - .HasColumnName("type"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.HasKey("Id") - .HasName("pk_chat_rooms"); - - b.HasIndex("BackgroundId") - .HasDatabaseName("ix_chat_rooms_background_id"); - - b.HasIndex("PictureId") - .HasDatabaseName("ix_chat_rooms_picture_id"); - - b.HasIndex("RealmId") - .HasDatabaseName("ix_chat_rooms_realm_id"); - - b.ToTable("chat_rooms", (string)null); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Chat.Message", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uuid") - .HasColumnName("id"); - - b.Property("ChatRoomId") - .HasColumnType("bigint") - .HasColumnName("chat_room_id"); - - b.Property("Content") - .HasMaxLength(4096) - .HasColumnType("character varying(4096)") - .HasColumnName("content"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property("EditedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("edited_at"); - - b.Property("ForwardedMessageId") - .HasColumnType("uuid") - .HasColumnName("forwarded_message_id"); - - b.Property>("MembersMentioned") - .HasColumnType("jsonb") - .HasColumnName("members_mentioned"); - - b.Property>("Meta") - .HasColumnType("jsonb") - .HasColumnName("meta"); - - b.Property("Nonce") - .IsRequired() - .HasMaxLength(36) - .HasColumnType("character varying(36)") - .HasColumnName("nonce"); - - b.Property("RepliedMessageId") - .HasColumnType("uuid") - .HasColumnName("replied_message_id"); - - b.Property("SenderId") - .HasColumnType("uuid") - .HasColumnName("sender_id"); - - b.Property("Type") - .IsRequired() - .HasColumnType("text") - .HasColumnName("type"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.HasKey("Id") - .HasName("pk_chat_messages"); - - b.HasIndex("ChatRoomId") - .HasDatabaseName("ix_chat_messages_chat_room_id"); - - b.HasIndex("ForwardedMessageId") - .HasDatabaseName("ix_chat_messages_forwarded_message_id"); - - b.HasIndex("RepliedMessageId") - .HasDatabaseName("ix_chat_messages_replied_message_id"); - - b.HasIndex("SenderId") - .HasDatabaseName("ix_chat_messages_sender_id"); - - b.ToTable("chat_messages", (string)null); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Chat.MessageReaction", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uuid") - .HasColumnName("id"); - - b.Property("Attitude") - .HasColumnType("integer") - .HasColumnName("attitude"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property("MessageId") - .HasColumnType("uuid") - .HasColumnName("message_id"); - - b.Property("SenderId") - .HasColumnType("uuid") - .HasColumnName("sender_id"); - - b.Property("Symbol") - .IsRequired() - .HasMaxLength(256) - .HasColumnType("character varying(256)") - .HasColumnName("symbol"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.HasKey("Id") - .HasName("pk_chat_reactions"); - - b.HasIndex("MessageId") - .HasDatabaseName("ix_chat_reactions_message_id"); - - b.HasIndex("SenderId") - .HasDatabaseName("ix_chat_reactions_sender_id"); - - b.ToTable("chat_reactions", (string)null); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Chat.MessageStatus", b => - { - b.Property("MessageId") - .HasColumnType("uuid") - .HasColumnName("message_id"); - - b.Property("SenderId") - .HasColumnType("uuid") - .HasColumnName("sender_id"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property("ReadAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("read_at"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.HasKey("MessageId", "SenderId") - .HasName("pk_chat_statuses"); - - b.HasIndex("SenderId") - .HasDatabaseName("ix_chat_statuses_sender_id"); - - b.ToTable("chat_statuses", (string)null); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Chat.RealtimeCall", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uuid") - .HasColumnName("id"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property("EndedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("ended_at"); - - b.Property("RoomId") - .HasColumnType("bigint") - .HasColumnName("room_id"); - - b.Property("SenderId") - .HasColumnType("uuid") - .HasColumnName("sender_id"); - - b.Property("Title") - .HasColumnType("text") - .HasColumnName("title"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.HasKey("Id") - .HasName("pk_chat_realtime_call"); - - b.HasIndex("RoomId") - .HasDatabaseName("ix_chat_realtime_call_room_id"); - - b.HasIndex("SenderId") - .HasDatabaseName("ix_chat_realtime_call_sender_id"); - - b.ToTable("chat_realtime_call", (string)null); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Permission.PermissionGroup", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uuid") - .HasColumnName("id"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property("Key") - .IsRequired() - .HasMaxLength(1024) - .HasColumnType("character varying(1024)") - .HasColumnName("key"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.HasKey("Id") - .HasName("pk_permission_groups"); - - b.ToTable("permission_groups", (string)null); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Permission.PermissionGroupMember", b => - { - b.Property("GroupId") - .HasColumnType("uuid") - .HasColumnName("group_id"); - - b.Property("Actor") - .HasMaxLength(1024) - .HasColumnType("character varying(1024)") - .HasColumnName("actor"); - - b.Property("AffectedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("affected_at"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property("ExpiredAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("expired_at"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.HasKey("GroupId", "Actor") - .HasName("pk_permission_group_members"); - - b.ToTable("permission_group_members", (string)null); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Permission.PermissionNode", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uuid") - .HasColumnName("id"); - - b.Property("Actor") - .IsRequired() - .HasMaxLength(1024) - .HasColumnType("character varying(1024)") - .HasColumnName("actor"); - - b.Property("AffectedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("affected_at"); - - b.Property("Area") - .IsRequired() - .HasMaxLength(1024) - .HasColumnType("character varying(1024)") - .HasColumnName("area"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property("ExpiredAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("expired_at"); - - b.Property("GroupId") - .HasColumnType("uuid") - .HasColumnName("group_id"); - - b.Property("Key") - .IsRequired() - .HasMaxLength(1024) - .HasColumnType("character varying(1024)") - .HasColumnName("key"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.Property("Value") - .IsRequired() - .HasColumnType("jsonb") - .HasColumnName("value"); - - b.HasKey("Id") - .HasName("pk_permission_nodes"); - - b.HasIndex("GroupId") - .HasDatabaseName("ix_permission_nodes_group_id"); - - b.HasIndex("Key", "Area", "Actor") - .HasDatabaseName("ix_permission_nodes_key_area_actor"); - - b.ToTable("permission_nodes", (string)null); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Post.Post", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Content") - .HasColumnType("text") - .HasColumnName("content"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property("Description") - .HasMaxLength(4096) - .HasColumnType("character varying(4096)") - .HasColumnName("description"); - - b.Property("Downvotes") - .HasColumnType("integer") - .HasColumnName("downvotes"); - - b.Property("EditedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("edited_at"); - - b.Property("ForwardedPostId") - .HasColumnType("bigint") - .HasColumnName("forwarded_post_id"); - - b.Property("Language") - .HasMaxLength(128) - .HasColumnType("character varying(128)") - .HasColumnName("language"); - - b.Property>("Meta") - .HasColumnType("jsonb") - .HasColumnName("meta"); - - b.Property("PublishedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("published_at"); - - b.Property("PublisherId") - .HasColumnType("bigint") - .HasColumnName("publisher_id"); - - b.Property("RepliedPostId") - .HasColumnType("bigint") - .HasColumnName("replied_post_id"); - - b.Property("SearchVector") - .IsRequired() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("tsvector") - .HasColumnName("search_vector") - .HasAnnotation("Npgsql:TsVectorConfig", "simple") - .HasAnnotation("Npgsql:TsVectorProperties", new[] { "Title", "Description", "Content" }); - - b.Property("ThreadedPostId") - .HasColumnType("bigint") - .HasColumnName("threaded_post_id"); - - b.Property("Title") - .HasMaxLength(1024) - .HasColumnType("character varying(1024)") - .HasColumnName("title"); - - b.Property("Type") - .HasColumnType("integer") - .HasColumnName("type"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.Property("Upvotes") - .HasColumnType("integer") - .HasColumnName("upvotes"); - - b.Property("ViewsTotal") - .HasColumnType("integer") - .HasColumnName("views_total"); - - b.Property("ViewsUnique") - .HasColumnType("integer") - .HasColumnName("views_unique"); - - b.Property("Visibility") - .HasColumnType("integer") - .HasColumnName("visibility"); - - b.HasKey("Id") - .HasName("pk_posts"); - - b.HasIndex("ForwardedPostId") - .HasDatabaseName("ix_posts_forwarded_post_id"); - - b.HasIndex("PublisherId") - .HasDatabaseName("ix_posts_publisher_id"); - - b.HasIndex("RepliedPostId") - .HasDatabaseName("ix_posts_replied_post_id"); - - b.HasIndex("SearchVector") - .HasDatabaseName("ix_posts_search_vector"); - - NpgsqlIndexBuilderExtensions.HasMethod(b.HasIndex("SearchVector"), "GIN"); - - b.HasIndex("ThreadedPostId") - .IsUnique() - .HasDatabaseName("ix_posts_threaded_post_id"); - - b.ToTable("posts", (string)null); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Post.PostCategory", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property("Name") - .HasMaxLength(256) - .HasColumnType("character varying(256)") - .HasColumnName("name"); - - b.Property("Slug") - .IsRequired() - .HasMaxLength(128) - .HasColumnType("character varying(128)") - .HasColumnName("slug"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.HasKey("Id") - .HasName("pk_post_categories"); - - b.ToTable("post_categories", (string)null); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Post.PostCollection", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property("Description") - .HasMaxLength(4096) - .HasColumnType("character varying(4096)") - .HasColumnName("description"); - - b.Property("Name") - .HasMaxLength(256) - .HasColumnType("character varying(256)") - .HasColumnName("name"); - - b.Property("PublisherId") - .HasColumnType("bigint") - .HasColumnName("publisher_id"); - - b.Property("Slug") - .IsRequired() - .HasMaxLength(128) - .HasColumnType("character varying(128)") - .HasColumnName("slug"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.HasKey("Id") - .HasName("pk_post_collections"); - - b.HasIndex("PublisherId") - .HasDatabaseName("ix_post_collections_publisher_id"); - - b.ToTable("post_collections", (string)null); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Post.PostReaction", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AccountId") - .HasColumnType("bigint") - .HasColumnName("account_id"); - - b.Property("Attitude") - .HasColumnType("integer") - .HasColumnName("attitude"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property("PostId") - .HasColumnType("bigint") - .HasColumnName("post_id"); - - b.Property("Symbol") - .IsRequired() - .HasMaxLength(256) - .HasColumnType("character varying(256)") - .HasColumnName("symbol"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.HasKey("Id") - .HasName("pk_post_reactions"); - - b.HasIndex("AccountId") - .HasDatabaseName("ix_post_reactions_account_id"); - - b.HasIndex("PostId") - .HasDatabaseName("ix_post_reactions_post_id"); - - b.ToTable("post_reactions", (string)null); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Post.PostTag", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property("Name") - .HasMaxLength(256) - .HasColumnType("character varying(256)") - .HasColumnName("name"); - - b.Property("Slug") - .IsRequired() - .HasMaxLength(128) - .HasColumnType("character varying(128)") - .HasColumnName("slug"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.HasKey("Id") - .HasName("pk_post_tags"); - - b.ToTable("post_tags", (string)null); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Post.Publisher", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AccountId") - .HasColumnType("bigint") - .HasColumnName("account_id"); - - b.Property("BackgroundId") - .HasColumnType("character varying(128)") - .HasColumnName("background_id"); - - b.Property("Bio") - .HasMaxLength(4096) - .HasColumnType("character varying(4096)") - .HasColumnName("bio"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(256) - .HasColumnType("character varying(256)") - .HasColumnName("name"); - - b.Property("Nick") - .IsRequired() - .HasMaxLength(256) - .HasColumnType("character varying(256)") - .HasColumnName("nick"); - - b.Property("PictureId") - .HasColumnType("character varying(128)") - .HasColumnName("picture_id"); - - b.Property("PublisherType") - .HasColumnType("integer") - .HasColumnName("publisher_type"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.HasKey("Id") - .HasName("pk_publishers"); - - b.HasIndex("AccountId") - .HasDatabaseName("ix_publishers_account_id"); - - b.HasIndex("BackgroundId") - .HasDatabaseName("ix_publishers_background_id"); - - b.HasIndex("Name") - .IsUnique() - .HasDatabaseName("ix_publishers_name"); - - b.HasIndex("PictureId") - .HasDatabaseName("ix_publishers_picture_id"); - - b.ToTable("publishers", (string)null); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Post.PublisherMember", b => - { - b.Property("PublisherId") - .HasColumnType("bigint") - .HasColumnName("publisher_id"); - - b.Property("AccountId") - .HasColumnType("bigint") - .HasColumnName("account_id"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property("JoinedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("joined_at"); - - b.Property("Role") - .HasColumnType("integer") - .HasColumnName("role"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.HasKey("PublisherId", "AccountId") - .HasName("pk_publisher_members"); - - b.HasIndex("AccountId") - .HasDatabaseName("ix_publisher_members_account_id"); - - b.ToTable("publisher_members", (string)null); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Realm.Realm", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AccountId") - .HasColumnType("bigint") - .HasColumnName("account_id"); - - b.Property("BackgroundId") - .HasColumnType("character varying(128)") - .HasColumnName("background_id"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property("Description") - .IsRequired() - .HasMaxLength(4096) - .HasColumnType("character varying(4096)") - .HasColumnName("description"); - - b.Property("IsCommunity") - .HasColumnType("boolean") - .HasColumnName("is_community"); - - b.Property("IsPublic") - .HasColumnType("boolean") - .HasColumnName("is_public"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(1024) - .HasColumnType("character varying(1024)") - .HasColumnName("name"); - - b.Property("PictureId") - .HasColumnType("character varying(128)") - .HasColumnName("picture_id"); - - b.Property("Slug") - .IsRequired() - .HasMaxLength(1024) - .HasColumnType("character varying(1024)") - .HasColumnName("slug"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.Property("VerifiedAs") - .HasMaxLength(4096) - .HasColumnType("character varying(4096)") - .HasColumnName("verified_as"); - - b.Property("VerifiedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("verified_at"); - - b.HasKey("Id") - .HasName("pk_realms"); - - b.HasIndex("AccountId") - .HasDatabaseName("ix_realms_account_id"); - - b.HasIndex("BackgroundId") - .HasDatabaseName("ix_realms_background_id"); - - b.HasIndex("PictureId") - .HasDatabaseName("ix_realms_picture_id"); - - b.HasIndex("Slug") - .IsUnique() - .HasDatabaseName("ix_realms_slug"); - - b.ToTable("realms", (string)null); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Realm.RealmMember", b => - { - b.Property("RealmId") - .HasColumnType("bigint") - .HasColumnName("realm_id"); - - b.Property("AccountId") - .HasColumnType("bigint") - .HasColumnName("account_id"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property("JoinedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("joined_at"); - - b.Property("Role") - .HasColumnType("integer") - .HasColumnName("role"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.HasKey("RealmId", "AccountId") - .HasName("pk_realm_members"); - - b.HasIndex("AccountId") - .HasDatabaseName("ix_realm_members_account_id"); - - b.ToTable("realm_members", (string)null); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Storage.CloudFile", b => - { - b.Property("Id") - .HasMaxLength(128) - .HasColumnType("character varying(128)") - .HasColumnName("id"); - - b.Property("AccountId") - .HasColumnType("bigint") - .HasColumnName("account_id"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property("Description") - .HasMaxLength(4096) - .HasColumnType("character varying(4096)") - .HasColumnName("description"); - - b.Property("ExpiredAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("expired_at"); - - b.Property>("FileMeta") - .HasColumnType("jsonb") - .HasColumnName("file_meta"); - - b.Property("HasCompression") - .HasColumnType("boolean") - .HasColumnName("has_compression"); - - b.Property("Hash") - .HasMaxLength(256) - .HasColumnType("character varying(256)") - .HasColumnName("hash"); - - b.Property("MessageId") - .HasColumnType("uuid") - .HasColumnName("message_id"); - - b.Property("MimeType") - .HasMaxLength(256) - .HasColumnType("character varying(256)") - .HasColumnName("mime_type"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(1024) - .HasColumnType("character varying(1024)") - .HasColumnName("name"); - - b.Property("PostId") - .HasColumnType("bigint") - .HasColumnName("post_id"); - - b.Property("Size") - .HasColumnType("bigint") - .HasColumnName("size"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.Property("UploadedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("uploaded_at"); - - b.Property("UploadedTo") - .HasMaxLength(128) - .HasColumnType("character varying(128)") - .HasColumnName("uploaded_to"); - - b.Property("UsedCount") - .HasColumnType("integer") - .HasColumnName("used_count"); - - b.Property>("UserMeta") - .HasColumnType("jsonb") - .HasColumnName("user_meta"); - - b.HasKey("Id") - .HasName("pk_files"); - - b.HasIndex("AccountId") - .HasDatabaseName("ix_files_account_id"); - - b.HasIndex("MessageId") - .HasDatabaseName("ix_files_message_id"); - - b.HasIndex("PostId") - .HasDatabaseName("ix_files_post_id"); - - b.ToTable("files", (string)null); - }); - - modelBuilder.Entity("PostPostCategory", b => - { - b.Property("CategoriesId") - .HasColumnType("bigint") - .HasColumnName("categories_id"); - - b.Property("PostsId") - .HasColumnType("bigint") - .HasColumnName("posts_id"); - - b.HasKey("CategoriesId", "PostsId") - .HasName("pk_post_category_links"); - - b.HasIndex("PostsId") - .HasDatabaseName("ix_post_category_links_posts_id"); - - b.ToTable("post_category_links", (string)null); - }); - - modelBuilder.Entity("PostPostCollection", b => - { - b.Property("CollectionsId") - .HasColumnType("bigint") - .HasColumnName("collections_id"); - - b.Property("PostsId") - .HasColumnType("bigint") - .HasColumnName("posts_id"); - - b.HasKey("CollectionsId", "PostsId") - .HasName("pk_post_collection_links"); - - b.HasIndex("PostsId") - .HasDatabaseName("ix_post_collection_links_posts_id"); - - b.ToTable("post_collection_links", (string)null); - }); - - modelBuilder.Entity("PostPostTag", b => - { - b.Property("PostsId") - .HasColumnType("bigint") - .HasColumnName("posts_id"); - - b.Property("TagsId") - .HasColumnType("bigint") - .HasColumnName("tags_id"); - - b.HasKey("PostsId", "TagsId") - .HasName("pk_post_tag_links"); - - b.HasIndex("TagsId") - .HasDatabaseName("ix_post_tag_links_tags_id"); - - b.ToTable("post_tag_links", (string)null); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Account.AccountAuthFactor", b => - { - b.HasOne("DysonNetwork.Sphere.Account.Account", "Account") - .WithMany("AuthFactors") - .HasForeignKey("AccountId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_account_auth_factors_accounts_account_id"); - - b.Navigation("Account"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Account.AccountContact", b => - { - b.HasOne("DysonNetwork.Sphere.Account.Account", "Account") - .WithMany("Contacts") - .HasForeignKey("AccountId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_account_contacts_accounts_account_id"); - - b.Navigation("Account"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Account.CheckInResult", b => - { - b.HasOne("DysonNetwork.Sphere.Account.Account", "Account") - .WithMany() - .HasForeignKey("AccountId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_account_check_in_results_accounts_account_id"); - - b.Navigation("Account"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Account.MagicSpell", b => - { - b.HasOne("DysonNetwork.Sphere.Account.Account", "Account") - .WithMany() - .HasForeignKey("AccountId") - .HasConstraintName("fk_magic_spells_accounts_account_id"); - - b.Navigation("Account"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Account.Notification", b => - { - b.HasOne("DysonNetwork.Sphere.Account.Account", "Account") - .WithMany() - .HasForeignKey("AccountId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_notifications_accounts_account_id"); - - b.Navigation("Account"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Account.NotificationPushSubscription", b => - { - b.HasOne("DysonNetwork.Sphere.Account.Account", "Account") - .WithMany() - .HasForeignKey("AccountId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_notification_push_subscriptions_accounts_account_id"); - - b.Navigation("Account"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Account.Profile", b => - { - b.HasOne("DysonNetwork.Sphere.Storage.CloudFile", "Background") - .WithMany() - .HasForeignKey("BackgroundId") - .HasConstraintName("fk_account_profiles_files_background_id"); - - b.HasOne("DysonNetwork.Sphere.Account.Account", "Account") - .WithOne("Profile") - .HasForeignKey("DysonNetwork.Sphere.Account.Profile", "Id") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_account_profiles_accounts_id"); - - b.HasOne("DysonNetwork.Sphere.Storage.CloudFile", "Picture") - .WithMany() - .HasForeignKey("PictureId") - .HasConstraintName("fk_account_profiles_files_picture_id"); - - b.Navigation("Account"); - - b.Navigation("Background"); - - b.Navigation("Picture"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Account.Relationship", b => - { - b.HasOne("DysonNetwork.Sphere.Account.Account", "Account") - .WithMany("OutgoingRelationships") - .HasForeignKey("AccountId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_account_relationships_accounts_account_id"); - - b.HasOne("DysonNetwork.Sphere.Account.Account", "Related") - .WithMany("IncomingRelationships") - .HasForeignKey("RelatedId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_account_relationships_accounts_related_id"); - - b.Navigation("Account"); - - b.Navigation("Related"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Account.Status", b => - { - b.HasOne("DysonNetwork.Sphere.Account.Account", "Account") - .WithMany() - .HasForeignKey("AccountId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_account_statuses_accounts_account_id"); - - b.Navigation("Account"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Activity.Activity", b => - { - b.HasOne("DysonNetwork.Sphere.Account.Account", "Account") - .WithMany() - .HasForeignKey("AccountId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_activities_accounts_account_id"); - - b.Navigation("Account"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Auth.Challenge", b => - { - b.HasOne("DysonNetwork.Sphere.Account.Account", "Account") - .WithMany("Challenges") - .HasForeignKey("AccountId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_auth_challenges_accounts_account_id"); - - b.Navigation("Account"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Auth.Session", b => - { - b.HasOne("DysonNetwork.Sphere.Account.Account", "Account") - .WithMany("Sessions") - .HasForeignKey("AccountId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_auth_sessions_accounts_account_id"); - - b.HasOne("DysonNetwork.Sphere.Auth.Challenge", "Challenge") - .WithMany() - .HasForeignKey("ChallengeId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_auth_sessions_auth_challenges_challenge_id"); - - b.Navigation("Account"); - - b.Navigation("Challenge"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Chat.ChatMember", b => - { - b.HasOne("DysonNetwork.Sphere.Account.Account", "Account") - .WithMany() - .HasForeignKey("AccountId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_chat_members_accounts_account_id"); - - b.HasOne("DysonNetwork.Sphere.Chat.ChatRoom", "ChatRoom") - .WithMany("Members") - .HasForeignKey("ChatRoomId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_chat_members_chat_rooms_chat_room_id"); - - b.Navigation("Account"); - - b.Navigation("ChatRoom"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Chat.ChatRoom", b => - { - b.HasOne("DysonNetwork.Sphere.Storage.CloudFile", "Background") - .WithMany() - .HasForeignKey("BackgroundId") - .HasConstraintName("fk_chat_rooms_files_background_id"); - - b.HasOne("DysonNetwork.Sphere.Storage.CloudFile", "Picture") - .WithMany() - .HasForeignKey("PictureId") - .HasConstraintName("fk_chat_rooms_files_picture_id"); - - b.HasOne("DysonNetwork.Sphere.Realm.Realm", "Realm") - .WithMany("ChatRooms") - .HasForeignKey("RealmId") - .HasConstraintName("fk_chat_rooms_realms_realm_id"); - - b.Navigation("Background"); - - b.Navigation("Picture"); - - b.Navigation("Realm"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Chat.Message", b => - { - b.HasOne("DysonNetwork.Sphere.Chat.ChatRoom", "ChatRoom") - .WithMany() - .HasForeignKey("ChatRoomId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_chat_messages_chat_rooms_chat_room_id"); - - b.HasOne("DysonNetwork.Sphere.Chat.Message", "ForwardedMessage") - .WithMany() - .HasForeignKey("ForwardedMessageId") - .OnDelete(DeleteBehavior.Restrict) - .HasConstraintName("fk_chat_messages_chat_messages_forwarded_message_id"); - - b.HasOne("DysonNetwork.Sphere.Chat.Message", "RepliedMessage") - .WithMany() - .HasForeignKey("RepliedMessageId") - .OnDelete(DeleteBehavior.Restrict) - .HasConstraintName("fk_chat_messages_chat_messages_replied_message_id"); - - b.HasOne("DysonNetwork.Sphere.Chat.ChatMember", "Sender") - .WithMany() - .HasForeignKey("SenderId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_chat_messages_chat_members_sender_id"); - - b.Navigation("ChatRoom"); - - b.Navigation("ForwardedMessage"); - - b.Navigation("RepliedMessage"); - - b.Navigation("Sender"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Chat.MessageReaction", b => - { - b.HasOne("DysonNetwork.Sphere.Chat.Message", "Message") - .WithMany("Reactions") - .HasForeignKey("MessageId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_chat_reactions_chat_messages_message_id"); - - b.HasOne("DysonNetwork.Sphere.Chat.ChatMember", "Sender") - .WithMany() - .HasForeignKey("SenderId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_chat_reactions_chat_members_sender_id"); - - b.Navigation("Message"); - - b.Navigation("Sender"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Chat.MessageStatus", b => - { - b.HasOne("DysonNetwork.Sphere.Chat.Message", "Message") - .WithMany("Statuses") - .HasForeignKey("MessageId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_chat_statuses_chat_messages_message_id"); - - b.HasOne("DysonNetwork.Sphere.Chat.ChatMember", "Sender") - .WithMany() - .HasForeignKey("SenderId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_chat_statuses_chat_members_sender_id"); - - b.Navigation("Message"); - - b.Navigation("Sender"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Chat.RealtimeCall", b => - { - b.HasOne("DysonNetwork.Sphere.Chat.ChatRoom", "Room") - .WithMany() - .HasForeignKey("RoomId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_chat_realtime_call_chat_rooms_room_id"); - - b.HasOne("DysonNetwork.Sphere.Chat.ChatMember", "Sender") - .WithMany() - .HasForeignKey("SenderId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_chat_realtime_call_chat_members_sender_id"); - - b.Navigation("Room"); - - b.Navigation("Sender"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Permission.PermissionGroupMember", b => - { - b.HasOne("DysonNetwork.Sphere.Permission.PermissionGroup", "Group") - .WithMany("Members") - .HasForeignKey("GroupId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_permission_group_members_permission_groups_group_id"); - - b.Navigation("Group"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Permission.PermissionNode", b => - { - b.HasOne("DysonNetwork.Sphere.Permission.PermissionGroup", "Group") - .WithMany("Nodes") - .HasForeignKey("GroupId") - .HasConstraintName("fk_permission_nodes_permission_groups_group_id"); - - b.Navigation("Group"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Post.Post", b => - { - b.HasOne("DysonNetwork.Sphere.Post.Post", "ForwardedPost") - .WithMany() - .HasForeignKey("ForwardedPostId") - .OnDelete(DeleteBehavior.Restrict) - .HasConstraintName("fk_posts_posts_forwarded_post_id"); - - b.HasOne("DysonNetwork.Sphere.Post.Publisher", "Publisher") - .WithMany("Posts") - .HasForeignKey("PublisherId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_posts_publishers_publisher_id"); - - b.HasOne("DysonNetwork.Sphere.Post.Post", "RepliedPost") - .WithMany() - .HasForeignKey("RepliedPostId") - .OnDelete(DeleteBehavior.Restrict) - .HasConstraintName("fk_posts_posts_replied_post_id"); - - b.HasOne("DysonNetwork.Sphere.Post.Post", "ThreadedPost") - .WithOne() - .HasForeignKey("DysonNetwork.Sphere.Post.Post", "ThreadedPostId") - .HasConstraintName("fk_posts_posts_threaded_post_id"); - - b.Navigation("ForwardedPost"); - - b.Navigation("Publisher"); - - b.Navigation("RepliedPost"); - - b.Navigation("ThreadedPost"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Post.PostCollection", b => - { - b.HasOne("DysonNetwork.Sphere.Post.Publisher", "Publisher") - .WithMany("Collections") - .HasForeignKey("PublisherId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_post_collections_publishers_publisher_id"); - - b.Navigation("Publisher"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Post.PostReaction", b => - { - b.HasOne("DysonNetwork.Sphere.Account.Account", "Account") - .WithMany() - .HasForeignKey("AccountId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_post_reactions_accounts_account_id"); - - b.HasOne("DysonNetwork.Sphere.Post.Post", "Post") - .WithMany("Reactions") - .HasForeignKey("PostId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_post_reactions_posts_post_id"); - - b.Navigation("Account"); - - b.Navigation("Post"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Post.Publisher", b => - { - b.HasOne("DysonNetwork.Sphere.Account.Account", "Account") - .WithMany() - .HasForeignKey("AccountId") - .HasConstraintName("fk_publishers_accounts_account_id"); - - b.HasOne("DysonNetwork.Sphere.Storage.CloudFile", "Background") - .WithMany() - .HasForeignKey("BackgroundId") - .HasConstraintName("fk_publishers_files_background_id"); - - b.HasOne("DysonNetwork.Sphere.Storage.CloudFile", "Picture") - .WithMany() - .HasForeignKey("PictureId") - .HasConstraintName("fk_publishers_files_picture_id"); - - b.Navigation("Account"); - - b.Navigation("Background"); - - b.Navigation("Picture"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Post.PublisherMember", b => - { - b.HasOne("DysonNetwork.Sphere.Account.Account", "Account") - .WithMany() - .HasForeignKey("AccountId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_publisher_members_accounts_account_id"); - - b.HasOne("DysonNetwork.Sphere.Post.Publisher", "Publisher") - .WithMany("Members") - .HasForeignKey("PublisherId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_publisher_members_publishers_publisher_id"); - - b.Navigation("Account"); - - b.Navigation("Publisher"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Realm.Realm", b => - { - b.HasOne("DysonNetwork.Sphere.Account.Account", "Account") - .WithMany() - .HasForeignKey("AccountId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_realms_accounts_account_id"); - - b.HasOne("DysonNetwork.Sphere.Storage.CloudFile", "Background") - .WithMany() - .HasForeignKey("BackgroundId") - .HasConstraintName("fk_realms_files_background_id"); - - b.HasOne("DysonNetwork.Sphere.Storage.CloudFile", "Picture") - .WithMany() - .HasForeignKey("PictureId") - .HasConstraintName("fk_realms_files_picture_id"); - - b.Navigation("Account"); - - b.Navigation("Background"); - - b.Navigation("Picture"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Realm.RealmMember", b => - { - b.HasOne("DysonNetwork.Sphere.Account.Account", "Account") - .WithMany() - .HasForeignKey("AccountId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_realm_members_accounts_account_id"); - - b.HasOne("DysonNetwork.Sphere.Realm.Realm", "Realm") - .WithMany("Members") - .HasForeignKey("RealmId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_realm_members_realms_realm_id"); - - b.Navigation("Account"); - - b.Navigation("Realm"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Storage.CloudFile", b => - { - b.HasOne("DysonNetwork.Sphere.Account.Account", "Account") - .WithMany() - .HasForeignKey("AccountId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_files_accounts_account_id"); - - b.HasOne("DysonNetwork.Sphere.Chat.Message", null) - .WithMany("Attachments") - .HasForeignKey("MessageId") - .HasConstraintName("fk_files_chat_messages_message_id"); - - b.HasOne("DysonNetwork.Sphere.Post.Post", null) - .WithMany("Attachments") - .HasForeignKey("PostId") - .HasConstraintName("fk_files_posts_post_id"); - - b.Navigation("Account"); - }); - - modelBuilder.Entity("PostPostCategory", b => - { - b.HasOne("DysonNetwork.Sphere.Post.PostCategory", null) - .WithMany() - .HasForeignKey("CategoriesId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_post_category_links_post_categories_categories_id"); - - b.HasOne("DysonNetwork.Sphere.Post.Post", null) - .WithMany() - .HasForeignKey("PostsId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_post_category_links_posts_posts_id"); - }); - - modelBuilder.Entity("PostPostCollection", b => - { - b.HasOne("DysonNetwork.Sphere.Post.PostCollection", null) - .WithMany() - .HasForeignKey("CollectionsId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_post_collection_links_post_collections_collections_id"); - - b.HasOne("DysonNetwork.Sphere.Post.Post", null) - .WithMany() - .HasForeignKey("PostsId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_post_collection_links_posts_posts_id"); - }); - - modelBuilder.Entity("PostPostTag", b => - { - b.HasOne("DysonNetwork.Sphere.Post.Post", null) - .WithMany() - .HasForeignKey("PostsId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_post_tag_links_posts_posts_id"); - - b.HasOne("DysonNetwork.Sphere.Post.PostTag", null) - .WithMany() - .HasForeignKey("TagsId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_post_tag_links_post_tags_tags_id"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Account.Account", b => - { - b.Navigation("AuthFactors"); - - b.Navigation("Challenges"); - - b.Navigation("Contacts"); - - b.Navigation("IncomingRelationships"); - - b.Navigation("OutgoingRelationships"); - - b.Navigation("Profile") - .IsRequired(); - - b.Navigation("Sessions"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Chat.ChatRoom", b => - { - b.Navigation("Members"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Chat.Message", b => - { - b.Navigation("Attachments"); - - b.Navigation("Reactions"); - - b.Navigation("Statuses"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Permission.PermissionGroup", b => - { - b.Navigation("Members"); - - b.Navigation("Nodes"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Post.Post", b => - { - b.Navigation("Attachments"); - - b.Navigation("Reactions"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Post.Publisher", b => - { - b.Navigation("Collections"); - - b.Navigation("Members"); - - b.Navigation("Posts"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Realm.Realm", b => - { - b.Navigation("ChatRooms"); - - b.Navigation("Members"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/DysonNetwork.Sphere/Migrations/20250508140200_DontKnowHowToNameThing.cs b/DysonNetwork.Sphere/Migrations/20250508140200_DontKnowHowToNameThing.cs deleted file mode 100644 index a96505a..0000000 --- a/DysonNetwork.Sphere/Migrations/20250508140200_DontKnowHowToNameThing.cs +++ /dev/null @@ -1,39 +0,0 @@ -using System.Collections.Generic; -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace DysonNetwork.Sphere.Migrations -{ - /// - public partial class DontKnowHowToNameThing : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.AddColumn>( - name: "meta", - table: "activities", - type: "jsonb", - nullable: false); - - migrationBuilder.AddColumn>( - name: "users_visible", - table: "activities", - type: "jsonb", - nullable: false); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropColumn( - name: "meta", - table: "activities"); - - migrationBuilder.DropColumn( - name: "users_visible", - table: "activities"); - } - } -} diff --git a/DysonNetwork.Sphere/Migrations/20250510124730_AddStickerAndPacks.Designer.cs b/DysonNetwork.Sphere/Migrations/20250510124730_AddStickerAndPacks.Designer.cs deleted file mode 100644 index fba0a6e..0000000 --- a/DysonNetwork.Sphere/Migrations/20250510124730_AddStickerAndPacks.Designer.cs +++ /dev/null @@ -1,2693 +0,0 @@ -// -using System; -using System.Collections.Generic; -using System.Text.Json; -using DysonNetwork.Sphere; -using DysonNetwork.Sphere.Account; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using NodaTime; -using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; -using NpgsqlTypes; - -#nullable disable - -namespace DysonNetwork.Sphere.Migrations -{ - [DbContext(typeof(AppDatabase))] - [Migration("20250510124730_AddStickerAndPacks")] - partial class AddStickerAndPacks - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "9.0.3") - .HasAnnotation("Relational:MaxIdentifierLength", 63); - - NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); - - modelBuilder.Entity("DysonNetwork.Sphere.Account.Account", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ActivatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("activated_at"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property("IsSuperuser") - .HasColumnType("boolean") - .HasColumnName("is_superuser"); - - b.Property("Language") - .IsRequired() - .HasMaxLength(32) - .HasColumnType("character varying(32)") - .HasColumnName("language"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(256) - .HasColumnType("character varying(256)") - .HasColumnName("name"); - - b.Property("Nick") - .IsRequired() - .HasMaxLength(256) - .HasColumnType("character varying(256)") - .HasColumnName("nick"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.HasKey("Id") - .HasName("pk_accounts"); - - b.HasIndex("Name") - .IsUnique() - .HasDatabaseName("ix_accounts_name"); - - b.ToTable("accounts", (string)null); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Account.AccountAuthFactor", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AccountId") - .HasColumnType("bigint") - .HasColumnName("account_id"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property("Secret") - .HasColumnType("text") - .HasColumnName("secret"); - - b.Property("Type") - .HasColumnType("integer") - .HasColumnName("type"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.HasKey("Id") - .HasName("pk_account_auth_factors"); - - b.HasIndex("AccountId") - .HasDatabaseName("ix_account_auth_factors_account_id"); - - b.ToTable("account_auth_factors", (string)null); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Account.AccountContact", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AccountId") - .HasColumnType("bigint") - .HasColumnName("account_id"); - - b.Property("Content") - .IsRequired() - .HasMaxLength(1024) - .HasColumnType("character varying(1024)") - .HasColumnName("content"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property("Type") - .HasColumnType("integer") - .HasColumnName("type"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.Property("VerifiedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("verified_at"); - - b.HasKey("Id") - .HasName("pk_account_contacts"); - - b.HasIndex("AccountId") - .HasDatabaseName("ix_account_contacts_account_id"); - - b.ToTable("account_contacts", (string)null); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Account.CheckInResult", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uuid") - .HasColumnName("id"); - - b.Property("AccountId") - .HasColumnType("bigint") - .HasColumnName("account_id"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property("Level") - .HasColumnType("integer") - .HasColumnName("level"); - - b.Property>("Tips") - .IsRequired() - .HasColumnType("jsonb") - .HasColumnName("tips"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.HasKey("Id") - .HasName("pk_account_check_in_results"); - - b.HasIndex("AccountId") - .HasDatabaseName("ix_account_check_in_results_account_id"); - - b.ToTable("account_check_in_results", (string)null); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Account.MagicSpell", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uuid") - .HasColumnName("id"); - - b.Property("AccountId") - .HasColumnType("bigint") - .HasColumnName("account_id"); - - b.Property("AffectedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("affected_at"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property("ExpiresAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("expires_at"); - - b.Property>("Meta") - .IsRequired() - .HasColumnType("jsonb") - .HasColumnName("meta"); - - b.Property("Spell") - .IsRequired() - .HasMaxLength(1024) - .HasColumnType("character varying(1024)") - .HasColumnName("spell"); - - b.Property("Type") - .HasColumnType("integer") - .HasColumnName("type"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.HasKey("Id") - .HasName("pk_magic_spells"); - - b.HasIndex("AccountId") - .HasDatabaseName("ix_magic_spells_account_id"); - - b.HasIndex("Spell") - .IsUnique() - .HasDatabaseName("ix_magic_spells_spell"); - - b.ToTable("magic_spells", (string)null); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Account.Notification", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uuid") - .HasColumnName("id"); - - b.Property("AccountId") - .HasColumnType("bigint") - .HasColumnName("account_id"); - - b.Property("Content") - .HasMaxLength(4096) - .HasColumnType("character varying(4096)") - .HasColumnName("content"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property>("Meta") - .HasColumnType("jsonb") - .HasColumnName("meta"); - - b.Property("Priority") - .HasColumnType("integer") - .HasColumnName("priority"); - - b.Property("Subtitle") - .HasMaxLength(2048) - .HasColumnType("character varying(2048)") - .HasColumnName("subtitle"); - - b.Property("Title") - .HasMaxLength(1024) - .HasColumnType("character varying(1024)") - .HasColumnName("title"); - - b.Property("Topic") - .IsRequired() - .HasMaxLength(1024) - .HasColumnType("character varying(1024)") - .HasColumnName("topic"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.Property("ViewedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("viewed_at"); - - b.HasKey("Id") - .HasName("pk_notifications"); - - b.HasIndex("AccountId") - .HasDatabaseName("ix_notifications_account_id"); - - b.ToTable("notifications", (string)null); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Account.NotificationPushSubscription", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uuid") - .HasColumnName("id"); - - b.Property("AccountId") - .HasColumnType("bigint") - .HasColumnName("account_id"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property("DeviceId") - .IsRequired() - .HasMaxLength(4096) - .HasColumnType("character varying(4096)") - .HasColumnName("device_id"); - - b.Property("DeviceToken") - .IsRequired() - .HasMaxLength(4096) - .HasColumnType("character varying(4096)") - .HasColumnName("device_token"); - - b.Property("LastUsedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("last_used_at"); - - b.Property("Provider") - .HasColumnType("integer") - .HasColumnName("provider"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.HasKey("Id") - .HasName("pk_notification_push_subscriptions"); - - b.HasIndex("AccountId") - .HasDatabaseName("ix_notification_push_subscriptions_account_id"); - - b.HasIndex("DeviceId") - .IsUnique() - .HasDatabaseName("ix_notification_push_subscriptions_device_id"); - - b.HasIndex("DeviceToken") - .IsUnique() - .HasDatabaseName("ix_notification_push_subscriptions_device_token"); - - b.ToTable("notification_push_subscriptions", (string)null); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Account.Profile", b => - { - b.Property("Id") - .HasColumnType("bigint") - .HasColumnName("id"); - - b.Property("BackgroundId") - .HasColumnType("character varying(128)") - .HasColumnName("background_id"); - - b.Property("Bio") - .HasMaxLength(4096) - .HasColumnType("character varying(4096)") - .HasColumnName("bio"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property("FirstName") - .HasMaxLength(256) - .HasColumnType("character varying(256)") - .HasColumnName("first_name"); - - b.Property("LastName") - .HasMaxLength(256) - .HasColumnType("character varying(256)") - .HasColumnName("last_name"); - - b.Property("MiddleName") - .HasMaxLength(256) - .HasColumnType("character varying(256)") - .HasColumnName("middle_name"); - - b.Property("PictureId") - .HasColumnType("character varying(128)") - .HasColumnName("picture_id"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.HasKey("Id") - .HasName("pk_account_profiles"); - - b.HasIndex("BackgroundId") - .HasDatabaseName("ix_account_profiles_background_id"); - - b.HasIndex("PictureId") - .HasDatabaseName("ix_account_profiles_picture_id"); - - b.ToTable("account_profiles", (string)null); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Account.Relationship", b => - { - b.Property("AccountId") - .HasColumnType("bigint") - .HasColumnName("account_id"); - - b.Property("RelatedId") - .HasColumnType("bigint") - .HasColumnName("related_id"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property("ExpiredAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("expired_at"); - - b.Property("Status") - .HasColumnType("integer") - .HasColumnName("status"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.HasKey("AccountId", "RelatedId") - .HasName("pk_account_relationships"); - - b.HasIndex("RelatedId") - .HasDatabaseName("ix_account_relationships_related_id"); - - b.ToTable("account_relationships", (string)null); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Account.Status", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uuid") - .HasColumnName("id"); - - b.Property("AccountId") - .HasColumnType("bigint") - .HasColumnName("account_id"); - - b.Property("Attitude") - .HasColumnType("integer") - .HasColumnName("attitude"); - - b.Property("ClearedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("cleared_at"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property("IsInvisible") - .HasColumnType("boolean") - .HasColumnName("is_invisible"); - - b.Property("IsNotDisturb") - .HasColumnType("boolean") - .HasColumnName("is_not_disturb"); - - b.Property("Label") - .HasMaxLength(1024) - .HasColumnType("character varying(1024)") - .HasColumnName("label"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.HasKey("Id") - .HasName("pk_account_statuses"); - - b.HasIndex("AccountId") - .HasDatabaseName("ix_account_statuses_account_id"); - - b.ToTable("account_statuses", (string)null); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Activity.Activity", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uuid") - .HasColumnName("id"); - - b.Property("AccountId") - .HasColumnType("bigint") - .HasColumnName("account_id"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property>("Meta") - .IsRequired() - .HasColumnType("jsonb") - .HasColumnName("meta"); - - b.Property("ResourceIdentifier") - .IsRequired() - .HasMaxLength(4096) - .HasColumnType("character varying(4096)") - .HasColumnName("resource_identifier"); - - b.Property("Type") - .IsRequired() - .HasMaxLength(1024) - .HasColumnType("character varying(1024)") - .HasColumnName("type"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.Property>("UsersVisible") - .IsRequired() - .HasColumnType("jsonb") - .HasColumnName("users_visible"); - - b.Property("Visibility") - .HasColumnType("integer") - .HasColumnName("visibility"); - - b.HasKey("Id") - .HasName("pk_activities"); - - b.HasIndex("AccountId") - .HasDatabaseName("ix_activities_account_id"); - - b.ToTable("activities", (string)null); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Auth.Challenge", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uuid") - .HasColumnName("id"); - - b.Property("AccountId") - .HasColumnType("bigint") - .HasColumnName("account_id"); - - b.Property>("Audiences") - .IsRequired() - .HasColumnType("jsonb") - .HasColumnName("audiences"); - - b.Property>("BlacklistFactors") - .IsRequired() - .HasColumnType("jsonb") - .HasColumnName("blacklist_factors"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property("DeviceId") - .HasMaxLength(256) - .HasColumnType("character varying(256)") - .HasColumnName("device_id"); - - b.Property("ExpiredAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("expired_at"); - - b.Property("FailedAttempts") - .HasColumnType("integer") - .HasColumnName("failed_attempts"); - - b.Property("IpAddress") - .HasMaxLength(128) - .HasColumnType("character varying(128)") - .HasColumnName("ip_address"); - - b.Property("Nonce") - .HasMaxLength(1024) - .HasColumnType("character varying(1024)") - .HasColumnName("nonce"); - - b.Property("Platform") - .HasColumnType("integer") - .HasColumnName("platform"); - - b.Property>("Scopes") - .IsRequired() - .HasColumnType("jsonb") - .HasColumnName("scopes"); - - b.Property("StepRemain") - .HasColumnType("integer") - .HasColumnName("step_remain"); - - b.Property("StepTotal") - .HasColumnType("integer") - .HasColumnName("step_total"); - - b.Property("Type") - .HasColumnType("integer") - .HasColumnName("type"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.Property("UserAgent") - .HasMaxLength(512) - .HasColumnType("character varying(512)") - .HasColumnName("user_agent"); - - b.HasKey("Id") - .HasName("pk_auth_challenges"); - - b.HasIndex("AccountId") - .HasDatabaseName("ix_auth_challenges_account_id"); - - b.ToTable("auth_challenges", (string)null); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Auth.Session", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uuid") - .HasColumnName("id"); - - b.Property("AccountId") - .HasColumnType("bigint") - .HasColumnName("account_id"); - - b.Property("ChallengeId") - .HasColumnType("uuid") - .HasColumnName("challenge_id"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property("ExpiredAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("expired_at"); - - b.Property("Label") - .HasMaxLength(1024) - .HasColumnType("character varying(1024)") - .HasColumnName("label"); - - b.Property("LastGrantedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("last_granted_at"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.HasKey("Id") - .HasName("pk_auth_sessions"); - - b.HasIndex("AccountId") - .HasDatabaseName("ix_auth_sessions_account_id"); - - b.HasIndex("ChallengeId") - .HasDatabaseName("ix_auth_sessions_challenge_id"); - - b.ToTable("auth_sessions", (string)null); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Chat.ChatMember", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uuid") - .HasColumnName("id"); - - b.Property("AccountId") - .HasColumnType("bigint") - .HasColumnName("account_id"); - - b.Property("ChatRoomId") - .HasColumnType("bigint") - .HasColumnName("chat_room_id"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property("IsBot") - .HasColumnType("boolean") - .HasColumnName("is_bot"); - - b.Property("JoinedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("joined_at"); - - b.Property("Nick") - .HasMaxLength(1024) - .HasColumnType("character varying(1024)") - .HasColumnName("nick"); - - b.Property("Notify") - .HasColumnType("integer") - .HasColumnName("notify"); - - b.Property("Role") - .HasColumnType("integer") - .HasColumnName("role"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.HasKey("Id") - .HasName("pk_chat_members"); - - b.HasAlternateKey("ChatRoomId", "AccountId") - .HasName("ak_chat_members_chat_room_id_account_id"); - - b.HasIndex("AccountId") - .HasDatabaseName("ix_chat_members_account_id"); - - b.ToTable("chat_members", (string)null); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Chat.ChatRoom", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("BackgroundId") - .HasColumnType("character varying(128)") - .HasColumnName("background_id"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property("Description") - .IsRequired() - .HasMaxLength(4096) - .HasColumnType("character varying(4096)") - .HasColumnName("description"); - - b.Property("IsPublic") - .HasColumnType("boolean") - .HasColumnName("is_public"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(1024) - .HasColumnType("character varying(1024)") - .HasColumnName("name"); - - b.Property("PictureId") - .HasColumnType("character varying(128)") - .HasColumnName("picture_id"); - - b.Property("RealmId") - .HasColumnType("bigint") - .HasColumnName("realm_id"); - - b.Property("Type") - .HasColumnType("integer") - .HasColumnName("type"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.HasKey("Id") - .HasName("pk_chat_rooms"); - - b.HasIndex("BackgroundId") - .HasDatabaseName("ix_chat_rooms_background_id"); - - b.HasIndex("PictureId") - .HasDatabaseName("ix_chat_rooms_picture_id"); - - b.HasIndex("RealmId") - .HasDatabaseName("ix_chat_rooms_realm_id"); - - b.ToTable("chat_rooms", (string)null); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Chat.Message", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uuid") - .HasColumnName("id"); - - b.Property("ChatRoomId") - .HasColumnType("bigint") - .HasColumnName("chat_room_id"); - - b.Property("Content") - .HasMaxLength(4096) - .HasColumnType("character varying(4096)") - .HasColumnName("content"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property("EditedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("edited_at"); - - b.Property("ForwardedMessageId") - .HasColumnType("uuid") - .HasColumnName("forwarded_message_id"); - - b.Property>("MembersMentioned") - .HasColumnType("jsonb") - .HasColumnName("members_mentioned"); - - b.Property>("Meta") - .HasColumnType("jsonb") - .HasColumnName("meta"); - - b.Property("Nonce") - .IsRequired() - .HasMaxLength(36) - .HasColumnType("character varying(36)") - .HasColumnName("nonce"); - - b.Property("RepliedMessageId") - .HasColumnType("uuid") - .HasColumnName("replied_message_id"); - - b.Property("SenderId") - .HasColumnType("uuid") - .HasColumnName("sender_id"); - - b.Property("Type") - .IsRequired() - .HasColumnType("text") - .HasColumnName("type"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.HasKey("Id") - .HasName("pk_chat_messages"); - - b.HasIndex("ChatRoomId") - .HasDatabaseName("ix_chat_messages_chat_room_id"); - - b.HasIndex("ForwardedMessageId") - .HasDatabaseName("ix_chat_messages_forwarded_message_id"); - - b.HasIndex("RepliedMessageId") - .HasDatabaseName("ix_chat_messages_replied_message_id"); - - b.HasIndex("SenderId") - .HasDatabaseName("ix_chat_messages_sender_id"); - - b.ToTable("chat_messages", (string)null); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Chat.MessageReaction", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uuid") - .HasColumnName("id"); - - b.Property("Attitude") - .HasColumnType("integer") - .HasColumnName("attitude"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property("MessageId") - .HasColumnType("uuid") - .HasColumnName("message_id"); - - b.Property("SenderId") - .HasColumnType("uuid") - .HasColumnName("sender_id"); - - b.Property("Symbol") - .IsRequired() - .HasMaxLength(256) - .HasColumnType("character varying(256)") - .HasColumnName("symbol"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.HasKey("Id") - .HasName("pk_chat_reactions"); - - b.HasIndex("MessageId") - .HasDatabaseName("ix_chat_reactions_message_id"); - - b.HasIndex("SenderId") - .HasDatabaseName("ix_chat_reactions_sender_id"); - - b.ToTable("chat_reactions", (string)null); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Chat.MessageStatus", b => - { - b.Property("MessageId") - .HasColumnType("uuid") - .HasColumnName("message_id"); - - b.Property("SenderId") - .HasColumnType("uuid") - .HasColumnName("sender_id"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property("ReadAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("read_at"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.HasKey("MessageId", "SenderId") - .HasName("pk_chat_statuses"); - - b.HasIndex("SenderId") - .HasDatabaseName("ix_chat_statuses_sender_id"); - - b.ToTable("chat_statuses", (string)null); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Chat.RealtimeCall", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uuid") - .HasColumnName("id"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property("EndedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("ended_at"); - - b.Property("RoomId") - .HasColumnType("bigint") - .HasColumnName("room_id"); - - b.Property("SenderId") - .HasColumnType("uuid") - .HasColumnName("sender_id"); - - b.Property("Title") - .HasColumnType("text") - .HasColumnName("title"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.HasKey("Id") - .HasName("pk_chat_realtime_call"); - - b.HasIndex("RoomId") - .HasDatabaseName("ix_chat_realtime_call_room_id"); - - b.HasIndex("SenderId") - .HasDatabaseName("ix_chat_realtime_call_sender_id"); - - b.ToTable("chat_realtime_call", (string)null); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Permission.PermissionGroup", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uuid") - .HasColumnName("id"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property("Key") - .IsRequired() - .HasMaxLength(1024) - .HasColumnType("character varying(1024)") - .HasColumnName("key"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.HasKey("Id") - .HasName("pk_permission_groups"); - - b.ToTable("permission_groups", (string)null); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Permission.PermissionGroupMember", b => - { - b.Property("GroupId") - .HasColumnType("uuid") - .HasColumnName("group_id"); - - b.Property("Actor") - .HasMaxLength(1024) - .HasColumnType("character varying(1024)") - .HasColumnName("actor"); - - b.Property("AffectedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("affected_at"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property("ExpiredAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("expired_at"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.HasKey("GroupId", "Actor") - .HasName("pk_permission_group_members"); - - b.ToTable("permission_group_members", (string)null); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Permission.PermissionNode", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uuid") - .HasColumnName("id"); - - b.Property("Actor") - .IsRequired() - .HasMaxLength(1024) - .HasColumnType("character varying(1024)") - .HasColumnName("actor"); - - b.Property("AffectedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("affected_at"); - - b.Property("Area") - .IsRequired() - .HasMaxLength(1024) - .HasColumnType("character varying(1024)") - .HasColumnName("area"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property("ExpiredAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("expired_at"); - - b.Property("GroupId") - .HasColumnType("uuid") - .HasColumnName("group_id"); - - b.Property("Key") - .IsRequired() - .HasMaxLength(1024) - .HasColumnType("character varying(1024)") - .HasColumnName("key"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.Property("Value") - .IsRequired() - .HasColumnType("jsonb") - .HasColumnName("value"); - - b.HasKey("Id") - .HasName("pk_permission_nodes"); - - b.HasIndex("GroupId") - .HasDatabaseName("ix_permission_nodes_group_id"); - - b.HasIndex("Key", "Area", "Actor") - .HasDatabaseName("ix_permission_nodes_key_area_actor"); - - b.ToTable("permission_nodes", (string)null); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Post.Post", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Content") - .HasColumnType("text") - .HasColumnName("content"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property("Description") - .HasMaxLength(4096) - .HasColumnType("character varying(4096)") - .HasColumnName("description"); - - b.Property("Downvotes") - .HasColumnType("integer") - .HasColumnName("downvotes"); - - b.Property("EditedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("edited_at"); - - b.Property("ForwardedPostId") - .HasColumnType("bigint") - .HasColumnName("forwarded_post_id"); - - b.Property("Language") - .HasMaxLength(128) - .HasColumnType("character varying(128)") - .HasColumnName("language"); - - b.Property>("Meta") - .HasColumnType("jsonb") - .HasColumnName("meta"); - - b.Property("PublishedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("published_at"); - - b.Property("PublisherId") - .HasColumnType("bigint") - .HasColumnName("publisher_id"); - - b.Property("RepliedPostId") - .HasColumnType("bigint") - .HasColumnName("replied_post_id"); - - b.Property("SearchVector") - .IsRequired() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("tsvector") - .HasColumnName("search_vector") - .HasAnnotation("Npgsql:TsVectorConfig", "simple") - .HasAnnotation("Npgsql:TsVectorProperties", new[] { "Title", "Description", "Content" }); - - b.Property("ThreadedPostId") - .HasColumnType("bigint") - .HasColumnName("threaded_post_id"); - - b.Property("Title") - .HasMaxLength(1024) - .HasColumnType("character varying(1024)") - .HasColumnName("title"); - - b.Property("Type") - .HasColumnType("integer") - .HasColumnName("type"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.Property("Upvotes") - .HasColumnType("integer") - .HasColumnName("upvotes"); - - b.Property("ViewsTotal") - .HasColumnType("integer") - .HasColumnName("views_total"); - - b.Property("ViewsUnique") - .HasColumnType("integer") - .HasColumnName("views_unique"); - - b.Property("Visibility") - .HasColumnType("integer") - .HasColumnName("visibility"); - - b.HasKey("Id") - .HasName("pk_posts"); - - b.HasIndex("ForwardedPostId") - .HasDatabaseName("ix_posts_forwarded_post_id"); - - b.HasIndex("PublisherId") - .HasDatabaseName("ix_posts_publisher_id"); - - b.HasIndex("RepliedPostId") - .HasDatabaseName("ix_posts_replied_post_id"); - - b.HasIndex("SearchVector") - .HasDatabaseName("ix_posts_search_vector"); - - NpgsqlIndexBuilderExtensions.HasMethod(b.HasIndex("SearchVector"), "GIN"); - - b.HasIndex("ThreadedPostId") - .IsUnique() - .HasDatabaseName("ix_posts_threaded_post_id"); - - b.ToTable("posts", (string)null); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Post.PostCategory", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property("Name") - .HasMaxLength(256) - .HasColumnType("character varying(256)") - .HasColumnName("name"); - - b.Property("Slug") - .IsRequired() - .HasMaxLength(128) - .HasColumnType("character varying(128)") - .HasColumnName("slug"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.HasKey("Id") - .HasName("pk_post_categories"); - - b.ToTable("post_categories", (string)null); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Post.PostCollection", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property("Description") - .HasMaxLength(4096) - .HasColumnType("character varying(4096)") - .HasColumnName("description"); - - b.Property("Name") - .HasMaxLength(256) - .HasColumnType("character varying(256)") - .HasColumnName("name"); - - b.Property("PublisherId") - .HasColumnType("bigint") - .HasColumnName("publisher_id"); - - b.Property("Slug") - .IsRequired() - .HasMaxLength(128) - .HasColumnType("character varying(128)") - .HasColumnName("slug"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.HasKey("Id") - .HasName("pk_post_collections"); - - b.HasIndex("PublisherId") - .HasDatabaseName("ix_post_collections_publisher_id"); - - b.ToTable("post_collections", (string)null); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Post.PostReaction", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AccountId") - .HasColumnType("bigint") - .HasColumnName("account_id"); - - b.Property("Attitude") - .HasColumnType("integer") - .HasColumnName("attitude"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property("PostId") - .HasColumnType("bigint") - .HasColumnName("post_id"); - - b.Property("Symbol") - .IsRequired() - .HasMaxLength(256) - .HasColumnType("character varying(256)") - .HasColumnName("symbol"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.HasKey("Id") - .HasName("pk_post_reactions"); - - b.HasIndex("AccountId") - .HasDatabaseName("ix_post_reactions_account_id"); - - b.HasIndex("PostId") - .HasDatabaseName("ix_post_reactions_post_id"); - - b.ToTable("post_reactions", (string)null); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Post.PostTag", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property("Name") - .HasMaxLength(256) - .HasColumnType("character varying(256)") - .HasColumnName("name"); - - b.Property("Slug") - .IsRequired() - .HasMaxLength(128) - .HasColumnType("character varying(128)") - .HasColumnName("slug"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.HasKey("Id") - .HasName("pk_post_tags"); - - b.ToTable("post_tags", (string)null); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Post.Publisher", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AccountId") - .HasColumnType("bigint") - .HasColumnName("account_id"); - - b.Property("BackgroundId") - .HasColumnType("character varying(128)") - .HasColumnName("background_id"); - - b.Property("Bio") - .HasMaxLength(4096) - .HasColumnType("character varying(4096)") - .HasColumnName("bio"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(256) - .HasColumnType("character varying(256)") - .HasColumnName("name"); - - b.Property("Nick") - .IsRequired() - .HasMaxLength(256) - .HasColumnType("character varying(256)") - .HasColumnName("nick"); - - b.Property("PictureId") - .HasColumnType("character varying(128)") - .HasColumnName("picture_id"); - - b.Property("PublisherType") - .HasColumnType("integer") - .HasColumnName("publisher_type"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.HasKey("Id") - .HasName("pk_publishers"); - - b.HasIndex("AccountId") - .HasDatabaseName("ix_publishers_account_id"); - - b.HasIndex("BackgroundId") - .HasDatabaseName("ix_publishers_background_id"); - - b.HasIndex("Name") - .IsUnique() - .HasDatabaseName("ix_publishers_name"); - - b.HasIndex("PictureId") - .HasDatabaseName("ix_publishers_picture_id"); - - b.ToTable("publishers", (string)null); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Post.PublisherMember", b => - { - b.Property("PublisherId") - .HasColumnType("bigint") - .HasColumnName("publisher_id"); - - b.Property("AccountId") - .HasColumnType("bigint") - .HasColumnName("account_id"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property("JoinedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("joined_at"); - - b.Property("Role") - .HasColumnType("integer") - .HasColumnName("role"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.HasKey("PublisherId", "AccountId") - .HasName("pk_publisher_members"); - - b.HasIndex("AccountId") - .HasDatabaseName("ix_publisher_members_account_id"); - - b.ToTable("publisher_members", (string)null); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Realm.Realm", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AccountId") - .HasColumnType("bigint") - .HasColumnName("account_id"); - - b.Property("BackgroundId") - .HasColumnType("character varying(128)") - .HasColumnName("background_id"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property("Description") - .IsRequired() - .HasMaxLength(4096) - .HasColumnType("character varying(4096)") - .HasColumnName("description"); - - b.Property("IsCommunity") - .HasColumnType("boolean") - .HasColumnName("is_community"); - - b.Property("IsPublic") - .HasColumnType("boolean") - .HasColumnName("is_public"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(1024) - .HasColumnType("character varying(1024)") - .HasColumnName("name"); - - b.Property("PictureId") - .HasColumnType("character varying(128)") - .HasColumnName("picture_id"); - - b.Property("Slug") - .IsRequired() - .HasMaxLength(1024) - .HasColumnType("character varying(1024)") - .HasColumnName("slug"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.Property("VerifiedAs") - .HasMaxLength(4096) - .HasColumnType("character varying(4096)") - .HasColumnName("verified_as"); - - b.Property("VerifiedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("verified_at"); - - b.HasKey("Id") - .HasName("pk_realms"); - - b.HasIndex("AccountId") - .HasDatabaseName("ix_realms_account_id"); - - b.HasIndex("BackgroundId") - .HasDatabaseName("ix_realms_background_id"); - - b.HasIndex("PictureId") - .HasDatabaseName("ix_realms_picture_id"); - - b.HasIndex("Slug") - .IsUnique() - .HasDatabaseName("ix_realms_slug"); - - b.ToTable("realms", (string)null); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Realm.RealmMember", b => - { - b.Property("RealmId") - .HasColumnType("bigint") - .HasColumnName("realm_id"); - - b.Property("AccountId") - .HasColumnType("bigint") - .HasColumnName("account_id"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property("JoinedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("joined_at"); - - b.Property("Role") - .HasColumnType("integer") - .HasColumnName("role"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.HasKey("RealmId", "AccountId") - .HasName("pk_realm_members"); - - b.HasIndex("AccountId") - .HasDatabaseName("ix_realm_members_account_id"); - - b.ToTable("realm_members", (string)null); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Sticker.Sticker", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uuid") - .HasColumnName("id"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property("ImageId") - .IsRequired() - .HasColumnType("character varying(128)") - .HasColumnName("image_id"); - - b.Property("PackId") - .HasColumnType("uuid") - .HasColumnName("pack_id"); - - b.Property("Slug") - .IsRequired() - .HasMaxLength(128) - .HasColumnType("character varying(128)") - .HasColumnName("slug"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.HasKey("Id") - .HasName("pk_stickers"); - - b.HasIndex("ImageId") - .HasDatabaseName("ix_stickers_image_id"); - - b.HasIndex("PackId") - .HasDatabaseName("ix_stickers_pack_id"); - - b.ToTable("stickers", (string)null); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Sticker.StickerPack", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uuid") - .HasColumnName("id"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property("Description") - .IsRequired() - .HasMaxLength(4096) - .HasColumnType("character varying(4096)") - .HasColumnName("description"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(1024) - .HasColumnType("character varying(1024)") - .HasColumnName("name"); - - b.Property("Prefix") - .IsRequired() - .HasMaxLength(128) - .HasColumnType("character varying(128)") - .HasColumnName("prefix"); - - b.Property("PublisherId") - .HasColumnType("bigint") - .HasColumnName("publisher_id"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.HasKey("Id") - .HasName("pk_sticker_packs"); - - b.HasIndex("PublisherId") - .HasDatabaseName("ix_sticker_packs_publisher_id"); - - b.ToTable("sticker_packs", (string)null); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Storage.CloudFile", b => - { - b.Property("Id") - .HasMaxLength(128) - .HasColumnType("character varying(128)") - .HasColumnName("id"); - - b.Property("AccountId") - .HasColumnType("bigint") - .HasColumnName("account_id"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property("Description") - .HasMaxLength(4096) - .HasColumnType("character varying(4096)") - .HasColumnName("description"); - - b.Property("ExpiredAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("expired_at"); - - b.Property>("FileMeta") - .HasColumnType("jsonb") - .HasColumnName("file_meta"); - - b.Property("HasCompression") - .HasColumnType("boolean") - .HasColumnName("has_compression"); - - b.Property("Hash") - .HasMaxLength(256) - .HasColumnType("character varying(256)") - .HasColumnName("hash"); - - b.Property("MessageId") - .HasColumnType("uuid") - .HasColumnName("message_id"); - - b.Property("MimeType") - .HasMaxLength(256) - .HasColumnType("character varying(256)") - .HasColumnName("mime_type"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(1024) - .HasColumnType("character varying(1024)") - .HasColumnName("name"); - - b.Property("PostId") - .HasColumnType("bigint") - .HasColumnName("post_id"); - - b.Property("Size") - .HasColumnType("bigint") - .HasColumnName("size"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.Property("UploadedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("uploaded_at"); - - b.Property("UploadedTo") - .HasMaxLength(128) - .HasColumnType("character varying(128)") - .HasColumnName("uploaded_to"); - - b.Property("UsedCount") - .HasColumnType("integer") - .HasColumnName("used_count"); - - b.Property>("UserMeta") - .HasColumnType("jsonb") - .HasColumnName("user_meta"); - - b.HasKey("Id") - .HasName("pk_files"); - - b.HasIndex("AccountId") - .HasDatabaseName("ix_files_account_id"); - - b.HasIndex("MessageId") - .HasDatabaseName("ix_files_message_id"); - - b.HasIndex("PostId") - .HasDatabaseName("ix_files_post_id"); - - b.ToTable("files", (string)null); - }); - - modelBuilder.Entity("PostPostCategory", b => - { - b.Property("CategoriesId") - .HasColumnType("bigint") - .HasColumnName("categories_id"); - - b.Property("PostsId") - .HasColumnType("bigint") - .HasColumnName("posts_id"); - - b.HasKey("CategoriesId", "PostsId") - .HasName("pk_post_category_links"); - - b.HasIndex("PostsId") - .HasDatabaseName("ix_post_category_links_posts_id"); - - b.ToTable("post_category_links", (string)null); - }); - - modelBuilder.Entity("PostPostCollection", b => - { - b.Property("CollectionsId") - .HasColumnType("bigint") - .HasColumnName("collections_id"); - - b.Property("PostsId") - .HasColumnType("bigint") - .HasColumnName("posts_id"); - - b.HasKey("CollectionsId", "PostsId") - .HasName("pk_post_collection_links"); - - b.HasIndex("PostsId") - .HasDatabaseName("ix_post_collection_links_posts_id"); - - b.ToTable("post_collection_links", (string)null); - }); - - modelBuilder.Entity("PostPostTag", b => - { - b.Property("PostsId") - .HasColumnType("bigint") - .HasColumnName("posts_id"); - - b.Property("TagsId") - .HasColumnType("bigint") - .HasColumnName("tags_id"); - - b.HasKey("PostsId", "TagsId") - .HasName("pk_post_tag_links"); - - b.HasIndex("TagsId") - .HasDatabaseName("ix_post_tag_links_tags_id"); - - b.ToTable("post_tag_links", (string)null); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Account.AccountAuthFactor", b => - { - b.HasOne("DysonNetwork.Sphere.Account.Account", "Account") - .WithMany("AuthFactors") - .HasForeignKey("AccountId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_account_auth_factors_accounts_account_id"); - - b.Navigation("Account"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Account.AccountContact", b => - { - b.HasOne("DysonNetwork.Sphere.Account.Account", "Account") - .WithMany("Contacts") - .HasForeignKey("AccountId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_account_contacts_accounts_account_id"); - - b.Navigation("Account"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Account.CheckInResult", b => - { - b.HasOne("DysonNetwork.Sphere.Account.Account", "Account") - .WithMany() - .HasForeignKey("AccountId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_account_check_in_results_accounts_account_id"); - - b.Navigation("Account"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Account.MagicSpell", b => - { - b.HasOne("DysonNetwork.Sphere.Account.Account", "Account") - .WithMany() - .HasForeignKey("AccountId") - .HasConstraintName("fk_magic_spells_accounts_account_id"); - - b.Navigation("Account"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Account.Notification", b => - { - b.HasOne("DysonNetwork.Sphere.Account.Account", "Account") - .WithMany() - .HasForeignKey("AccountId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_notifications_accounts_account_id"); - - b.Navigation("Account"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Account.NotificationPushSubscription", b => - { - b.HasOne("DysonNetwork.Sphere.Account.Account", "Account") - .WithMany() - .HasForeignKey("AccountId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_notification_push_subscriptions_accounts_account_id"); - - b.Navigation("Account"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Account.Profile", b => - { - b.HasOne("DysonNetwork.Sphere.Storage.CloudFile", "Background") - .WithMany() - .HasForeignKey("BackgroundId") - .HasConstraintName("fk_account_profiles_files_background_id"); - - b.HasOne("DysonNetwork.Sphere.Account.Account", "Account") - .WithOne("Profile") - .HasForeignKey("DysonNetwork.Sphere.Account.Profile", "Id") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_account_profiles_accounts_id"); - - b.HasOne("DysonNetwork.Sphere.Storage.CloudFile", "Picture") - .WithMany() - .HasForeignKey("PictureId") - .HasConstraintName("fk_account_profiles_files_picture_id"); - - b.Navigation("Account"); - - b.Navigation("Background"); - - b.Navigation("Picture"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Account.Relationship", b => - { - b.HasOne("DysonNetwork.Sphere.Account.Account", "Account") - .WithMany("OutgoingRelationships") - .HasForeignKey("AccountId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_account_relationships_accounts_account_id"); - - b.HasOne("DysonNetwork.Sphere.Account.Account", "Related") - .WithMany("IncomingRelationships") - .HasForeignKey("RelatedId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_account_relationships_accounts_related_id"); - - b.Navigation("Account"); - - b.Navigation("Related"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Account.Status", b => - { - b.HasOne("DysonNetwork.Sphere.Account.Account", "Account") - .WithMany() - .HasForeignKey("AccountId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_account_statuses_accounts_account_id"); - - b.Navigation("Account"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Activity.Activity", b => - { - b.HasOne("DysonNetwork.Sphere.Account.Account", "Account") - .WithMany() - .HasForeignKey("AccountId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_activities_accounts_account_id"); - - b.Navigation("Account"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Auth.Challenge", b => - { - b.HasOne("DysonNetwork.Sphere.Account.Account", "Account") - .WithMany("Challenges") - .HasForeignKey("AccountId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_auth_challenges_accounts_account_id"); - - b.Navigation("Account"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Auth.Session", b => - { - b.HasOne("DysonNetwork.Sphere.Account.Account", "Account") - .WithMany("Sessions") - .HasForeignKey("AccountId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_auth_sessions_accounts_account_id"); - - b.HasOne("DysonNetwork.Sphere.Auth.Challenge", "Challenge") - .WithMany() - .HasForeignKey("ChallengeId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_auth_sessions_auth_challenges_challenge_id"); - - b.Navigation("Account"); - - b.Navigation("Challenge"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Chat.ChatMember", b => - { - b.HasOne("DysonNetwork.Sphere.Account.Account", "Account") - .WithMany() - .HasForeignKey("AccountId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_chat_members_accounts_account_id"); - - b.HasOne("DysonNetwork.Sphere.Chat.ChatRoom", "ChatRoom") - .WithMany("Members") - .HasForeignKey("ChatRoomId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_chat_members_chat_rooms_chat_room_id"); - - b.Navigation("Account"); - - b.Navigation("ChatRoom"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Chat.ChatRoom", b => - { - b.HasOne("DysonNetwork.Sphere.Storage.CloudFile", "Background") - .WithMany() - .HasForeignKey("BackgroundId") - .HasConstraintName("fk_chat_rooms_files_background_id"); - - b.HasOne("DysonNetwork.Sphere.Storage.CloudFile", "Picture") - .WithMany() - .HasForeignKey("PictureId") - .HasConstraintName("fk_chat_rooms_files_picture_id"); - - b.HasOne("DysonNetwork.Sphere.Realm.Realm", "Realm") - .WithMany("ChatRooms") - .HasForeignKey("RealmId") - .HasConstraintName("fk_chat_rooms_realms_realm_id"); - - b.Navigation("Background"); - - b.Navigation("Picture"); - - b.Navigation("Realm"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Chat.Message", b => - { - b.HasOne("DysonNetwork.Sphere.Chat.ChatRoom", "ChatRoom") - .WithMany() - .HasForeignKey("ChatRoomId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_chat_messages_chat_rooms_chat_room_id"); - - b.HasOne("DysonNetwork.Sphere.Chat.Message", "ForwardedMessage") - .WithMany() - .HasForeignKey("ForwardedMessageId") - .OnDelete(DeleteBehavior.Restrict) - .HasConstraintName("fk_chat_messages_chat_messages_forwarded_message_id"); - - b.HasOne("DysonNetwork.Sphere.Chat.Message", "RepliedMessage") - .WithMany() - .HasForeignKey("RepliedMessageId") - .OnDelete(DeleteBehavior.Restrict) - .HasConstraintName("fk_chat_messages_chat_messages_replied_message_id"); - - b.HasOne("DysonNetwork.Sphere.Chat.ChatMember", "Sender") - .WithMany() - .HasForeignKey("SenderId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_chat_messages_chat_members_sender_id"); - - b.Navigation("ChatRoom"); - - b.Navigation("ForwardedMessage"); - - b.Navigation("RepliedMessage"); - - b.Navigation("Sender"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Chat.MessageReaction", b => - { - b.HasOne("DysonNetwork.Sphere.Chat.Message", "Message") - .WithMany("Reactions") - .HasForeignKey("MessageId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_chat_reactions_chat_messages_message_id"); - - b.HasOne("DysonNetwork.Sphere.Chat.ChatMember", "Sender") - .WithMany() - .HasForeignKey("SenderId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_chat_reactions_chat_members_sender_id"); - - b.Navigation("Message"); - - b.Navigation("Sender"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Chat.MessageStatus", b => - { - b.HasOne("DysonNetwork.Sphere.Chat.Message", "Message") - .WithMany("Statuses") - .HasForeignKey("MessageId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_chat_statuses_chat_messages_message_id"); - - b.HasOne("DysonNetwork.Sphere.Chat.ChatMember", "Sender") - .WithMany() - .HasForeignKey("SenderId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_chat_statuses_chat_members_sender_id"); - - b.Navigation("Message"); - - b.Navigation("Sender"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Chat.RealtimeCall", b => - { - b.HasOne("DysonNetwork.Sphere.Chat.ChatRoom", "Room") - .WithMany() - .HasForeignKey("RoomId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_chat_realtime_call_chat_rooms_room_id"); - - b.HasOne("DysonNetwork.Sphere.Chat.ChatMember", "Sender") - .WithMany() - .HasForeignKey("SenderId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_chat_realtime_call_chat_members_sender_id"); - - b.Navigation("Room"); - - b.Navigation("Sender"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Permission.PermissionGroupMember", b => - { - b.HasOne("DysonNetwork.Sphere.Permission.PermissionGroup", "Group") - .WithMany("Members") - .HasForeignKey("GroupId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_permission_group_members_permission_groups_group_id"); - - b.Navigation("Group"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Permission.PermissionNode", b => - { - b.HasOne("DysonNetwork.Sphere.Permission.PermissionGroup", "Group") - .WithMany("Nodes") - .HasForeignKey("GroupId") - .HasConstraintName("fk_permission_nodes_permission_groups_group_id"); - - b.Navigation("Group"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Post.Post", b => - { - b.HasOne("DysonNetwork.Sphere.Post.Post", "ForwardedPost") - .WithMany() - .HasForeignKey("ForwardedPostId") - .OnDelete(DeleteBehavior.Restrict) - .HasConstraintName("fk_posts_posts_forwarded_post_id"); - - b.HasOne("DysonNetwork.Sphere.Post.Publisher", "Publisher") - .WithMany("Posts") - .HasForeignKey("PublisherId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_posts_publishers_publisher_id"); - - b.HasOne("DysonNetwork.Sphere.Post.Post", "RepliedPost") - .WithMany() - .HasForeignKey("RepliedPostId") - .OnDelete(DeleteBehavior.Restrict) - .HasConstraintName("fk_posts_posts_replied_post_id"); - - b.HasOne("DysonNetwork.Sphere.Post.Post", "ThreadedPost") - .WithOne() - .HasForeignKey("DysonNetwork.Sphere.Post.Post", "ThreadedPostId") - .HasConstraintName("fk_posts_posts_threaded_post_id"); - - b.Navigation("ForwardedPost"); - - b.Navigation("Publisher"); - - b.Navigation("RepliedPost"); - - b.Navigation("ThreadedPost"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Post.PostCollection", b => - { - b.HasOne("DysonNetwork.Sphere.Post.Publisher", "Publisher") - .WithMany("Collections") - .HasForeignKey("PublisherId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_post_collections_publishers_publisher_id"); - - b.Navigation("Publisher"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Post.PostReaction", b => - { - b.HasOne("DysonNetwork.Sphere.Account.Account", "Account") - .WithMany() - .HasForeignKey("AccountId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_post_reactions_accounts_account_id"); - - b.HasOne("DysonNetwork.Sphere.Post.Post", "Post") - .WithMany("Reactions") - .HasForeignKey("PostId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_post_reactions_posts_post_id"); - - b.Navigation("Account"); - - b.Navigation("Post"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Post.Publisher", b => - { - b.HasOne("DysonNetwork.Sphere.Account.Account", "Account") - .WithMany() - .HasForeignKey("AccountId") - .HasConstraintName("fk_publishers_accounts_account_id"); - - b.HasOne("DysonNetwork.Sphere.Storage.CloudFile", "Background") - .WithMany() - .HasForeignKey("BackgroundId") - .HasConstraintName("fk_publishers_files_background_id"); - - b.HasOne("DysonNetwork.Sphere.Storage.CloudFile", "Picture") - .WithMany() - .HasForeignKey("PictureId") - .HasConstraintName("fk_publishers_files_picture_id"); - - b.Navigation("Account"); - - b.Navigation("Background"); - - b.Navigation("Picture"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Post.PublisherMember", b => - { - b.HasOne("DysonNetwork.Sphere.Account.Account", "Account") - .WithMany() - .HasForeignKey("AccountId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_publisher_members_accounts_account_id"); - - b.HasOne("DysonNetwork.Sphere.Post.Publisher", "Publisher") - .WithMany("Members") - .HasForeignKey("PublisherId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_publisher_members_publishers_publisher_id"); - - b.Navigation("Account"); - - b.Navigation("Publisher"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Realm.Realm", b => - { - b.HasOne("DysonNetwork.Sphere.Account.Account", "Account") - .WithMany() - .HasForeignKey("AccountId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_realms_accounts_account_id"); - - b.HasOne("DysonNetwork.Sphere.Storage.CloudFile", "Background") - .WithMany() - .HasForeignKey("BackgroundId") - .HasConstraintName("fk_realms_files_background_id"); - - b.HasOne("DysonNetwork.Sphere.Storage.CloudFile", "Picture") - .WithMany() - .HasForeignKey("PictureId") - .HasConstraintName("fk_realms_files_picture_id"); - - b.Navigation("Account"); - - b.Navigation("Background"); - - b.Navigation("Picture"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Realm.RealmMember", b => - { - b.HasOne("DysonNetwork.Sphere.Account.Account", "Account") - .WithMany() - .HasForeignKey("AccountId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_realm_members_accounts_account_id"); - - b.HasOne("DysonNetwork.Sphere.Realm.Realm", "Realm") - .WithMany("Members") - .HasForeignKey("RealmId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_realm_members_realms_realm_id"); - - b.Navigation("Account"); - - b.Navigation("Realm"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Sticker.Sticker", b => - { - b.HasOne("DysonNetwork.Sphere.Storage.CloudFile", "Image") - .WithMany() - .HasForeignKey("ImageId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_stickers_files_image_id"); - - b.HasOne("DysonNetwork.Sphere.Sticker.StickerPack", "Pack") - .WithMany() - .HasForeignKey("PackId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_stickers_sticker_packs_pack_id"); - - b.Navigation("Image"); - - b.Navigation("Pack"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Sticker.StickerPack", b => - { - b.HasOne("DysonNetwork.Sphere.Post.Publisher", "Publisher") - .WithMany() - .HasForeignKey("PublisherId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_sticker_packs_publishers_publisher_id"); - - b.Navigation("Publisher"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Storage.CloudFile", b => - { - b.HasOne("DysonNetwork.Sphere.Account.Account", "Account") - .WithMany() - .HasForeignKey("AccountId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_files_accounts_account_id"); - - b.HasOne("DysonNetwork.Sphere.Chat.Message", null) - .WithMany("Attachments") - .HasForeignKey("MessageId") - .HasConstraintName("fk_files_chat_messages_message_id"); - - b.HasOne("DysonNetwork.Sphere.Post.Post", null) - .WithMany("Attachments") - .HasForeignKey("PostId") - .HasConstraintName("fk_files_posts_post_id"); - - b.Navigation("Account"); - }); - - modelBuilder.Entity("PostPostCategory", b => - { - b.HasOne("DysonNetwork.Sphere.Post.PostCategory", null) - .WithMany() - .HasForeignKey("CategoriesId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_post_category_links_post_categories_categories_id"); - - b.HasOne("DysonNetwork.Sphere.Post.Post", null) - .WithMany() - .HasForeignKey("PostsId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_post_category_links_posts_posts_id"); - }); - - modelBuilder.Entity("PostPostCollection", b => - { - b.HasOne("DysonNetwork.Sphere.Post.PostCollection", null) - .WithMany() - .HasForeignKey("CollectionsId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_post_collection_links_post_collections_collections_id"); - - b.HasOne("DysonNetwork.Sphere.Post.Post", null) - .WithMany() - .HasForeignKey("PostsId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_post_collection_links_posts_posts_id"); - }); - - modelBuilder.Entity("PostPostTag", b => - { - b.HasOne("DysonNetwork.Sphere.Post.Post", null) - .WithMany() - .HasForeignKey("PostsId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_post_tag_links_posts_posts_id"); - - b.HasOne("DysonNetwork.Sphere.Post.PostTag", null) - .WithMany() - .HasForeignKey("TagsId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_post_tag_links_post_tags_tags_id"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Account.Account", b => - { - b.Navigation("AuthFactors"); - - b.Navigation("Challenges"); - - b.Navigation("Contacts"); - - b.Navigation("IncomingRelationships"); - - b.Navigation("OutgoingRelationships"); - - b.Navigation("Profile") - .IsRequired(); - - b.Navigation("Sessions"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Chat.ChatRoom", b => - { - b.Navigation("Members"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Chat.Message", b => - { - b.Navigation("Attachments"); - - b.Navigation("Reactions"); - - b.Navigation("Statuses"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Permission.PermissionGroup", b => - { - b.Navigation("Members"); - - b.Navigation("Nodes"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Post.Post", b => - { - b.Navigation("Attachments"); - - b.Navigation("Reactions"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Post.Publisher", b => - { - b.Navigation("Collections"); - - b.Navigation("Members"); - - b.Navigation("Posts"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Realm.Realm", b => - { - b.Navigation("ChatRooms"); - - b.Navigation("Members"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/DysonNetwork.Sphere/Migrations/20250510124730_AddStickerAndPacks.cs b/DysonNetwork.Sphere/Migrations/20250510124730_AddStickerAndPacks.cs deleted file mode 100644 index 8de4a9b..0000000 --- a/DysonNetwork.Sphere/Migrations/20250510124730_AddStickerAndPacks.cs +++ /dev/null @@ -1,94 +0,0 @@ -using System; -using Microsoft.EntityFrameworkCore.Migrations; -using NodaTime; - -#nullable disable - -namespace DysonNetwork.Sphere.Migrations -{ - /// - public partial class AddStickerAndPacks : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.CreateTable( - name: "sticker_packs", - columns: table => new - { - id = table.Column(type: "uuid", nullable: false), - name = table.Column(type: "character varying(1024)", maxLength: 1024, nullable: false), - description = table.Column(type: "character varying(4096)", maxLength: 4096, nullable: false), - prefix = table.Column(type: "character varying(128)", maxLength: 128, nullable: false), - publisher_id = table.Column(type: "bigint", nullable: false), - created_at = table.Column(type: "timestamp with time zone", nullable: false), - updated_at = table.Column(type: "timestamp with time zone", nullable: false), - deleted_at = table.Column(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(type: "uuid", nullable: false), - slug = table.Column(type: "character varying(128)", maxLength: 128, nullable: false), - image_id = table.Column(type: "character varying(128)", nullable: false), - pack_id = table.Column(type: "uuid", nullable: false), - created_at = table.Column(type: "timestamp with time zone", nullable: false), - updated_at = table.Column(type: "timestamp with time zone", nullable: false), - deleted_at = table.Column(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"); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropTable( - name: "stickers"); - - migrationBuilder.DropTable( - name: "sticker_packs"); - } - } -} diff --git a/DysonNetwork.Sphere/Migrations/20250512132355_AddPublisherSubscription.Designer.cs b/DysonNetwork.Sphere/Migrations/20250512132355_AddPublisherSubscription.Designer.cs deleted file mode 100644 index e9b3384..0000000 --- a/DysonNetwork.Sphere/Migrations/20250512132355_AddPublisherSubscription.Designer.cs +++ /dev/null @@ -1,2763 +0,0 @@ -// -using System; -using System.Collections.Generic; -using System.Text.Json; -using DysonNetwork.Sphere; -using DysonNetwork.Sphere.Account; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using NodaTime; -using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; -using NpgsqlTypes; - -#nullable disable - -namespace DysonNetwork.Sphere.Migrations -{ - [DbContext(typeof(AppDatabase))] - [Migration("20250512132355_AddPublisherSubscription")] - partial class AddPublisherSubscription - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "9.0.3") - .HasAnnotation("Relational:MaxIdentifierLength", 63); - - NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); - - modelBuilder.Entity("DysonNetwork.Sphere.Account.Account", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ActivatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("activated_at"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property("IsSuperuser") - .HasColumnType("boolean") - .HasColumnName("is_superuser"); - - b.Property("Language") - .IsRequired() - .HasMaxLength(32) - .HasColumnType("character varying(32)") - .HasColumnName("language"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(256) - .HasColumnType("character varying(256)") - .HasColumnName("name"); - - b.Property("Nick") - .IsRequired() - .HasMaxLength(256) - .HasColumnType("character varying(256)") - .HasColumnName("nick"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.HasKey("Id") - .HasName("pk_accounts"); - - b.HasIndex("Name") - .IsUnique() - .HasDatabaseName("ix_accounts_name"); - - b.ToTable("accounts", (string)null); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Account.AccountAuthFactor", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AccountId") - .HasColumnType("bigint") - .HasColumnName("account_id"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property("Secret") - .HasColumnType("text") - .HasColumnName("secret"); - - b.Property("Type") - .HasColumnType("integer") - .HasColumnName("type"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.HasKey("Id") - .HasName("pk_account_auth_factors"); - - b.HasIndex("AccountId") - .HasDatabaseName("ix_account_auth_factors_account_id"); - - b.ToTable("account_auth_factors", (string)null); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Account.AccountContact", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AccountId") - .HasColumnType("bigint") - .HasColumnName("account_id"); - - b.Property("Content") - .IsRequired() - .HasMaxLength(1024) - .HasColumnType("character varying(1024)") - .HasColumnName("content"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property("Type") - .HasColumnType("integer") - .HasColumnName("type"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.Property("VerifiedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("verified_at"); - - b.HasKey("Id") - .HasName("pk_account_contacts"); - - b.HasIndex("AccountId") - .HasDatabaseName("ix_account_contacts_account_id"); - - b.ToTable("account_contacts", (string)null); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Account.CheckInResult", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uuid") - .HasColumnName("id"); - - b.Property("AccountId") - .HasColumnType("bigint") - .HasColumnName("account_id"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property("Level") - .HasColumnType("integer") - .HasColumnName("level"); - - b.Property>("Tips") - .IsRequired() - .HasColumnType("jsonb") - .HasColumnName("tips"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.HasKey("Id") - .HasName("pk_account_check_in_results"); - - b.HasIndex("AccountId") - .HasDatabaseName("ix_account_check_in_results_account_id"); - - b.ToTable("account_check_in_results", (string)null); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Account.MagicSpell", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uuid") - .HasColumnName("id"); - - b.Property("AccountId") - .HasColumnType("bigint") - .HasColumnName("account_id"); - - b.Property("AffectedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("affected_at"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property("ExpiresAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("expires_at"); - - b.Property>("Meta") - .IsRequired() - .HasColumnType("jsonb") - .HasColumnName("meta"); - - b.Property("Spell") - .IsRequired() - .HasMaxLength(1024) - .HasColumnType("character varying(1024)") - .HasColumnName("spell"); - - b.Property("Type") - .HasColumnType("integer") - .HasColumnName("type"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.HasKey("Id") - .HasName("pk_magic_spells"); - - b.HasIndex("AccountId") - .HasDatabaseName("ix_magic_spells_account_id"); - - b.HasIndex("Spell") - .IsUnique() - .HasDatabaseName("ix_magic_spells_spell"); - - b.ToTable("magic_spells", (string)null); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Account.Notification", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uuid") - .HasColumnName("id"); - - b.Property("AccountId") - .HasColumnType("bigint") - .HasColumnName("account_id"); - - b.Property("Content") - .HasMaxLength(4096) - .HasColumnType("character varying(4096)") - .HasColumnName("content"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property>("Meta") - .HasColumnType("jsonb") - .HasColumnName("meta"); - - b.Property("Priority") - .HasColumnType("integer") - .HasColumnName("priority"); - - b.Property("Subtitle") - .HasMaxLength(2048) - .HasColumnType("character varying(2048)") - .HasColumnName("subtitle"); - - b.Property("Title") - .HasMaxLength(1024) - .HasColumnType("character varying(1024)") - .HasColumnName("title"); - - b.Property("Topic") - .IsRequired() - .HasMaxLength(1024) - .HasColumnType("character varying(1024)") - .HasColumnName("topic"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.Property("ViewedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("viewed_at"); - - b.HasKey("Id") - .HasName("pk_notifications"); - - b.HasIndex("AccountId") - .HasDatabaseName("ix_notifications_account_id"); - - b.ToTable("notifications", (string)null); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Account.NotificationPushSubscription", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uuid") - .HasColumnName("id"); - - b.Property("AccountId") - .HasColumnType("bigint") - .HasColumnName("account_id"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property("DeviceId") - .IsRequired() - .HasMaxLength(4096) - .HasColumnType("character varying(4096)") - .HasColumnName("device_id"); - - b.Property("DeviceToken") - .IsRequired() - .HasMaxLength(4096) - .HasColumnType("character varying(4096)") - .HasColumnName("device_token"); - - b.Property("LastUsedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("last_used_at"); - - b.Property("Provider") - .HasColumnType("integer") - .HasColumnName("provider"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.HasKey("Id") - .HasName("pk_notification_push_subscriptions"); - - b.HasIndex("AccountId") - .HasDatabaseName("ix_notification_push_subscriptions_account_id"); - - b.HasIndex("DeviceId") - .IsUnique() - .HasDatabaseName("ix_notification_push_subscriptions_device_id"); - - b.HasIndex("DeviceToken") - .IsUnique() - .HasDatabaseName("ix_notification_push_subscriptions_device_token"); - - b.ToTable("notification_push_subscriptions", (string)null); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Account.Profile", b => - { - b.Property("Id") - .HasColumnType("bigint") - .HasColumnName("id"); - - b.Property("BackgroundId") - .HasColumnType("character varying(128)") - .HasColumnName("background_id"); - - b.Property("Bio") - .HasMaxLength(4096) - .HasColumnType("character varying(4096)") - .HasColumnName("bio"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property("FirstName") - .HasMaxLength(256) - .HasColumnType("character varying(256)") - .HasColumnName("first_name"); - - b.Property("LastName") - .HasMaxLength(256) - .HasColumnType("character varying(256)") - .HasColumnName("last_name"); - - b.Property("MiddleName") - .HasMaxLength(256) - .HasColumnType("character varying(256)") - .HasColumnName("middle_name"); - - b.Property("PictureId") - .HasColumnType("character varying(128)") - .HasColumnName("picture_id"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.HasKey("Id") - .HasName("pk_account_profiles"); - - b.HasIndex("BackgroundId") - .HasDatabaseName("ix_account_profiles_background_id"); - - b.HasIndex("PictureId") - .HasDatabaseName("ix_account_profiles_picture_id"); - - b.ToTable("account_profiles", (string)null); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Account.Relationship", b => - { - b.Property("AccountId") - .HasColumnType("bigint") - .HasColumnName("account_id"); - - b.Property("RelatedId") - .HasColumnType("bigint") - .HasColumnName("related_id"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property("ExpiredAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("expired_at"); - - b.Property("Status") - .HasColumnType("integer") - .HasColumnName("status"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.HasKey("AccountId", "RelatedId") - .HasName("pk_account_relationships"); - - b.HasIndex("RelatedId") - .HasDatabaseName("ix_account_relationships_related_id"); - - b.ToTable("account_relationships", (string)null); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Account.Status", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uuid") - .HasColumnName("id"); - - b.Property("AccountId") - .HasColumnType("bigint") - .HasColumnName("account_id"); - - b.Property("Attitude") - .HasColumnType("integer") - .HasColumnName("attitude"); - - b.Property("ClearedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("cleared_at"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property("IsInvisible") - .HasColumnType("boolean") - .HasColumnName("is_invisible"); - - b.Property("IsNotDisturb") - .HasColumnType("boolean") - .HasColumnName("is_not_disturb"); - - b.Property("Label") - .HasMaxLength(1024) - .HasColumnType("character varying(1024)") - .HasColumnName("label"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.HasKey("Id") - .HasName("pk_account_statuses"); - - b.HasIndex("AccountId") - .HasDatabaseName("ix_account_statuses_account_id"); - - b.ToTable("account_statuses", (string)null); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Activity.Activity", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uuid") - .HasColumnName("id"); - - b.Property("AccountId") - .HasColumnType("bigint") - .HasColumnName("account_id"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property>("Meta") - .IsRequired() - .HasColumnType("jsonb") - .HasColumnName("meta"); - - b.Property("ResourceIdentifier") - .IsRequired() - .HasMaxLength(4096) - .HasColumnType("character varying(4096)") - .HasColumnName("resource_identifier"); - - b.Property("Type") - .IsRequired() - .HasMaxLength(1024) - .HasColumnType("character varying(1024)") - .HasColumnName("type"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.Property>("UsersVisible") - .IsRequired() - .HasColumnType("jsonb") - .HasColumnName("users_visible"); - - b.Property("Visibility") - .HasColumnType("integer") - .HasColumnName("visibility"); - - b.HasKey("Id") - .HasName("pk_activities"); - - b.HasIndex("AccountId") - .HasDatabaseName("ix_activities_account_id"); - - b.ToTable("activities", (string)null); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Auth.Challenge", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uuid") - .HasColumnName("id"); - - b.Property("AccountId") - .HasColumnType("bigint") - .HasColumnName("account_id"); - - b.Property>("Audiences") - .IsRequired() - .HasColumnType("jsonb") - .HasColumnName("audiences"); - - b.Property>("BlacklistFactors") - .IsRequired() - .HasColumnType("jsonb") - .HasColumnName("blacklist_factors"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property("DeviceId") - .HasMaxLength(256) - .HasColumnType("character varying(256)") - .HasColumnName("device_id"); - - b.Property("ExpiredAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("expired_at"); - - b.Property("FailedAttempts") - .HasColumnType("integer") - .HasColumnName("failed_attempts"); - - b.Property("IpAddress") - .HasMaxLength(128) - .HasColumnType("character varying(128)") - .HasColumnName("ip_address"); - - b.Property("Nonce") - .HasMaxLength(1024) - .HasColumnType("character varying(1024)") - .HasColumnName("nonce"); - - b.Property("Platform") - .HasColumnType("integer") - .HasColumnName("platform"); - - b.Property>("Scopes") - .IsRequired() - .HasColumnType("jsonb") - .HasColumnName("scopes"); - - b.Property("StepRemain") - .HasColumnType("integer") - .HasColumnName("step_remain"); - - b.Property("StepTotal") - .HasColumnType("integer") - .HasColumnName("step_total"); - - b.Property("Type") - .HasColumnType("integer") - .HasColumnName("type"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.Property("UserAgent") - .HasMaxLength(512) - .HasColumnType("character varying(512)") - .HasColumnName("user_agent"); - - b.HasKey("Id") - .HasName("pk_auth_challenges"); - - b.HasIndex("AccountId") - .HasDatabaseName("ix_auth_challenges_account_id"); - - b.ToTable("auth_challenges", (string)null); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Auth.Session", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uuid") - .HasColumnName("id"); - - b.Property("AccountId") - .HasColumnType("bigint") - .HasColumnName("account_id"); - - b.Property("ChallengeId") - .HasColumnType("uuid") - .HasColumnName("challenge_id"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property("ExpiredAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("expired_at"); - - b.Property("Label") - .HasMaxLength(1024) - .HasColumnType("character varying(1024)") - .HasColumnName("label"); - - b.Property("LastGrantedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("last_granted_at"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.HasKey("Id") - .HasName("pk_auth_sessions"); - - b.HasIndex("AccountId") - .HasDatabaseName("ix_auth_sessions_account_id"); - - b.HasIndex("ChallengeId") - .HasDatabaseName("ix_auth_sessions_challenge_id"); - - b.ToTable("auth_sessions", (string)null); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Chat.ChatMember", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uuid") - .HasColumnName("id"); - - b.Property("AccountId") - .HasColumnType("bigint") - .HasColumnName("account_id"); - - b.Property("ChatRoomId") - .HasColumnType("bigint") - .HasColumnName("chat_room_id"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property("IsBot") - .HasColumnType("boolean") - .HasColumnName("is_bot"); - - b.Property("JoinedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("joined_at"); - - b.Property("Nick") - .HasMaxLength(1024) - .HasColumnType("character varying(1024)") - .HasColumnName("nick"); - - b.Property("Notify") - .HasColumnType("integer") - .HasColumnName("notify"); - - b.Property("Role") - .HasColumnType("integer") - .HasColumnName("role"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.HasKey("Id") - .HasName("pk_chat_members"); - - b.HasAlternateKey("ChatRoomId", "AccountId") - .HasName("ak_chat_members_chat_room_id_account_id"); - - b.HasIndex("AccountId") - .HasDatabaseName("ix_chat_members_account_id"); - - b.ToTable("chat_members", (string)null); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Chat.ChatRoom", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("BackgroundId") - .HasColumnType("character varying(128)") - .HasColumnName("background_id"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property("Description") - .IsRequired() - .HasMaxLength(4096) - .HasColumnType("character varying(4096)") - .HasColumnName("description"); - - b.Property("IsPublic") - .HasColumnType("boolean") - .HasColumnName("is_public"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(1024) - .HasColumnType("character varying(1024)") - .HasColumnName("name"); - - b.Property("PictureId") - .HasColumnType("character varying(128)") - .HasColumnName("picture_id"); - - b.Property("RealmId") - .HasColumnType("bigint") - .HasColumnName("realm_id"); - - b.Property("Type") - .HasColumnType("integer") - .HasColumnName("type"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.HasKey("Id") - .HasName("pk_chat_rooms"); - - b.HasIndex("BackgroundId") - .HasDatabaseName("ix_chat_rooms_background_id"); - - b.HasIndex("PictureId") - .HasDatabaseName("ix_chat_rooms_picture_id"); - - b.HasIndex("RealmId") - .HasDatabaseName("ix_chat_rooms_realm_id"); - - b.ToTable("chat_rooms", (string)null); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Chat.Message", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uuid") - .HasColumnName("id"); - - b.Property("ChatRoomId") - .HasColumnType("bigint") - .HasColumnName("chat_room_id"); - - b.Property("Content") - .HasMaxLength(4096) - .HasColumnType("character varying(4096)") - .HasColumnName("content"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property("EditedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("edited_at"); - - b.Property("ForwardedMessageId") - .HasColumnType("uuid") - .HasColumnName("forwarded_message_id"); - - b.Property>("MembersMentioned") - .HasColumnType("jsonb") - .HasColumnName("members_mentioned"); - - b.Property>("Meta") - .HasColumnType("jsonb") - .HasColumnName("meta"); - - b.Property("Nonce") - .IsRequired() - .HasMaxLength(36) - .HasColumnType("character varying(36)") - .HasColumnName("nonce"); - - b.Property("RepliedMessageId") - .HasColumnType("uuid") - .HasColumnName("replied_message_id"); - - b.Property("SenderId") - .HasColumnType("uuid") - .HasColumnName("sender_id"); - - b.Property("Type") - .IsRequired() - .HasColumnType("text") - .HasColumnName("type"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.HasKey("Id") - .HasName("pk_chat_messages"); - - b.HasIndex("ChatRoomId") - .HasDatabaseName("ix_chat_messages_chat_room_id"); - - b.HasIndex("ForwardedMessageId") - .HasDatabaseName("ix_chat_messages_forwarded_message_id"); - - b.HasIndex("RepliedMessageId") - .HasDatabaseName("ix_chat_messages_replied_message_id"); - - b.HasIndex("SenderId") - .HasDatabaseName("ix_chat_messages_sender_id"); - - b.ToTable("chat_messages", (string)null); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Chat.MessageReaction", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uuid") - .HasColumnName("id"); - - b.Property("Attitude") - .HasColumnType("integer") - .HasColumnName("attitude"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property("MessageId") - .HasColumnType("uuid") - .HasColumnName("message_id"); - - b.Property("SenderId") - .HasColumnType("uuid") - .HasColumnName("sender_id"); - - b.Property("Symbol") - .IsRequired() - .HasMaxLength(256) - .HasColumnType("character varying(256)") - .HasColumnName("symbol"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.HasKey("Id") - .HasName("pk_chat_reactions"); - - b.HasIndex("MessageId") - .HasDatabaseName("ix_chat_reactions_message_id"); - - b.HasIndex("SenderId") - .HasDatabaseName("ix_chat_reactions_sender_id"); - - b.ToTable("chat_reactions", (string)null); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Chat.MessageStatus", b => - { - b.Property("MessageId") - .HasColumnType("uuid") - .HasColumnName("message_id"); - - b.Property("SenderId") - .HasColumnType("uuid") - .HasColumnName("sender_id"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property("ReadAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("read_at"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.HasKey("MessageId", "SenderId") - .HasName("pk_chat_statuses"); - - b.HasIndex("SenderId") - .HasDatabaseName("ix_chat_statuses_sender_id"); - - b.ToTable("chat_statuses", (string)null); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Chat.RealtimeCall", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uuid") - .HasColumnName("id"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property("EndedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("ended_at"); - - b.Property("RoomId") - .HasColumnType("bigint") - .HasColumnName("room_id"); - - b.Property("SenderId") - .HasColumnType("uuid") - .HasColumnName("sender_id"); - - b.Property("Title") - .HasColumnType("text") - .HasColumnName("title"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.HasKey("Id") - .HasName("pk_chat_realtime_call"); - - b.HasIndex("RoomId") - .HasDatabaseName("ix_chat_realtime_call_room_id"); - - b.HasIndex("SenderId") - .HasDatabaseName("ix_chat_realtime_call_sender_id"); - - b.ToTable("chat_realtime_call", (string)null); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Permission.PermissionGroup", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uuid") - .HasColumnName("id"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property("Key") - .IsRequired() - .HasMaxLength(1024) - .HasColumnType("character varying(1024)") - .HasColumnName("key"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.HasKey("Id") - .HasName("pk_permission_groups"); - - b.ToTable("permission_groups", (string)null); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Permission.PermissionGroupMember", b => - { - b.Property("GroupId") - .HasColumnType("uuid") - .HasColumnName("group_id"); - - b.Property("Actor") - .HasMaxLength(1024) - .HasColumnType("character varying(1024)") - .HasColumnName("actor"); - - b.Property("AffectedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("affected_at"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property("ExpiredAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("expired_at"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.HasKey("GroupId", "Actor") - .HasName("pk_permission_group_members"); - - b.ToTable("permission_group_members", (string)null); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Permission.PermissionNode", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uuid") - .HasColumnName("id"); - - b.Property("Actor") - .IsRequired() - .HasMaxLength(1024) - .HasColumnType("character varying(1024)") - .HasColumnName("actor"); - - b.Property("AffectedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("affected_at"); - - b.Property("Area") - .IsRequired() - .HasMaxLength(1024) - .HasColumnType("character varying(1024)") - .HasColumnName("area"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property("ExpiredAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("expired_at"); - - b.Property("GroupId") - .HasColumnType("uuid") - .HasColumnName("group_id"); - - b.Property("Key") - .IsRequired() - .HasMaxLength(1024) - .HasColumnType("character varying(1024)") - .HasColumnName("key"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.Property("Value") - .IsRequired() - .HasColumnType("jsonb") - .HasColumnName("value"); - - b.HasKey("Id") - .HasName("pk_permission_nodes"); - - b.HasIndex("GroupId") - .HasDatabaseName("ix_permission_nodes_group_id"); - - b.HasIndex("Key", "Area", "Actor") - .HasDatabaseName("ix_permission_nodes_key_area_actor"); - - b.ToTable("permission_nodes", (string)null); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Post.Post", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Content") - .HasColumnType("text") - .HasColumnName("content"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property("Description") - .HasMaxLength(4096) - .HasColumnType("character varying(4096)") - .HasColumnName("description"); - - b.Property("Downvotes") - .HasColumnType("integer") - .HasColumnName("downvotes"); - - b.Property("EditedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("edited_at"); - - b.Property("ForwardedPostId") - .HasColumnType("bigint") - .HasColumnName("forwarded_post_id"); - - b.Property("Language") - .HasMaxLength(128) - .HasColumnType("character varying(128)") - .HasColumnName("language"); - - b.Property>("Meta") - .HasColumnType("jsonb") - .HasColumnName("meta"); - - b.Property("PublishedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("published_at"); - - b.Property("PublisherId") - .HasColumnType("bigint") - .HasColumnName("publisher_id"); - - b.Property("RepliedPostId") - .HasColumnType("bigint") - .HasColumnName("replied_post_id"); - - b.Property("SearchVector") - .IsRequired() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("tsvector") - .HasColumnName("search_vector") - .HasAnnotation("Npgsql:TsVectorConfig", "simple") - .HasAnnotation("Npgsql:TsVectorProperties", new[] { "Title", "Description", "Content" }); - - b.Property("ThreadedPostId") - .HasColumnType("bigint") - .HasColumnName("threaded_post_id"); - - b.Property("Title") - .HasMaxLength(1024) - .HasColumnType("character varying(1024)") - .HasColumnName("title"); - - b.Property("Type") - .HasColumnType("integer") - .HasColumnName("type"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.Property("Upvotes") - .HasColumnType("integer") - .HasColumnName("upvotes"); - - b.Property("ViewsTotal") - .HasColumnType("integer") - .HasColumnName("views_total"); - - b.Property("ViewsUnique") - .HasColumnType("integer") - .HasColumnName("views_unique"); - - b.Property("Visibility") - .HasColumnType("integer") - .HasColumnName("visibility"); - - b.HasKey("Id") - .HasName("pk_posts"); - - b.HasIndex("ForwardedPostId") - .HasDatabaseName("ix_posts_forwarded_post_id"); - - b.HasIndex("PublisherId") - .HasDatabaseName("ix_posts_publisher_id"); - - b.HasIndex("RepliedPostId") - .HasDatabaseName("ix_posts_replied_post_id"); - - b.HasIndex("SearchVector") - .HasDatabaseName("ix_posts_search_vector"); - - NpgsqlIndexBuilderExtensions.HasMethod(b.HasIndex("SearchVector"), "GIN"); - - b.HasIndex("ThreadedPostId") - .IsUnique() - .HasDatabaseName("ix_posts_threaded_post_id"); - - b.ToTable("posts", (string)null); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Post.PostCategory", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property("Name") - .HasMaxLength(256) - .HasColumnType("character varying(256)") - .HasColumnName("name"); - - b.Property("Slug") - .IsRequired() - .HasMaxLength(128) - .HasColumnType("character varying(128)") - .HasColumnName("slug"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.HasKey("Id") - .HasName("pk_post_categories"); - - b.ToTable("post_categories", (string)null); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Post.PostCollection", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property("Description") - .HasMaxLength(4096) - .HasColumnType("character varying(4096)") - .HasColumnName("description"); - - b.Property("Name") - .HasMaxLength(256) - .HasColumnType("character varying(256)") - .HasColumnName("name"); - - b.Property("PublisherId") - .HasColumnType("bigint") - .HasColumnName("publisher_id"); - - b.Property("Slug") - .IsRequired() - .HasMaxLength(128) - .HasColumnType("character varying(128)") - .HasColumnName("slug"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.HasKey("Id") - .HasName("pk_post_collections"); - - b.HasIndex("PublisherId") - .HasDatabaseName("ix_post_collections_publisher_id"); - - b.ToTable("post_collections", (string)null); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Post.PostReaction", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AccountId") - .HasColumnType("bigint") - .HasColumnName("account_id"); - - b.Property("Attitude") - .HasColumnType("integer") - .HasColumnName("attitude"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property("PostId") - .HasColumnType("bigint") - .HasColumnName("post_id"); - - b.Property("Symbol") - .IsRequired() - .HasMaxLength(256) - .HasColumnType("character varying(256)") - .HasColumnName("symbol"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.HasKey("Id") - .HasName("pk_post_reactions"); - - b.HasIndex("AccountId") - .HasDatabaseName("ix_post_reactions_account_id"); - - b.HasIndex("PostId") - .HasDatabaseName("ix_post_reactions_post_id"); - - b.ToTable("post_reactions", (string)null); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Post.PostTag", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property("Name") - .HasMaxLength(256) - .HasColumnType("character varying(256)") - .HasColumnName("name"); - - b.Property("Slug") - .IsRequired() - .HasMaxLength(128) - .HasColumnType("character varying(128)") - .HasColumnName("slug"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.HasKey("Id") - .HasName("pk_post_tags"); - - b.ToTable("post_tags", (string)null); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Post.Publisher", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AccountId") - .HasColumnType("bigint") - .HasColumnName("account_id"); - - b.Property("BackgroundId") - .HasColumnType("character varying(128)") - .HasColumnName("background_id"); - - b.Property("Bio") - .HasMaxLength(4096) - .HasColumnType("character varying(4096)") - .HasColumnName("bio"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(256) - .HasColumnType("character varying(256)") - .HasColumnName("name"); - - b.Property("Nick") - .IsRequired() - .HasMaxLength(256) - .HasColumnType("character varying(256)") - .HasColumnName("nick"); - - b.Property("PictureId") - .HasColumnType("character varying(128)") - .HasColumnName("picture_id"); - - b.Property("PublisherType") - .HasColumnType("integer") - .HasColumnName("publisher_type"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.HasKey("Id") - .HasName("pk_publishers"); - - b.HasIndex("AccountId") - .HasDatabaseName("ix_publishers_account_id"); - - b.HasIndex("BackgroundId") - .HasDatabaseName("ix_publishers_background_id"); - - b.HasIndex("Name") - .IsUnique() - .HasDatabaseName("ix_publishers_name"); - - b.HasIndex("PictureId") - .HasDatabaseName("ix_publishers_picture_id"); - - b.ToTable("publishers", (string)null); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Post.PublisherMember", b => - { - b.Property("PublisherId") - .HasColumnType("bigint") - .HasColumnName("publisher_id"); - - b.Property("AccountId") - .HasColumnType("bigint") - .HasColumnName("account_id"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property("JoinedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("joined_at"); - - b.Property("Role") - .HasColumnType("integer") - .HasColumnName("role"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.HasKey("PublisherId", "AccountId") - .HasName("pk_publisher_members"); - - b.HasIndex("AccountId") - .HasDatabaseName("ix_publisher_members_account_id"); - - b.ToTable("publisher_members", (string)null); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Post.PublisherSubscription", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uuid") - .HasColumnName("id"); - - b.Property("AccountId") - .HasColumnType("bigint") - .HasColumnName("account_id"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property("PublisherId") - .HasColumnType("bigint") - .HasColumnName("publisher_id"); - - b.Property("Status") - .HasColumnType("integer") - .HasColumnName("status"); - - b.Property("Tier") - .HasColumnType("integer") - .HasColumnName("tier"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.HasKey("Id") - .HasName("pk_publisher_subscriptions"); - - b.HasIndex("AccountId") - .HasDatabaseName("ix_publisher_subscriptions_account_id"); - - b.HasIndex("PublisherId") - .HasDatabaseName("ix_publisher_subscriptions_publisher_id"); - - b.ToTable("publisher_subscriptions", (string)null); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Realm.Realm", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AccountId") - .HasColumnType("bigint") - .HasColumnName("account_id"); - - b.Property("BackgroundId") - .HasColumnType("character varying(128)") - .HasColumnName("background_id"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property("Description") - .IsRequired() - .HasMaxLength(4096) - .HasColumnType("character varying(4096)") - .HasColumnName("description"); - - b.Property("IsCommunity") - .HasColumnType("boolean") - .HasColumnName("is_community"); - - b.Property("IsPublic") - .HasColumnType("boolean") - .HasColumnName("is_public"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(1024) - .HasColumnType("character varying(1024)") - .HasColumnName("name"); - - b.Property("PictureId") - .HasColumnType("character varying(128)") - .HasColumnName("picture_id"); - - b.Property("Slug") - .IsRequired() - .HasMaxLength(1024) - .HasColumnType("character varying(1024)") - .HasColumnName("slug"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.Property("VerifiedAs") - .HasMaxLength(4096) - .HasColumnType("character varying(4096)") - .HasColumnName("verified_as"); - - b.Property("VerifiedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("verified_at"); - - b.HasKey("Id") - .HasName("pk_realms"); - - b.HasIndex("AccountId") - .HasDatabaseName("ix_realms_account_id"); - - b.HasIndex("BackgroundId") - .HasDatabaseName("ix_realms_background_id"); - - b.HasIndex("PictureId") - .HasDatabaseName("ix_realms_picture_id"); - - b.HasIndex("Slug") - .IsUnique() - .HasDatabaseName("ix_realms_slug"); - - b.ToTable("realms", (string)null); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Realm.RealmMember", b => - { - b.Property("RealmId") - .HasColumnType("bigint") - .HasColumnName("realm_id"); - - b.Property("AccountId") - .HasColumnType("bigint") - .HasColumnName("account_id"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property("JoinedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("joined_at"); - - b.Property("Role") - .HasColumnType("integer") - .HasColumnName("role"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.HasKey("RealmId", "AccountId") - .HasName("pk_realm_members"); - - b.HasIndex("AccountId") - .HasDatabaseName("ix_realm_members_account_id"); - - b.ToTable("realm_members", (string)null); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Sticker.Sticker", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uuid") - .HasColumnName("id"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property("ImageId") - .IsRequired() - .HasColumnType("character varying(128)") - .HasColumnName("image_id"); - - b.Property("PackId") - .HasColumnType("uuid") - .HasColumnName("pack_id"); - - b.Property("Slug") - .IsRequired() - .HasMaxLength(128) - .HasColumnType("character varying(128)") - .HasColumnName("slug"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.HasKey("Id") - .HasName("pk_stickers"); - - b.HasIndex("ImageId") - .HasDatabaseName("ix_stickers_image_id"); - - b.HasIndex("PackId") - .HasDatabaseName("ix_stickers_pack_id"); - - b.ToTable("stickers", (string)null); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Sticker.StickerPack", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uuid") - .HasColumnName("id"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property("Description") - .IsRequired() - .HasMaxLength(4096) - .HasColumnType("character varying(4096)") - .HasColumnName("description"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(1024) - .HasColumnType("character varying(1024)") - .HasColumnName("name"); - - b.Property("Prefix") - .IsRequired() - .HasMaxLength(128) - .HasColumnType("character varying(128)") - .HasColumnName("prefix"); - - b.Property("PublisherId") - .HasColumnType("bigint") - .HasColumnName("publisher_id"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.HasKey("Id") - .HasName("pk_sticker_packs"); - - b.HasIndex("PublisherId") - .HasDatabaseName("ix_sticker_packs_publisher_id"); - - b.ToTable("sticker_packs", (string)null); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Storage.CloudFile", b => - { - b.Property("Id") - .HasMaxLength(128) - .HasColumnType("character varying(128)") - .HasColumnName("id"); - - b.Property("AccountId") - .HasColumnType("bigint") - .HasColumnName("account_id"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property("Description") - .HasMaxLength(4096) - .HasColumnType("character varying(4096)") - .HasColumnName("description"); - - b.Property("ExpiredAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("expired_at"); - - b.Property>("FileMeta") - .HasColumnType("jsonb") - .HasColumnName("file_meta"); - - b.Property("HasCompression") - .HasColumnType("boolean") - .HasColumnName("has_compression"); - - b.Property("Hash") - .HasMaxLength(256) - .HasColumnType("character varying(256)") - .HasColumnName("hash"); - - b.Property("MessageId") - .HasColumnType("uuid") - .HasColumnName("message_id"); - - b.Property("MimeType") - .HasMaxLength(256) - .HasColumnType("character varying(256)") - .HasColumnName("mime_type"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(1024) - .HasColumnType("character varying(1024)") - .HasColumnName("name"); - - b.Property("PostId") - .HasColumnType("bigint") - .HasColumnName("post_id"); - - b.Property("Size") - .HasColumnType("bigint") - .HasColumnName("size"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.Property("UploadedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("uploaded_at"); - - b.Property("UploadedTo") - .HasMaxLength(128) - .HasColumnType("character varying(128)") - .HasColumnName("uploaded_to"); - - b.Property("UsedCount") - .HasColumnType("integer") - .HasColumnName("used_count"); - - b.Property>("UserMeta") - .HasColumnType("jsonb") - .HasColumnName("user_meta"); - - b.HasKey("Id") - .HasName("pk_files"); - - b.HasIndex("AccountId") - .HasDatabaseName("ix_files_account_id"); - - b.HasIndex("MessageId") - .HasDatabaseName("ix_files_message_id"); - - b.HasIndex("PostId") - .HasDatabaseName("ix_files_post_id"); - - b.ToTable("files", (string)null); - }); - - modelBuilder.Entity("PostPostCategory", b => - { - b.Property("CategoriesId") - .HasColumnType("bigint") - .HasColumnName("categories_id"); - - b.Property("PostsId") - .HasColumnType("bigint") - .HasColumnName("posts_id"); - - b.HasKey("CategoriesId", "PostsId") - .HasName("pk_post_category_links"); - - b.HasIndex("PostsId") - .HasDatabaseName("ix_post_category_links_posts_id"); - - b.ToTable("post_category_links", (string)null); - }); - - modelBuilder.Entity("PostPostCollection", b => - { - b.Property("CollectionsId") - .HasColumnType("bigint") - .HasColumnName("collections_id"); - - b.Property("PostsId") - .HasColumnType("bigint") - .HasColumnName("posts_id"); - - b.HasKey("CollectionsId", "PostsId") - .HasName("pk_post_collection_links"); - - b.HasIndex("PostsId") - .HasDatabaseName("ix_post_collection_links_posts_id"); - - b.ToTable("post_collection_links", (string)null); - }); - - modelBuilder.Entity("PostPostTag", b => - { - b.Property("PostsId") - .HasColumnType("bigint") - .HasColumnName("posts_id"); - - b.Property("TagsId") - .HasColumnType("bigint") - .HasColumnName("tags_id"); - - b.HasKey("PostsId", "TagsId") - .HasName("pk_post_tag_links"); - - b.HasIndex("TagsId") - .HasDatabaseName("ix_post_tag_links_tags_id"); - - b.ToTable("post_tag_links", (string)null); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Account.AccountAuthFactor", b => - { - b.HasOne("DysonNetwork.Sphere.Account.Account", "Account") - .WithMany("AuthFactors") - .HasForeignKey("AccountId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_account_auth_factors_accounts_account_id"); - - b.Navigation("Account"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Account.AccountContact", b => - { - b.HasOne("DysonNetwork.Sphere.Account.Account", "Account") - .WithMany("Contacts") - .HasForeignKey("AccountId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_account_contacts_accounts_account_id"); - - b.Navigation("Account"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Account.CheckInResult", b => - { - b.HasOne("DysonNetwork.Sphere.Account.Account", "Account") - .WithMany() - .HasForeignKey("AccountId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_account_check_in_results_accounts_account_id"); - - b.Navigation("Account"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Account.MagicSpell", b => - { - b.HasOne("DysonNetwork.Sphere.Account.Account", "Account") - .WithMany() - .HasForeignKey("AccountId") - .HasConstraintName("fk_magic_spells_accounts_account_id"); - - b.Navigation("Account"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Account.Notification", b => - { - b.HasOne("DysonNetwork.Sphere.Account.Account", "Account") - .WithMany() - .HasForeignKey("AccountId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_notifications_accounts_account_id"); - - b.Navigation("Account"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Account.NotificationPushSubscription", b => - { - b.HasOne("DysonNetwork.Sphere.Account.Account", "Account") - .WithMany() - .HasForeignKey("AccountId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_notification_push_subscriptions_accounts_account_id"); - - b.Navigation("Account"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Account.Profile", b => - { - b.HasOne("DysonNetwork.Sphere.Storage.CloudFile", "Background") - .WithMany() - .HasForeignKey("BackgroundId") - .HasConstraintName("fk_account_profiles_files_background_id"); - - b.HasOne("DysonNetwork.Sphere.Account.Account", "Account") - .WithOne("Profile") - .HasForeignKey("DysonNetwork.Sphere.Account.Profile", "Id") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_account_profiles_accounts_id"); - - b.HasOne("DysonNetwork.Sphere.Storage.CloudFile", "Picture") - .WithMany() - .HasForeignKey("PictureId") - .HasConstraintName("fk_account_profiles_files_picture_id"); - - b.Navigation("Account"); - - b.Navigation("Background"); - - b.Navigation("Picture"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Account.Relationship", b => - { - b.HasOne("DysonNetwork.Sphere.Account.Account", "Account") - .WithMany("OutgoingRelationships") - .HasForeignKey("AccountId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_account_relationships_accounts_account_id"); - - b.HasOne("DysonNetwork.Sphere.Account.Account", "Related") - .WithMany("IncomingRelationships") - .HasForeignKey("RelatedId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_account_relationships_accounts_related_id"); - - b.Navigation("Account"); - - b.Navigation("Related"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Account.Status", b => - { - b.HasOne("DysonNetwork.Sphere.Account.Account", "Account") - .WithMany() - .HasForeignKey("AccountId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_account_statuses_accounts_account_id"); - - b.Navigation("Account"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Activity.Activity", b => - { - b.HasOne("DysonNetwork.Sphere.Account.Account", "Account") - .WithMany() - .HasForeignKey("AccountId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_activities_accounts_account_id"); - - b.Navigation("Account"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Auth.Challenge", b => - { - b.HasOne("DysonNetwork.Sphere.Account.Account", "Account") - .WithMany("Challenges") - .HasForeignKey("AccountId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_auth_challenges_accounts_account_id"); - - b.Navigation("Account"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Auth.Session", b => - { - b.HasOne("DysonNetwork.Sphere.Account.Account", "Account") - .WithMany("Sessions") - .HasForeignKey("AccountId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_auth_sessions_accounts_account_id"); - - b.HasOne("DysonNetwork.Sphere.Auth.Challenge", "Challenge") - .WithMany() - .HasForeignKey("ChallengeId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_auth_sessions_auth_challenges_challenge_id"); - - b.Navigation("Account"); - - b.Navigation("Challenge"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Chat.ChatMember", b => - { - b.HasOne("DysonNetwork.Sphere.Account.Account", "Account") - .WithMany() - .HasForeignKey("AccountId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_chat_members_accounts_account_id"); - - b.HasOne("DysonNetwork.Sphere.Chat.ChatRoom", "ChatRoom") - .WithMany("Members") - .HasForeignKey("ChatRoomId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_chat_members_chat_rooms_chat_room_id"); - - b.Navigation("Account"); - - b.Navigation("ChatRoom"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Chat.ChatRoom", b => - { - b.HasOne("DysonNetwork.Sphere.Storage.CloudFile", "Background") - .WithMany() - .HasForeignKey("BackgroundId") - .HasConstraintName("fk_chat_rooms_files_background_id"); - - b.HasOne("DysonNetwork.Sphere.Storage.CloudFile", "Picture") - .WithMany() - .HasForeignKey("PictureId") - .HasConstraintName("fk_chat_rooms_files_picture_id"); - - b.HasOne("DysonNetwork.Sphere.Realm.Realm", "Realm") - .WithMany("ChatRooms") - .HasForeignKey("RealmId") - .HasConstraintName("fk_chat_rooms_realms_realm_id"); - - b.Navigation("Background"); - - b.Navigation("Picture"); - - b.Navigation("Realm"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Chat.Message", b => - { - b.HasOne("DysonNetwork.Sphere.Chat.ChatRoom", "ChatRoom") - .WithMany() - .HasForeignKey("ChatRoomId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_chat_messages_chat_rooms_chat_room_id"); - - b.HasOne("DysonNetwork.Sphere.Chat.Message", "ForwardedMessage") - .WithMany() - .HasForeignKey("ForwardedMessageId") - .OnDelete(DeleteBehavior.Restrict) - .HasConstraintName("fk_chat_messages_chat_messages_forwarded_message_id"); - - b.HasOne("DysonNetwork.Sphere.Chat.Message", "RepliedMessage") - .WithMany() - .HasForeignKey("RepliedMessageId") - .OnDelete(DeleteBehavior.Restrict) - .HasConstraintName("fk_chat_messages_chat_messages_replied_message_id"); - - b.HasOne("DysonNetwork.Sphere.Chat.ChatMember", "Sender") - .WithMany() - .HasForeignKey("SenderId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_chat_messages_chat_members_sender_id"); - - b.Navigation("ChatRoom"); - - b.Navigation("ForwardedMessage"); - - b.Navigation("RepliedMessage"); - - b.Navigation("Sender"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Chat.MessageReaction", b => - { - b.HasOne("DysonNetwork.Sphere.Chat.Message", "Message") - .WithMany("Reactions") - .HasForeignKey("MessageId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_chat_reactions_chat_messages_message_id"); - - b.HasOne("DysonNetwork.Sphere.Chat.ChatMember", "Sender") - .WithMany() - .HasForeignKey("SenderId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_chat_reactions_chat_members_sender_id"); - - b.Navigation("Message"); - - b.Navigation("Sender"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Chat.MessageStatus", b => - { - b.HasOne("DysonNetwork.Sphere.Chat.Message", "Message") - .WithMany("Statuses") - .HasForeignKey("MessageId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_chat_statuses_chat_messages_message_id"); - - b.HasOne("DysonNetwork.Sphere.Chat.ChatMember", "Sender") - .WithMany() - .HasForeignKey("SenderId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_chat_statuses_chat_members_sender_id"); - - b.Navigation("Message"); - - b.Navigation("Sender"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Chat.RealtimeCall", b => - { - b.HasOne("DysonNetwork.Sphere.Chat.ChatRoom", "Room") - .WithMany() - .HasForeignKey("RoomId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_chat_realtime_call_chat_rooms_room_id"); - - b.HasOne("DysonNetwork.Sphere.Chat.ChatMember", "Sender") - .WithMany() - .HasForeignKey("SenderId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_chat_realtime_call_chat_members_sender_id"); - - b.Navigation("Room"); - - b.Navigation("Sender"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Permission.PermissionGroupMember", b => - { - b.HasOne("DysonNetwork.Sphere.Permission.PermissionGroup", "Group") - .WithMany("Members") - .HasForeignKey("GroupId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_permission_group_members_permission_groups_group_id"); - - b.Navigation("Group"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Permission.PermissionNode", b => - { - b.HasOne("DysonNetwork.Sphere.Permission.PermissionGroup", "Group") - .WithMany("Nodes") - .HasForeignKey("GroupId") - .HasConstraintName("fk_permission_nodes_permission_groups_group_id"); - - b.Navigation("Group"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Post.Post", b => - { - b.HasOne("DysonNetwork.Sphere.Post.Post", "ForwardedPost") - .WithMany() - .HasForeignKey("ForwardedPostId") - .OnDelete(DeleteBehavior.Restrict) - .HasConstraintName("fk_posts_posts_forwarded_post_id"); - - b.HasOne("DysonNetwork.Sphere.Post.Publisher", "Publisher") - .WithMany("Posts") - .HasForeignKey("PublisherId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_posts_publishers_publisher_id"); - - b.HasOne("DysonNetwork.Sphere.Post.Post", "RepliedPost") - .WithMany() - .HasForeignKey("RepliedPostId") - .OnDelete(DeleteBehavior.Restrict) - .HasConstraintName("fk_posts_posts_replied_post_id"); - - b.HasOne("DysonNetwork.Sphere.Post.Post", "ThreadedPost") - .WithOne() - .HasForeignKey("DysonNetwork.Sphere.Post.Post", "ThreadedPostId") - .HasConstraintName("fk_posts_posts_threaded_post_id"); - - b.Navigation("ForwardedPost"); - - b.Navigation("Publisher"); - - b.Navigation("RepliedPost"); - - b.Navigation("ThreadedPost"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Post.PostCollection", b => - { - b.HasOne("DysonNetwork.Sphere.Post.Publisher", "Publisher") - .WithMany("Collections") - .HasForeignKey("PublisherId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_post_collections_publishers_publisher_id"); - - b.Navigation("Publisher"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Post.PostReaction", b => - { - b.HasOne("DysonNetwork.Sphere.Account.Account", "Account") - .WithMany() - .HasForeignKey("AccountId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_post_reactions_accounts_account_id"); - - b.HasOne("DysonNetwork.Sphere.Post.Post", "Post") - .WithMany("Reactions") - .HasForeignKey("PostId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_post_reactions_posts_post_id"); - - b.Navigation("Account"); - - b.Navigation("Post"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Post.Publisher", b => - { - b.HasOne("DysonNetwork.Sphere.Account.Account", "Account") - .WithMany() - .HasForeignKey("AccountId") - .HasConstraintName("fk_publishers_accounts_account_id"); - - b.HasOne("DysonNetwork.Sphere.Storage.CloudFile", "Background") - .WithMany() - .HasForeignKey("BackgroundId") - .HasConstraintName("fk_publishers_files_background_id"); - - b.HasOne("DysonNetwork.Sphere.Storage.CloudFile", "Picture") - .WithMany() - .HasForeignKey("PictureId") - .HasConstraintName("fk_publishers_files_picture_id"); - - b.Navigation("Account"); - - b.Navigation("Background"); - - b.Navigation("Picture"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Post.PublisherMember", b => - { - b.HasOne("DysonNetwork.Sphere.Account.Account", "Account") - .WithMany() - .HasForeignKey("AccountId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_publisher_members_accounts_account_id"); - - b.HasOne("DysonNetwork.Sphere.Post.Publisher", "Publisher") - .WithMany("Members") - .HasForeignKey("PublisherId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_publisher_members_publishers_publisher_id"); - - b.Navigation("Account"); - - b.Navigation("Publisher"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Post.PublisherSubscription", b => - { - b.HasOne("DysonNetwork.Sphere.Account.Account", "Account") - .WithMany() - .HasForeignKey("AccountId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_publisher_subscriptions_accounts_account_id"); - - b.HasOne("DysonNetwork.Sphere.Post.Publisher", "Publisher") - .WithMany("Subscriptions") - .HasForeignKey("PublisherId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_publisher_subscriptions_publishers_publisher_id"); - - b.Navigation("Account"); - - b.Navigation("Publisher"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Realm.Realm", b => - { - b.HasOne("DysonNetwork.Sphere.Account.Account", "Account") - .WithMany() - .HasForeignKey("AccountId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_realms_accounts_account_id"); - - b.HasOne("DysonNetwork.Sphere.Storage.CloudFile", "Background") - .WithMany() - .HasForeignKey("BackgroundId") - .HasConstraintName("fk_realms_files_background_id"); - - b.HasOne("DysonNetwork.Sphere.Storage.CloudFile", "Picture") - .WithMany() - .HasForeignKey("PictureId") - .HasConstraintName("fk_realms_files_picture_id"); - - b.Navigation("Account"); - - b.Navigation("Background"); - - b.Navigation("Picture"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Realm.RealmMember", b => - { - b.HasOne("DysonNetwork.Sphere.Account.Account", "Account") - .WithMany() - .HasForeignKey("AccountId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_realm_members_accounts_account_id"); - - b.HasOne("DysonNetwork.Sphere.Realm.Realm", "Realm") - .WithMany("Members") - .HasForeignKey("RealmId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_realm_members_realms_realm_id"); - - b.Navigation("Account"); - - b.Navigation("Realm"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Sticker.Sticker", b => - { - b.HasOne("DysonNetwork.Sphere.Storage.CloudFile", "Image") - .WithMany() - .HasForeignKey("ImageId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_stickers_files_image_id"); - - b.HasOne("DysonNetwork.Sphere.Sticker.StickerPack", "Pack") - .WithMany() - .HasForeignKey("PackId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_stickers_sticker_packs_pack_id"); - - b.Navigation("Image"); - - b.Navigation("Pack"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Sticker.StickerPack", b => - { - b.HasOne("DysonNetwork.Sphere.Post.Publisher", "Publisher") - .WithMany() - .HasForeignKey("PublisherId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_sticker_packs_publishers_publisher_id"); - - b.Navigation("Publisher"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Storage.CloudFile", b => - { - b.HasOne("DysonNetwork.Sphere.Account.Account", "Account") - .WithMany() - .HasForeignKey("AccountId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_files_accounts_account_id"); - - b.HasOne("DysonNetwork.Sphere.Chat.Message", null) - .WithMany("Attachments") - .HasForeignKey("MessageId") - .HasConstraintName("fk_files_chat_messages_message_id"); - - b.HasOne("DysonNetwork.Sphere.Post.Post", null) - .WithMany("Attachments") - .HasForeignKey("PostId") - .HasConstraintName("fk_files_posts_post_id"); - - b.Navigation("Account"); - }); - - modelBuilder.Entity("PostPostCategory", b => - { - b.HasOne("DysonNetwork.Sphere.Post.PostCategory", null) - .WithMany() - .HasForeignKey("CategoriesId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_post_category_links_post_categories_categories_id"); - - b.HasOne("DysonNetwork.Sphere.Post.Post", null) - .WithMany() - .HasForeignKey("PostsId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_post_category_links_posts_posts_id"); - }); - - modelBuilder.Entity("PostPostCollection", b => - { - b.HasOne("DysonNetwork.Sphere.Post.PostCollection", null) - .WithMany() - .HasForeignKey("CollectionsId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_post_collection_links_post_collections_collections_id"); - - b.HasOne("DysonNetwork.Sphere.Post.Post", null) - .WithMany() - .HasForeignKey("PostsId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_post_collection_links_posts_posts_id"); - }); - - modelBuilder.Entity("PostPostTag", b => - { - b.HasOne("DysonNetwork.Sphere.Post.Post", null) - .WithMany() - .HasForeignKey("PostsId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_post_tag_links_posts_posts_id"); - - b.HasOne("DysonNetwork.Sphere.Post.PostTag", null) - .WithMany() - .HasForeignKey("TagsId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_post_tag_links_post_tags_tags_id"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Account.Account", b => - { - b.Navigation("AuthFactors"); - - b.Navigation("Challenges"); - - b.Navigation("Contacts"); - - b.Navigation("IncomingRelationships"); - - b.Navigation("OutgoingRelationships"); - - b.Navigation("Profile") - .IsRequired(); - - b.Navigation("Sessions"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Chat.ChatRoom", b => - { - b.Navigation("Members"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Chat.Message", b => - { - b.Navigation("Attachments"); - - b.Navigation("Reactions"); - - b.Navigation("Statuses"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Permission.PermissionGroup", b => - { - b.Navigation("Members"); - - b.Navigation("Nodes"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Post.Post", b => - { - b.Navigation("Attachments"); - - b.Navigation("Reactions"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Post.Publisher", b => - { - b.Navigation("Collections"); - - b.Navigation("Members"); - - b.Navigation("Posts"); - - b.Navigation("Subscriptions"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Realm.Realm", b => - { - b.Navigation("ChatRooms"); - - b.Navigation("Members"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/DysonNetwork.Sphere/Migrations/20250512132355_AddPublisherSubscription.cs b/DysonNetwork.Sphere/Migrations/20250512132355_AddPublisherSubscription.cs deleted file mode 100644 index 8d71af3..0000000 --- a/DysonNetwork.Sphere/Migrations/20250512132355_AddPublisherSubscription.cs +++ /dev/null @@ -1,63 +0,0 @@ -using System; -using Microsoft.EntityFrameworkCore.Migrations; -using NodaTime; - -#nullable disable - -namespace DysonNetwork.Sphere.Migrations -{ - /// - public partial class AddPublisherSubscription : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.CreateTable( - name: "publisher_subscriptions", - columns: table => new - { - id = table.Column(type: "uuid", nullable: false), - publisher_id = table.Column(type: "bigint", nullable: false), - account_id = table.Column(type: "bigint", nullable: false), - status = table.Column(type: "integer", nullable: false), - tier = table.Column(type: "integer", nullable: false), - created_at = table.Column(type: "timestamp with time zone", nullable: false), - updated_at = table.Column(type: "timestamp with time zone", nullable: false), - deleted_at = table.Column(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"); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropTable( - name: "publisher_subscriptions"); - } - } -} diff --git a/DysonNetwork.Sphere/Migrations/20250512133934_PublisherWithOrganization.Designer.cs b/DysonNetwork.Sphere/Migrations/20250512133934_PublisherWithOrganization.Designer.cs deleted file mode 100644 index bd49cd6..0000000 --- a/DysonNetwork.Sphere/Migrations/20250512133934_PublisherWithOrganization.Designer.cs +++ /dev/null @@ -1,2777 +0,0 @@ -// -using System; -using System.Collections.Generic; -using System.Text.Json; -using DysonNetwork.Sphere; -using DysonNetwork.Sphere.Account; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using NodaTime; -using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; -using NpgsqlTypes; - -#nullable disable - -namespace DysonNetwork.Sphere.Migrations -{ - [DbContext(typeof(AppDatabase))] - [Migration("20250512133934_PublisherWithOrganization")] - partial class PublisherWithOrganization - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "9.0.3") - .HasAnnotation("Relational:MaxIdentifierLength", 63); - - NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); - - modelBuilder.Entity("DysonNetwork.Sphere.Account.Account", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ActivatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("activated_at"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property("IsSuperuser") - .HasColumnType("boolean") - .HasColumnName("is_superuser"); - - b.Property("Language") - .IsRequired() - .HasMaxLength(32) - .HasColumnType("character varying(32)") - .HasColumnName("language"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(256) - .HasColumnType("character varying(256)") - .HasColumnName("name"); - - b.Property("Nick") - .IsRequired() - .HasMaxLength(256) - .HasColumnType("character varying(256)") - .HasColumnName("nick"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.HasKey("Id") - .HasName("pk_accounts"); - - b.HasIndex("Name") - .IsUnique() - .HasDatabaseName("ix_accounts_name"); - - b.ToTable("accounts", (string)null); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Account.AccountAuthFactor", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AccountId") - .HasColumnType("bigint") - .HasColumnName("account_id"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property("Secret") - .HasColumnType("text") - .HasColumnName("secret"); - - b.Property("Type") - .HasColumnType("integer") - .HasColumnName("type"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.HasKey("Id") - .HasName("pk_account_auth_factors"); - - b.HasIndex("AccountId") - .HasDatabaseName("ix_account_auth_factors_account_id"); - - b.ToTable("account_auth_factors", (string)null); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Account.AccountContact", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AccountId") - .HasColumnType("bigint") - .HasColumnName("account_id"); - - b.Property("Content") - .IsRequired() - .HasMaxLength(1024) - .HasColumnType("character varying(1024)") - .HasColumnName("content"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property("Type") - .HasColumnType("integer") - .HasColumnName("type"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.Property("VerifiedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("verified_at"); - - b.HasKey("Id") - .HasName("pk_account_contacts"); - - b.HasIndex("AccountId") - .HasDatabaseName("ix_account_contacts_account_id"); - - b.ToTable("account_contacts", (string)null); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Account.CheckInResult", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uuid") - .HasColumnName("id"); - - b.Property("AccountId") - .HasColumnType("bigint") - .HasColumnName("account_id"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property("Level") - .HasColumnType("integer") - .HasColumnName("level"); - - b.Property>("Tips") - .IsRequired() - .HasColumnType("jsonb") - .HasColumnName("tips"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.HasKey("Id") - .HasName("pk_account_check_in_results"); - - b.HasIndex("AccountId") - .HasDatabaseName("ix_account_check_in_results_account_id"); - - b.ToTable("account_check_in_results", (string)null); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Account.MagicSpell", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uuid") - .HasColumnName("id"); - - b.Property("AccountId") - .HasColumnType("bigint") - .HasColumnName("account_id"); - - b.Property("AffectedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("affected_at"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property("ExpiresAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("expires_at"); - - b.Property>("Meta") - .IsRequired() - .HasColumnType("jsonb") - .HasColumnName("meta"); - - b.Property("Spell") - .IsRequired() - .HasMaxLength(1024) - .HasColumnType("character varying(1024)") - .HasColumnName("spell"); - - b.Property("Type") - .HasColumnType("integer") - .HasColumnName("type"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.HasKey("Id") - .HasName("pk_magic_spells"); - - b.HasIndex("AccountId") - .HasDatabaseName("ix_magic_spells_account_id"); - - b.HasIndex("Spell") - .IsUnique() - .HasDatabaseName("ix_magic_spells_spell"); - - b.ToTable("magic_spells", (string)null); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Account.Notification", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uuid") - .HasColumnName("id"); - - b.Property("AccountId") - .HasColumnType("bigint") - .HasColumnName("account_id"); - - b.Property("Content") - .HasMaxLength(4096) - .HasColumnType("character varying(4096)") - .HasColumnName("content"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property>("Meta") - .HasColumnType("jsonb") - .HasColumnName("meta"); - - b.Property("Priority") - .HasColumnType("integer") - .HasColumnName("priority"); - - b.Property("Subtitle") - .HasMaxLength(2048) - .HasColumnType("character varying(2048)") - .HasColumnName("subtitle"); - - b.Property("Title") - .HasMaxLength(1024) - .HasColumnType("character varying(1024)") - .HasColumnName("title"); - - b.Property("Topic") - .IsRequired() - .HasMaxLength(1024) - .HasColumnType("character varying(1024)") - .HasColumnName("topic"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.Property("ViewedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("viewed_at"); - - b.HasKey("Id") - .HasName("pk_notifications"); - - b.HasIndex("AccountId") - .HasDatabaseName("ix_notifications_account_id"); - - b.ToTable("notifications", (string)null); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Account.NotificationPushSubscription", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uuid") - .HasColumnName("id"); - - b.Property("AccountId") - .HasColumnType("bigint") - .HasColumnName("account_id"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property("DeviceId") - .IsRequired() - .HasMaxLength(4096) - .HasColumnType("character varying(4096)") - .HasColumnName("device_id"); - - b.Property("DeviceToken") - .IsRequired() - .HasMaxLength(4096) - .HasColumnType("character varying(4096)") - .HasColumnName("device_token"); - - b.Property("LastUsedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("last_used_at"); - - b.Property("Provider") - .HasColumnType("integer") - .HasColumnName("provider"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.HasKey("Id") - .HasName("pk_notification_push_subscriptions"); - - b.HasIndex("AccountId") - .HasDatabaseName("ix_notification_push_subscriptions_account_id"); - - b.HasIndex("DeviceId") - .IsUnique() - .HasDatabaseName("ix_notification_push_subscriptions_device_id"); - - b.HasIndex("DeviceToken") - .IsUnique() - .HasDatabaseName("ix_notification_push_subscriptions_device_token"); - - b.ToTable("notification_push_subscriptions", (string)null); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Account.Profile", b => - { - b.Property("Id") - .HasColumnType("bigint") - .HasColumnName("id"); - - b.Property("BackgroundId") - .HasColumnType("character varying(128)") - .HasColumnName("background_id"); - - b.Property("Bio") - .HasMaxLength(4096) - .HasColumnType("character varying(4096)") - .HasColumnName("bio"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property("FirstName") - .HasMaxLength(256) - .HasColumnType("character varying(256)") - .HasColumnName("first_name"); - - b.Property("LastName") - .HasMaxLength(256) - .HasColumnType("character varying(256)") - .HasColumnName("last_name"); - - b.Property("MiddleName") - .HasMaxLength(256) - .HasColumnType("character varying(256)") - .HasColumnName("middle_name"); - - b.Property("PictureId") - .HasColumnType("character varying(128)") - .HasColumnName("picture_id"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.HasKey("Id") - .HasName("pk_account_profiles"); - - b.HasIndex("BackgroundId") - .HasDatabaseName("ix_account_profiles_background_id"); - - b.HasIndex("PictureId") - .HasDatabaseName("ix_account_profiles_picture_id"); - - b.ToTable("account_profiles", (string)null); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Account.Relationship", b => - { - b.Property("AccountId") - .HasColumnType("bigint") - .HasColumnName("account_id"); - - b.Property("RelatedId") - .HasColumnType("bigint") - .HasColumnName("related_id"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property("ExpiredAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("expired_at"); - - b.Property("Status") - .HasColumnType("integer") - .HasColumnName("status"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.HasKey("AccountId", "RelatedId") - .HasName("pk_account_relationships"); - - b.HasIndex("RelatedId") - .HasDatabaseName("ix_account_relationships_related_id"); - - b.ToTable("account_relationships", (string)null); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Account.Status", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uuid") - .HasColumnName("id"); - - b.Property("AccountId") - .HasColumnType("bigint") - .HasColumnName("account_id"); - - b.Property("Attitude") - .HasColumnType("integer") - .HasColumnName("attitude"); - - b.Property("ClearedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("cleared_at"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property("IsInvisible") - .HasColumnType("boolean") - .HasColumnName("is_invisible"); - - b.Property("IsNotDisturb") - .HasColumnType("boolean") - .HasColumnName("is_not_disturb"); - - b.Property("Label") - .HasMaxLength(1024) - .HasColumnType("character varying(1024)") - .HasColumnName("label"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.HasKey("Id") - .HasName("pk_account_statuses"); - - b.HasIndex("AccountId") - .HasDatabaseName("ix_account_statuses_account_id"); - - b.ToTable("account_statuses", (string)null); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Activity.Activity", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uuid") - .HasColumnName("id"); - - b.Property("AccountId") - .HasColumnType("bigint") - .HasColumnName("account_id"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property>("Meta") - .IsRequired() - .HasColumnType("jsonb") - .HasColumnName("meta"); - - b.Property("ResourceIdentifier") - .IsRequired() - .HasMaxLength(4096) - .HasColumnType("character varying(4096)") - .HasColumnName("resource_identifier"); - - b.Property("Type") - .IsRequired() - .HasMaxLength(1024) - .HasColumnType("character varying(1024)") - .HasColumnName("type"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.Property>("UsersVisible") - .IsRequired() - .HasColumnType("jsonb") - .HasColumnName("users_visible"); - - b.Property("Visibility") - .HasColumnType("integer") - .HasColumnName("visibility"); - - b.HasKey("Id") - .HasName("pk_activities"); - - b.HasIndex("AccountId") - .HasDatabaseName("ix_activities_account_id"); - - b.ToTable("activities", (string)null); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Auth.Challenge", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uuid") - .HasColumnName("id"); - - b.Property("AccountId") - .HasColumnType("bigint") - .HasColumnName("account_id"); - - b.Property>("Audiences") - .IsRequired() - .HasColumnType("jsonb") - .HasColumnName("audiences"); - - b.Property>("BlacklistFactors") - .IsRequired() - .HasColumnType("jsonb") - .HasColumnName("blacklist_factors"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property("DeviceId") - .HasMaxLength(256) - .HasColumnType("character varying(256)") - .HasColumnName("device_id"); - - b.Property("ExpiredAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("expired_at"); - - b.Property("FailedAttempts") - .HasColumnType("integer") - .HasColumnName("failed_attempts"); - - b.Property("IpAddress") - .HasMaxLength(128) - .HasColumnType("character varying(128)") - .HasColumnName("ip_address"); - - b.Property("Nonce") - .HasMaxLength(1024) - .HasColumnType("character varying(1024)") - .HasColumnName("nonce"); - - b.Property("Platform") - .HasColumnType("integer") - .HasColumnName("platform"); - - b.Property>("Scopes") - .IsRequired() - .HasColumnType("jsonb") - .HasColumnName("scopes"); - - b.Property("StepRemain") - .HasColumnType("integer") - .HasColumnName("step_remain"); - - b.Property("StepTotal") - .HasColumnType("integer") - .HasColumnName("step_total"); - - b.Property("Type") - .HasColumnType("integer") - .HasColumnName("type"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.Property("UserAgent") - .HasMaxLength(512) - .HasColumnType("character varying(512)") - .HasColumnName("user_agent"); - - b.HasKey("Id") - .HasName("pk_auth_challenges"); - - b.HasIndex("AccountId") - .HasDatabaseName("ix_auth_challenges_account_id"); - - b.ToTable("auth_challenges", (string)null); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Auth.Session", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uuid") - .HasColumnName("id"); - - b.Property("AccountId") - .HasColumnType("bigint") - .HasColumnName("account_id"); - - b.Property("ChallengeId") - .HasColumnType("uuid") - .HasColumnName("challenge_id"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property("ExpiredAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("expired_at"); - - b.Property("Label") - .HasMaxLength(1024) - .HasColumnType("character varying(1024)") - .HasColumnName("label"); - - b.Property("LastGrantedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("last_granted_at"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.HasKey("Id") - .HasName("pk_auth_sessions"); - - b.HasIndex("AccountId") - .HasDatabaseName("ix_auth_sessions_account_id"); - - b.HasIndex("ChallengeId") - .HasDatabaseName("ix_auth_sessions_challenge_id"); - - b.ToTable("auth_sessions", (string)null); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Chat.ChatMember", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uuid") - .HasColumnName("id"); - - b.Property("AccountId") - .HasColumnType("bigint") - .HasColumnName("account_id"); - - b.Property("ChatRoomId") - .HasColumnType("bigint") - .HasColumnName("chat_room_id"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property("IsBot") - .HasColumnType("boolean") - .HasColumnName("is_bot"); - - b.Property("JoinedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("joined_at"); - - b.Property("Nick") - .HasMaxLength(1024) - .HasColumnType("character varying(1024)") - .HasColumnName("nick"); - - b.Property("Notify") - .HasColumnType("integer") - .HasColumnName("notify"); - - b.Property("Role") - .HasColumnType("integer") - .HasColumnName("role"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.HasKey("Id") - .HasName("pk_chat_members"); - - b.HasAlternateKey("ChatRoomId", "AccountId") - .HasName("ak_chat_members_chat_room_id_account_id"); - - b.HasIndex("AccountId") - .HasDatabaseName("ix_chat_members_account_id"); - - b.ToTable("chat_members", (string)null); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Chat.ChatRoom", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("BackgroundId") - .HasColumnType("character varying(128)") - .HasColumnName("background_id"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property("Description") - .IsRequired() - .HasMaxLength(4096) - .HasColumnType("character varying(4096)") - .HasColumnName("description"); - - b.Property("IsPublic") - .HasColumnType("boolean") - .HasColumnName("is_public"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(1024) - .HasColumnType("character varying(1024)") - .HasColumnName("name"); - - b.Property("PictureId") - .HasColumnType("character varying(128)") - .HasColumnName("picture_id"); - - b.Property("RealmId") - .HasColumnType("bigint") - .HasColumnName("realm_id"); - - b.Property("Type") - .HasColumnType("integer") - .HasColumnName("type"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.HasKey("Id") - .HasName("pk_chat_rooms"); - - b.HasIndex("BackgroundId") - .HasDatabaseName("ix_chat_rooms_background_id"); - - b.HasIndex("PictureId") - .HasDatabaseName("ix_chat_rooms_picture_id"); - - b.HasIndex("RealmId") - .HasDatabaseName("ix_chat_rooms_realm_id"); - - b.ToTable("chat_rooms", (string)null); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Chat.Message", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uuid") - .HasColumnName("id"); - - b.Property("ChatRoomId") - .HasColumnType("bigint") - .HasColumnName("chat_room_id"); - - b.Property("Content") - .HasMaxLength(4096) - .HasColumnType("character varying(4096)") - .HasColumnName("content"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property("EditedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("edited_at"); - - b.Property("ForwardedMessageId") - .HasColumnType("uuid") - .HasColumnName("forwarded_message_id"); - - b.Property>("MembersMentioned") - .HasColumnType("jsonb") - .HasColumnName("members_mentioned"); - - b.Property>("Meta") - .HasColumnType("jsonb") - .HasColumnName("meta"); - - b.Property("Nonce") - .IsRequired() - .HasMaxLength(36) - .HasColumnType("character varying(36)") - .HasColumnName("nonce"); - - b.Property("RepliedMessageId") - .HasColumnType("uuid") - .HasColumnName("replied_message_id"); - - b.Property("SenderId") - .HasColumnType("uuid") - .HasColumnName("sender_id"); - - b.Property("Type") - .IsRequired() - .HasColumnType("text") - .HasColumnName("type"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.HasKey("Id") - .HasName("pk_chat_messages"); - - b.HasIndex("ChatRoomId") - .HasDatabaseName("ix_chat_messages_chat_room_id"); - - b.HasIndex("ForwardedMessageId") - .HasDatabaseName("ix_chat_messages_forwarded_message_id"); - - b.HasIndex("RepliedMessageId") - .HasDatabaseName("ix_chat_messages_replied_message_id"); - - b.HasIndex("SenderId") - .HasDatabaseName("ix_chat_messages_sender_id"); - - b.ToTable("chat_messages", (string)null); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Chat.MessageReaction", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uuid") - .HasColumnName("id"); - - b.Property("Attitude") - .HasColumnType("integer") - .HasColumnName("attitude"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property("MessageId") - .HasColumnType("uuid") - .HasColumnName("message_id"); - - b.Property("SenderId") - .HasColumnType("uuid") - .HasColumnName("sender_id"); - - b.Property("Symbol") - .IsRequired() - .HasMaxLength(256) - .HasColumnType("character varying(256)") - .HasColumnName("symbol"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.HasKey("Id") - .HasName("pk_chat_reactions"); - - b.HasIndex("MessageId") - .HasDatabaseName("ix_chat_reactions_message_id"); - - b.HasIndex("SenderId") - .HasDatabaseName("ix_chat_reactions_sender_id"); - - b.ToTable("chat_reactions", (string)null); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Chat.MessageStatus", b => - { - b.Property("MessageId") - .HasColumnType("uuid") - .HasColumnName("message_id"); - - b.Property("SenderId") - .HasColumnType("uuid") - .HasColumnName("sender_id"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property("ReadAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("read_at"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.HasKey("MessageId", "SenderId") - .HasName("pk_chat_statuses"); - - b.HasIndex("SenderId") - .HasDatabaseName("ix_chat_statuses_sender_id"); - - b.ToTable("chat_statuses", (string)null); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Chat.RealtimeCall", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uuid") - .HasColumnName("id"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property("EndedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("ended_at"); - - b.Property("RoomId") - .HasColumnType("bigint") - .HasColumnName("room_id"); - - b.Property("SenderId") - .HasColumnType("uuid") - .HasColumnName("sender_id"); - - b.Property("Title") - .HasColumnType("text") - .HasColumnName("title"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.HasKey("Id") - .HasName("pk_chat_realtime_call"); - - b.HasIndex("RoomId") - .HasDatabaseName("ix_chat_realtime_call_room_id"); - - b.HasIndex("SenderId") - .HasDatabaseName("ix_chat_realtime_call_sender_id"); - - b.ToTable("chat_realtime_call", (string)null); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Permission.PermissionGroup", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uuid") - .HasColumnName("id"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property("Key") - .IsRequired() - .HasMaxLength(1024) - .HasColumnType("character varying(1024)") - .HasColumnName("key"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.HasKey("Id") - .HasName("pk_permission_groups"); - - b.ToTable("permission_groups", (string)null); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Permission.PermissionGroupMember", b => - { - b.Property("GroupId") - .HasColumnType("uuid") - .HasColumnName("group_id"); - - b.Property("Actor") - .HasMaxLength(1024) - .HasColumnType("character varying(1024)") - .HasColumnName("actor"); - - b.Property("AffectedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("affected_at"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property("ExpiredAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("expired_at"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.HasKey("GroupId", "Actor") - .HasName("pk_permission_group_members"); - - b.ToTable("permission_group_members", (string)null); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Permission.PermissionNode", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uuid") - .HasColumnName("id"); - - b.Property("Actor") - .IsRequired() - .HasMaxLength(1024) - .HasColumnType("character varying(1024)") - .HasColumnName("actor"); - - b.Property("AffectedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("affected_at"); - - b.Property("Area") - .IsRequired() - .HasMaxLength(1024) - .HasColumnType("character varying(1024)") - .HasColumnName("area"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property("ExpiredAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("expired_at"); - - b.Property("GroupId") - .HasColumnType("uuid") - .HasColumnName("group_id"); - - b.Property("Key") - .IsRequired() - .HasMaxLength(1024) - .HasColumnType("character varying(1024)") - .HasColumnName("key"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.Property("Value") - .IsRequired() - .HasColumnType("jsonb") - .HasColumnName("value"); - - b.HasKey("Id") - .HasName("pk_permission_nodes"); - - b.HasIndex("GroupId") - .HasDatabaseName("ix_permission_nodes_group_id"); - - b.HasIndex("Key", "Area", "Actor") - .HasDatabaseName("ix_permission_nodes_key_area_actor"); - - b.ToTable("permission_nodes", (string)null); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Post.Post", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Content") - .HasColumnType("text") - .HasColumnName("content"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property("Description") - .HasMaxLength(4096) - .HasColumnType("character varying(4096)") - .HasColumnName("description"); - - b.Property("Downvotes") - .HasColumnType("integer") - .HasColumnName("downvotes"); - - b.Property("EditedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("edited_at"); - - b.Property("ForwardedPostId") - .HasColumnType("bigint") - .HasColumnName("forwarded_post_id"); - - b.Property("Language") - .HasMaxLength(128) - .HasColumnType("character varying(128)") - .HasColumnName("language"); - - b.Property>("Meta") - .HasColumnType("jsonb") - .HasColumnName("meta"); - - b.Property("PublishedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("published_at"); - - b.Property("PublisherId") - .HasColumnType("bigint") - .HasColumnName("publisher_id"); - - b.Property("RepliedPostId") - .HasColumnType("bigint") - .HasColumnName("replied_post_id"); - - b.Property("SearchVector") - .IsRequired() - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("tsvector") - .HasColumnName("search_vector") - .HasAnnotation("Npgsql:TsVectorConfig", "simple") - .HasAnnotation("Npgsql:TsVectorProperties", new[] { "Title", "Description", "Content" }); - - b.Property("ThreadedPostId") - .HasColumnType("bigint") - .HasColumnName("threaded_post_id"); - - b.Property("Title") - .HasMaxLength(1024) - .HasColumnType("character varying(1024)") - .HasColumnName("title"); - - b.Property("Type") - .HasColumnType("integer") - .HasColumnName("type"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.Property("Upvotes") - .HasColumnType("integer") - .HasColumnName("upvotes"); - - b.Property("ViewsTotal") - .HasColumnType("integer") - .HasColumnName("views_total"); - - b.Property("ViewsUnique") - .HasColumnType("integer") - .HasColumnName("views_unique"); - - b.Property("Visibility") - .HasColumnType("integer") - .HasColumnName("visibility"); - - b.HasKey("Id") - .HasName("pk_posts"); - - b.HasIndex("ForwardedPostId") - .HasDatabaseName("ix_posts_forwarded_post_id"); - - b.HasIndex("PublisherId") - .HasDatabaseName("ix_posts_publisher_id"); - - b.HasIndex("RepliedPostId") - .HasDatabaseName("ix_posts_replied_post_id"); - - b.HasIndex("SearchVector") - .HasDatabaseName("ix_posts_search_vector"); - - NpgsqlIndexBuilderExtensions.HasMethod(b.HasIndex("SearchVector"), "GIN"); - - b.HasIndex("ThreadedPostId") - .IsUnique() - .HasDatabaseName("ix_posts_threaded_post_id"); - - b.ToTable("posts", (string)null); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Post.PostCategory", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property("Name") - .HasMaxLength(256) - .HasColumnType("character varying(256)") - .HasColumnName("name"); - - b.Property("Slug") - .IsRequired() - .HasMaxLength(128) - .HasColumnType("character varying(128)") - .HasColumnName("slug"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.HasKey("Id") - .HasName("pk_post_categories"); - - b.ToTable("post_categories", (string)null); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Post.PostCollection", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property("Description") - .HasMaxLength(4096) - .HasColumnType("character varying(4096)") - .HasColumnName("description"); - - b.Property("Name") - .HasMaxLength(256) - .HasColumnType("character varying(256)") - .HasColumnName("name"); - - b.Property("PublisherId") - .HasColumnType("bigint") - .HasColumnName("publisher_id"); - - b.Property("Slug") - .IsRequired() - .HasMaxLength(128) - .HasColumnType("character varying(128)") - .HasColumnName("slug"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.HasKey("Id") - .HasName("pk_post_collections"); - - b.HasIndex("PublisherId") - .HasDatabaseName("ix_post_collections_publisher_id"); - - b.ToTable("post_collections", (string)null); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Post.PostReaction", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AccountId") - .HasColumnType("bigint") - .HasColumnName("account_id"); - - b.Property("Attitude") - .HasColumnType("integer") - .HasColumnName("attitude"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property("PostId") - .HasColumnType("bigint") - .HasColumnName("post_id"); - - b.Property("Symbol") - .IsRequired() - .HasMaxLength(256) - .HasColumnType("character varying(256)") - .HasColumnName("symbol"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.HasKey("Id") - .HasName("pk_post_reactions"); - - b.HasIndex("AccountId") - .HasDatabaseName("ix_post_reactions_account_id"); - - b.HasIndex("PostId") - .HasDatabaseName("ix_post_reactions_post_id"); - - b.ToTable("post_reactions", (string)null); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Post.PostTag", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property("Name") - .HasMaxLength(256) - .HasColumnType("character varying(256)") - .HasColumnName("name"); - - b.Property("Slug") - .IsRequired() - .HasMaxLength(128) - .HasColumnType("character varying(128)") - .HasColumnName("slug"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.HasKey("Id") - .HasName("pk_post_tags"); - - b.ToTable("post_tags", (string)null); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Post.Publisher", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AccountId") - .HasColumnType("bigint") - .HasColumnName("account_id"); - - b.Property("BackgroundId") - .HasColumnType("character varying(128)") - .HasColumnName("background_id"); - - b.Property("Bio") - .HasMaxLength(4096) - .HasColumnType("character varying(4096)") - .HasColumnName("bio"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(256) - .HasColumnType("character varying(256)") - .HasColumnName("name"); - - b.Property("Nick") - .IsRequired() - .HasMaxLength(256) - .HasColumnType("character varying(256)") - .HasColumnName("nick"); - - b.Property("PictureId") - .HasColumnType("character varying(128)") - .HasColumnName("picture_id"); - - b.Property("PublisherType") - .HasColumnType("integer") - .HasColumnName("publisher_type"); - - b.Property("RealmId") - .HasColumnType("bigint") - .HasColumnName("realm_id"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.HasKey("Id") - .HasName("pk_publishers"); - - b.HasIndex("AccountId") - .HasDatabaseName("ix_publishers_account_id"); - - b.HasIndex("BackgroundId") - .HasDatabaseName("ix_publishers_background_id"); - - b.HasIndex("Name") - .IsUnique() - .HasDatabaseName("ix_publishers_name"); - - b.HasIndex("PictureId") - .HasDatabaseName("ix_publishers_picture_id"); - - b.HasIndex("RealmId") - .HasDatabaseName("ix_publishers_realm_id"); - - b.ToTable("publishers", (string)null); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Post.PublisherMember", b => - { - b.Property("PublisherId") - .HasColumnType("bigint") - .HasColumnName("publisher_id"); - - b.Property("AccountId") - .HasColumnType("bigint") - .HasColumnName("account_id"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property("JoinedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("joined_at"); - - b.Property("Role") - .HasColumnType("integer") - .HasColumnName("role"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.HasKey("PublisherId", "AccountId") - .HasName("pk_publisher_members"); - - b.HasIndex("AccountId") - .HasDatabaseName("ix_publisher_members_account_id"); - - b.ToTable("publisher_members", (string)null); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Post.PublisherSubscription", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uuid") - .HasColumnName("id"); - - b.Property("AccountId") - .HasColumnType("bigint") - .HasColumnName("account_id"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property("PublisherId") - .HasColumnType("bigint") - .HasColumnName("publisher_id"); - - b.Property("Status") - .HasColumnType("integer") - .HasColumnName("status"); - - b.Property("Tier") - .HasColumnType("integer") - .HasColumnName("tier"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.HasKey("Id") - .HasName("pk_publisher_subscriptions"); - - b.HasIndex("AccountId") - .HasDatabaseName("ix_publisher_subscriptions_account_id"); - - b.HasIndex("PublisherId") - .HasDatabaseName("ix_publisher_subscriptions_publisher_id"); - - b.ToTable("publisher_subscriptions", (string)null); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Realm.Realm", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AccountId") - .HasColumnType("bigint") - .HasColumnName("account_id"); - - b.Property("BackgroundId") - .HasColumnType("character varying(128)") - .HasColumnName("background_id"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property("Description") - .IsRequired() - .HasMaxLength(4096) - .HasColumnType("character varying(4096)") - .HasColumnName("description"); - - b.Property("IsCommunity") - .HasColumnType("boolean") - .HasColumnName("is_community"); - - b.Property("IsPublic") - .HasColumnType("boolean") - .HasColumnName("is_public"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(1024) - .HasColumnType("character varying(1024)") - .HasColumnName("name"); - - b.Property("PictureId") - .HasColumnType("character varying(128)") - .HasColumnName("picture_id"); - - b.Property("Slug") - .IsRequired() - .HasMaxLength(1024) - .HasColumnType("character varying(1024)") - .HasColumnName("slug"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.Property("VerifiedAs") - .HasMaxLength(4096) - .HasColumnType("character varying(4096)") - .HasColumnName("verified_as"); - - b.Property("VerifiedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("verified_at"); - - b.HasKey("Id") - .HasName("pk_realms"); - - b.HasIndex("AccountId") - .HasDatabaseName("ix_realms_account_id"); - - b.HasIndex("BackgroundId") - .HasDatabaseName("ix_realms_background_id"); - - b.HasIndex("PictureId") - .HasDatabaseName("ix_realms_picture_id"); - - b.HasIndex("Slug") - .IsUnique() - .HasDatabaseName("ix_realms_slug"); - - b.ToTable("realms", (string)null); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Realm.RealmMember", b => - { - b.Property("RealmId") - .HasColumnType("bigint") - .HasColumnName("realm_id"); - - b.Property("AccountId") - .HasColumnType("bigint") - .HasColumnName("account_id"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property("JoinedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("joined_at"); - - b.Property("Role") - .HasColumnType("integer") - .HasColumnName("role"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.HasKey("RealmId", "AccountId") - .HasName("pk_realm_members"); - - b.HasIndex("AccountId") - .HasDatabaseName("ix_realm_members_account_id"); - - b.ToTable("realm_members", (string)null); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Sticker.Sticker", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uuid") - .HasColumnName("id"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property("ImageId") - .IsRequired() - .HasColumnType("character varying(128)") - .HasColumnName("image_id"); - - b.Property("PackId") - .HasColumnType("uuid") - .HasColumnName("pack_id"); - - b.Property("Slug") - .IsRequired() - .HasMaxLength(128) - .HasColumnType("character varying(128)") - .HasColumnName("slug"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.HasKey("Id") - .HasName("pk_stickers"); - - b.HasIndex("ImageId") - .HasDatabaseName("ix_stickers_image_id"); - - b.HasIndex("PackId") - .HasDatabaseName("ix_stickers_pack_id"); - - b.ToTable("stickers", (string)null); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Sticker.StickerPack", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uuid") - .HasColumnName("id"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property("Description") - .IsRequired() - .HasMaxLength(4096) - .HasColumnType("character varying(4096)") - .HasColumnName("description"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(1024) - .HasColumnType("character varying(1024)") - .HasColumnName("name"); - - b.Property("Prefix") - .IsRequired() - .HasMaxLength(128) - .HasColumnType("character varying(128)") - .HasColumnName("prefix"); - - b.Property("PublisherId") - .HasColumnType("bigint") - .HasColumnName("publisher_id"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.HasKey("Id") - .HasName("pk_sticker_packs"); - - b.HasIndex("PublisherId") - .HasDatabaseName("ix_sticker_packs_publisher_id"); - - b.ToTable("sticker_packs", (string)null); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Storage.CloudFile", b => - { - b.Property("Id") - .HasMaxLength(128) - .HasColumnType("character varying(128)") - .HasColumnName("id"); - - b.Property("AccountId") - .HasColumnType("bigint") - .HasColumnName("account_id"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("DeletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("deleted_at"); - - b.Property("Description") - .HasMaxLength(4096) - .HasColumnType("character varying(4096)") - .HasColumnName("description"); - - b.Property("ExpiredAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("expired_at"); - - b.Property>("FileMeta") - .HasColumnType("jsonb") - .HasColumnName("file_meta"); - - b.Property("HasCompression") - .HasColumnType("boolean") - .HasColumnName("has_compression"); - - b.Property("Hash") - .HasMaxLength(256) - .HasColumnType("character varying(256)") - .HasColumnName("hash"); - - b.Property("MessageId") - .HasColumnType("uuid") - .HasColumnName("message_id"); - - b.Property("MimeType") - .HasMaxLength(256) - .HasColumnType("character varying(256)") - .HasColumnName("mime_type"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(1024) - .HasColumnType("character varying(1024)") - .HasColumnName("name"); - - b.Property("PostId") - .HasColumnType("bigint") - .HasColumnName("post_id"); - - b.Property("Size") - .HasColumnType("bigint") - .HasColumnName("size"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.Property("UploadedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("uploaded_at"); - - b.Property("UploadedTo") - .HasMaxLength(128) - .HasColumnType("character varying(128)") - .HasColumnName("uploaded_to"); - - b.Property("UsedCount") - .HasColumnType("integer") - .HasColumnName("used_count"); - - b.Property>("UserMeta") - .HasColumnType("jsonb") - .HasColumnName("user_meta"); - - b.HasKey("Id") - .HasName("pk_files"); - - b.HasIndex("AccountId") - .HasDatabaseName("ix_files_account_id"); - - b.HasIndex("MessageId") - .HasDatabaseName("ix_files_message_id"); - - b.HasIndex("PostId") - .HasDatabaseName("ix_files_post_id"); - - b.ToTable("files", (string)null); - }); - - modelBuilder.Entity("PostPostCategory", b => - { - b.Property("CategoriesId") - .HasColumnType("bigint") - .HasColumnName("categories_id"); - - b.Property("PostsId") - .HasColumnType("bigint") - .HasColumnName("posts_id"); - - b.HasKey("CategoriesId", "PostsId") - .HasName("pk_post_category_links"); - - b.HasIndex("PostsId") - .HasDatabaseName("ix_post_category_links_posts_id"); - - b.ToTable("post_category_links", (string)null); - }); - - modelBuilder.Entity("PostPostCollection", b => - { - b.Property("CollectionsId") - .HasColumnType("bigint") - .HasColumnName("collections_id"); - - b.Property("PostsId") - .HasColumnType("bigint") - .HasColumnName("posts_id"); - - b.HasKey("CollectionsId", "PostsId") - .HasName("pk_post_collection_links"); - - b.HasIndex("PostsId") - .HasDatabaseName("ix_post_collection_links_posts_id"); - - b.ToTable("post_collection_links", (string)null); - }); - - modelBuilder.Entity("PostPostTag", b => - { - b.Property("PostsId") - .HasColumnType("bigint") - .HasColumnName("posts_id"); - - b.Property("TagsId") - .HasColumnType("bigint") - .HasColumnName("tags_id"); - - b.HasKey("PostsId", "TagsId") - .HasName("pk_post_tag_links"); - - b.HasIndex("TagsId") - .HasDatabaseName("ix_post_tag_links_tags_id"); - - b.ToTable("post_tag_links", (string)null); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Account.AccountAuthFactor", b => - { - b.HasOne("DysonNetwork.Sphere.Account.Account", "Account") - .WithMany("AuthFactors") - .HasForeignKey("AccountId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_account_auth_factors_accounts_account_id"); - - b.Navigation("Account"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Account.AccountContact", b => - { - b.HasOne("DysonNetwork.Sphere.Account.Account", "Account") - .WithMany("Contacts") - .HasForeignKey("AccountId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_account_contacts_accounts_account_id"); - - b.Navigation("Account"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Account.CheckInResult", b => - { - b.HasOne("DysonNetwork.Sphere.Account.Account", "Account") - .WithMany() - .HasForeignKey("AccountId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_account_check_in_results_accounts_account_id"); - - b.Navigation("Account"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Account.MagicSpell", b => - { - b.HasOne("DysonNetwork.Sphere.Account.Account", "Account") - .WithMany() - .HasForeignKey("AccountId") - .HasConstraintName("fk_magic_spells_accounts_account_id"); - - b.Navigation("Account"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Account.Notification", b => - { - b.HasOne("DysonNetwork.Sphere.Account.Account", "Account") - .WithMany() - .HasForeignKey("AccountId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_notifications_accounts_account_id"); - - b.Navigation("Account"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Account.NotificationPushSubscription", b => - { - b.HasOne("DysonNetwork.Sphere.Account.Account", "Account") - .WithMany() - .HasForeignKey("AccountId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_notification_push_subscriptions_accounts_account_id"); - - b.Navigation("Account"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Account.Profile", b => - { - b.HasOne("DysonNetwork.Sphere.Storage.CloudFile", "Background") - .WithMany() - .HasForeignKey("BackgroundId") - .HasConstraintName("fk_account_profiles_files_background_id"); - - b.HasOne("DysonNetwork.Sphere.Account.Account", "Account") - .WithOne("Profile") - .HasForeignKey("DysonNetwork.Sphere.Account.Profile", "Id") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_account_profiles_accounts_id"); - - b.HasOne("DysonNetwork.Sphere.Storage.CloudFile", "Picture") - .WithMany() - .HasForeignKey("PictureId") - .HasConstraintName("fk_account_profiles_files_picture_id"); - - b.Navigation("Account"); - - b.Navigation("Background"); - - b.Navigation("Picture"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Account.Relationship", b => - { - b.HasOne("DysonNetwork.Sphere.Account.Account", "Account") - .WithMany("OutgoingRelationships") - .HasForeignKey("AccountId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_account_relationships_accounts_account_id"); - - b.HasOne("DysonNetwork.Sphere.Account.Account", "Related") - .WithMany("IncomingRelationships") - .HasForeignKey("RelatedId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_account_relationships_accounts_related_id"); - - b.Navigation("Account"); - - b.Navigation("Related"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Account.Status", b => - { - b.HasOne("DysonNetwork.Sphere.Account.Account", "Account") - .WithMany() - .HasForeignKey("AccountId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_account_statuses_accounts_account_id"); - - b.Navigation("Account"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Activity.Activity", b => - { - b.HasOne("DysonNetwork.Sphere.Account.Account", "Account") - .WithMany() - .HasForeignKey("AccountId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_activities_accounts_account_id"); - - b.Navigation("Account"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Auth.Challenge", b => - { - b.HasOne("DysonNetwork.Sphere.Account.Account", "Account") - .WithMany("Challenges") - .HasForeignKey("AccountId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_auth_challenges_accounts_account_id"); - - b.Navigation("Account"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Auth.Session", b => - { - b.HasOne("DysonNetwork.Sphere.Account.Account", "Account") - .WithMany("Sessions") - .HasForeignKey("AccountId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_auth_sessions_accounts_account_id"); - - b.HasOne("DysonNetwork.Sphere.Auth.Challenge", "Challenge") - .WithMany() - .HasForeignKey("ChallengeId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_auth_sessions_auth_challenges_challenge_id"); - - b.Navigation("Account"); - - b.Navigation("Challenge"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Chat.ChatMember", b => - { - b.HasOne("DysonNetwork.Sphere.Account.Account", "Account") - .WithMany() - .HasForeignKey("AccountId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_chat_members_accounts_account_id"); - - b.HasOne("DysonNetwork.Sphere.Chat.ChatRoom", "ChatRoom") - .WithMany("Members") - .HasForeignKey("ChatRoomId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_chat_members_chat_rooms_chat_room_id"); - - b.Navigation("Account"); - - b.Navigation("ChatRoom"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Chat.ChatRoom", b => - { - b.HasOne("DysonNetwork.Sphere.Storage.CloudFile", "Background") - .WithMany() - .HasForeignKey("BackgroundId") - .HasConstraintName("fk_chat_rooms_files_background_id"); - - b.HasOne("DysonNetwork.Sphere.Storage.CloudFile", "Picture") - .WithMany() - .HasForeignKey("PictureId") - .HasConstraintName("fk_chat_rooms_files_picture_id"); - - b.HasOne("DysonNetwork.Sphere.Realm.Realm", "Realm") - .WithMany("ChatRooms") - .HasForeignKey("RealmId") - .HasConstraintName("fk_chat_rooms_realms_realm_id"); - - b.Navigation("Background"); - - b.Navigation("Picture"); - - b.Navigation("Realm"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Chat.Message", b => - { - b.HasOne("DysonNetwork.Sphere.Chat.ChatRoom", "ChatRoom") - .WithMany() - .HasForeignKey("ChatRoomId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_chat_messages_chat_rooms_chat_room_id"); - - b.HasOne("DysonNetwork.Sphere.Chat.Message", "ForwardedMessage") - .WithMany() - .HasForeignKey("ForwardedMessageId") - .OnDelete(DeleteBehavior.Restrict) - .HasConstraintName("fk_chat_messages_chat_messages_forwarded_message_id"); - - b.HasOne("DysonNetwork.Sphere.Chat.Message", "RepliedMessage") - .WithMany() - .HasForeignKey("RepliedMessageId") - .OnDelete(DeleteBehavior.Restrict) - .HasConstraintName("fk_chat_messages_chat_messages_replied_message_id"); - - b.HasOne("DysonNetwork.Sphere.Chat.ChatMember", "Sender") - .WithMany() - .HasForeignKey("SenderId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_chat_messages_chat_members_sender_id"); - - b.Navigation("ChatRoom"); - - b.Navigation("ForwardedMessage"); - - b.Navigation("RepliedMessage"); - - b.Navigation("Sender"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Chat.MessageReaction", b => - { - b.HasOne("DysonNetwork.Sphere.Chat.Message", "Message") - .WithMany("Reactions") - .HasForeignKey("MessageId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_chat_reactions_chat_messages_message_id"); - - b.HasOne("DysonNetwork.Sphere.Chat.ChatMember", "Sender") - .WithMany() - .HasForeignKey("SenderId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_chat_reactions_chat_members_sender_id"); - - b.Navigation("Message"); - - b.Navigation("Sender"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Chat.MessageStatus", b => - { - b.HasOne("DysonNetwork.Sphere.Chat.Message", "Message") - .WithMany("Statuses") - .HasForeignKey("MessageId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_chat_statuses_chat_messages_message_id"); - - b.HasOne("DysonNetwork.Sphere.Chat.ChatMember", "Sender") - .WithMany() - .HasForeignKey("SenderId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_chat_statuses_chat_members_sender_id"); - - b.Navigation("Message"); - - b.Navigation("Sender"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Chat.RealtimeCall", b => - { - b.HasOne("DysonNetwork.Sphere.Chat.ChatRoom", "Room") - .WithMany() - .HasForeignKey("RoomId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_chat_realtime_call_chat_rooms_room_id"); - - b.HasOne("DysonNetwork.Sphere.Chat.ChatMember", "Sender") - .WithMany() - .HasForeignKey("SenderId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_chat_realtime_call_chat_members_sender_id"); - - b.Navigation("Room"); - - b.Navigation("Sender"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Permission.PermissionGroupMember", b => - { - b.HasOne("DysonNetwork.Sphere.Permission.PermissionGroup", "Group") - .WithMany("Members") - .HasForeignKey("GroupId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_permission_group_members_permission_groups_group_id"); - - b.Navigation("Group"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Permission.PermissionNode", b => - { - b.HasOne("DysonNetwork.Sphere.Permission.PermissionGroup", "Group") - .WithMany("Nodes") - .HasForeignKey("GroupId") - .HasConstraintName("fk_permission_nodes_permission_groups_group_id"); - - b.Navigation("Group"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Post.Post", b => - { - b.HasOne("DysonNetwork.Sphere.Post.Post", "ForwardedPost") - .WithMany() - .HasForeignKey("ForwardedPostId") - .OnDelete(DeleteBehavior.Restrict) - .HasConstraintName("fk_posts_posts_forwarded_post_id"); - - b.HasOne("DysonNetwork.Sphere.Post.Publisher", "Publisher") - .WithMany("Posts") - .HasForeignKey("PublisherId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_posts_publishers_publisher_id"); - - b.HasOne("DysonNetwork.Sphere.Post.Post", "RepliedPost") - .WithMany() - .HasForeignKey("RepliedPostId") - .OnDelete(DeleteBehavior.Restrict) - .HasConstraintName("fk_posts_posts_replied_post_id"); - - b.HasOne("DysonNetwork.Sphere.Post.Post", "ThreadedPost") - .WithOne() - .HasForeignKey("DysonNetwork.Sphere.Post.Post", "ThreadedPostId") - .HasConstraintName("fk_posts_posts_threaded_post_id"); - - b.Navigation("ForwardedPost"); - - b.Navigation("Publisher"); - - b.Navigation("RepliedPost"); - - b.Navigation("ThreadedPost"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Post.PostCollection", b => - { - b.HasOne("DysonNetwork.Sphere.Post.Publisher", "Publisher") - .WithMany("Collections") - .HasForeignKey("PublisherId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_post_collections_publishers_publisher_id"); - - b.Navigation("Publisher"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Post.PostReaction", b => - { - b.HasOne("DysonNetwork.Sphere.Account.Account", "Account") - .WithMany() - .HasForeignKey("AccountId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_post_reactions_accounts_account_id"); - - b.HasOne("DysonNetwork.Sphere.Post.Post", "Post") - .WithMany("Reactions") - .HasForeignKey("PostId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_post_reactions_posts_post_id"); - - b.Navigation("Account"); - - b.Navigation("Post"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Post.Publisher", b => - { - b.HasOne("DysonNetwork.Sphere.Account.Account", "Account") - .WithMany() - .HasForeignKey("AccountId") - .HasConstraintName("fk_publishers_accounts_account_id"); - - b.HasOne("DysonNetwork.Sphere.Storage.CloudFile", "Background") - .WithMany() - .HasForeignKey("BackgroundId") - .HasConstraintName("fk_publishers_files_background_id"); - - b.HasOne("DysonNetwork.Sphere.Storage.CloudFile", "Picture") - .WithMany() - .HasForeignKey("PictureId") - .HasConstraintName("fk_publishers_files_picture_id"); - - b.HasOne("DysonNetwork.Sphere.Realm.Realm", "Realm") - .WithMany() - .HasForeignKey("RealmId") - .HasConstraintName("fk_publishers_realms_realm_id"); - - b.Navigation("Account"); - - b.Navigation("Background"); - - b.Navigation("Picture"); - - b.Navigation("Realm"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Post.PublisherMember", b => - { - b.HasOne("DysonNetwork.Sphere.Account.Account", "Account") - .WithMany() - .HasForeignKey("AccountId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_publisher_members_accounts_account_id"); - - b.HasOne("DysonNetwork.Sphere.Post.Publisher", "Publisher") - .WithMany("Members") - .HasForeignKey("PublisherId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_publisher_members_publishers_publisher_id"); - - b.Navigation("Account"); - - b.Navigation("Publisher"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Post.PublisherSubscription", b => - { - b.HasOne("DysonNetwork.Sphere.Account.Account", "Account") - .WithMany() - .HasForeignKey("AccountId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_publisher_subscriptions_accounts_account_id"); - - b.HasOne("DysonNetwork.Sphere.Post.Publisher", "Publisher") - .WithMany("Subscriptions") - .HasForeignKey("PublisherId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_publisher_subscriptions_publishers_publisher_id"); - - b.Navigation("Account"); - - b.Navigation("Publisher"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Realm.Realm", b => - { - b.HasOne("DysonNetwork.Sphere.Account.Account", "Account") - .WithMany() - .HasForeignKey("AccountId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_realms_accounts_account_id"); - - b.HasOne("DysonNetwork.Sphere.Storage.CloudFile", "Background") - .WithMany() - .HasForeignKey("BackgroundId") - .HasConstraintName("fk_realms_files_background_id"); - - b.HasOne("DysonNetwork.Sphere.Storage.CloudFile", "Picture") - .WithMany() - .HasForeignKey("PictureId") - .HasConstraintName("fk_realms_files_picture_id"); - - b.Navigation("Account"); - - b.Navigation("Background"); - - b.Navigation("Picture"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Realm.RealmMember", b => - { - b.HasOne("DysonNetwork.Sphere.Account.Account", "Account") - .WithMany() - .HasForeignKey("AccountId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_realm_members_accounts_account_id"); - - b.HasOne("DysonNetwork.Sphere.Realm.Realm", "Realm") - .WithMany("Members") - .HasForeignKey("RealmId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_realm_members_realms_realm_id"); - - b.Navigation("Account"); - - b.Navigation("Realm"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Sticker.Sticker", b => - { - b.HasOne("DysonNetwork.Sphere.Storage.CloudFile", "Image") - .WithMany() - .HasForeignKey("ImageId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_stickers_files_image_id"); - - b.HasOne("DysonNetwork.Sphere.Sticker.StickerPack", "Pack") - .WithMany() - .HasForeignKey("PackId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_stickers_sticker_packs_pack_id"); - - b.Navigation("Image"); - - b.Navigation("Pack"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Sticker.StickerPack", b => - { - b.HasOne("DysonNetwork.Sphere.Post.Publisher", "Publisher") - .WithMany() - .HasForeignKey("PublisherId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_sticker_packs_publishers_publisher_id"); - - b.Navigation("Publisher"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Storage.CloudFile", b => - { - b.HasOne("DysonNetwork.Sphere.Account.Account", "Account") - .WithMany() - .HasForeignKey("AccountId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_files_accounts_account_id"); - - b.HasOne("DysonNetwork.Sphere.Chat.Message", null) - .WithMany("Attachments") - .HasForeignKey("MessageId") - .HasConstraintName("fk_files_chat_messages_message_id"); - - b.HasOne("DysonNetwork.Sphere.Post.Post", null) - .WithMany("Attachments") - .HasForeignKey("PostId") - .HasConstraintName("fk_files_posts_post_id"); - - b.Navigation("Account"); - }); - - modelBuilder.Entity("PostPostCategory", b => - { - b.HasOne("DysonNetwork.Sphere.Post.PostCategory", null) - .WithMany() - .HasForeignKey("CategoriesId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_post_category_links_post_categories_categories_id"); - - b.HasOne("DysonNetwork.Sphere.Post.Post", null) - .WithMany() - .HasForeignKey("PostsId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_post_category_links_posts_posts_id"); - }); - - modelBuilder.Entity("PostPostCollection", b => - { - b.HasOne("DysonNetwork.Sphere.Post.PostCollection", null) - .WithMany() - .HasForeignKey("CollectionsId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_post_collection_links_post_collections_collections_id"); - - b.HasOne("DysonNetwork.Sphere.Post.Post", null) - .WithMany() - .HasForeignKey("PostsId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_post_collection_links_posts_posts_id"); - }); - - modelBuilder.Entity("PostPostTag", b => - { - b.HasOne("DysonNetwork.Sphere.Post.Post", null) - .WithMany() - .HasForeignKey("PostsId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_post_tag_links_posts_posts_id"); - - b.HasOne("DysonNetwork.Sphere.Post.PostTag", null) - .WithMany() - .HasForeignKey("TagsId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_post_tag_links_post_tags_tags_id"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Account.Account", b => - { - b.Navigation("AuthFactors"); - - b.Navigation("Challenges"); - - b.Navigation("Contacts"); - - b.Navigation("IncomingRelationships"); - - b.Navigation("OutgoingRelationships"); - - b.Navigation("Profile") - .IsRequired(); - - b.Navigation("Sessions"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Chat.ChatRoom", b => - { - b.Navigation("Members"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Chat.Message", b => - { - b.Navigation("Attachments"); - - b.Navigation("Reactions"); - - b.Navigation("Statuses"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Permission.PermissionGroup", b => - { - b.Navigation("Members"); - - b.Navigation("Nodes"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Post.Post", b => - { - b.Navigation("Attachments"); - - b.Navigation("Reactions"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Post.Publisher", b => - { - b.Navigation("Collections"); - - b.Navigation("Members"); - - b.Navigation("Posts"); - - b.Navigation("Subscriptions"); - }); - - modelBuilder.Entity("DysonNetwork.Sphere.Realm.Realm", b => - { - b.Navigation("ChatRooms"); - - b.Navigation("Members"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/DysonNetwork.Sphere/Migrations/20250512133934_PublisherWithOrganization.cs b/DysonNetwork.Sphere/Migrations/20250512133934_PublisherWithOrganization.cs deleted file mode 100644 index 53166f6..0000000 --- a/DysonNetwork.Sphere/Migrations/20250512133934_PublisherWithOrganization.cs +++ /dev/null @@ -1,48 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace DysonNetwork.Sphere.Migrations -{ - /// - public partial class PublisherWithOrganization : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.AddColumn( - 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"); - } - - /// - 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"); - } - } -} diff --git a/DysonNetwork.Sphere/Migrations/20250512160008_AddAccountBadges.cs b/DysonNetwork.Sphere/Migrations/20250512160008_AddAccountBadges.cs deleted file mode 100644 index c5c9a6e..0000000 --- a/DysonNetwork.Sphere/Migrations/20250512160008_AddAccountBadges.cs +++ /dev/null @@ -1,55 +0,0 @@ -using System; -using System.Collections.Generic; -using Microsoft.EntityFrameworkCore.Migrations; -using NodaTime; - -#nullable disable - -namespace DysonNetwork.Sphere.Migrations -{ - /// - public partial class AddAccountBadges : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.CreateTable( - name: "badges", - columns: table => new - { - id = table.Column(type: "uuid", nullable: false), - type = table.Column(type: "character varying(1024)", maxLength: 1024, nullable: false), - label = table.Column(type: "character varying(1024)", maxLength: 1024, nullable: true), - caption = table.Column(type: "character varying(4096)", maxLength: 4096, nullable: true), - meta = table.Column>(type: "jsonb", nullable: false), - expired_at = table.Column(type: "timestamp with time zone", nullable: true), - account_id = table.Column(type: "bigint", nullable: false), - created_at = table.Column(type: "timestamp with time zone", nullable: false), - updated_at = table.Column(type: "timestamp with time zone", nullable: false), - deleted_at = table.Column(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"); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropTable( - name: "badges"); - } - } -} diff --git a/DysonNetwork.Sphere/Migrations/20250512160008_AddAccountBadges.Designer.cs b/DysonNetwork.Sphere/Migrations/20250514115228_InitialMigration.Designer.cs similarity index 94% rename from DysonNetwork.Sphere/Migrations/20250512160008_AddAccountBadges.Designer.cs rename to DysonNetwork.Sphere/Migrations/20250514115228_InitialMigration.Designer.cs index c12f21f..cce0a5d 100644 --- a/DysonNetwork.Sphere/Migrations/20250512160008_AddAccountBadges.Designer.cs +++ b/DysonNetwork.Sphere/Migrations/20250514115228_InitialMigration.Designer.cs @@ -17,8 +17,8 @@ using NpgsqlTypes; namespace DysonNetwork.Sphere.Migrations { [DbContext(typeof(AppDatabase))] - [Migration("20250512160008_AddAccountBadges")] - partial class AddAccountBadges + [Migration("20250514115228_InitialMigration")] + partial class InitialMigration { /// protected override void BuildTargetModel(ModelBuilder modelBuilder) @@ -32,13 +32,11 @@ namespace DysonNetwork.Sphere.Migrations modelBuilder.Entity("DysonNetwork.Sphere.Account.Account", b => { - b.Property("Id") + b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("bigint") + .HasColumnType("uuid") .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - b.Property("ActivatedAt") .HasColumnType("timestamp with time zone") .HasColumnName("activated_at"); @@ -89,15 +87,13 @@ namespace DysonNetwork.Sphere.Migrations modelBuilder.Entity("DysonNetwork.Sphere.Account.AccountAuthFactor", b => { - b.Property("Id") + b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("bigint") + .HasColumnType("uuid") .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AccountId") - .HasColumnType("bigint") + b.Property("AccountId") + .HasColumnType("uuid") .HasColumnName("account_id"); b.Property("CreatedAt") @@ -109,7 +105,8 @@ namespace DysonNetwork.Sphere.Migrations .HasColumnName("deleted_at"); b.Property("Secret") - .HasColumnType("text") + .HasMaxLength(8196) + .HasColumnType("character varying(8196)") .HasColumnName("secret"); b.Property("Type") @@ -131,15 +128,13 @@ namespace DysonNetwork.Sphere.Migrations modelBuilder.Entity("DysonNetwork.Sphere.Account.AccountContact", b => { - b.Property("Id") + b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("bigint") + .HasColumnType("uuid") .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AccountId") - .HasColumnType("bigint") + b.Property("AccountId") + .HasColumnType("uuid") .HasColumnName("account_id"); b.Property("Content") @@ -184,8 +179,8 @@ namespace DysonNetwork.Sphere.Migrations .HasColumnType("uuid") .HasColumnName("id"); - b.Property("AccountId") - .HasColumnType("bigint") + b.Property("AccountId") + .HasColumnType("uuid") .HasColumnName("account_id"); b.Property("Caption") @@ -241,8 +236,8 @@ namespace DysonNetwork.Sphere.Migrations .HasColumnType("uuid") .HasColumnName("id"); - b.Property("AccountId") - .HasColumnType("bigint") + b.Property("AccountId") + .HasColumnType("uuid") .HasColumnName("account_id"); b.Property("CreatedAt") @@ -282,8 +277,8 @@ namespace DysonNetwork.Sphere.Migrations .HasColumnType("uuid") .HasColumnName("id"); - b.Property("AccountId") - .HasColumnType("bigint") + b.Property("AccountId") + .HasColumnType("uuid") .HasColumnName("account_id"); b.Property("AffectedAt") @@ -341,8 +336,8 @@ namespace DysonNetwork.Sphere.Migrations .HasColumnType("uuid") .HasColumnName("id"); - b.Property("AccountId") - .HasColumnType("bigint") + b.Property("AccountId") + .HasColumnType("uuid") .HasColumnName("account_id"); b.Property("Content") @@ -406,8 +401,8 @@ namespace DysonNetwork.Sphere.Migrations .HasColumnType("uuid") .HasColumnName("id"); - b.Property("AccountId") - .HasColumnType("bigint") + b.Property("AccountId") + .HasColumnType("uuid") .HasColumnName("account_id"); b.Property("CreatedAt") @@ -461,8 +456,8 @@ namespace DysonNetwork.Sphere.Migrations modelBuilder.Entity("DysonNetwork.Sphere.Account.Profile", b => { - b.Property("Id") - .HasColumnType("bigint") + b.Property("Id") + .HasColumnType("uuid") .HasColumnName("id"); b.Property("BackgroundId") @@ -519,12 +514,12 @@ namespace DysonNetwork.Sphere.Migrations modelBuilder.Entity("DysonNetwork.Sphere.Account.Relationship", b => { - b.Property("AccountId") - .HasColumnType("bigint") + b.Property("AccountId") + .HasColumnType("uuid") .HasColumnName("account_id"); - b.Property("RelatedId") - .HasColumnType("bigint") + b.Property("RelatedId") + .HasColumnType("uuid") .HasColumnName("related_id"); b.Property("CreatedAt") @@ -563,8 +558,8 @@ namespace DysonNetwork.Sphere.Migrations .HasColumnType("uuid") .HasColumnName("id"); - b.Property("AccountId") - .HasColumnType("bigint") + b.Property("AccountId") + .HasColumnType("uuid") .HasColumnName("account_id"); b.Property("Attitude") @@ -616,8 +611,8 @@ namespace DysonNetwork.Sphere.Migrations .HasColumnType("uuid") .HasColumnName("id"); - b.Property("AccountId") - .HasColumnType("bigint") + b.Property("AccountId") + .HasColumnType("uuid") .HasColumnName("account_id"); b.Property("CreatedAt") @@ -649,7 +644,7 @@ namespace DysonNetwork.Sphere.Migrations .HasColumnType("timestamp with time zone") .HasColumnName("updated_at"); - b.Property>("UsersVisible") + b.Property>("UsersVisible") .IsRequired() .HasColumnType("jsonb") .HasColumnName("users_visible"); @@ -674,8 +669,8 @@ namespace DysonNetwork.Sphere.Migrations .HasColumnType("uuid") .HasColumnName("id"); - b.Property("AccountId") - .HasColumnType("bigint") + b.Property("AccountId") + .HasColumnType("uuid") .HasColumnName("account_id"); b.Property>("Audiences") @@ -683,7 +678,7 @@ namespace DysonNetwork.Sphere.Migrations .HasColumnType("jsonb") .HasColumnName("audiences"); - b.Property>("BlacklistFactors") + b.Property>("BlacklistFactors") .IsRequired() .HasColumnType("jsonb") .HasColumnName("blacklist_factors"); @@ -765,8 +760,8 @@ namespace DysonNetwork.Sphere.Migrations .HasColumnType("uuid") .HasColumnName("id"); - b.Property("AccountId") - .HasColumnType("bigint") + b.Property("AccountId") + .HasColumnType("uuid") .HasColumnName("account_id"); b.Property("ChallengeId") @@ -817,12 +812,12 @@ namespace DysonNetwork.Sphere.Migrations .HasColumnType("uuid") .HasColumnName("id"); - b.Property("AccountId") - .HasColumnType("bigint") + b.Property("AccountId") + .HasColumnType("uuid") .HasColumnName("account_id"); - b.Property("ChatRoomId") - .HasColumnType("bigint") + b.Property("ChatRoomId") + .HasColumnType("uuid") .HasColumnName("chat_room_id"); b.Property("CreatedAt") @@ -872,13 +867,11 @@ namespace DysonNetwork.Sphere.Migrations modelBuilder.Entity("DysonNetwork.Sphere.Chat.ChatRoom", b => { - b.Property("Id") + b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("bigint") + .HasColumnType("uuid") .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - b.Property("BackgroundId") .HasColumnType("character varying(128)") .HasColumnName("background_id"); @@ -911,8 +904,8 @@ namespace DysonNetwork.Sphere.Migrations .HasColumnType("character varying(128)") .HasColumnName("picture_id"); - b.Property("RealmId") - .HasColumnType("bigint") + b.Property("RealmId") + .HasColumnType("uuid") .HasColumnName("realm_id"); b.Property("Type") @@ -945,8 +938,8 @@ namespace DysonNetwork.Sphere.Migrations .HasColumnType("uuid") .HasColumnName("id"); - b.Property("ChatRoomId") - .HasColumnType("bigint") + b.Property("ChatRoomId") + .HasColumnType("uuid") .HasColumnName("chat_room_id"); b.Property("Content") @@ -1122,8 +1115,8 @@ namespace DysonNetwork.Sphere.Migrations .HasColumnType("timestamp with time zone") .HasColumnName("ended_at"); - b.Property("RoomId") - .HasColumnType("bigint") + b.Property("RoomId") + .HasColumnType("uuid") .HasColumnName("room_id"); b.Property("SenderId") @@ -1286,13 +1279,11 @@ namespace DysonNetwork.Sphere.Migrations modelBuilder.Entity("DysonNetwork.Sphere.Post.Post", b => { - b.Property("Id") + b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("bigint") + .HasColumnType("uuid") .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - b.Property("Content") .HasColumnType("text") .HasColumnName("content"); @@ -1318,8 +1309,8 @@ namespace DysonNetwork.Sphere.Migrations .HasColumnType("timestamp with time zone") .HasColumnName("edited_at"); - b.Property("ForwardedPostId") - .HasColumnType("bigint") + b.Property("ForwardedPostId") + .HasColumnType("uuid") .HasColumnName("forwarded_post_id"); b.Property("Language") @@ -1335,12 +1326,12 @@ namespace DysonNetwork.Sphere.Migrations .HasColumnType("timestamp with time zone") .HasColumnName("published_at"); - b.Property("PublisherId") - .HasColumnType("bigint") + b.Property("PublisherId") + .HasColumnType("uuid") .HasColumnName("publisher_id"); - b.Property("RepliedPostId") - .HasColumnType("bigint") + b.Property("RepliedPostId") + .HasColumnType("uuid") .HasColumnName("replied_post_id"); b.Property("SearchVector") @@ -1351,8 +1342,8 @@ namespace DysonNetwork.Sphere.Migrations .HasAnnotation("Npgsql:TsVectorConfig", "simple") .HasAnnotation("Npgsql:TsVectorProperties", new[] { "Title", "Description", "Content" }); - b.Property("ThreadedPostId") - .HasColumnType("bigint") + b.Property("ThreadedPostId") + .HasColumnType("uuid") .HasColumnName("threaded_post_id"); b.Property("Title") @@ -1410,13 +1401,11 @@ namespace DysonNetwork.Sphere.Migrations modelBuilder.Entity("DysonNetwork.Sphere.Post.PostCategory", b => { - b.Property("Id") + b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("bigint") + .HasColumnType("uuid") .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - b.Property("CreatedAt") .HasColumnType("timestamp with time zone") .HasColumnName("created_at"); @@ -1448,13 +1437,11 @@ namespace DysonNetwork.Sphere.Migrations modelBuilder.Entity("DysonNetwork.Sphere.Post.PostCollection", b => { - b.Property("Id") + b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("bigint") + .HasColumnType("uuid") .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - b.Property("CreatedAt") .HasColumnType("timestamp with time zone") .HasColumnName("created_at"); @@ -1473,8 +1460,8 @@ namespace DysonNetwork.Sphere.Migrations .HasColumnType("character varying(256)") .HasColumnName("name"); - b.Property("PublisherId") - .HasColumnType("bigint") + b.Property("PublisherId") + .HasColumnType("uuid") .HasColumnName("publisher_id"); b.Property("Slug") @@ -1498,15 +1485,13 @@ namespace DysonNetwork.Sphere.Migrations modelBuilder.Entity("DysonNetwork.Sphere.Post.PostReaction", b => { - b.Property("Id") + b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("bigint") + .HasColumnType("uuid") .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AccountId") - .HasColumnType("bigint") + b.Property("AccountId") + .HasColumnType("uuid") .HasColumnName("account_id"); b.Property("Attitude") @@ -1521,8 +1506,8 @@ namespace DysonNetwork.Sphere.Migrations .HasColumnType("timestamp with time zone") .HasColumnName("deleted_at"); - b.Property("PostId") - .HasColumnType("bigint") + b.Property("PostId") + .HasColumnType("uuid") .HasColumnName("post_id"); b.Property("Symbol") @@ -1549,13 +1534,11 @@ namespace DysonNetwork.Sphere.Migrations modelBuilder.Entity("DysonNetwork.Sphere.Post.PostTag", b => { - b.Property("Id") + b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("bigint") + .HasColumnType("uuid") .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - b.Property("CreatedAt") .HasColumnType("timestamp with time zone") .HasColumnName("created_at"); @@ -1587,15 +1570,13 @@ namespace DysonNetwork.Sphere.Migrations modelBuilder.Entity("DysonNetwork.Sphere.Post.Publisher", b => { - b.Property("Id") + b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("bigint") + .HasColumnType("uuid") .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AccountId") - .HasColumnType("bigint") + b.Property("AccountId") + .HasColumnType("uuid") .HasColumnName("account_id"); b.Property("BackgroundId") @@ -1635,8 +1616,8 @@ namespace DysonNetwork.Sphere.Migrations .HasColumnType("integer") .HasColumnName("publisher_type"); - b.Property("RealmId") - .HasColumnType("bigint") + b.Property("RealmId") + .HasColumnType("uuid") .HasColumnName("realm_id"); b.Property("UpdatedAt") @@ -1667,12 +1648,12 @@ namespace DysonNetwork.Sphere.Migrations modelBuilder.Entity("DysonNetwork.Sphere.Post.PublisherMember", b => { - b.Property("PublisherId") - .HasColumnType("bigint") + b.Property("PublisherId") + .HasColumnType("uuid") .HasColumnName("publisher_id"); - b.Property("AccountId") - .HasColumnType("bigint") + b.Property("AccountId") + .HasColumnType("uuid") .HasColumnName("account_id"); b.Property("CreatedAt") @@ -1711,8 +1692,8 @@ namespace DysonNetwork.Sphere.Migrations .HasColumnType("uuid") .HasColumnName("id"); - b.Property("AccountId") - .HasColumnType("bigint") + b.Property("AccountId") + .HasColumnType("uuid") .HasColumnName("account_id"); b.Property("CreatedAt") @@ -1723,8 +1704,8 @@ namespace DysonNetwork.Sphere.Migrations .HasColumnType("timestamp with time zone") .HasColumnName("deleted_at"); - b.Property("PublisherId") - .HasColumnType("bigint") + b.Property("PublisherId") + .HasColumnType("uuid") .HasColumnName("publisher_id"); b.Property("Status") @@ -1753,15 +1734,13 @@ namespace DysonNetwork.Sphere.Migrations modelBuilder.Entity("DysonNetwork.Sphere.Realm.Realm", b => { - b.Property("Id") + b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("bigint") + .HasColumnType("uuid") .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AccountId") - .HasColumnType("bigint") + b.Property("AccountId") + .HasColumnType("uuid") .HasColumnName("account_id"); b.Property("BackgroundId") @@ -1840,12 +1819,12 @@ namespace DysonNetwork.Sphere.Migrations modelBuilder.Entity("DysonNetwork.Sphere.Realm.RealmMember", b => { - b.Property("RealmId") - .HasColumnType("bigint") + b.Property("RealmId") + .HasColumnType("uuid") .HasColumnName("realm_id"); - b.Property("AccountId") - .HasColumnType("bigint") + b.Property("AccountId") + .HasColumnType("uuid") .HasColumnName("account_id"); b.Property("CreatedAt") @@ -1956,8 +1935,8 @@ namespace DysonNetwork.Sphere.Migrations .HasColumnType("character varying(128)") .HasColumnName("prefix"); - b.Property("PublisherId") - .HasColumnType("bigint") + b.Property("PublisherId") + .HasColumnType("uuid") .HasColumnName("publisher_id"); b.Property("UpdatedAt") @@ -1980,8 +1959,8 @@ namespace DysonNetwork.Sphere.Migrations .HasColumnType("character varying(128)") .HasColumnName("id"); - b.Property("AccountId") - .HasColumnType("bigint") + b.Property("AccountId") + .HasColumnType("uuid") .HasColumnName("account_id"); b.Property("CreatedAt") @@ -2029,8 +2008,8 @@ namespace DysonNetwork.Sphere.Migrations .HasColumnType("character varying(1024)") .HasColumnName("name"); - b.Property("PostId") - .HasColumnType("bigint") + b.Property("PostId") + .HasColumnType("uuid") .HasColumnName("post_id"); b.Property("Size") @@ -2075,12 +2054,12 @@ namespace DysonNetwork.Sphere.Migrations modelBuilder.Entity("PostPostCategory", b => { - b.Property("CategoriesId") - .HasColumnType("bigint") + b.Property("CategoriesId") + .HasColumnType("uuid") .HasColumnName("categories_id"); - b.Property("PostsId") - .HasColumnType("bigint") + b.Property("PostsId") + .HasColumnType("uuid") .HasColumnName("posts_id"); b.HasKey("CategoriesId", "PostsId") @@ -2094,12 +2073,12 @@ namespace DysonNetwork.Sphere.Migrations modelBuilder.Entity("PostPostCollection", b => { - b.Property("CollectionsId") - .HasColumnType("bigint") + b.Property("CollectionsId") + .HasColumnType("uuid") .HasColumnName("collections_id"); - b.Property("PostsId") - .HasColumnType("bigint") + b.Property("PostsId") + .HasColumnType("uuid") .HasColumnName("posts_id"); b.HasKey("CollectionsId", "PostsId") @@ -2113,12 +2092,12 @@ namespace DysonNetwork.Sphere.Migrations modelBuilder.Entity("PostPostTag", b => { - b.Property("PostsId") - .HasColumnType("bigint") + b.Property("PostsId") + .HasColumnType("uuid") .HasColumnName("posts_id"); - b.Property("TagsId") - .HasColumnType("bigint") + b.Property("TagsId") + .HasColumnType("uuid") .HasColumnName("tags_id"); b.HasKey("PostsId", "TagsId") diff --git a/DysonNetwork.Sphere/Migrations/20250504170705_InitialMigration.cs b/DysonNetwork.Sphere/Migrations/20250514115228_InitialMigration.cs similarity index 77% rename from DysonNetwork.Sphere/Migrations/20250504170705_InitialMigration.cs rename to DysonNetwork.Sphere/Migrations/20250514115228_InitialMigration.cs index cdbcb8a..5782b4c 100644 --- a/DysonNetwork.Sphere/Migrations/20250504170705_InitialMigration.cs +++ b/DysonNetwork.Sphere/Migrations/20250514115228_InitialMigration.cs @@ -1,9 +1,9 @@ using System; using System.Collections.Generic; using System.Text.Json; +using DysonNetwork.Sphere.Account; using Microsoft.EntityFrameworkCore.Migrations; using NodaTime; -using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; using NpgsqlTypes; #nullable disable @@ -20,8 +20,7 @@ namespace DysonNetwork.Sphere.Migrations name: "accounts", columns: table => new { - id = table.Column(type: "bigint", nullable: false) - .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), + id = table.Column(type: "uuid", nullable: false), name = table.Column(type: "character varying(256)", maxLength: 256, nullable: false), nick = table.Column(type: "character varying(256)", maxLength: 256, nullable: false), language = table.Column(type: "character varying(32)", maxLength: 32, nullable: false), @@ -55,8 +54,7 @@ namespace DysonNetwork.Sphere.Migrations name: "post_categories", columns: table => new { - id = table.Column(type: "bigint", nullable: false) - .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), + id = table.Column(type: "uuid", nullable: false), slug = table.Column(type: "character varying(128)", maxLength: 128, nullable: false), name = table.Column(type: "character varying(256)", maxLength: 256, nullable: true), created_at = table.Column(type: "timestamp with time zone", nullable: false), @@ -72,8 +70,7 @@ namespace DysonNetwork.Sphere.Migrations name: "post_tags", columns: table => new { - id = table.Column(type: "bigint", nullable: false) - .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), + id = table.Column(type: "uuid", nullable: false), slug = table.Column(type: "character varying(128)", maxLength: 128, nullable: false), name = table.Column(type: "character varying(256)", maxLength: 256, nullable: true), created_at = table.Column(type: "timestamp with time zone", nullable: false), @@ -89,11 +86,10 @@ namespace DysonNetwork.Sphere.Migrations name: "account_auth_factors", columns: table => new { - id = table.Column(type: "bigint", nullable: false) - .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), + id = table.Column(type: "uuid", nullable: false), type = table.Column(type: "integer", nullable: false), - secret = table.Column(type: "text", nullable: true), - account_id = table.Column(type: "bigint", nullable: false), + secret = table.Column(type: "character varying(8196)", maxLength: 8196, nullable: true), + account_id = table.Column(type: "uuid", nullable: false), created_at = table.Column(type: "timestamp with time zone", nullable: false), updated_at = table.Column(type: "timestamp with time zone", nullable: false), deleted_at = table.Column(type: "timestamp with time zone", nullable: true) @@ -109,16 +105,38 @@ namespace DysonNetwork.Sphere.Migrations onDelete: ReferentialAction.Cascade); }); + migrationBuilder.CreateTable( + name: "account_check_in_results", + columns: table => new + { + id = table.Column(type: "uuid", nullable: false), + level = table.Column(type: "integer", nullable: false), + tips = table.Column>(type: "jsonb", nullable: false), + account_id = table.Column(type: "uuid", nullable: false), + created_at = table.Column(type: "timestamp with time zone", nullable: false), + updated_at = table.Column(type: "timestamp with time zone", nullable: false), + deleted_at = table.Column(type: "timestamp with time zone", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("pk_account_check_in_results", x => x.id); + table.ForeignKey( + name: "fk_account_check_in_results_accounts_account_id", + column: x => x.account_id, + principalTable: "accounts", + principalColumn: "id", + onDelete: ReferentialAction.Cascade); + }); + migrationBuilder.CreateTable( name: "account_contacts", columns: table => new { - id = table.Column(type: "bigint", nullable: false) - .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), + id = table.Column(type: "uuid", nullable: false), type = table.Column(type: "integer", nullable: false), verified_at = table.Column(type: "timestamp with time zone", nullable: true), content = table.Column(type: "character varying(1024)", maxLength: 1024, nullable: false), - account_id = table.Column(type: "bigint", nullable: false), + account_id = table.Column(type: "uuid", nullable: false), created_at = table.Column(type: "timestamp with time zone", nullable: false), updated_at = table.Column(type: "timestamp with time zone", nullable: false), deleted_at = table.Column(type: "timestamp with time zone", nullable: true) @@ -138,8 +156,8 @@ namespace DysonNetwork.Sphere.Migrations name: "account_relationships", columns: table => new { - account_id = table.Column(type: "bigint", nullable: false), - related_id = table.Column(type: "bigint", nullable: false), + account_id = table.Column(type: "uuid", nullable: false), + related_id = table.Column(type: "uuid", nullable: false), expired_at = table.Column(type: "timestamp with time zone", nullable: true), status = table.Column(type: "integer", nullable: false), created_at = table.Column(type: "timestamp with time zone", nullable: false), @@ -163,6 +181,32 @@ namespace DysonNetwork.Sphere.Migrations onDelete: ReferentialAction.Cascade); }); + migrationBuilder.CreateTable( + name: "account_statuses", + columns: table => new + { + id = table.Column(type: "uuid", nullable: false), + attitude = table.Column(type: "integer", nullable: false), + is_invisible = table.Column(type: "boolean", nullable: false), + is_not_disturb = table.Column(type: "boolean", nullable: false), + label = table.Column(type: "character varying(1024)", maxLength: 1024, nullable: true), + cleared_at = table.Column(type: "timestamp with time zone", nullable: true), + account_id = table.Column(type: "uuid", nullable: false), + created_at = table.Column(type: "timestamp with time zone", nullable: false), + updated_at = table.Column(type: "timestamp with time zone", nullable: false), + deleted_at = table.Column(type: "timestamp with time zone", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("pk_account_statuses", x => x.id); + table.ForeignKey( + name: "fk_account_statuses_accounts_account_id", + column: x => x.account_id, + principalTable: "accounts", + principalColumn: "id", + onDelete: ReferentialAction.Cascade); + }); + migrationBuilder.CreateTable( name: "activities", columns: table => new @@ -171,7 +215,9 @@ namespace DysonNetwork.Sphere.Migrations type = table.Column(type: "character varying(1024)", maxLength: 1024, nullable: false), resource_identifier = table.Column(type: "character varying(4096)", maxLength: 4096, nullable: false), visibility = table.Column(type: "integer", nullable: false), - account_id = table.Column(type: "bigint", nullable: false), + meta = table.Column>(type: "jsonb", nullable: false), + users_visible = table.Column>(type: "jsonb", nullable: false), + account_id = table.Column(type: "uuid", nullable: false), created_at = table.Column(type: "timestamp with time zone", nullable: false), updated_at = table.Column(type: "timestamp with time zone", nullable: false), deleted_at = table.Column(type: "timestamp with time zone", nullable: true) @@ -198,14 +244,14 @@ namespace DysonNetwork.Sphere.Migrations failed_attempts = table.Column(type: "integer", nullable: false), platform = table.Column(type: "integer", nullable: false), type = table.Column(type: "integer", nullable: false), - blacklist_factors = table.Column>(type: "jsonb", nullable: false), + blacklist_factors = table.Column>(type: "jsonb", nullable: false), audiences = table.Column>(type: "jsonb", nullable: false), scopes = table.Column>(type: "jsonb", nullable: false), ip_address = table.Column(type: "character varying(128)", maxLength: 128, nullable: true), user_agent = table.Column(type: "character varying(512)", maxLength: 512, nullable: true), device_id = table.Column(type: "character varying(256)", maxLength: 256, nullable: true), nonce = table.Column(type: "character varying(1024)", maxLength: 1024, nullable: true), - account_id = table.Column(type: "bigint", nullable: false), + account_id = table.Column(type: "uuid", nullable: false), created_at = table.Column(type: "timestamp with time zone", nullable: false), updated_at = table.Column(type: "timestamp with time zone", nullable: false), deleted_at = table.Column(type: "timestamp with time zone", nullable: true) @@ -221,6 +267,32 @@ namespace DysonNetwork.Sphere.Migrations onDelete: ReferentialAction.Cascade); }); + migrationBuilder.CreateTable( + name: "badges", + columns: table => new + { + id = table.Column(type: "uuid", nullable: false), + type = table.Column(type: "character varying(1024)", maxLength: 1024, nullable: false), + label = table.Column(type: "character varying(1024)", maxLength: 1024, nullable: true), + caption = table.Column(type: "character varying(4096)", maxLength: 4096, nullable: true), + meta = table.Column>(type: "jsonb", nullable: false), + expired_at = table.Column(type: "timestamp with time zone", nullable: true), + account_id = table.Column(type: "uuid", nullable: false), + created_at = table.Column(type: "timestamp with time zone", nullable: false), + updated_at = table.Column(type: "timestamp with time zone", nullable: false), + deleted_at = table.Column(type: "timestamp with time zone", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("pk_badges", x => x.id); + table.ForeignKey( + name: "fk_badges_accounts_account_id", + column: x => x.account_id, + principalTable: "accounts", + principalColumn: "id", + onDelete: ReferentialAction.Cascade); + }); + migrationBuilder.CreateTable( name: "magic_spells", columns: table => new @@ -231,7 +303,7 @@ namespace DysonNetwork.Sphere.Migrations expires_at = table.Column(type: "timestamp with time zone", nullable: true), affected_at = table.Column(type: "timestamp with time zone", nullable: true), meta = table.Column>(type: "jsonb", nullable: false), - account_id = table.Column(type: "bigint", nullable: true), + account_id = table.Column(type: "uuid", nullable: true), created_at = table.Column(type: "timestamp with time zone", nullable: false), updated_at = table.Column(type: "timestamp with time zone", nullable: false), deleted_at = table.Column(type: "timestamp with time zone", nullable: true) @@ -255,7 +327,7 @@ namespace DysonNetwork.Sphere.Migrations device_token = table.Column(type: "character varying(4096)", maxLength: 4096, nullable: false), provider = table.Column(type: "integer", nullable: false), last_used_at = table.Column(type: "timestamp with time zone", nullable: true), - account_id = table.Column(type: "bigint", nullable: false), + account_id = table.Column(type: "uuid", nullable: false), created_at = table.Column(type: "timestamp with time zone", nullable: false), updated_at = table.Column(type: "timestamp with time zone", nullable: false), deleted_at = table.Column(type: "timestamp with time zone", nullable: true) @@ -283,7 +355,7 @@ namespace DysonNetwork.Sphere.Migrations meta = table.Column>(type: "jsonb", nullable: true), priority = table.Column(type: "integer", nullable: false), viewed_at = table.Column(type: "timestamp with time zone", nullable: true), - account_id = table.Column(type: "bigint", nullable: false), + account_id = table.Column(type: "uuid", nullable: false), created_at = table.Column(type: "timestamp with time zone", nullable: false), updated_at = table.Column(type: "timestamp with time zone", nullable: false), deleted_at = table.Column(type: "timestamp with time zone", nullable: true) @@ -356,7 +428,7 @@ namespace DysonNetwork.Sphere.Migrations label = table.Column(type: "character varying(1024)", maxLength: 1024, nullable: true), last_granted_at = table.Column(type: "timestamp with time zone", nullable: true), expired_at = table.Column(type: "timestamp with time zone", nullable: true), - account_id = table.Column(type: "bigint", nullable: false), + account_id = table.Column(type: "uuid", nullable: false), challenge_id = table.Column(type: "uuid", nullable: false), created_at = table.Column(type: "timestamp with time zone", nullable: false), updated_at = table.Column(type: "timestamp with time zone", nullable: false), @@ -383,7 +455,7 @@ namespace DysonNetwork.Sphere.Migrations name: "account_profiles", columns: table => new { - id = table.Column(type: "bigint", nullable: false), + id = table.Column(type: "uuid", nullable: false), first_name = table.Column(type: "character varying(256)", maxLength: 256, nullable: true), middle_name = table.Column(type: "character varying(256)", maxLength: 256, nullable: true), last_name = table.Column(type: "character varying(256)", maxLength: 256, nullable: true), @@ -410,8 +482,8 @@ namespace DysonNetwork.Sphere.Migrations columns: table => new { id = table.Column(type: "uuid", nullable: false), - chat_room_id = table.Column(type: "bigint", nullable: false), - account_id = table.Column(type: "bigint", nullable: false), + chat_room_id = table.Column(type: "uuid", nullable: false), + account_id = table.Column(type: "uuid", nullable: false), nick = table.Column(type: "character varying(1024)", maxLength: 1024, nullable: true), role = table.Column(type: "integer", nullable: false), notify = table.Column(type: "integer", nullable: false), @@ -438,7 +510,8 @@ namespace DysonNetwork.Sphere.Migrations columns: table => new { id = table.Column(type: "uuid", nullable: false), - content = table.Column(type: "character varying(4096)", maxLength: 4096, nullable: false), + type = table.Column(type: "text", nullable: false), + content = table.Column(type: "character varying(4096)", maxLength: 4096, nullable: true), meta = table.Column>(type: "jsonb", nullable: true), members_mentioned = table.Column>(type: "jsonb", nullable: true), nonce = table.Column(type: "character varying(36)", maxLength: 36, nullable: false), @@ -446,7 +519,7 @@ namespace DysonNetwork.Sphere.Migrations replied_message_id = table.Column(type: "uuid", nullable: true), forwarded_message_id = table.Column(type: "uuid", nullable: true), sender_id = table.Column(type: "uuid", nullable: false), - chat_room_id = table.Column(type: "bigint", nullable: false), + chat_room_id = table.Column(type: "uuid", nullable: false), created_at = table.Column(type: "timestamp with time zone", nullable: false), updated_at = table.Column(type: "timestamp with time zone", nullable: false), deleted_at = table.Column(type: "timestamp with time zone", nullable: true) @@ -474,6 +547,36 @@ namespace DysonNetwork.Sphere.Migrations onDelete: ReferentialAction.Restrict); }); + migrationBuilder.CreateTable( + name: "chat_reactions", + columns: table => new + { + id = table.Column(type: "uuid", nullable: false), + message_id = table.Column(type: "uuid", nullable: false), + sender_id = table.Column(type: "uuid", nullable: false), + symbol = table.Column(type: "character varying(256)", maxLength: 256, nullable: false), + attitude = table.Column(type: "integer", nullable: false), + created_at = table.Column(type: "timestamp with time zone", nullable: false), + updated_at = table.Column(type: "timestamp with time zone", nullable: false), + deleted_at = table.Column(type: "timestamp with time zone", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("pk_chat_reactions", x => x.id); + table.ForeignKey( + name: "fk_chat_reactions_chat_members_sender_id", + column: x => x.sender_id, + principalTable: "chat_members", + principalColumn: "id", + onDelete: ReferentialAction.Cascade); + table.ForeignKey( + name: "fk_chat_reactions_chat_messages_message_id", + column: x => x.message_id, + principalTable: "chat_messages", + principalColumn: "id", + onDelete: ReferentialAction.Cascade); + }); + migrationBuilder.CreateTable( name: "chat_statuses", columns: table => new @@ -503,48 +606,41 @@ namespace DysonNetwork.Sphere.Migrations }); migrationBuilder.CreateTable( - name: "message_reaction", + name: "chat_realtime_call", columns: table => new { id = table.Column(type: "uuid", nullable: false), - message_id = table.Column(type: "uuid", nullable: false), + title = table.Column(type: "text", nullable: true), + ended_at = table.Column(type: "timestamp with time zone", nullable: true), sender_id = table.Column(type: "uuid", nullable: false), - symbol = table.Column(type: "character varying(256)", maxLength: 256, nullable: false), - attitude = table.Column(type: "integer", nullable: false), + room_id = table.Column(type: "uuid", nullable: false), created_at = table.Column(type: "timestamp with time zone", nullable: false), updated_at = table.Column(type: "timestamp with time zone", nullable: false), deleted_at = table.Column(type: "timestamp with time zone", nullable: true) }, constraints: table => { - table.PrimaryKey("pk_message_reaction", x => x.id); + table.PrimaryKey("pk_chat_realtime_call", x => x.id); table.ForeignKey( - name: "fk_message_reaction_chat_members_sender_id", + name: "fk_chat_realtime_call_chat_members_sender_id", column: x => x.sender_id, principalTable: "chat_members", principalColumn: "id", onDelete: ReferentialAction.Cascade); - table.ForeignKey( - name: "fk_message_reaction_chat_messages_message_id", - column: x => x.message_id, - principalTable: "chat_messages", - principalColumn: "id", - onDelete: ReferentialAction.Cascade); }); migrationBuilder.CreateTable( name: "chat_rooms", columns: table => new { - id = table.Column(type: "bigint", nullable: false) - .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), + id = table.Column(type: "uuid", nullable: false), name = table.Column(type: "character varying(1024)", maxLength: 1024, nullable: false), description = table.Column(type: "character varying(4096)", maxLength: 4096, nullable: false), type = table.Column(type: "integer", nullable: false), is_public = table.Column(type: "boolean", nullable: false), picture_id = table.Column(type: "character varying(128)", nullable: true), background_id = table.Column(type: "character varying(128)", nullable: true), - realm_id = table.Column(type: "bigint", nullable: true), + realm_id = table.Column(type: "uuid", nullable: true), created_at = table.Column(type: "timestamp with time zone", nullable: false), updated_at = table.Column(type: "timestamp with time zone", nullable: false), deleted_at = table.Column(type: "timestamp with time zone", nullable: true) @@ -571,9 +667,9 @@ namespace DysonNetwork.Sphere.Migrations uploaded_to = table.Column(type: "character varying(128)", maxLength: 128, nullable: true), has_compression = table.Column(type: "boolean", nullable: false), used_count = table.Column(type: "integer", nullable: false), - account_id = table.Column(type: "bigint", nullable: false), + account_id = table.Column(type: "uuid", nullable: false), message_id = table.Column(type: "uuid", nullable: true), - post_id = table.Column(type: "bigint", nullable: true), + post_id = table.Column(type: "uuid", nullable: true), created_at = table.Column(type: "timestamp with time zone", nullable: false), updated_at = table.Column(type: "timestamp with time zone", nullable: false), deleted_at = table.Column(type: "timestamp with time zone", nullable: true) @@ -594,49 +690,11 @@ namespace DysonNetwork.Sphere.Migrations principalColumn: "id"); }); - migrationBuilder.CreateTable( - name: "publishers", - columns: table => new - { - id = table.Column(type: "bigint", nullable: false) - .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), - publisher_type = table.Column(type: "integer", nullable: false), - name = table.Column(type: "character varying(256)", maxLength: 256, nullable: false), - nick = table.Column(type: "character varying(256)", maxLength: 256, nullable: false), - bio = table.Column(type: "character varying(4096)", maxLength: 4096, nullable: true), - picture_id = table.Column(type: "character varying(128)", nullable: true), - background_id = table.Column(type: "character varying(128)", nullable: true), - account_id = table.Column(type: "bigint", nullable: true), - created_at = table.Column(type: "timestamp with time zone", nullable: false), - updated_at = table.Column(type: "timestamp with time zone", nullable: false), - deleted_at = table.Column(type: "timestamp with time zone", nullable: true) - }, - constraints: table => - { - table.PrimaryKey("pk_publishers", x => x.id); - table.ForeignKey( - name: "fk_publishers_accounts_account_id", - column: x => x.account_id, - principalTable: "accounts", - principalColumn: "id"); - table.ForeignKey( - name: "fk_publishers_files_background_id", - column: x => x.background_id, - principalTable: "files", - principalColumn: "id"); - table.ForeignKey( - name: "fk_publishers_files_picture_id", - column: x => x.picture_id, - principalTable: "files", - principalColumn: "id"); - }); - migrationBuilder.CreateTable( name: "realms", columns: table => new { - id = table.Column(type: "bigint", nullable: false) - .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), + id = table.Column(type: "uuid", nullable: false), slug = table.Column(type: "character varying(1024)", maxLength: 1024, nullable: false), name = table.Column(type: "character varying(1024)", maxLength: 1024, nullable: false), description = table.Column(type: "character varying(4096)", maxLength: 4096, nullable: false), @@ -646,7 +704,7 @@ namespace DysonNetwork.Sphere.Migrations is_public = table.Column(type: "boolean", nullable: false), picture_id = table.Column(type: "character varying(128)", nullable: true), background_id = table.Column(type: "character varying(128)", nullable: true), - account_id = table.Column(type: "bigint", nullable: false), + account_id = table.Column(type: "uuid", nullable: false), created_at = table.Column(type: "timestamp with time zone", nullable: false), updated_at = table.Column(type: "timestamp with time zone", nullable: false), deleted_at = table.Column(type: "timestamp with time zone", nullable: true) @@ -672,16 +730,86 @@ namespace DysonNetwork.Sphere.Migrations principalColumn: "id"); }); + migrationBuilder.CreateTable( + name: "publishers", + columns: table => new + { + id = table.Column(type: "uuid", nullable: false), + publisher_type = table.Column(type: "integer", nullable: false), + name = table.Column(type: "character varying(256)", maxLength: 256, nullable: false), + nick = table.Column(type: "character varying(256)", maxLength: 256, nullable: false), + bio = table.Column(type: "character varying(4096)", maxLength: 4096, nullable: true), + picture_id = table.Column(type: "character varying(128)", nullable: true), + background_id = table.Column(type: "character varying(128)", nullable: true), + account_id = table.Column(type: "uuid", nullable: true), + realm_id = table.Column(type: "uuid", nullable: true), + created_at = table.Column(type: "timestamp with time zone", nullable: false), + updated_at = table.Column(type: "timestamp with time zone", nullable: false), + deleted_at = table.Column(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(type: "uuid", nullable: false), + account_id = table.Column(type: "uuid", nullable: false), + role = table.Column(type: "integer", nullable: false), + joined_at = table.Column(type: "timestamp with time zone", nullable: true), + created_at = table.Column(type: "timestamp with time zone", nullable: false), + updated_at = table.Column(type: "timestamp with time zone", nullable: false), + deleted_at = table.Column(type: "timestamp with time zone", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("pk_realm_members", x => new { x.realm_id, x.account_id }); + table.ForeignKey( + name: "fk_realm_members_accounts_account_id", + column: x => x.account_id, + principalTable: "accounts", + principalColumn: "id", + onDelete: ReferentialAction.Cascade); + table.ForeignKey( + name: "fk_realm_members_realms_realm_id", + column: x => x.realm_id, + principalTable: "realms", + principalColumn: "id", + onDelete: ReferentialAction.Cascade); + }); + migrationBuilder.CreateTable( name: "post_collections", columns: table => new { - id = table.Column(type: "bigint", nullable: false) - .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), + id = table.Column(type: "uuid", nullable: false), slug = table.Column(type: "character varying(128)", maxLength: 128, nullable: false), name = table.Column(type: "character varying(256)", maxLength: 256, nullable: true), description = table.Column(type: "character varying(4096)", maxLength: 4096, nullable: true), - publisher_id = table.Column(type: "bigint", nullable: false), + publisher_id = table.Column(type: "uuid", nullable: false), created_at = table.Column(type: "timestamp with time zone", nullable: false), updated_at = table.Column(type: "timestamp with time zone", nullable: false), deleted_at = table.Column(type: "timestamp with time zone", nullable: true) @@ -701,8 +829,7 @@ namespace DysonNetwork.Sphere.Migrations name: "posts", columns: table => new { - id = table.Column(type: "bigint", nullable: false) - .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), + id = table.Column(type: "uuid", nullable: false), title = table.Column(type: "character varying(1024)", maxLength: 1024, nullable: true), description = table.Column(type: "character varying(4096)", maxLength: 4096, nullable: true), language = table.Column(type: "character varying(128)", maxLength: 128, nullable: true), @@ -716,13 +843,13 @@ namespace DysonNetwork.Sphere.Migrations views_total = table.Column(type: "integer", nullable: false), upvotes = table.Column(type: "integer", nullable: false), downvotes = table.Column(type: "integer", nullable: false), - threaded_post_id = table.Column(type: "bigint", nullable: true), - replied_post_id = table.Column(type: "bigint", nullable: true), - forwarded_post_id = table.Column(type: "bigint", nullable: true), + threaded_post_id = table.Column(type: "uuid", nullable: true), + replied_post_id = table.Column(type: "uuid", nullable: true), + forwarded_post_id = table.Column(type: "uuid", nullable: true), search_vector = table.Column(type: "tsvector", nullable: false) .Annotation("Npgsql:TsVectorConfig", "simple") .Annotation("Npgsql:TsVectorProperties", new[] { "title", "description", "content" }), - publisher_id = table.Column(type: "bigint", nullable: false), + publisher_id = table.Column(type: "uuid", nullable: false), created_at = table.Column(type: "timestamp with time zone", nullable: false), updated_at = table.Column(type: "timestamp with time zone", nullable: false), deleted_at = table.Column(type: "timestamp with time zone", nullable: true) @@ -759,8 +886,8 @@ namespace DysonNetwork.Sphere.Migrations name: "publisher_members", columns: table => new { - publisher_id = table.Column(type: "bigint", nullable: false), - account_id = table.Column(type: "bigint", nullable: false), + publisher_id = table.Column(type: "uuid", nullable: false), + account_id = table.Column(type: "uuid", nullable: false), role = table.Column(type: "integer", nullable: false), joined_at = table.Column(type: "timestamp with time zone", nullable: true), created_at = table.Column(type: "timestamp with time zone", nullable: false), @@ -785,30 +912,55 @@ namespace DysonNetwork.Sphere.Migrations }); migrationBuilder.CreateTable( - name: "realm_members", + name: "publisher_subscriptions", columns: table => new { - realm_id = table.Column(type: "bigint", nullable: false), - account_id = table.Column(type: "bigint", nullable: false), - role = table.Column(type: "integer", nullable: false), - joined_at = table.Column(type: "timestamp with time zone", nullable: true), + id = table.Column(type: "uuid", nullable: false), + publisher_id = table.Column(type: "uuid", nullable: false), + account_id = table.Column(type: "uuid", nullable: false), + status = table.Column(type: "integer", nullable: false), + tier = table.Column(type: "integer", nullable: false), created_at = table.Column(type: "timestamp with time zone", nullable: false), updated_at = table.Column(type: "timestamp with time zone", nullable: false), deleted_at = table.Column(type: "timestamp with time zone", nullable: true) }, constraints: table => { - table.PrimaryKey("pk_realm_members", x => new { x.realm_id, x.account_id }); + table.PrimaryKey("pk_publisher_subscriptions", x => x.id); table.ForeignKey( - name: "fk_realm_members_accounts_account_id", + name: "fk_publisher_subscriptions_accounts_account_id", column: x => x.account_id, principalTable: "accounts", principalColumn: "id", onDelete: ReferentialAction.Cascade); table.ForeignKey( - name: "fk_realm_members_realms_realm_id", - column: x => x.realm_id, - principalTable: "realms", + name: "fk_publisher_subscriptions_publishers_publisher_id", + column: x => x.publisher_id, + principalTable: "publishers", + principalColumn: "id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "sticker_packs", + columns: table => new + { + id = table.Column(type: "uuid", nullable: false), + name = table.Column(type: "character varying(1024)", maxLength: 1024, nullable: false), + description = table.Column(type: "character varying(4096)", maxLength: 4096, nullable: false), + prefix = table.Column(type: "character varying(128)", maxLength: 128, nullable: false), + publisher_id = table.Column(type: "uuid", nullable: false), + created_at = table.Column(type: "timestamp with time zone", nullable: false), + updated_at = table.Column(type: "timestamp with time zone", nullable: false), + deleted_at = table.Column(type: "timestamp with time zone", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("pk_sticker_packs", x => x.id); + table.ForeignKey( + name: "fk_sticker_packs_publishers_publisher_id", + column: x => x.publisher_id, + principalTable: "publishers", principalColumn: "id", onDelete: ReferentialAction.Cascade); }); @@ -817,8 +969,8 @@ namespace DysonNetwork.Sphere.Migrations name: "post_category_links", columns: table => new { - categories_id = table.Column(type: "bigint", nullable: false), - posts_id = table.Column(type: "bigint", nullable: false) + categories_id = table.Column(type: "uuid", nullable: false), + posts_id = table.Column(type: "uuid", nullable: false) }, constraints: table => { @@ -841,8 +993,8 @@ namespace DysonNetwork.Sphere.Migrations name: "post_collection_links", columns: table => new { - collections_id = table.Column(type: "bigint", nullable: false), - posts_id = table.Column(type: "bigint", nullable: false) + collections_id = table.Column(type: "uuid", nullable: false), + posts_id = table.Column(type: "uuid", nullable: false) }, constraints: table => { @@ -865,12 +1017,11 @@ namespace DysonNetwork.Sphere.Migrations name: "post_reactions", columns: table => new { - id = table.Column(type: "bigint", nullable: false) - .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), + id = table.Column(type: "uuid", nullable: false), symbol = table.Column(type: "character varying(256)", maxLength: 256, nullable: false), attitude = table.Column(type: "integer", nullable: false), - post_id = table.Column(type: "bigint", nullable: false), - account_id = table.Column(type: "bigint", nullable: false), + post_id = table.Column(type: "uuid", nullable: false), + account_id = table.Column(type: "uuid", nullable: false), created_at = table.Column(type: "timestamp with time zone", nullable: false), updated_at = table.Column(type: "timestamp with time zone", nullable: false), deleted_at = table.Column(type: "timestamp with time zone", nullable: true) @@ -896,8 +1047,8 @@ namespace DysonNetwork.Sphere.Migrations name: "post_tag_links", columns: table => new { - posts_id = table.Column(type: "bigint", nullable: false), - tags_id = table.Column(type: "bigint", nullable: false) + posts_id = table.Column(type: "uuid", nullable: false), + tags_id = table.Column(type: "uuid", nullable: false) }, constraints: table => { @@ -916,11 +1067,45 @@ namespace DysonNetwork.Sphere.Migrations onDelete: ReferentialAction.Cascade); }); + migrationBuilder.CreateTable( + name: "stickers", + columns: table => new + { + id = table.Column(type: "uuid", nullable: false), + slug = table.Column(type: "character varying(128)", maxLength: 128, nullable: false), + image_id = table.Column(type: "character varying(128)", nullable: false), + pack_id = table.Column(type: "uuid", nullable: false), + created_at = table.Column(type: "timestamp with time zone", nullable: false), + updated_at = table.Column(type: "timestamp with time zone", nullable: false), + deleted_at = table.Column(type: "timestamp with time zone", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("pk_stickers", x => x.id); + table.ForeignKey( + name: "fk_stickers_files_image_id", + column: x => x.image_id, + principalTable: "files", + principalColumn: "id", + onDelete: ReferentialAction.Cascade); + table.ForeignKey( + name: "fk_stickers_sticker_packs_pack_id", + column: x => x.pack_id, + principalTable: "sticker_packs", + principalColumn: "id", + onDelete: ReferentialAction.Cascade); + }); + migrationBuilder.CreateIndex( name: "ix_account_auth_factors_account_id", table: "account_auth_factors", column: "account_id"); + migrationBuilder.CreateIndex( + name: "ix_account_check_in_results_account_id", + table: "account_check_in_results", + column: "account_id"); + migrationBuilder.CreateIndex( name: "ix_account_contacts_account_id", table: "account_contacts", @@ -941,6 +1126,11 @@ namespace DysonNetwork.Sphere.Migrations table: "account_relationships", column: "related_id"); + migrationBuilder.CreateIndex( + name: "ix_account_statuses_account_id", + table: "account_statuses", + column: "account_id"); + migrationBuilder.CreateIndex( name: "ix_accounts_name", table: "accounts", @@ -967,6 +1157,11 @@ namespace DysonNetwork.Sphere.Migrations table: "auth_sessions", column: "challenge_id"); + migrationBuilder.CreateIndex( + name: "ix_badges_account_id", + table: "badges", + column: "account_id"); + migrationBuilder.CreateIndex( name: "ix_chat_members_account_id", table: "chat_members", @@ -992,6 +1187,26 @@ namespace DysonNetwork.Sphere.Migrations table: "chat_messages", column: "sender_id"); + migrationBuilder.CreateIndex( + name: "ix_chat_reactions_message_id", + table: "chat_reactions", + column: "message_id"); + + migrationBuilder.CreateIndex( + name: "ix_chat_reactions_sender_id", + table: "chat_reactions", + column: "sender_id"); + + migrationBuilder.CreateIndex( + name: "ix_chat_realtime_call_room_id", + table: "chat_realtime_call", + column: "room_id"); + + migrationBuilder.CreateIndex( + name: "ix_chat_realtime_call_sender_id", + table: "chat_realtime_call", + column: "sender_id"); + migrationBuilder.CreateIndex( name: "ix_chat_rooms_background_id", table: "chat_rooms", @@ -1038,16 +1253,6 @@ namespace DysonNetwork.Sphere.Migrations column: "spell", unique: true); - migrationBuilder.CreateIndex( - name: "ix_message_reaction_message_id", - table: "message_reaction", - column: "message_id"); - - migrationBuilder.CreateIndex( - name: "ix_message_reaction_sender_id", - table: "message_reaction", - column: "sender_id"); - migrationBuilder.CreateIndex( name: "ix_notification_push_subscriptions_account_id", table: "notification_push_subscriptions", @@ -1142,6 +1347,16 @@ namespace DysonNetwork.Sphere.Migrations table: "publisher_members", column: "account_id"); + migrationBuilder.CreateIndex( + name: "ix_publisher_subscriptions_account_id", + table: "publisher_subscriptions", + column: "account_id"); + + migrationBuilder.CreateIndex( + name: "ix_publisher_subscriptions_publisher_id", + table: "publisher_subscriptions", + column: "publisher_id"); + migrationBuilder.CreateIndex( name: "ix_publishers_account_id", table: "publishers", @@ -1163,6 +1378,11 @@ namespace DysonNetwork.Sphere.Migrations table: "publishers", column: "picture_id"); + migrationBuilder.CreateIndex( + name: "ix_publishers_realm_id", + table: "publishers", + column: "realm_id"); + migrationBuilder.CreateIndex( name: "ix_realm_members_account_id", table: "realm_members", @@ -1189,6 +1409,21 @@ namespace DysonNetwork.Sphere.Migrations column: "slug", unique: true); + migrationBuilder.CreateIndex( + name: "ix_sticker_packs_publisher_id", + table: "sticker_packs", + column: "publisher_id"); + + migrationBuilder.CreateIndex( + name: "ix_stickers_image_id", + table: "stickers", + column: "image_id"); + + migrationBuilder.CreateIndex( + name: "ix_stickers_pack_id", + table: "stickers", + column: "pack_id"); + migrationBuilder.AddForeignKey( name: "fk_account_profiles_files_background_id", table: "account_profiles", @@ -1219,6 +1454,14 @@ namespace DysonNetwork.Sphere.Migrations principalColumn: "id", onDelete: ReferentialAction.Cascade); + migrationBuilder.AddForeignKey( + name: "fk_chat_realtime_call_chat_rooms_room_id", + table: "chat_realtime_call", + column: "room_id", + principalTable: "chat_rooms", + principalColumn: "id", + onDelete: ReferentialAction.Cascade); + migrationBuilder.AddForeignKey( name: "fk_chat_rooms_files_background_id", table: "chat_rooms", @@ -1294,6 +1537,9 @@ namespace DysonNetwork.Sphere.Migrations migrationBuilder.DropTable( name: "account_auth_factors"); + migrationBuilder.DropTable( + name: "account_check_in_results"); + migrationBuilder.DropTable( name: "account_contacts"); @@ -1303,21 +1549,30 @@ namespace DysonNetwork.Sphere.Migrations migrationBuilder.DropTable( name: "account_relationships"); + migrationBuilder.DropTable( + name: "account_statuses"); + migrationBuilder.DropTable( name: "activities"); migrationBuilder.DropTable( name: "auth_sessions"); + migrationBuilder.DropTable( + name: "badges"); + + migrationBuilder.DropTable( + name: "chat_reactions"); + + migrationBuilder.DropTable( + name: "chat_realtime_call"); + migrationBuilder.DropTable( name: "chat_statuses"); migrationBuilder.DropTable( name: "magic_spells"); - migrationBuilder.DropTable( - name: "message_reaction"); - migrationBuilder.DropTable( name: "notification_push_subscriptions"); @@ -1345,9 +1600,15 @@ namespace DysonNetwork.Sphere.Migrations migrationBuilder.DropTable( name: "publisher_members"); + migrationBuilder.DropTable( + name: "publisher_subscriptions"); + migrationBuilder.DropTable( name: "realm_members"); + migrationBuilder.DropTable( + name: "stickers"); + migrationBuilder.DropTable( name: "auth_challenges"); @@ -1363,6 +1624,9 @@ namespace DysonNetwork.Sphere.Migrations migrationBuilder.DropTable( name: "post_tags"); + migrationBuilder.DropTable( + name: "sticker_packs"); + migrationBuilder.DropTable( name: "accounts"); diff --git a/DysonNetwork.Sphere/Migrations/AppDatabaseModelSnapshot.cs b/DysonNetwork.Sphere/Migrations/AppDatabaseModelSnapshot.cs index ea38f4f..2879600 100644 --- a/DysonNetwork.Sphere/Migrations/AppDatabaseModelSnapshot.cs +++ b/DysonNetwork.Sphere/Migrations/AppDatabaseModelSnapshot.cs @@ -29,13 +29,11 @@ namespace DysonNetwork.Sphere.Migrations modelBuilder.Entity("DysonNetwork.Sphere.Account.Account", b => { - b.Property("Id") + b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("bigint") + .HasColumnType("uuid") .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - b.Property("ActivatedAt") .HasColumnType("timestamp with time zone") .HasColumnName("activated_at"); @@ -86,15 +84,13 @@ namespace DysonNetwork.Sphere.Migrations modelBuilder.Entity("DysonNetwork.Sphere.Account.AccountAuthFactor", b => { - b.Property("Id") + b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("bigint") + .HasColumnType("uuid") .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AccountId") - .HasColumnType("bigint") + b.Property("AccountId") + .HasColumnType("uuid") .HasColumnName("account_id"); b.Property("CreatedAt") @@ -106,7 +102,8 @@ namespace DysonNetwork.Sphere.Migrations .HasColumnName("deleted_at"); b.Property("Secret") - .HasColumnType("text") + .HasMaxLength(8196) + .HasColumnType("character varying(8196)") .HasColumnName("secret"); b.Property("Type") @@ -128,15 +125,13 @@ namespace DysonNetwork.Sphere.Migrations modelBuilder.Entity("DysonNetwork.Sphere.Account.AccountContact", b => { - b.Property("Id") + b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("bigint") + .HasColumnType("uuid") .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AccountId") - .HasColumnType("bigint") + b.Property("AccountId") + .HasColumnType("uuid") .HasColumnName("account_id"); b.Property("Content") @@ -181,8 +176,8 @@ namespace DysonNetwork.Sphere.Migrations .HasColumnType("uuid") .HasColumnName("id"); - b.Property("AccountId") - .HasColumnType("bigint") + b.Property("AccountId") + .HasColumnType("uuid") .HasColumnName("account_id"); b.Property("Caption") @@ -238,8 +233,8 @@ namespace DysonNetwork.Sphere.Migrations .HasColumnType("uuid") .HasColumnName("id"); - b.Property("AccountId") - .HasColumnType("bigint") + b.Property("AccountId") + .HasColumnType("uuid") .HasColumnName("account_id"); b.Property("CreatedAt") @@ -279,8 +274,8 @@ namespace DysonNetwork.Sphere.Migrations .HasColumnType("uuid") .HasColumnName("id"); - b.Property("AccountId") - .HasColumnType("bigint") + b.Property("AccountId") + .HasColumnType("uuid") .HasColumnName("account_id"); b.Property("AffectedAt") @@ -338,8 +333,8 @@ namespace DysonNetwork.Sphere.Migrations .HasColumnType("uuid") .HasColumnName("id"); - b.Property("AccountId") - .HasColumnType("bigint") + b.Property("AccountId") + .HasColumnType("uuid") .HasColumnName("account_id"); b.Property("Content") @@ -403,8 +398,8 @@ namespace DysonNetwork.Sphere.Migrations .HasColumnType("uuid") .HasColumnName("id"); - b.Property("AccountId") - .HasColumnType("bigint") + b.Property("AccountId") + .HasColumnType("uuid") .HasColumnName("account_id"); b.Property("CreatedAt") @@ -458,8 +453,8 @@ namespace DysonNetwork.Sphere.Migrations modelBuilder.Entity("DysonNetwork.Sphere.Account.Profile", b => { - b.Property("Id") - .HasColumnType("bigint") + b.Property("Id") + .HasColumnType("uuid") .HasColumnName("id"); b.Property("BackgroundId") @@ -516,12 +511,12 @@ namespace DysonNetwork.Sphere.Migrations modelBuilder.Entity("DysonNetwork.Sphere.Account.Relationship", b => { - b.Property("AccountId") - .HasColumnType("bigint") + b.Property("AccountId") + .HasColumnType("uuid") .HasColumnName("account_id"); - b.Property("RelatedId") - .HasColumnType("bigint") + b.Property("RelatedId") + .HasColumnType("uuid") .HasColumnName("related_id"); b.Property("CreatedAt") @@ -560,8 +555,8 @@ namespace DysonNetwork.Sphere.Migrations .HasColumnType("uuid") .HasColumnName("id"); - b.Property("AccountId") - .HasColumnType("bigint") + b.Property("AccountId") + .HasColumnType("uuid") .HasColumnName("account_id"); b.Property("Attitude") @@ -613,8 +608,8 @@ namespace DysonNetwork.Sphere.Migrations .HasColumnType("uuid") .HasColumnName("id"); - b.Property("AccountId") - .HasColumnType("bigint") + b.Property("AccountId") + .HasColumnType("uuid") .HasColumnName("account_id"); b.Property("CreatedAt") @@ -646,7 +641,7 @@ namespace DysonNetwork.Sphere.Migrations .HasColumnType("timestamp with time zone") .HasColumnName("updated_at"); - b.Property>("UsersVisible") + b.Property>("UsersVisible") .IsRequired() .HasColumnType("jsonb") .HasColumnName("users_visible"); @@ -671,8 +666,8 @@ namespace DysonNetwork.Sphere.Migrations .HasColumnType("uuid") .HasColumnName("id"); - b.Property("AccountId") - .HasColumnType("bigint") + b.Property("AccountId") + .HasColumnType("uuid") .HasColumnName("account_id"); b.Property>("Audiences") @@ -680,7 +675,7 @@ namespace DysonNetwork.Sphere.Migrations .HasColumnType("jsonb") .HasColumnName("audiences"); - b.Property>("BlacklistFactors") + b.Property>("BlacklistFactors") .IsRequired() .HasColumnType("jsonb") .HasColumnName("blacklist_factors"); @@ -762,8 +757,8 @@ namespace DysonNetwork.Sphere.Migrations .HasColumnType("uuid") .HasColumnName("id"); - b.Property("AccountId") - .HasColumnType("bigint") + b.Property("AccountId") + .HasColumnType("uuid") .HasColumnName("account_id"); b.Property("ChallengeId") @@ -814,12 +809,12 @@ namespace DysonNetwork.Sphere.Migrations .HasColumnType("uuid") .HasColumnName("id"); - b.Property("AccountId") - .HasColumnType("bigint") + b.Property("AccountId") + .HasColumnType("uuid") .HasColumnName("account_id"); - b.Property("ChatRoomId") - .HasColumnType("bigint") + b.Property("ChatRoomId") + .HasColumnType("uuid") .HasColumnName("chat_room_id"); b.Property("CreatedAt") @@ -869,13 +864,11 @@ namespace DysonNetwork.Sphere.Migrations modelBuilder.Entity("DysonNetwork.Sphere.Chat.ChatRoom", b => { - b.Property("Id") + b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("bigint") + .HasColumnType("uuid") .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - b.Property("BackgroundId") .HasColumnType("character varying(128)") .HasColumnName("background_id"); @@ -908,8 +901,8 @@ namespace DysonNetwork.Sphere.Migrations .HasColumnType("character varying(128)") .HasColumnName("picture_id"); - b.Property("RealmId") - .HasColumnType("bigint") + b.Property("RealmId") + .HasColumnType("uuid") .HasColumnName("realm_id"); b.Property("Type") @@ -942,8 +935,8 @@ namespace DysonNetwork.Sphere.Migrations .HasColumnType("uuid") .HasColumnName("id"); - b.Property("ChatRoomId") - .HasColumnType("bigint") + b.Property("ChatRoomId") + .HasColumnType("uuid") .HasColumnName("chat_room_id"); b.Property("Content") @@ -1119,8 +1112,8 @@ namespace DysonNetwork.Sphere.Migrations .HasColumnType("timestamp with time zone") .HasColumnName("ended_at"); - b.Property("RoomId") - .HasColumnType("bigint") + b.Property("RoomId") + .HasColumnType("uuid") .HasColumnName("room_id"); b.Property("SenderId") @@ -1283,13 +1276,11 @@ namespace DysonNetwork.Sphere.Migrations modelBuilder.Entity("DysonNetwork.Sphere.Post.Post", b => { - b.Property("Id") + b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("bigint") + .HasColumnType("uuid") .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - b.Property("Content") .HasColumnType("text") .HasColumnName("content"); @@ -1315,8 +1306,8 @@ namespace DysonNetwork.Sphere.Migrations .HasColumnType("timestamp with time zone") .HasColumnName("edited_at"); - b.Property("ForwardedPostId") - .HasColumnType("bigint") + b.Property("ForwardedPostId") + .HasColumnType("uuid") .HasColumnName("forwarded_post_id"); b.Property("Language") @@ -1332,12 +1323,12 @@ namespace DysonNetwork.Sphere.Migrations .HasColumnType("timestamp with time zone") .HasColumnName("published_at"); - b.Property("PublisherId") - .HasColumnType("bigint") + b.Property("PublisherId") + .HasColumnType("uuid") .HasColumnName("publisher_id"); - b.Property("RepliedPostId") - .HasColumnType("bigint") + b.Property("RepliedPostId") + .HasColumnType("uuid") .HasColumnName("replied_post_id"); b.Property("SearchVector") @@ -1348,8 +1339,8 @@ namespace DysonNetwork.Sphere.Migrations .HasAnnotation("Npgsql:TsVectorConfig", "simple") .HasAnnotation("Npgsql:TsVectorProperties", new[] { "Title", "Description", "Content" }); - b.Property("ThreadedPostId") - .HasColumnType("bigint") + b.Property("ThreadedPostId") + .HasColumnType("uuid") .HasColumnName("threaded_post_id"); b.Property("Title") @@ -1407,13 +1398,11 @@ namespace DysonNetwork.Sphere.Migrations modelBuilder.Entity("DysonNetwork.Sphere.Post.PostCategory", b => { - b.Property("Id") + b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("bigint") + .HasColumnType("uuid") .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - b.Property("CreatedAt") .HasColumnType("timestamp with time zone") .HasColumnName("created_at"); @@ -1445,13 +1434,11 @@ namespace DysonNetwork.Sphere.Migrations modelBuilder.Entity("DysonNetwork.Sphere.Post.PostCollection", b => { - b.Property("Id") + b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("bigint") + .HasColumnType("uuid") .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - b.Property("CreatedAt") .HasColumnType("timestamp with time zone") .HasColumnName("created_at"); @@ -1470,8 +1457,8 @@ namespace DysonNetwork.Sphere.Migrations .HasColumnType("character varying(256)") .HasColumnName("name"); - b.Property("PublisherId") - .HasColumnType("bigint") + b.Property("PublisherId") + .HasColumnType("uuid") .HasColumnName("publisher_id"); b.Property("Slug") @@ -1495,15 +1482,13 @@ namespace DysonNetwork.Sphere.Migrations modelBuilder.Entity("DysonNetwork.Sphere.Post.PostReaction", b => { - b.Property("Id") + b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("bigint") + .HasColumnType("uuid") .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AccountId") - .HasColumnType("bigint") + b.Property("AccountId") + .HasColumnType("uuid") .HasColumnName("account_id"); b.Property("Attitude") @@ -1518,8 +1503,8 @@ namespace DysonNetwork.Sphere.Migrations .HasColumnType("timestamp with time zone") .HasColumnName("deleted_at"); - b.Property("PostId") - .HasColumnType("bigint") + b.Property("PostId") + .HasColumnType("uuid") .HasColumnName("post_id"); b.Property("Symbol") @@ -1546,13 +1531,11 @@ namespace DysonNetwork.Sphere.Migrations modelBuilder.Entity("DysonNetwork.Sphere.Post.PostTag", b => { - b.Property("Id") + b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("bigint") + .HasColumnType("uuid") .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - b.Property("CreatedAt") .HasColumnType("timestamp with time zone") .HasColumnName("created_at"); @@ -1584,15 +1567,13 @@ namespace DysonNetwork.Sphere.Migrations modelBuilder.Entity("DysonNetwork.Sphere.Post.Publisher", b => { - b.Property("Id") + b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("bigint") + .HasColumnType("uuid") .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AccountId") - .HasColumnType("bigint") + b.Property("AccountId") + .HasColumnType("uuid") .HasColumnName("account_id"); b.Property("BackgroundId") @@ -1632,8 +1613,8 @@ namespace DysonNetwork.Sphere.Migrations .HasColumnType("integer") .HasColumnName("publisher_type"); - b.Property("RealmId") - .HasColumnType("bigint") + b.Property("RealmId") + .HasColumnType("uuid") .HasColumnName("realm_id"); b.Property("UpdatedAt") @@ -1664,12 +1645,12 @@ namespace DysonNetwork.Sphere.Migrations modelBuilder.Entity("DysonNetwork.Sphere.Post.PublisherMember", b => { - b.Property("PublisherId") - .HasColumnType("bigint") + b.Property("PublisherId") + .HasColumnType("uuid") .HasColumnName("publisher_id"); - b.Property("AccountId") - .HasColumnType("bigint") + b.Property("AccountId") + .HasColumnType("uuid") .HasColumnName("account_id"); b.Property("CreatedAt") @@ -1708,8 +1689,8 @@ namespace DysonNetwork.Sphere.Migrations .HasColumnType("uuid") .HasColumnName("id"); - b.Property("AccountId") - .HasColumnType("bigint") + b.Property("AccountId") + .HasColumnType("uuid") .HasColumnName("account_id"); b.Property("CreatedAt") @@ -1720,8 +1701,8 @@ namespace DysonNetwork.Sphere.Migrations .HasColumnType("timestamp with time zone") .HasColumnName("deleted_at"); - b.Property("PublisherId") - .HasColumnType("bigint") + b.Property("PublisherId") + .HasColumnType("uuid") .HasColumnName("publisher_id"); b.Property("Status") @@ -1750,15 +1731,13 @@ namespace DysonNetwork.Sphere.Migrations modelBuilder.Entity("DysonNetwork.Sphere.Realm.Realm", b => { - b.Property("Id") + b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("bigint") + .HasColumnType("uuid") .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AccountId") - .HasColumnType("bigint") + b.Property("AccountId") + .HasColumnType("uuid") .HasColumnName("account_id"); b.Property("BackgroundId") @@ -1837,12 +1816,12 @@ namespace DysonNetwork.Sphere.Migrations modelBuilder.Entity("DysonNetwork.Sphere.Realm.RealmMember", b => { - b.Property("RealmId") - .HasColumnType("bigint") + b.Property("RealmId") + .HasColumnType("uuid") .HasColumnName("realm_id"); - b.Property("AccountId") - .HasColumnType("bigint") + b.Property("AccountId") + .HasColumnType("uuid") .HasColumnName("account_id"); b.Property("CreatedAt") @@ -1953,8 +1932,8 @@ namespace DysonNetwork.Sphere.Migrations .HasColumnType("character varying(128)") .HasColumnName("prefix"); - b.Property("PublisherId") - .HasColumnType("bigint") + b.Property("PublisherId") + .HasColumnType("uuid") .HasColumnName("publisher_id"); b.Property("UpdatedAt") @@ -1977,8 +1956,8 @@ namespace DysonNetwork.Sphere.Migrations .HasColumnType("character varying(128)") .HasColumnName("id"); - b.Property("AccountId") - .HasColumnType("bigint") + b.Property("AccountId") + .HasColumnType("uuid") .HasColumnName("account_id"); b.Property("CreatedAt") @@ -2026,8 +2005,8 @@ namespace DysonNetwork.Sphere.Migrations .HasColumnType("character varying(1024)") .HasColumnName("name"); - b.Property("PostId") - .HasColumnType("bigint") + b.Property("PostId") + .HasColumnType("uuid") .HasColumnName("post_id"); b.Property("Size") @@ -2072,12 +2051,12 @@ namespace DysonNetwork.Sphere.Migrations modelBuilder.Entity("PostPostCategory", b => { - b.Property("CategoriesId") - .HasColumnType("bigint") + b.Property("CategoriesId") + .HasColumnType("uuid") .HasColumnName("categories_id"); - b.Property("PostsId") - .HasColumnType("bigint") + b.Property("PostsId") + .HasColumnType("uuid") .HasColumnName("posts_id"); b.HasKey("CategoriesId", "PostsId") @@ -2091,12 +2070,12 @@ namespace DysonNetwork.Sphere.Migrations modelBuilder.Entity("PostPostCollection", b => { - b.Property("CollectionsId") - .HasColumnType("bigint") + b.Property("CollectionsId") + .HasColumnType("uuid") .HasColumnName("collections_id"); - b.Property("PostsId") - .HasColumnType("bigint") + b.Property("PostsId") + .HasColumnType("uuid") .HasColumnName("posts_id"); b.HasKey("CollectionsId", "PostsId") @@ -2110,12 +2089,12 @@ namespace DysonNetwork.Sphere.Migrations modelBuilder.Entity("PostPostTag", b => { - b.Property("PostsId") - .HasColumnType("bigint") + b.Property("PostsId") + .HasColumnType("uuid") .HasColumnName("posts_id"); - b.Property("TagsId") - .HasColumnType("bigint") + b.Property("TagsId") + .HasColumnType("uuid") .HasColumnName("tags_id"); b.HasKey("PostsId", "TagsId") diff --git a/DysonNetwork.Sphere/Post/Post.cs b/DysonNetwork.Sphere/Post/Post.cs index 289aaf7..e07c105 100644 --- a/DysonNetwork.Sphere/Post/Post.cs +++ b/DysonNetwork.Sphere/Post/Post.cs @@ -25,7 +25,7 @@ public enum PostVisibility public class Post : ModelBase { - public long Id { get; set; } + public Guid Id { get; set; } [MaxLength(1024)] public string? Title { get; set; } [MaxLength(4096)] public string? Description { get; set; } [MaxLength(128)] public string? Language { get; set; } @@ -45,11 +45,11 @@ public class Post : ModelBase public int Downvotes { get; set; } [NotMapped] public Dictionary ReactionsCount { get; set; } = new(); - public long? ThreadedPostId { get; set; } + public Guid? ThreadedPostId { get; set; } public Post? ThreadedPost { get; set; } - public long? RepliedPostId { get; set; } + public Guid? RepliedPostId { get; set; } public Post? RepliedPost { get; set; } - public long? ForwardedPostId { get; set; } + public Guid? ForwardedPostId { get; set; } public Post? ForwardedPost { get; set; } public ICollection Attachments { get; set; } = new List(); @@ -67,7 +67,7 @@ public class Post : ModelBase public class PostTag : ModelBase { - public long Id { get; set; } + public Guid Id { get; set; } [MaxLength(128)] public string Slug { get; set; } = null!; [MaxLength(256)] public string? Name { get; set; } public ICollection Posts { get; set; } = new List(); @@ -75,7 +75,7 @@ public class PostTag : ModelBase public class PostCategory : ModelBase { - public long Id { get; set; } + public Guid Id { get; set; } [MaxLength(128)] public string Slug { get; set; } = null!; [MaxLength(256)] public string? Name { get; set; } public ICollection Posts { get; set; } = new List(); @@ -83,7 +83,7 @@ public class PostCategory : ModelBase public class PostCollection : ModelBase { - public long Id { get; set; } + public Guid Id { get; set; } [MaxLength(128)] public string Slug { get; set; } = null!; [MaxLength(256)] public string? Name { get; set; } [MaxLength(4096)] public string? Description { get; set; } @@ -102,12 +102,12 @@ public enum PostReactionAttitude public class PostReaction : ModelBase { - public long Id { get; set; } + public Guid Id { get; set; } [MaxLength(256)] public string Symbol { get; set; } = null!; public PostReactionAttitude Attitude { get; set; } - public long PostId { get; set; } + public Guid PostId { get; set; } [JsonIgnore] public Post Post { get; set; } = null!; - public long AccountId { get; set; } + public Guid AccountId { get; set; } public Account.Account Account { get; set; } = null!; -} +} \ No newline at end of file diff --git a/DysonNetwork.Sphere/Post/PostController.cs b/DysonNetwork.Sphere/Post/PostController.cs index d1232d1..849f2b0 100644 --- a/DysonNetwork.Sphere/Post/PostController.cs +++ b/DysonNetwork.Sphere/Post/PostController.cs @@ -58,8 +58,8 @@ public class PostController(AppDatabase db, PostService ps, RelationshipService return Ok(posts); } - [HttpGet("{id:long}")] - public async Task> GetPost(long id) + [HttpGet("{id:guid}")] + public async Task> GetPost(Guid id) { HttpContext.Items.TryGetValue("CurrentUser", out var currentUserValue); var currentUser = currentUserValue as Account.Account; @@ -83,8 +83,8 @@ public class PostController(AppDatabase db, PostService ps, RelationshipService return Ok(post); } - [HttpGet("{id:long}/replies")] - public async Task>> ListReplies(long id, [FromQuery] int offset = 0, + [HttpGet("{id:guid}/replies")] + public async Task>> ListReplies(Guid id, [FromQuery] int offset = 0, [FromQuery] int take = 20) { HttpContext.Items.TryGetValue("CurrentUser", out var currentUserValue); @@ -137,8 +137,8 @@ public class PostController(AppDatabase db, PostService ps, RelationshipService [MaxLength(32)] public List? Attachments { get; set; } public Dictionary? Meta { get; set; } public Instant? PublishedAt { get; set; } - public long? RepliedPostId { get; set; } - public long? ForwardedPostId { get; set; } + public Guid? RepliedPostId { get; set; } + public Guid? ForwardedPostId { get; set; } } [HttpPost] @@ -230,10 +230,10 @@ public class PostController(AppDatabase db, PostService ps, RelationshipService public PostReactionAttitude Attitude { get; set; } } - [HttpPost("{id:long}/reactions")] + [HttpPost("{id:guid}/reactions")] [Authorize] [RequiredPermission("global", "posts.react")] - public async Task> ReactPost(long id, [FromBody] PostReactionRequest request) + public async Task> ReactPost(Guid id, [FromBody] PostReactionRequest request) { HttpContext.Items.TryGetValue("CurrentUser", out var currentUserValue); if (currentUserValue is not Account.Account currentUser) return Unauthorized(); @@ -265,8 +265,8 @@ public class PostController(AppDatabase db, PostService ps, RelationshipService return Ok(reaction); } - [HttpPatch("{id:long}")] - public async Task> UpdatePost(long id, [FromBody] PostRequest request) + [HttpPatch("{id:guid}")] + public async Task> UpdatePost(Guid id, [FromBody] PostRequest request) { 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); } - [HttpDelete("{id:long}")] - public async Task> DeletePost(long id) + [HttpDelete("{id:guid}")] + public async Task> DeletePost(Guid id) { if (HttpContext.Items["CurrentUser"] is not Account.Account currentUser) return Unauthorized(); diff --git a/DysonNetwork.Sphere/Post/PostService.cs b/DysonNetwork.Sphere/Post/PostService.cs index 32c5ec6..942bb61 100644 --- a/DysonNetwork.Sphere/Post/PostService.cs +++ b/DysonNetwork.Sphere/Post/PostService.cs @@ -215,7 +215,7 @@ public class PostService(AppDatabase db, FileService fs, ActivityService act) return isRemoving; } - public async Task> GetPostReactionMap(long postId) + public async Task> GetPostReactionMap(Guid postId) { return await db.Set() .Where(r => r.PostId == postId) @@ -226,7 +226,7 @@ public class PostService(AppDatabase db, FileService fs, ActivityService act) ); } - public async Task>> GetPostReactionMapBatch(List postIds) + public async Task>> GetPostReactionMapBatch(List postIds) { return await db.Set() .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 IQueryable FilterWithVisibility(this IQueryable source, Account.Account? currentUser, - List userFriends, bool isListing = false) + List userFriends, bool isListing = false) { var now = Instant.FromDateTimeUtc(DateTime.UtcNow); diff --git a/DysonNetwork.Sphere/Post/Publisher.cs b/DysonNetwork.Sphere/Post/Publisher.cs index 8aa71f7..9d06e68 100644 --- a/DysonNetwork.Sphere/Post/Publisher.cs +++ b/DysonNetwork.Sphere/Post/Publisher.cs @@ -16,7 +16,7 @@ public enum PublisherType [Index(nameof(Name), IsUnique = true)] public class Publisher : ModelBase { - public long Id { get; set; } + public Guid Id { get; set; } public PublisherType PublisherType { get; set; } [MaxLength(256)] public string Name { get; set; } = string.Empty; [MaxLength(256)] public string Nick { get; set; } = string.Empty; @@ -34,9 +34,9 @@ public class Publisher : ModelBase [JsonIgnore] public ICollection Subscriptions { get; set; } = new List(); - public long? AccountId { get; set; } + public Guid? AccountId { 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; } } @@ -50,9 +50,9 @@ public enum PublisherMemberRole public class PublisherMember : ModelBase { - public long PublisherId { get; set; } + public Guid PublisherId { get; set; } [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!; public PublisherMemberRole Role { get; set; } = PublisherMemberRole.Viewer; @@ -70,9 +70,9 @@ public class PublisherSubscription : ModelBase { public Guid Id { get; set; } - public long PublisherId { get; set; } + public Guid PublisherId { get; set; } [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!; public SubscriptionStatus Status { get; set; } = SubscriptionStatus.Active; diff --git a/DysonNetwork.Sphere/Post/PublisherSubscriptionController.cs b/DysonNetwork.Sphere/Post/PublisherSubscriptionController.cs index 211d7f6..ef74d29 100644 --- a/DysonNetwork.Sphere/Post/PublisherSubscriptionController.cs +++ b/DysonNetwork.Sphere/Post/PublisherSubscriptionController.cs @@ -16,7 +16,7 @@ public class PublisherSubscriptionController( public class SubscriptionStatusResponse { public bool IsSubscribed { get; set; } - public long PublisherId { get; set; } + public Guid PublisherId { get; set; } public string PublisherName { get; set; } = string.Empty; } diff --git a/DysonNetwork.Sphere/Post/PublisherSubscriptionService.cs b/DysonNetwork.Sphere/Post/PublisherSubscriptionService.cs index f68b131..6fd9155 100644 --- a/DysonNetwork.Sphere/Post/PublisherSubscriptionService.cs +++ b/DysonNetwork.Sphere/Post/PublisherSubscriptionService.cs @@ -12,7 +12,7 @@ public class PublisherSubscriptionService(AppDatabase db, NotificationService nt /// The account ID /// The publisher ID /// True if a subscription exists, false otherwise - public async Task SubscriptionExistsAsync(long accountId, long publisherId) + public async Task SubscriptionExistsAsync(Guid accountId, Guid publisherId) { return await db.PublisherSubscriptions .AnyAsync(ps => ps.AccountId == accountId && @@ -26,7 +26,7 @@ public class PublisherSubscriptionService(AppDatabase db, NotificationService nt /// The account ID /// The publisher ID /// The subscription or null if not found - public async Task GetSubscriptionAsync(long accountId, long publisherId) + public async Task GetSubscriptionAsync(Guid accountId, Guid publisherId) { return await db.PublisherSubscriptions .Include(ps => ps.Publisher) @@ -95,7 +95,7 @@ public class PublisherSubscriptionService(AppDatabase db, NotificationService nt /// /// The account ID /// A list of active subscriptions - public async Task> GetAccountSubscriptionsAsync(long accountId) + public async Task> GetAccountSubscriptionsAsync(Guid accountId) { return await db.PublisherSubscriptions .Include(ps => ps.Publisher) @@ -108,7 +108,7 @@ public class PublisherSubscriptionService(AppDatabase db, NotificationService nt /// /// The publisher ID /// A list of active subscriptions - public async Task> GetPublisherSubscribersAsync(long publisherId) + public async Task> GetPublisherSubscribersAsync(Guid publisherId) { return await db.PublisherSubscriptions .Include(ps => ps.Account) @@ -124,8 +124,8 @@ public class PublisherSubscriptionService(AppDatabase db, NotificationService nt /// Optional subscription tier /// The created subscription public async Task CreateSubscriptionAsync( - long accountId, - long publisherId, + Guid accountId, + Guid publisherId, int tier = 0 ) { @@ -166,7 +166,7 @@ public class PublisherSubscriptionService(AppDatabase db, NotificationService nt /// The account ID /// The publisher ID /// True if the subscription was cancelled, false if it wasn't found - public async Task CancelSubscriptionAsync(long accountId, long publisherId) + public async Task CancelSubscriptionAsync(Guid accountId, Guid publisherId) { var subscription = await GetSubscriptionAsync(accountId, publisherId); if (subscription is not { Status: SubscriptionStatus.Active }) diff --git a/DysonNetwork.Sphere/Realm/Realm.cs b/DysonNetwork.Sphere/Realm/Realm.cs index a6bbf1e..d06a788 100644 --- a/DysonNetwork.Sphere/Realm/Realm.cs +++ b/DysonNetwork.Sphere/Realm/Realm.cs @@ -10,7 +10,7 @@ namespace DysonNetwork.Sphere.Realm; [Index(nameof(Slug), IsUnique = true)] 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 Name { get; set; } = string.Empty; [MaxLength(4096)] public string Description { get; set; } = string.Empty; @@ -27,7 +27,7 @@ public class Realm : ModelBase [JsonIgnore] public ICollection Members { get; set; } = new List(); [JsonIgnore] public ICollection ChatRooms { get; set; } = new List(); - public long AccountId { get; set; } + public Guid AccountId { get; set; } [JsonIgnore] public Account.Account Account { get; set; } = null!; } @@ -40,9 +40,9 @@ public enum RealmMemberRole public class RealmMember : ModelBase { - public long RealmId { get; set; } + public Guid RealmId { get; set; } public Realm Realm { get; set; } = null!; - public long AccountId { get; set; } + public Guid AccountId { get; set; } public Account.Account Account { get; set; } = null!; public RealmMemberRole Role { get; set; } = RealmMemberRole.Normal; diff --git a/DysonNetwork.Sphere/Realm/RealmController.cs b/DysonNetwork.Sphere/Realm/RealmController.cs index 1766ca2..c0cfdb2 100644 --- a/DysonNetwork.Sphere/Realm/RealmController.cs +++ b/DysonNetwork.Sphere/Realm/RealmController.cs @@ -58,7 +58,7 @@ public class RealmController(AppDatabase db, RealmService rs, FileService fs) : public class RealmMemberRequest { - [Required] public long RelatedUserId { get; set; } + [Required] public Guid RelatedUserId { get; set; } [Required] public RealmMemberRole Role { get; set; } } diff --git a/DysonNetwork.Sphere/Sticker/Sticker.cs b/DysonNetwork.Sphere/Sticker/Sticker.cs index 2792808..54cbad7 100644 --- a/DysonNetwork.Sphere/Sticker/Sticker.cs +++ b/DysonNetwork.Sphere/Sticker/Sticker.cs @@ -22,7 +22,7 @@ public class StickerPack : ModelBase [MaxLength(4096)] public string Description { get; set; } = string.Empty; [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!; } diff --git a/DysonNetwork.Sphere/Storage/CloudFile.cs b/DysonNetwork.Sphere/Storage/CloudFile.cs index a01c8ba..dec7787 100644 --- a/DysonNetwork.Sphere/Storage/CloudFile.cs +++ b/DysonNetwork.Sphere/Storage/CloudFile.cs @@ -41,7 +41,7 @@ public class CloudFile : ModelBase public int UsedCount { get; set; } = 0; [JsonIgnore] public Account.Account Account { get; set; } = null!; - public long AccountId { get; set; } + public Guid AccountId { get; set; } } public enum CloudFileSensitiveMark diff --git a/DysonNetwork.Sphere/Storage/FileService.cs b/DysonNetwork.Sphere/Storage/FileService.cs index b51a7b5..a958609 100644 --- a/DysonNetwork.Sphere/Storage/FileService.cs +++ b/DysonNetwork.Sphere/Storage/FileService.cs @@ -55,7 +55,7 @@ public class FileService( case "image": stream.Position = 0; // We still need ImageSharp for blurhash calculation - using (var imageSharp = await SixLabors.ImageSharp.Image.LoadAsync(stream)) + using (var imageSharp = await Image.LoadAsync(stream)) { var blurhash = Blurhasher.Encode(imageSharp, 3, 3);