server ban update, remove reporting
This commit is contained in:
32
Docker/build/Dockerfile-MareSynchronosAuthService
Normal file
32
Docker/build/Dockerfile-MareSynchronosAuthService
Normal file
@@ -0,0 +1,32 @@
|
|||||||
|
FROM mcr.microsoft.com/dotnet/sdk:8.0 as BUILD
|
||||||
|
|
||||||
|
COPY MareAPI /server/MareAPI
|
||||||
|
COPY MareSynchronosServer/MareSynchronosShared /server/MareSynchronosServer/MareSynchronosShared
|
||||||
|
COPY MareSynchronosServer/MareSynchronosAuthService /server/MareSynchronosServer/MareSynchronosAuthService
|
||||||
|
|
||||||
|
WORKDIR /server/MareSynchronosServer/MareSynchronosAuthService/
|
||||||
|
|
||||||
|
RUN dotnet publish \
|
||||||
|
--configuration=Debug \
|
||||||
|
--os=linux \
|
||||||
|
--output=/build \
|
||||||
|
MareSynchronosAuthService.csproj
|
||||||
|
|
||||||
|
FROM mcr.microsoft.com/dotnet/aspnet:8.0
|
||||||
|
|
||||||
|
RUN adduser \
|
||||||
|
--disabled-password \
|
||||||
|
--group \
|
||||||
|
--no-create-home \
|
||||||
|
--quiet \
|
||||||
|
--system \
|
||||||
|
mare
|
||||||
|
|
||||||
|
COPY --from=BUILD /build /opt/MareSynchronosAuthService
|
||||||
|
RUN chown -R mare:mare /opt/MareSynchronosAuthService
|
||||||
|
RUN apt-get update; apt-get install curl -y
|
||||||
|
|
||||||
|
USER mare:mare
|
||||||
|
WORKDIR /opt/MareSynchronosAuthService
|
||||||
|
|
||||||
|
CMD ["./MareSynchronosAuthService"]
|
||||||
30
Docker/build/Dockerfile-MareSynchronosAuthService-git
Normal file
30
Docker/build/Dockerfile-MareSynchronosAuthService-git
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
FROM mcr.microsoft.com/dotnet/sdk:8.0 as BUILD
|
||||||
|
|
||||||
|
RUN git clone --recurse-submodules https://github.com/Penumbra-Sync/server
|
||||||
|
|
||||||
|
WORKDIR /server/MareSynchronosServer/MareSynchronosAuthService/
|
||||||
|
|
||||||
|
RUN dotnet publish \
|
||||||
|
--configuration=Release \
|
||||||
|
--os=linux \
|
||||||
|
--output=/MareSynchronosAuthService \
|
||||||
|
MareSynchronosAuthService.csproj
|
||||||
|
|
||||||
|
FROM mcr.microsoft.com/dotnet/aspnet:8.0
|
||||||
|
|
||||||
|
RUN adduser \
|
||||||
|
--disabled-password \
|
||||||
|
--group \
|
||||||
|
--no-create-home \
|
||||||
|
--quiet \
|
||||||
|
--system \
|
||||||
|
mare
|
||||||
|
|
||||||
|
COPY --from=BUILD /MareSynchronosAuthService /opt/MareSynchronosAuthService
|
||||||
|
RUN chown -R mare:mare /opt/MareSynchronosAuthService
|
||||||
|
RUN apt-get update; apt-get install curl -y
|
||||||
|
|
||||||
|
USER mare:mare
|
||||||
|
WORKDIR /opt/MareSynchronosAuthService
|
||||||
|
|
||||||
|
CMD ["./MareSynchronosAuthService"]
|
||||||
2
Docker/build/linux-git/docker-build-authservice.sh
Normal file
2
Docker/build/linux-git/docker-build-authservice.sh
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
docker build -t darkarchon/mare-synchronos-authservice:latest . -f ../Dockerfile-MareSynchronosAuthService-git --no-cache --pull --force-rm
|
||||||
@@ -1,4 +1,5 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
./docker-build-server.sh
|
./docker-build-server.sh
|
||||||
|
./docker-build-authservice.sh
|
||||||
./docker-build-services.sh
|
./docker-build-services.sh
|
||||||
./docker-build-staticfilesserver.sh
|
./docker-build-staticfilesserver.sh
|
||||||
2
Docker/build/linux-local/docker-build-authservice.sh
Normal file
2
Docker/build/linux-local/docker-build-authservice.sh
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
docker build -t darkarchon/mare-synchronos-authservice:latest . -f ../Dockerfile-MareSynchronosAuthService --no-cache --pull --force-rm
|
||||||
@@ -1,4 +1,5 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
./docker-build-server.sh
|
./docker-build-server.sh
|
||||||
|
./docker-build-authservice.sh
|
||||||
./docker-build-services.sh
|
./docker-build-services.sh
|
||||||
./docker-build-staticfilesserver.sh
|
./docker-build-staticfilesserver.sh
|
||||||
3
Docker/build/windows-git/docker-build-authservice.bat
Normal file
3
Docker/build/windows-git/docker-build-authservice.bat
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
@echo off
|
||||||
|
|
||||||
|
docker build -t darkarchon/mare-synchronos-authservice:latest . -f ..\Dockerfile-MareSynchronosAuthService-git --no-cache --pull --force-rm
|
||||||
@@ -1,5 +1,6 @@
|
|||||||
@echo off
|
@echo off
|
||||||
|
|
||||||
call docker-build-server.bat
|
call docker-build-server.bat
|
||||||
|
call docker-build-authservice.bat
|
||||||
call docker-build-services.bat
|
call docker-build-services.bat
|
||||||
call docker-build-staticfilesserver.bat
|
call docker-build-staticfilesserver.bat
|
||||||
4
Docker/build/windows-local/docker-build-authservice.bat
Normal file
4
Docker/build/windows-local/docker-build-authservice.bat
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
@echo off
|
||||||
|
cd ..\..\..\
|
||||||
|
docker build -t darkarchon/mare-synchronos-authservice:latest . -f Docker\build\Dockerfile-MareSynchronosAuthService --no-cache --pull --force-rm
|
||||||
|
cd Docker\build\windows-local
|
||||||
@@ -1,5 +1,6 @@
|
|||||||
@echo off
|
@echo off
|
||||||
|
|
||||||
call docker-build-server.bat
|
call docker-build-server.bat
|
||||||
|
call docker-build-authservice.bat
|
||||||
call docker-build-services.bat
|
call docker-build-services.bat
|
||||||
call docker-build-staticfilesserver.bat
|
call docker-build-staticfilesserver.bat
|
||||||
@@ -47,6 +47,21 @@ services:
|
|||||||
start_period: 10s
|
start_period: 10s
|
||||||
timeout: 1s
|
timeout: 1s
|
||||||
|
|
||||||
|
mare-auth:
|
||||||
|
image: darkarchon/mare-synchronos-authservice:latest
|
||||||
|
restart: on-failure
|
||||||
|
environment:
|
||||||
|
DOTNET_USE_POLLING_FILE_WATCHER: 1
|
||||||
|
volumes:
|
||||||
|
- ../config/standalone/authservice-standalone.json:/opt/MareSynchronosAuthService/appsettings.json
|
||||||
|
- ../log/authservice-standalone/:/opt/MareSynchronosAuthService/logs/:rw
|
||||||
|
- postgres_socket:/var/run/postgresql/:rw
|
||||||
|
depends_on:
|
||||||
|
mare-server:
|
||||||
|
condition: service_healthy
|
||||||
|
postgres:
|
||||||
|
condition: service_healthy
|
||||||
|
|
||||||
mare-services:
|
mare-services:
|
||||||
image: darkarchon/mare-synchronos-services:latest
|
image: darkarchon/mare-synchronos-services:latest
|
||||||
restart: on-failure
|
restart: on-failure
|
||||||
|
|||||||
42
Docker/run/config/standalone/authservice-standalone.json
Normal file
42
Docker/run/config/standalone/authservice-standalone.json
Normal file
@@ -0,0 +1,42 @@
|
|||||||
|
{
|
||||||
|
"ConnectionStrings": {
|
||||||
|
"DefaultConnection": "Host=/var/run/postgresql;Port=5432;Database=mare;Username=mare;Keepalive=15;Minimum Pool Size=10;Maximum Pool Size=50;No Reset On Close=true;Max Auto Prepare=50;Enlist=false"
|
||||||
|
},
|
||||||
|
"Logging": {
|
||||||
|
"LogLevel": {
|
||||||
|
"Default": "Warning",
|
||||||
|
"Microsoft": "Warning",
|
||||||
|
"Microsoft.Hosting.Lifetime": "Information",
|
||||||
|
"MareSynchronosServices": "Information",
|
||||||
|
"MareSynchronosShared": "Information",
|
||||||
|
"System.IO": "Information"
|
||||||
|
},
|
||||||
|
"File": {
|
||||||
|
"BasePath": "logs",
|
||||||
|
"FileAccessMode": "KeepOpenAndAutoFlush",
|
||||||
|
"FileEncodingName": "utf-8",
|
||||||
|
"DateFormat": "yyyMMdd",
|
||||||
|
"MaxFileSize": 104857600,
|
||||||
|
"Files": [
|
||||||
|
{
|
||||||
|
"Path": "<date:yyyy>/<date:MM>/<date:dd>/mare-<date:HH>-<counter:0000>.log"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"MareSynchronos": {
|
||||||
|
"DbContextPoolSize": 512,
|
||||||
|
"ShardName": "AuthServices",
|
||||||
|
"MetricsPort": 6150,
|
||||||
|
"Jwt": "teststringteststringteststringteststringteststringteststringteststringteststringteststringteststring",
|
||||||
|
"RedisConnectionString": "redis,password=secretredispassword",
|
||||||
|
"FailedAuthForTempBan": 5,
|
||||||
|
"UseGeoIP": false,
|
||||||
|
"GeoIPDbCityFile": ""
|
||||||
|
},
|
||||||
|
"AllowedHosts": "*",
|
||||||
|
"Kestrel": {
|
||||||
|
},
|
||||||
|
"IpRateLimiting": {},
|
||||||
|
"IPRateLimitPolicies": {}
|
||||||
|
}
|
||||||
@@ -28,7 +28,6 @@
|
|||||||
"DbContextPoolSize": 512,
|
"DbContextPoolSize": 512,
|
||||||
"ShardName": "Files",
|
"ShardName": "Files",
|
||||||
"MetricsPort": 6250,
|
"MetricsPort": 6250,
|
||||||
"FileServerGrpcAddress": "",
|
|
||||||
"ForcedDeletionOfFilesAfterHours": -1,
|
"ForcedDeletionOfFilesAfterHours": -1,
|
||||||
"CacheSizeHardLimitInGiB": -1,
|
"CacheSizeHardLimitInGiB": -1,
|
||||||
"UnusedFileRetentionPeriodInDays": 14,
|
"UnusedFileRetentionPeriodInDays": 14,
|
||||||
@@ -37,7 +36,9 @@
|
|||||||
"MainServerAddress": "http://mare-server:6000/",
|
"MainServerAddress": "http://mare-server:6000/",
|
||||||
"RedisConnectionString": "redis,password=secretredispassword",
|
"RedisConnectionString": "redis,password=secretredispassword",
|
||||||
"MainFileServerAddress": "",
|
"MainFileServerAddress": "",
|
||||||
"Jwt": "teststringteststringteststringteststringteststringteststringteststringteststringteststringteststring"
|
"Jwt": "teststringteststringteststringteststringteststringteststringteststringteststringteststringteststring",
|
||||||
|
"UseColdStorage": false,
|
||||||
|
"IsDistributionNode": true
|
||||||
},
|
},
|
||||||
"AllowedHosts": "*",
|
"AllowedHosts": "*",
|
||||||
"Kestrel": {
|
"Kestrel": {
|
||||||
|
|||||||
2
MareAPI
2
MareAPI
Submodule MareAPI updated: 72ba13de29...4a0ee24688
@@ -1,3 +1,3 @@
|
|||||||
namespace MareSynchronosAuthService.Authentication;
|
namespace MareSynchronosAuthService.Authentication;
|
||||||
|
|
||||||
public record SecretKeyAuthReply(bool Success, string Uid, string PrimaryUid, string Alias, bool TempBan, bool Permaban);
|
public record SecretKeyAuthReply(bool Success, string? Uid, string? PrimaryUid, string? Alias, bool TempBan, bool Permaban, bool MarkedForBan);
|
||||||
|
|||||||
@@ -62,16 +62,17 @@ public class JwtController : Controller
|
|||||||
var ident = HttpContext.User.Claims.Single(p => string.Equals(p.Type, MareClaimTypes.CharaIdent, StringComparison.Ordinal))!.Value;
|
var ident = HttpContext.User.Claims.Single(p => string.Equals(p.Type, MareClaimTypes.CharaIdent, StringComparison.Ordinal))!.Value;
|
||||||
var alias = HttpContext.User.Claims.SingleOrDefault(p => string.Equals(p.Type, MareClaimTypes.Alias))?.Value ?? string.Empty;
|
var alias = HttpContext.User.Claims.SingleOrDefault(p => string.Equals(p.Type, MareClaimTypes.Alias))?.Value ?? string.Empty;
|
||||||
|
|
||||||
if (await _mareDbContext.Auth.Where(u => u.UserUID == uid || u.PrimaryUserUID == uid).AnyAsync(a => a.IsBanned))
|
if (await _mareDbContext.Auth.Where(u => u.UserUID == uid || u.PrimaryUserUID == uid).AnyAsync(a => a.MarkForBan))
|
||||||
{
|
{
|
||||||
await EnsureBan(uid, ident);
|
var userAuth = await _mareDbContext.Auth.SingleAsync(u => u.UserUID == uid);
|
||||||
|
await EnsureBan(uid, userAuth.PrimaryUserUID, ident);
|
||||||
|
|
||||||
return Unauthorized("You are permanently banned.");
|
return Unauthorized("Your Mare account is banned.");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (await IsIdentBanned(uid, ident))
|
if (await IsIdentBanned(ident))
|
||||||
{
|
{
|
||||||
return Unauthorized("Your character is banned from using the service.");
|
return Unauthorized("Your XIV service account is banned from using the service.");
|
||||||
}
|
}
|
||||||
|
|
||||||
_logger.LogInformation("RenewToken:SUCCESS:{id}:{ident}", uid, ident);
|
_logger.LogInformation("RenewToken:SUCCESS:{id}:{ident}", uid, ident);
|
||||||
@@ -95,10 +96,10 @@ public class JwtController : Controller
|
|||||||
|
|
||||||
var authResult = await _secretKeyAuthenticatorService.AuthorizeAsync(ip, auth);
|
var authResult = await _secretKeyAuthenticatorService.AuthorizeAsync(ip, auth);
|
||||||
|
|
||||||
if (await IsIdentBanned(authResult.Uid, charaIdent))
|
if (await IsIdentBanned(charaIdent))
|
||||||
{
|
{
|
||||||
_logger.LogWarning("Authenticate:IDENTBAN:{id}:{ident}", authResult.Uid, charaIdent);
|
_logger.LogWarning("Authenticate:IDENTBAN:{id}:{ident}", authResult.Uid, charaIdent);
|
||||||
return Unauthorized("Your character is banned from using the service.");
|
return Unauthorized("Your XIV service account is banned from using the service.");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!authResult.Success && !authResult.TempBan)
|
if (!authResult.Success && !authResult.TempBan)
|
||||||
@@ -111,23 +112,28 @@ public class JwtController : Controller
|
|||||||
_logger.LogWarning("Authenticate:TEMPBAN:{id}:{ident}", authResult.Uid ?? "NOUID", charaIdent);
|
_logger.LogWarning("Authenticate:TEMPBAN:{id}:{ident}", authResult.Uid ?? "NOUID", charaIdent);
|
||||||
return Unauthorized("Due to an excessive amount of failed authentication attempts you are temporarily banned. Check your Secret Key configuration and try connecting again in 5 minutes.");
|
return Unauthorized("Due to an excessive amount of failed authentication attempts you are temporarily banned. Check your Secret Key configuration and try connecting again in 5 minutes.");
|
||||||
}
|
}
|
||||||
if (authResult.Permaban)
|
|
||||||
|
if (authResult.Permaban || authResult.MarkedForBan)
|
||||||
{
|
{
|
||||||
await EnsureBan(authResult.Uid, charaIdent);
|
if (authResult.MarkedForBan)
|
||||||
|
{
|
||||||
|
_logger.LogWarning("Authenticate:MARKBAN:{id}:{primaryid}:{ident}", authResult.Uid, authResult.PrimaryUid, charaIdent);
|
||||||
|
await EnsureBan(authResult.Uid!, authResult.PrimaryUid, charaIdent);
|
||||||
|
}
|
||||||
|
|
||||||
_logger.LogWarning("Authenticate:UIDBAN:{id}:{ident}", authResult.Uid, charaIdent);
|
_logger.LogWarning("Authenticate:UIDBAN:{id}:{ident}", authResult.Uid, charaIdent);
|
||||||
return Unauthorized("You are permanently banned.");
|
return Unauthorized("Your Mare account is banned.");
|
||||||
}
|
}
|
||||||
|
|
||||||
var existingIdent = await _redis.GetAsync<string>("UID:" + authResult.Uid);
|
var existingIdent = await _redis.GetAsync<string>("UID:" + authResult.Uid);
|
||||||
if (!string.IsNullOrEmpty(existingIdent))
|
if (!string.IsNullOrEmpty(existingIdent))
|
||||||
{
|
{
|
||||||
_logger.LogWarning("Authenticate:DUPLICATE:{id}:{ident}", authResult.Uid, charaIdent);
|
_logger.LogWarning("Authenticate:DUPLICATE:{id}:{ident}", authResult.Uid, charaIdent);
|
||||||
return Unauthorized("Already logged in to this account. Reconnect in 60 seconds. If you keep seeing this issue, restart your game.");
|
return Unauthorized("Already logged in to this XIV service account. Reconnect in 60 seconds. If you keep seeing this issue, restart your game.");
|
||||||
}
|
}
|
||||||
|
|
||||||
_logger.LogInformation("Authenticate:SUCCESS:{id}:{ident}", authResult.Uid, charaIdent);
|
_logger.LogInformation("Authenticate:SUCCESS:{id}:{ident}", authResult.Uid, charaIdent);
|
||||||
return await CreateJwtFromId(authResult.Uid, charaIdent, authResult.Alias ?? string.Empty);
|
return await CreateJwtFromId(authResult.Uid!, charaIdent, authResult.Alias ?? string.Empty);
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
@@ -165,7 +171,7 @@ public class JwtController : Controller
|
|||||||
return Content(token.RawData);
|
return Content(token.RawData);
|
||||||
}
|
}
|
||||||
|
|
||||||
private async Task EnsureBan(string uid, string charaIdent)
|
private async Task EnsureBan(string uid, string? primaryUid, string charaIdent)
|
||||||
{
|
{
|
||||||
if (!_mareDbContext.BannedUsers.Any(c => c.CharacterIdentification == charaIdent))
|
if (!_mareDbContext.BannedUsers.Any(c => c.CharacterIdentification == charaIdent))
|
||||||
{
|
{
|
||||||
@@ -174,15 +180,15 @@ public class JwtController : Controller
|
|||||||
CharacterIdentification = charaIdent,
|
CharacterIdentification = charaIdent,
|
||||||
Reason = "Autobanned CharacterIdent (" + uid + ")",
|
Reason = "Autobanned CharacterIdent (" + uid + ")",
|
||||||
});
|
});
|
||||||
|
|
||||||
await _mareDbContext.SaveChangesAsync();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
var primaryUser = await _mareDbContext.Auth.Include(a => a.User).FirstOrDefaultAsync(f => f.PrimaryUserUID == uid);
|
var uidToLookFor = primaryUid ?? uid;
|
||||||
|
|
||||||
var toBanUid = primaryUser == null ? uid : primaryUser.UserUID;
|
var primaryUserAuth = await _mareDbContext.Auth.FirstAsync(f => f.UserUID == uidToLookFor);
|
||||||
|
primaryUserAuth.MarkForBan = false;
|
||||||
|
primaryUserAuth.IsBanned = true;
|
||||||
|
|
||||||
var lodestone = await _mareDbContext.LodeStoneAuth.Include(a => a.User).FirstOrDefaultAsync(c => c.User.UID == toBanUid);
|
var lodestone = await _mareDbContext.LodeStoneAuth.Include(a => a.User).FirstOrDefaultAsync(c => c.User.UID == uidToLookFor);
|
||||||
|
|
||||||
if (lodestone != null)
|
if (lodestone != null)
|
||||||
{
|
{
|
||||||
@@ -200,24 +206,13 @@ public class JwtController : Controller
|
|||||||
DiscordIdOrLodestoneAuth = lodestone.DiscordId.ToString(),
|
DiscordIdOrLodestoneAuth = lodestone.DiscordId.ToString(),
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
await _mareDbContext.SaveChangesAsync();
|
await _mareDbContext.SaveChangesAsync();
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
private async Task<bool> IsIdentBanned(string uid, string charaIdent)
|
private async Task<bool> IsIdentBanned(string charaIdent)
|
||||||
{
|
{
|
||||||
var isBanned = await _mareDbContext.BannedUsers.AsNoTracking().AnyAsync(u => u.CharacterIdentification == charaIdent).ConfigureAwait(false);
|
return await _mareDbContext.BannedUsers.AsNoTracking().AnyAsync(u => u.CharacterIdentification == charaIdent).ConfigureAwait(false);
|
||||||
if (isBanned)
|
|
||||||
{
|
|
||||||
var authToBan = _mareDbContext.Auth.SingleOrDefault(a => a.UserUID == uid);
|
|
||||||
if (authToBan != null)
|
|
||||||
{
|
|
||||||
authToBan.IsBanned = true;
|
|
||||||
await _mareDbContext.SaveChangesAsync().ConfigureAwait(false);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return isBanned;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -45,23 +45,26 @@ public class SecretKeyAuthenticatorService
|
|||||||
_failedAuthorizations.Remove(ip, out _);
|
_failedAuthorizations.Remove(ip, out _);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
return new(Success: false, Uid: null, PrimaryUid: null, Alias: null, TempBan: true, Permaban: false);
|
return new(Success: false, Uid: null, PrimaryUid: null, Alias: null, TempBan: true, Permaban: false, MarkedForBan: false);
|
||||||
}
|
}
|
||||||
|
|
||||||
using var context = await _dbContextFactory.CreateDbContextAsync().ConfigureAwait(false);
|
using var context = await _dbContextFactory.CreateDbContextAsync().ConfigureAwait(false);
|
||||||
var authReply = await context.Auth.Include(a => a.User).AsNoTracking()
|
var authReply = await context.Auth.Include(a => a.User).AsNoTracking()
|
||||||
.SingleOrDefaultAsync(u => u.HashedKey == hashedSecretKey).ConfigureAwait(false);
|
.SingleOrDefaultAsync(u => u.HashedKey == hashedSecretKey).ConfigureAwait(false);
|
||||||
var isBanned = authReply?.IsBanned ?? false;
|
var isBanned = authReply?.IsBanned ?? false;
|
||||||
|
var markedForBan = authReply?.MarkForBan ?? false;
|
||||||
var primaryUid = authReply?.PrimaryUserUID ?? authReply?.UserUID;
|
var primaryUid = authReply?.PrimaryUserUID ?? authReply?.UserUID;
|
||||||
|
|
||||||
if (authReply?.PrimaryUserUID != null)
|
if (authReply?.PrimaryUserUID != null)
|
||||||
{
|
{
|
||||||
var primaryUser = await context.Auth.AsNoTracking().SingleOrDefaultAsync(u => u.UserUID == authReply.PrimaryUserUID).ConfigureAwait(false);
|
var primaryUser = await context.Auth.AsNoTracking().SingleAsync(u => u.UserUID == authReply.PrimaryUserUID).ConfigureAwait(false);
|
||||||
isBanned = isBanned || primaryUser.IsBanned;
|
isBanned = isBanned || primaryUser.IsBanned;
|
||||||
|
markedForBan = markedForBan || primaryUser.MarkForBan;
|
||||||
}
|
}
|
||||||
|
|
||||||
SecretKeyAuthReply reply = new(authReply != null, authReply?.UserUID,
|
SecretKeyAuthReply reply = new(authReply != null, authReply?.UserUID,
|
||||||
authReply?.PrimaryUserUID ?? authReply?.UserUID, authReply?.User?.Alias ?? string.Empty, TempBan: false, isBanned);
|
authReply?.PrimaryUserUID ?? authReply?.UserUID, authReply?.User?.Alias ?? string.Empty,
|
||||||
|
TempBan: false, isBanned, markedForBan);
|
||||||
|
|
||||||
if (reply.Success)
|
if (reply.Success)
|
||||||
{
|
{
|
||||||
@@ -94,6 +97,6 @@ public class SecretKeyAuthenticatorService
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return new(Success: false, Uid: null, PrimaryUid: null, Alias: null, TempBan: false, Permaban: false);
|
return new(Success: false, Uid: null, PrimaryUid: null, Alias: null, TempBan: false, Permaban: false, MarkedForBan: false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,7 +4,6 @@ using System.Text.RegularExpressions;
|
|||||||
using MareSynchronos.API.Data;
|
using MareSynchronos.API.Data;
|
||||||
using MareSynchronos.API.Data.Enum;
|
using MareSynchronos.API.Data.Enum;
|
||||||
using MareSynchronos.API.Data.Extensions;
|
using MareSynchronos.API.Data.Extensions;
|
||||||
using MareSynchronos.API.Dto;
|
|
||||||
using MareSynchronos.API.Dto.User;
|
using MareSynchronos.API.Dto.User;
|
||||||
using MareSynchronosServer.Utils;
|
using MareSynchronosServer.Utils;
|
||||||
using MareSynchronosShared.Metrics;
|
using MareSynchronosShared.Metrics;
|
||||||
@@ -341,48 +340,6 @@ public partial class MareHub
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
[Authorize(Policy = "Identified")]
|
|
||||||
public async Task UserReportProfile(UserProfileReportDto dto)
|
|
||||||
{
|
|
||||||
_logger.LogCallInfo(MareHubLogger.Args(dto));
|
|
||||||
|
|
||||||
UserProfileDataReport report = await DbContext.UserProfileReports.SingleOrDefaultAsync(u => u.ReportedUserUID == dto.User.UID && u.ReportingUserUID == UserUID).ConfigureAwait(false);
|
|
||||||
if (report != null)
|
|
||||||
{
|
|
||||||
await Clients.Caller.Client_ReceiveServerMessage(MessageSeverity.Error, "You already reported this profile and it's pending validation").ConfigureAwait(false);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
UserProfileData profile = await DbContext.UserProfileData.SingleOrDefaultAsync(u => u.UserUID == dto.User.UID).ConfigureAwait(false);
|
|
||||||
if (profile == null)
|
|
||||||
{
|
|
||||||
await Clients.Caller.Client_ReceiveServerMessage(MessageSeverity.Error, "This user has no profile").ConfigureAwait(false);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
UserProfileDataReport reportToAdd = new()
|
|
||||||
{
|
|
||||||
ReportDate = DateTime.UtcNow,
|
|
||||||
ReportingUserUID = UserUID,
|
|
||||||
ReportReason = dto.ProfileReport,
|
|
||||||
ReportedUserUID = dto.User.UID,
|
|
||||||
};
|
|
||||||
|
|
||||||
profile.FlaggedForReport = true;
|
|
||||||
|
|
||||||
await DbContext.UserProfileReports.AddAsync(reportToAdd).ConfigureAwait(false);
|
|
||||||
|
|
||||||
await DbContext.SaveChangesAsync().ConfigureAwait(false);
|
|
||||||
|
|
||||||
await Clients.User(dto.User.UID).Client_ReceiveServerMessage(MessageSeverity.Warning, "Your Mare profile has been reported and disabled for admin validation").ConfigureAwait(false);
|
|
||||||
|
|
||||||
var allPairedUsers = await GetAllPairedUnpausedUsers(dto.User.UID).ConfigureAwait(false);
|
|
||||||
var pairs = await GetOnlineUsers(allPairedUsers).ConfigureAwait(false);
|
|
||||||
|
|
||||||
await Clients.Users(pairs.Select(p => p.Key)).Client_UserUpdateProfile(new(dto.User)).ConfigureAwait(false);
|
|
||||||
await Clients.Users(dto.User.UID).Client_UserUpdateProfile(new(dto.User)).ConfigureAwait(false);
|
|
||||||
}
|
|
||||||
|
|
||||||
[Authorize(Policy = "Identified")]
|
[Authorize(Policy = "Identified")]
|
||||||
public async Task UserSetProfile(UserProfileDto dto)
|
public async Task UserSetProfile(UserProfileDto dto)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -139,7 +139,7 @@ internal class DiscordBot : IHostedService
|
|||||||
builder.WithColor(Color.DarkGreen);
|
builder.WithColor(Color.DarkGreen);
|
||||||
profile.FlaggedForReport = false;
|
profile.FlaggedForReport = false;
|
||||||
var reportingUser = await dbContext.Auth.SingleAsync(u => u.UserUID == split[2]).ConfigureAwait(false);
|
var reportingUser = await dbContext.Auth.SingleAsync(u => u.UserUID == split[2]).ConfigureAwait(false);
|
||||||
reportingUser.IsBanned = true;
|
reportingUser.MarkForBan = true;
|
||||||
var regReporting = await dbContext.LodeStoneAuth.SingleAsync(u => u.User.UID == reportingUser.UserUID).ConfigureAwait(false);
|
var regReporting = await dbContext.LodeStoneAuth.SingleAsync(u => u.User.UID == reportingUser.UserUID).ConfigureAwait(false);
|
||||||
dbContext.BannedRegistrations.Add(new MareSynchronosShared.Models.BannedRegistrations()
|
dbContext.BannedRegistrations.Add(new MareSynchronosShared.Models.BannedRegistrations()
|
||||||
{
|
{
|
||||||
@@ -170,7 +170,7 @@ internal class DiscordBot : IHostedService
|
|||||||
builder.AddField("Resolution", $"User has been banned by <@{userId}>");
|
builder.AddField("Resolution", $"User has been banned by <@{userId}>");
|
||||||
builder.WithColor(Color.DarkRed);
|
builder.WithColor(Color.DarkRed);
|
||||||
var offendingUser = await dbContext.Auth.SingleAsync(u => u.UserUID == split[1]).ConfigureAwait(false);
|
var offendingUser = await dbContext.Auth.SingleAsync(u => u.UserUID == split[1]).ConfigureAwait(false);
|
||||||
offendingUser.IsBanned = true;
|
offendingUser.MarkForBan = true;
|
||||||
profile.Base64ProfileImage = null;
|
profile.Base64ProfileImage = null;
|
||||||
profile.UserDescription = null;
|
profile.UserDescription = null;
|
||||||
profile.ProfileDisabled = true;
|
profile.ProfileDisabled = true;
|
||||||
@@ -210,7 +210,6 @@ internal class DiscordBot : IHostedService
|
|||||||
await CreateOrUpdateModal(guild).ConfigureAwait(false);
|
await CreateOrUpdateModal(guild).ConfigureAwait(false);
|
||||||
_ = UpdateVanityRoles(guild);
|
_ = UpdateVanityRoles(guild);
|
||||||
_ = RemoveUsersNotInVanityRole();
|
_ = RemoveUsersNotInVanityRole();
|
||||||
_ = ProcessReportsQueue();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private async Task UpdateVanityRoles(RestGuild guild)
|
private async Task UpdateVanityRoles(RestGuild guild)
|
||||||
@@ -319,96 +318,6 @@ internal class DiscordBot : IHostedService
|
|||||||
return Task.CompletedTask;
|
return Task.CompletedTask;
|
||||||
}
|
}
|
||||||
|
|
||||||
private async Task ProcessReportsQueue()
|
|
||||||
{
|
|
||||||
var guild = (await _discordClient.Rest.GetGuildsAsync()).First();
|
|
||||||
|
|
||||||
_processReportQueueCts?.Cancel();
|
|
||||||
_processReportQueueCts?.Dispose();
|
|
||||||
_processReportQueueCts = new();
|
|
||||||
var token = _processReportQueueCts.Token;
|
|
||||||
while (!token.IsCancellationRequested)
|
|
||||||
{
|
|
||||||
await Task.Delay(TimeSpan.FromSeconds(30)).ConfigureAwait(false);
|
|
||||||
|
|
||||||
if (_discordClient.ConnectionState != ConnectionState.Connected) continue;
|
|
||||||
var reportChannelId = _configurationService.GetValue<ulong?>(nameof(ServicesConfiguration.DiscordChannelForReports));
|
|
||||||
if (reportChannelId == null) continue;
|
|
||||||
|
|
||||||
try
|
|
||||||
{
|
|
||||||
using (var scope = _services.CreateScope())
|
|
||||||
{
|
|
||||||
_logger.LogInformation("Checking for Profile Reports");
|
|
||||||
var dbContext = scope.ServiceProvider.GetRequiredService<MareDbContext>();
|
|
||||||
if (!dbContext.UserProfileReports.Any())
|
|
||||||
{
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
var reports = await dbContext.UserProfileReports.ToListAsync().ConfigureAwait(false);
|
|
||||||
var restChannel = await guild.GetTextChannelAsync(reportChannelId.Value).ConfigureAwait(false);
|
|
||||||
|
|
||||||
foreach (var report in reports)
|
|
||||||
{
|
|
||||||
var reportedUser = await dbContext.Users.SingleAsync(u => u.UID == report.ReportedUserUID).ConfigureAwait(false);
|
|
||||||
var reportedUserLodestone = await dbContext.LodeStoneAuth.SingleOrDefaultAsync(u => u.User.UID == report.ReportedUserUID).ConfigureAwait(false);
|
|
||||||
var reportingUser = await dbContext.Users.SingleAsync(u => u.UID == report.ReportingUserUID).ConfigureAwait(false);
|
|
||||||
var reportingUserLodestone = await dbContext.LodeStoneAuth.SingleOrDefaultAsync(u => u.User.UID == report.ReportingUserUID).ConfigureAwait(false);
|
|
||||||
var reportedUserProfile = await dbContext.UserProfileData.SingleAsync(u => u.UserUID == report.ReportedUserUID).ConfigureAwait(false);
|
|
||||||
EmbedBuilder eb = new();
|
|
||||||
eb.WithTitle("Mare Synchronos Profile Report");
|
|
||||||
|
|
||||||
StringBuilder reportedUserSb = new();
|
|
||||||
StringBuilder reportingUserSb = new();
|
|
||||||
reportedUserSb.Append(reportedUser.UID);
|
|
||||||
reportingUserSb.Append(reportingUser.UID);
|
|
||||||
if (reportedUserLodestone != null)
|
|
||||||
{
|
|
||||||
reportedUserSb.AppendLine($" (<@{reportedUserLodestone.DiscordId}>)");
|
|
||||||
}
|
|
||||||
if (reportingUserLodestone != null)
|
|
||||||
{
|
|
||||||
reportingUserSb.AppendLine($" (<@{reportingUserLodestone.DiscordId}>)");
|
|
||||||
}
|
|
||||||
eb.AddField("Reported User", reportedUserSb.ToString());
|
|
||||||
eb.AddField("Reporting User", reportingUserSb.ToString());
|
|
||||||
eb.AddField("Report Date (UTC)", report.ReportDate);
|
|
||||||
eb.AddField("Report Reason", string.IsNullOrWhiteSpace(report.ReportReason) ? "-" : report.ReportReason);
|
|
||||||
eb.AddField("Reported User Profile Description", string.IsNullOrWhiteSpace(reportedUserProfile.UserDescription) ? "-" : reportedUserProfile.UserDescription);
|
|
||||||
eb.AddField("Reported User Profile Is NSFW", reportedUserProfile.IsNSFW);
|
|
||||||
|
|
||||||
var cb = new ComponentBuilder();
|
|
||||||
cb.WithButton("Dismiss Report", customId: $"mare-report-button-dismiss-{reportedUser.UID}", style: ButtonStyle.Primary);
|
|
||||||
cb.WithButton("Ban profile", customId: $"mare-report-button-banprofile-{reportedUser.UID}", style: ButtonStyle.Secondary);
|
|
||||||
cb.WithButton("Ban user", customId: $"mare-report-button-banuser-{reportedUser.UID}", style: ButtonStyle.Danger);
|
|
||||||
cb.WithButton("Dismiss and Ban Reporting user", customId: $"mare-report-button-banreporting-{reportedUser.UID}-{reportingUser.UID}", style: ButtonStyle.Danger);
|
|
||||||
|
|
||||||
if (!string.IsNullOrEmpty(reportedUserProfile.Base64ProfileImage))
|
|
||||||
{
|
|
||||||
var fileName = reportedUser.UID + "_profile_" + Guid.NewGuid().ToString("N") + ".png";
|
|
||||||
eb.WithImageUrl($"attachment://{fileName}");
|
|
||||||
using MemoryStream ms = new(Convert.FromBase64String(reportedUserProfile.Base64ProfileImage));
|
|
||||||
await restChannel.SendFileAsync(ms, fileName, "User Report", embed: eb.Build(), components: cb.Build(), isSpoiler: true).ConfigureAwait(false);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
var msg = await restChannel.SendMessageAsync(embed: eb.Build(), components: cb.Build()).ConfigureAwait(false);
|
|
||||||
}
|
|
||||||
|
|
||||||
dbContext.Remove(report);
|
|
||||||
}
|
|
||||||
|
|
||||||
await dbContext.SaveChangesAsync().ConfigureAwait(false);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
catch (Exception ex)
|
|
||||||
{
|
|
||||||
_logger.LogWarning(ex, "Failed to process reports");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private async Task RemoveUsersNotInVanityRole()
|
private async Task RemoveUsersNotInVanityRole()
|
||||||
{
|
{
|
||||||
_vanityUpdateCts?.Cancel();
|
_vanityUpdateCts?.Cancel();
|
||||||
|
|||||||
@@ -43,7 +43,6 @@ public class MareDbContext : DbContext
|
|||||||
public DbSet<GroupTempInvite> GroupTempInvites { get; set; }
|
public DbSet<GroupTempInvite> GroupTempInvites { get; set; }
|
||||||
public DbSet<LodeStoneAuth> LodeStoneAuth { get; set; }
|
public DbSet<LodeStoneAuth> LodeStoneAuth { get; set; }
|
||||||
public DbSet<UserProfileData> UserProfileData { get; set; }
|
public DbSet<UserProfileData> UserProfileData { get; set; }
|
||||||
public DbSet<UserProfileDataReport> UserProfileReports { get; set; }
|
|
||||||
public DbSet<User> Users { get; set; }
|
public DbSet<User> Users { get; set; }
|
||||||
public DbSet<UserPermissionSet> Permissions { get; set; }
|
public DbSet<UserPermissionSet> Permissions { get; set; }
|
||||||
public DbSet<GroupPairPreferredPermission> GroupPairPreferredPermissions { get; set; }
|
public DbSet<GroupPairPreferredPermission> GroupPairPreferredPermissions { get; set; }
|
||||||
@@ -79,7 +78,6 @@ public class MareDbContext : DbContext
|
|||||||
modelBuilder.Entity<GroupTempInvite>().HasIndex(c => c.Invite);
|
modelBuilder.Entity<GroupTempInvite>().HasIndex(c => c.Invite);
|
||||||
modelBuilder.Entity<UserProfileData>().ToTable("user_profile_data");
|
modelBuilder.Entity<UserProfileData>().ToTable("user_profile_data");
|
||||||
modelBuilder.Entity<UserProfileData>().HasKey(c => c.UserUID);
|
modelBuilder.Entity<UserProfileData>().HasKey(c => c.UserUID);
|
||||||
modelBuilder.Entity<UserProfileDataReport>().ToTable("user_profile_data_reports");
|
|
||||||
modelBuilder.Entity<UserPermissionSet>().ToTable("user_permission_sets");
|
modelBuilder.Entity<UserPermissionSet>().ToTable("user_permission_sets");
|
||||||
modelBuilder.Entity<UserPermissionSet>().HasKey(u => new { u.UserUID, u.OtherUserUID });
|
modelBuilder.Entity<UserPermissionSet>().HasKey(u => new { u.UserUID, u.OtherUserUID });
|
||||||
modelBuilder.Entity<UserPermissionSet>().HasIndex(c => c.UserUID);
|
modelBuilder.Entity<UserPermissionSet>().HasIndex(c => c.UserUID);
|
||||||
|
|||||||
811
MareSynchronosServer/MareSynchronosShared/Migrations/20240718095806_MarkForBan.Designer.cs
generated
Normal file
811
MareSynchronosServer/MareSynchronosShared/Migrations/20240718095806_MarkForBan.Designer.cs
generated
Normal file
@@ -0,0 +1,811 @@
|
|||||||
|
// <auto-generated />
|
||||||
|
using System;
|
||||||
|
using MareSynchronosShared.Data;
|
||||||
|
using Microsoft.EntityFrameworkCore;
|
||||||
|
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||||
|
using Microsoft.EntityFrameworkCore.Migrations;
|
||||||
|
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||||
|
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
|
||||||
|
|
||||||
|
#nullable disable
|
||||||
|
|
||||||
|
namespace MareSynchronosServer.Migrations
|
||||||
|
{
|
||||||
|
[DbContext(typeof(MareDbContext))]
|
||||||
|
[Migration("20240718095806_MarkForBan")]
|
||||||
|
partial class MarkForBan
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
||||||
|
{
|
||||||
|
#pragma warning disable 612, 618
|
||||||
|
modelBuilder
|
||||||
|
.HasAnnotation("ProductVersion", "8.0.4")
|
||||||
|
.HasAnnotation("Relational:MaxIdentifierLength", 63);
|
||||||
|
|
||||||
|
NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
|
||||||
|
|
||||||
|
modelBuilder.Entity("MareSynchronosShared.Models.Auth", b =>
|
||||||
|
{
|
||||||
|
b.Property<string>("HashedKey")
|
||||||
|
.HasMaxLength(64)
|
||||||
|
.HasColumnType("character varying(64)")
|
||||||
|
.HasColumnName("hashed_key");
|
||||||
|
|
||||||
|
b.Property<bool>("IsBanned")
|
||||||
|
.HasColumnType("boolean")
|
||||||
|
.HasColumnName("is_banned");
|
||||||
|
|
||||||
|
b.Property<bool>("MarkForBan")
|
||||||
|
.HasColumnType("boolean")
|
||||||
|
.HasColumnName("mark_for_ban");
|
||||||
|
|
||||||
|
b.Property<string>("PrimaryUserUID")
|
||||||
|
.HasColumnType("character varying(10)")
|
||||||
|
.HasColumnName("primary_user_uid");
|
||||||
|
|
||||||
|
b.Property<string>("UserUID")
|
||||||
|
.HasColumnType("character varying(10)")
|
||||||
|
.HasColumnName("user_uid");
|
||||||
|
|
||||||
|
b.HasKey("HashedKey")
|
||||||
|
.HasName("pk_auth");
|
||||||
|
|
||||||
|
b.HasIndex("PrimaryUserUID")
|
||||||
|
.HasDatabaseName("ix_auth_primary_user_uid");
|
||||||
|
|
||||||
|
b.HasIndex("UserUID")
|
||||||
|
.HasDatabaseName("ix_auth_user_uid");
|
||||||
|
|
||||||
|
b.ToTable("auth", (string)null);
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("MareSynchronosShared.Models.Banned", b =>
|
||||||
|
{
|
||||||
|
b.Property<string>("CharacterIdentification")
|
||||||
|
.HasMaxLength(100)
|
||||||
|
.HasColumnType("character varying(100)")
|
||||||
|
.HasColumnName("character_identification");
|
||||||
|
|
||||||
|
b.Property<string>("Reason")
|
||||||
|
.HasColumnType("text")
|
||||||
|
.HasColumnName("reason");
|
||||||
|
|
||||||
|
b.Property<byte[]>("Timestamp")
|
||||||
|
.IsConcurrencyToken()
|
||||||
|
.ValueGeneratedOnAddOrUpdate()
|
||||||
|
.HasColumnType("bytea")
|
||||||
|
.HasColumnName("timestamp");
|
||||||
|
|
||||||
|
b.HasKey("CharacterIdentification")
|
||||||
|
.HasName("pk_banned_users");
|
||||||
|
|
||||||
|
b.ToTable("banned_users", (string)null);
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("MareSynchronosShared.Models.BannedRegistrations", b =>
|
||||||
|
{
|
||||||
|
b.Property<string>("DiscordIdOrLodestoneAuth")
|
||||||
|
.HasMaxLength(100)
|
||||||
|
.HasColumnType("character varying(100)")
|
||||||
|
.HasColumnName("discord_id_or_lodestone_auth");
|
||||||
|
|
||||||
|
b.HasKey("DiscordIdOrLodestoneAuth")
|
||||||
|
.HasName("pk_banned_registrations");
|
||||||
|
|
||||||
|
b.ToTable("banned_registrations", (string)null);
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("MareSynchronosShared.Models.ClientPair", b =>
|
||||||
|
{
|
||||||
|
b.Property<string>("UserUID")
|
||||||
|
.HasMaxLength(10)
|
||||||
|
.HasColumnType("character varying(10)")
|
||||||
|
.HasColumnName("user_uid");
|
||||||
|
|
||||||
|
b.Property<string>("OtherUserUID")
|
||||||
|
.HasMaxLength(10)
|
||||||
|
.HasColumnType("character varying(10)")
|
||||||
|
.HasColumnName("other_user_uid");
|
||||||
|
|
||||||
|
b.Property<byte[]>("Timestamp")
|
||||||
|
.IsConcurrencyToken()
|
||||||
|
.ValueGeneratedOnAddOrUpdate()
|
||||||
|
.HasColumnType("bytea")
|
||||||
|
.HasColumnName("timestamp");
|
||||||
|
|
||||||
|
b.HasKey("UserUID", "OtherUserUID")
|
||||||
|
.HasName("pk_client_pairs");
|
||||||
|
|
||||||
|
b.HasIndex("OtherUserUID")
|
||||||
|
.HasDatabaseName("ix_client_pairs_other_user_uid");
|
||||||
|
|
||||||
|
b.HasIndex("UserUID")
|
||||||
|
.HasDatabaseName("ix_client_pairs_user_uid");
|
||||||
|
|
||||||
|
b.ToTable("client_pairs", (string)null);
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("MareSynchronosShared.Models.FileCache", b =>
|
||||||
|
{
|
||||||
|
b.Property<string>("Hash")
|
||||||
|
.HasMaxLength(40)
|
||||||
|
.HasColumnType("character varying(40)")
|
||||||
|
.HasColumnName("hash");
|
||||||
|
|
||||||
|
b.Property<long>("Size")
|
||||||
|
.HasColumnType("bigint")
|
||||||
|
.HasColumnName("size");
|
||||||
|
|
||||||
|
b.Property<byte[]>("Timestamp")
|
||||||
|
.IsConcurrencyToken()
|
||||||
|
.ValueGeneratedOnAddOrUpdate()
|
||||||
|
.HasColumnType("bytea")
|
||||||
|
.HasColumnName("timestamp");
|
||||||
|
|
||||||
|
b.Property<DateTime>("UploadDate")
|
||||||
|
.HasColumnType("timestamp with time zone")
|
||||||
|
.HasColumnName("upload_date");
|
||||||
|
|
||||||
|
b.Property<bool>("Uploaded")
|
||||||
|
.HasColumnType("boolean")
|
||||||
|
.HasColumnName("uploaded");
|
||||||
|
|
||||||
|
b.Property<string>("UploaderUID")
|
||||||
|
.HasMaxLength(10)
|
||||||
|
.HasColumnType("character varying(10)")
|
||||||
|
.HasColumnName("uploader_uid");
|
||||||
|
|
||||||
|
b.HasKey("Hash")
|
||||||
|
.HasName("pk_file_caches");
|
||||||
|
|
||||||
|
b.HasIndex("UploaderUID")
|
||||||
|
.HasDatabaseName("ix_file_caches_uploader_uid");
|
||||||
|
|
||||||
|
b.ToTable("file_caches", (string)null);
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("MareSynchronosShared.Models.ForbiddenUploadEntry", b =>
|
||||||
|
{
|
||||||
|
b.Property<string>("Hash")
|
||||||
|
.HasMaxLength(40)
|
||||||
|
.HasColumnType("character varying(40)")
|
||||||
|
.HasColumnName("hash");
|
||||||
|
|
||||||
|
b.Property<string>("ForbiddenBy")
|
||||||
|
.HasMaxLength(100)
|
||||||
|
.HasColumnType("character varying(100)")
|
||||||
|
.HasColumnName("forbidden_by");
|
||||||
|
|
||||||
|
b.Property<byte[]>("Timestamp")
|
||||||
|
.IsConcurrencyToken()
|
||||||
|
.ValueGeneratedOnAddOrUpdate()
|
||||||
|
.HasColumnType("bytea")
|
||||||
|
.HasColumnName("timestamp");
|
||||||
|
|
||||||
|
b.HasKey("Hash")
|
||||||
|
.HasName("pk_forbidden_upload_entries");
|
||||||
|
|
||||||
|
b.ToTable("forbidden_upload_entries", (string)null);
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("MareSynchronosShared.Models.Group", b =>
|
||||||
|
{
|
||||||
|
b.Property<string>("GID")
|
||||||
|
.HasMaxLength(20)
|
||||||
|
.HasColumnType("character varying(20)")
|
||||||
|
.HasColumnName("gid");
|
||||||
|
|
||||||
|
b.Property<string>("Alias")
|
||||||
|
.HasMaxLength(50)
|
||||||
|
.HasColumnType("character varying(50)")
|
||||||
|
.HasColumnName("alias");
|
||||||
|
|
||||||
|
b.Property<string>("HashedPassword")
|
||||||
|
.HasColumnType("text")
|
||||||
|
.HasColumnName("hashed_password");
|
||||||
|
|
||||||
|
b.Property<bool>("InvitesEnabled")
|
||||||
|
.HasColumnType("boolean")
|
||||||
|
.HasColumnName("invites_enabled");
|
||||||
|
|
||||||
|
b.Property<string>("OwnerUID")
|
||||||
|
.HasColumnType("character varying(10)")
|
||||||
|
.HasColumnName("owner_uid");
|
||||||
|
|
||||||
|
b.Property<bool>("PreferDisableAnimations")
|
||||||
|
.HasColumnType("boolean")
|
||||||
|
.HasColumnName("prefer_disable_animations");
|
||||||
|
|
||||||
|
b.Property<bool>("PreferDisableSounds")
|
||||||
|
.HasColumnType("boolean")
|
||||||
|
.HasColumnName("prefer_disable_sounds");
|
||||||
|
|
||||||
|
b.Property<bool>("PreferDisableVFX")
|
||||||
|
.HasColumnType("boolean")
|
||||||
|
.HasColumnName("prefer_disable_vfx");
|
||||||
|
|
||||||
|
b.HasKey("GID")
|
||||||
|
.HasName("pk_groups");
|
||||||
|
|
||||||
|
b.HasIndex("OwnerUID")
|
||||||
|
.HasDatabaseName("ix_groups_owner_uid");
|
||||||
|
|
||||||
|
b.ToTable("groups", (string)null);
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("MareSynchronosShared.Models.GroupBan", b =>
|
||||||
|
{
|
||||||
|
b.Property<string>("GroupGID")
|
||||||
|
.HasColumnType("character varying(20)")
|
||||||
|
.HasColumnName("group_gid");
|
||||||
|
|
||||||
|
b.Property<string>("BannedUserUID")
|
||||||
|
.HasColumnType("character varying(10)")
|
||||||
|
.HasColumnName("banned_user_uid");
|
||||||
|
|
||||||
|
b.Property<string>("BannedByUID")
|
||||||
|
.HasColumnType("character varying(10)")
|
||||||
|
.HasColumnName("banned_by_uid");
|
||||||
|
|
||||||
|
b.Property<DateTime>("BannedOn")
|
||||||
|
.HasColumnType("timestamp with time zone")
|
||||||
|
.HasColumnName("banned_on");
|
||||||
|
|
||||||
|
b.Property<string>("BannedReason")
|
||||||
|
.HasColumnType("text")
|
||||||
|
.HasColumnName("banned_reason");
|
||||||
|
|
||||||
|
b.HasKey("GroupGID", "BannedUserUID")
|
||||||
|
.HasName("pk_group_bans");
|
||||||
|
|
||||||
|
b.HasIndex("BannedByUID")
|
||||||
|
.HasDatabaseName("ix_group_bans_banned_by_uid");
|
||||||
|
|
||||||
|
b.HasIndex("BannedUserUID")
|
||||||
|
.HasDatabaseName("ix_group_bans_banned_user_uid");
|
||||||
|
|
||||||
|
b.HasIndex("GroupGID")
|
||||||
|
.HasDatabaseName("ix_group_bans_group_gid");
|
||||||
|
|
||||||
|
b.ToTable("group_bans", (string)null);
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("MareSynchronosShared.Models.GroupPair", b =>
|
||||||
|
{
|
||||||
|
b.Property<string>("GroupGID")
|
||||||
|
.HasColumnType("character varying(20)")
|
||||||
|
.HasColumnName("group_gid");
|
||||||
|
|
||||||
|
b.Property<string>("GroupUserUID")
|
||||||
|
.HasColumnType("character varying(10)")
|
||||||
|
.HasColumnName("group_user_uid");
|
||||||
|
|
||||||
|
b.Property<bool>("IsModerator")
|
||||||
|
.HasColumnType("boolean")
|
||||||
|
.HasColumnName("is_moderator");
|
||||||
|
|
||||||
|
b.Property<bool>("IsPinned")
|
||||||
|
.HasColumnType("boolean")
|
||||||
|
.HasColumnName("is_pinned");
|
||||||
|
|
||||||
|
b.HasKey("GroupGID", "GroupUserUID")
|
||||||
|
.HasName("pk_group_pairs");
|
||||||
|
|
||||||
|
b.HasIndex("GroupGID")
|
||||||
|
.HasDatabaseName("ix_group_pairs_group_gid");
|
||||||
|
|
||||||
|
b.HasIndex("GroupUserUID")
|
||||||
|
.HasDatabaseName("ix_group_pairs_group_user_uid");
|
||||||
|
|
||||||
|
b.ToTable("group_pairs", (string)null);
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("MareSynchronosShared.Models.GroupPairPreferredPermission", b =>
|
||||||
|
{
|
||||||
|
b.Property<string>("UserUID")
|
||||||
|
.HasColumnType("character varying(10)")
|
||||||
|
.HasColumnName("user_uid");
|
||||||
|
|
||||||
|
b.Property<string>("GroupGID")
|
||||||
|
.HasColumnType("character varying(20)")
|
||||||
|
.HasColumnName("group_gid");
|
||||||
|
|
||||||
|
b.Property<bool>("DisableAnimations")
|
||||||
|
.HasColumnType("boolean")
|
||||||
|
.HasColumnName("disable_animations");
|
||||||
|
|
||||||
|
b.Property<bool>("DisableSounds")
|
||||||
|
.HasColumnType("boolean")
|
||||||
|
.HasColumnName("disable_sounds");
|
||||||
|
|
||||||
|
b.Property<bool>("DisableVFX")
|
||||||
|
.HasColumnType("boolean")
|
||||||
|
.HasColumnName("disable_vfx");
|
||||||
|
|
||||||
|
b.Property<bool>("IsPaused")
|
||||||
|
.HasColumnType("boolean")
|
||||||
|
.HasColumnName("is_paused");
|
||||||
|
|
||||||
|
b.HasKey("UserUID", "GroupGID")
|
||||||
|
.HasName("pk_group_pair_preferred_permissions");
|
||||||
|
|
||||||
|
b.HasIndex("GroupGID")
|
||||||
|
.HasDatabaseName("ix_group_pair_preferred_permissions_group_gid");
|
||||||
|
|
||||||
|
b.HasIndex("UserUID")
|
||||||
|
.HasDatabaseName("ix_group_pair_preferred_permissions_user_uid");
|
||||||
|
|
||||||
|
b.ToTable("group_pair_preferred_permissions", (string)null);
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("MareSynchronosShared.Models.GroupTempInvite", b =>
|
||||||
|
{
|
||||||
|
b.Property<string>("GroupGID")
|
||||||
|
.HasColumnType("character varying(20)")
|
||||||
|
.HasColumnName("group_gid");
|
||||||
|
|
||||||
|
b.Property<string>("Invite")
|
||||||
|
.HasMaxLength(64)
|
||||||
|
.HasColumnType("character varying(64)")
|
||||||
|
.HasColumnName("invite");
|
||||||
|
|
||||||
|
b.Property<DateTime>("ExpirationDate")
|
||||||
|
.HasColumnType("timestamp with time zone")
|
||||||
|
.HasColumnName("expiration_date");
|
||||||
|
|
||||||
|
b.HasKey("GroupGID", "Invite")
|
||||||
|
.HasName("pk_group_temp_invites");
|
||||||
|
|
||||||
|
b.HasIndex("GroupGID")
|
||||||
|
.HasDatabaseName("ix_group_temp_invites_group_gid");
|
||||||
|
|
||||||
|
b.HasIndex("Invite")
|
||||||
|
.HasDatabaseName("ix_group_temp_invites_invite");
|
||||||
|
|
||||||
|
b.ToTable("group_temp_invites", (string)null);
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("MareSynchronosShared.Models.LodeStoneAuth", b =>
|
||||||
|
{
|
||||||
|
b.Property<decimal>("DiscordId")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("numeric(20,0)")
|
||||||
|
.HasColumnName("discord_id");
|
||||||
|
|
||||||
|
b.Property<string>("HashedLodestoneId")
|
||||||
|
.HasMaxLength(100)
|
||||||
|
.HasColumnType("character varying(100)")
|
||||||
|
.HasColumnName("hashed_lodestone_id");
|
||||||
|
|
||||||
|
b.Property<string>("LodestoneAuthString")
|
||||||
|
.HasMaxLength(100)
|
||||||
|
.HasColumnType("character varying(100)")
|
||||||
|
.HasColumnName("lodestone_auth_string");
|
||||||
|
|
||||||
|
b.Property<DateTime?>("StartedAt")
|
||||||
|
.HasColumnType("timestamp with time zone")
|
||||||
|
.HasColumnName("started_at");
|
||||||
|
|
||||||
|
b.Property<string>("UserUID")
|
||||||
|
.HasColumnType("character varying(10)")
|
||||||
|
.HasColumnName("user_uid");
|
||||||
|
|
||||||
|
b.HasKey("DiscordId")
|
||||||
|
.HasName("pk_lodestone_auth");
|
||||||
|
|
||||||
|
b.HasIndex("UserUID")
|
||||||
|
.HasDatabaseName("ix_lodestone_auth_user_uid");
|
||||||
|
|
||||||
|
b.ToTable("lodestone_auth", (string)null);
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("MareSynchronosShared.Models.User", b =>
|
||||||
|
{
|
||||||
|
b.Property<string>("UID")
|
||||||
|
.HasMaxLength(10)
|
||||||
|
.HasColumnType("character varying(10)")
|
||||||
|
.HasColumnName("uid");
|
||||||
|
|
||||||
|
b.Property<string>("Alias")
|
||||||
|
.HasMaxLength(15)
|
||||||
|
.HasColumnType("character varying(15)")
|
||||||
|
.HasColumnName("alias");
|
||||||
|
|
||||||
|
b.Property<bool>("IsAdmin")
|
||||||
|
.HasColumnType("boolean")
|
||||||
|
.HasColumnName("is_admin");
|
||||||
|
|
||||||
|
b.Property<bool>("IsModerator")
|
||||||
|
.HasColumnType("boolean")
|
||||||
|
.HasColumnName("is_moderator");
|
||||||
|
|
||||||
|
b.Property<DateTime>("LastLoggedIn")
|
||||||
|
.HasColumnType("timestamp with time zone")
|
||||||
|
.HasColumnName("last_logged_in");
|
||||||
|
|
||||||
|
b.Property<byte[]>("Timestamp")
|
||||||
|
.IsConcurrencyToken()
|
||||||
|
.ValueGeneratedOnAddOrUpdate()
|
||||||
|
.HasColumnType("bytea")
|
||||||
|
.HasColumnName("timestamp");
|
||||||
|
|
||||||
|
b.HasKey("UID")
|
||||||
|
.HasName("pk_users");
|
||||||
|
|
||||||
|
b.ToTable("users", (string)null);
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("MareSynchronosShared.Models.UserDefaultPreferredPermission", b =>
|
||||||
|
{
|
||||||
|
b.Property<string>("UserUID")
|
||||||
|
.HasMaxLength(10)
|
||||||
|
.HasColumnType("character varying(10)")
|
||||||
|
.HasColumnName("user_uid");
|
||||||
|
|
||||||
|
b.Property<bool>("DisableGroupAnimations")
|
||||||
|
.HasColumnType("boolean")
|
||||||
|
.HasColumnName("disable_group_animations");
|
||||||
|
|
||||||
|
b.Property<bool>("DisableGroupSounds")
|
||||||
|
.HasColumnType("boolean")
|
||||||
|
.HasColumnName("disable_group_sounds");
|
||||||
|
|
||||||
|
b.Property<bool>("DisableGroupVFX")
|
||||||
|
.HasColumnType("boolean")
|
||||||
|
.HasColumnName("disable_group_vfx");
|
||||||
|
|
||||||
|
b.Property<bool>("DisableIndividualAnimations")
|
||||||
|
.HasColumnType("boolean")
|
||||||
|
.HasColumnName("disable_individual_animations");
|
||||||
|
|
||||||
|
b.Property<bool>("DisableIndividualSounds")
|
||||||
|
.HasColumnType("boolean")
|
||||||
|
.HasColumnName("disable_individual_sounds");
|
||||||
|
|
||||||
|
b.Property<bool>("DisableIndividualVFX")
|
||||||
|
.HasColumnType("boolean")
|
||||||
|
.HasColumnName("disable_individual_vfx");
|
||||||
|
|
||||||
|
b.Property<bool>("IndividualIsSticky")
|
||||||
|
.HasColumnType("boolean")
|
||||||
|
.HasColumnName("individual_is_sticky");
|
||||||
|
|
||||||
|
b.HasKey("UserUID")
|
||||||
|
.HasName("pk_user_default_preferred_permissions");
|
||||||
|
|
||||||
|
b.HasIndex("UserUID")
|
||||||
|
.HasDatabaseName("ix_user_default_preferred_permissions_user_uid");
|
||||||
|
|
||||||
|
b.ToTable("user_default_preferred_permissions", (string)null);
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("MareSynchronosShared.Models.UserPermissionSet", b =>
|
||||||
|
{
|
||||||
|
b.Property<string>("UserUID")
|
||||||
|
.HasColumnType("character varying(10)")
|
||||||
|
.HasColumnName("user_uid");
|
||||||
|
|
||||||
|
b.Property<string>("OtherUserUID")
|
||||||
|
.HasColumnType("character varying(10)")
|
||||||
|
.HasColumnName("other_user_uid");
|
||||||
|
|
||||||
|
b.Property<bool>("DisableAnimations")
|
||||||
|
.HasColumnType("boolean")
|
||||||
|
.HasColumnName("disable_animations");
|
||||||
|
|
||||||
|
b.Property<bool>("DisableSounds")
|
||||||
|
.HasColumnType("boolean")
|
||||||
|
.HasColumnName("disable_sounds");
|
||||||
|
|
||||||
|
b.Property<bool>("DisableVFX")
|
||||||
|
.HasColumnType("boolean")
|
||||||
|
.HasColumnName("disable_vfx");
|
||||||
|
|
||||||
|
b.Property<bool>("IsPaused")
|
||||||
|
.HasColumnType("boolean")
|
||||||
|
.HasColumnName("is_paused");
|
||||||
|
|
||||||
|
b.Property<bool>("Sticky")
|
||||||
|
.HasColumnType("boolean")
|
||||||
|
.HasColumnName("sticky");
|
||||||
|
|
||||||
|
b.HasKey("UserUID", "OtherUserUID")
|
||||||
|
.HasName("pk_user_permission_sets");
|
||||||
|
|
||||||
|
b.HasIndex("OtherUserUID")
|
||||||
|
.HasDatabaseName("ix_user_permission_sets_other_user_uid");
|
||||||
|
|
||||||
|
b.HasIndex("UserUID")
|
||||||
|
.HasDatabaseName("ix_user_permission_sets_user_uid");
|
||||||
|
|
||||||
|
b.HasIndex("UserUID", "OtherUserUID", "IsPaused")
|
||||||
|
.HasDatabaseName("ix_user_permission_sets_user_uid_other_user_uid_is_paused");
|
||||||
|
|
||||||
|
b.ToTable("user_permission_sets", (string)null);
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("MareSynchronosShared.Models.UserProfileData", b =>
|
||||||
|
{
|
||||||
|
b.Property<string>("UserUID")
|
||||||
|
.HasColumnType("character varying(10)")
|
||||||
|
.HasColumnName("user_uid");
|
||||||
|
|
||||||
|
b.Property<string>("Base64ProfileImage")
|
||||||
|
.HasColumnType("text")
|
||||||
|
.HasColumnName("base64profile_image");
|
||||||
|
|
||||||
|
b.Property<bool>("FlaggedForReport")
|
||||||
|
.HasColumnType("boolean")
|
||||||
|
.HasColumnName("flagged_for_report");
|
||||||
|
|
||||||
|
b.Property<bool>("IsNSFW")
|
||||||
|
.HasColumnType("boolean")
|
||||||
|
.HasColumnName("is_nsfw");
|
||||||
|
|
||||||
|
b.Property<bool>("ProfileDisabled")
|
||||||
|
.HasColumnType("boolean")
|
||||||
|
.HasColumnName("profile_disabled");
|
||||||
|
|
||||||
|
b.Property<string>("UserDescription")
|
||||||
|
.HasColumnType("text")
|
||||||
|
.HasColumnName("user_description");
|
||||||
|
|
||||||
|
b.HasKey("UserUID")
|
||||||
|
.HasName("pk_user_profile_data");
|
||||||
|
|
||||||
|
b.ToTable("user_profile_data", (string)null);
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("MareSynchronosShared.Models.UserProfileDataReport", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("integer")
|
||||||
|
.HasColumnName("id");
|
||||||
|
|
||||||
|
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
||||||
|
|
||||||
|
b.Property<DateTime>("ReportDate")
|
||||||
|
.HasColumnType("timestamp with time zone")
|
||||||
|
.HasColumnName("report_date");
|
||||||
|
|
||||||
|
b.Property<string>("ReportReason")
|
||||||
|
.HasColumnType("text")
|
||||||
|
.HasColumnName("report_reason");
|
||||||
|
|
||||||
|
b.Property<string>("ReportedUserUID")
|
||||||
|
.HasColumnType("character varying(10)")
|
||||||
|
.HasColumnName("reported_user_uid");
|
||||||
|
|
||||||
|
b.Property<string>("ReportingUserUID")
|
||||||
|
.HasColumnType("character varying(10)")
|
||||||
|
.HasColumnName("reporting_user_uid");
|
||||||
|
|
||||||
|
b.HasKey("Id")
|
||||||
|
.HasName("pk_user_profile_data_reports");
|
||||||
|
|
||||||
|
b.HasIndex("ReportedUserUID")
|
||||||
|
.HasDatabaseName("ix_user_profile_data_reports_reported_user_uid");
|
||||||
|
|
||||||
|
b.HasIndex("ReportingUserUID")
|
||||||
|
.HasDatabaseName("ix_user_profile_data_reports_reporting_user_uid");
|
||||||
|
|
||||||
|
b.ToTable("user_profile_data_reports", (string)null);
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("MareSynchronosShared.Models.Auth", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("MareSynchronosShared.Models.User", "PrimaryUser")
|
||||||
|
.WithMany()
|
||||||
|
.HasForeignKey("PrimaryUserUID")
|
||||||
|
.HasConstraintName("fk_auth_users_primary_user_uid");
|
||||||
|
|
||||||
|
b.HasOne("MareSynchronosShared.Models.User", "User")
|
||||||
|
.WithMany()
|
||||||
|
.HasForeignKey("UserUID")
|
||||||
|
.HasConstraintName("fk_auth_users_user_uid");
|
||||||
|
|
||||||
|
b.Navigation("PrimaryUser");
|
||||||
|
|
||||||
|
b.Navigation("User");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("MareSynchronosShared.Models.ClientPair", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("MareSynchronosShared.Models.User", "OtherUser")
|
||||||
|
.WithMany()
|
||||||
|
.HasForeignKey("OtherUserUID")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired()
|
||||||
|
.HasConstraintName("fk_client_pairs_users_other_user_uid");
|
||||||
|
|
||||||
|
b.HasOne("MareSynchronosShared.Models.User", "User")
|
||||||
|
.WithMany()
|
||||||
|
.HasForeignKey("UserUID")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired()
|
||||||
|
.HasConstraintName("fk_client_pairs_users_user_uid");
|
||||||
|
|
||||||
|
b.Navigation("OtherUser");
|
||||||
|
|
||||||
|
b.Navigation("User");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("MareSynchronosShared.Models.FileCache", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("MareSynchronosShared.Models.User", "Uploader")
|
||||||
|
.WithMany()
|
||||||
|
.HasForeignKey("UploaderUID")
|
||||||
|
.HasConstraintName("fk_file_caches_users_uploader_uid");
|
||||||
|
|
||||||
|
b.Navigation("Uploader");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("MareSynchronosShared.Models.Group", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("MareSynchronosShared.Models.User", "Owner")
|
||||||
|
.WithMany()
|
||||||
|
.HasForeignKey("OwnerUID")
|
||||||
|
.HasConstraintName("fk_groups_users_owner_uid");
|
||||||
|
|
||||||
|
b.Navigation("Owner");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("MareSynchronosShared.Models.GroupBan", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("MareSynchronosShared.Models.User", "BannedBy")
|
||||||
|
.WithMany()
|
||||||
|
.HasForeignKey("BannedByUID")
|
||||||
|
.HasConstraintName("fk_group_bans_users_banned_by_uid");
|
||||||
|
|
||||||
|
b.HasOne("MareSynchronosShared.Models.User", "BannedUser")
|
||||||
|
.WithMany()
|
||||||
|
.HasForeignKey("BannedUserUID")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired()
|
||||||
|
.HasConstraintName("fk_group_bans_users_banned_user_uid");
|
||||||
|
|
||||||
|
b.HasOne("MareSynchronosShared.Models.Group", "Group")
|
||||||
|
.WithMany()
|
||||||
|
.HasForeignKey("GroupGID")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired()
|
||||||
|
.HasConstraintName("fk_group_bans_groups_group_gid");
|
||||||
|
|
||||||
|
b.Navigation("BannedBy");
|
||||||
|
|
||||||
|
b.Navigation("BannedUser");
|
||||||
|
|
||||||
|
b.Navigation("Group");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("MareSynchronosShared.Models.GroupPair", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("MareSynchronosShared.Models.Group", "Group")
|
||||||
|
.WithMany()
|
||||||
|
.HasForeignKey("GroupGID")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired()
|
||||||
|
.HasConstraintName("fk_group_pairs_groups_group_gid");
|
||||||
|
|
||||||
|
b.HasOne("MareSynchronosShared.Models.User", "GroupUser")
|
||||||
|
.WithMany()
|
||||||
|
.HasForeignKey("GroupUserUID")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired()
|
||||||
|
.HasConstraintName("fk_group_pairs_users_group_user_uid");
|
||||||
|
|
||||||
|
b.Navigation("Group");
|
||||||
|
|
||||||
|
b.Navigation("GroupUser");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("MareSynchronosShared.Models.GroupPairPreferredPermission", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("MareSynchronosShared.Models.Group", "Group")
|
||||||
|
.WithMany()
|
||||||
|
.HasForeignKey("GroupGID")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired()
|
||||||
|
.HasConstraintName("fk_group_pair_preferred_permissions_groups_group_gid");
|
||||||
|
|
||||||
|
b.HasOne("MareSynchronosShared.Models.User", "User")
|
||||||
|
.WithMany()
|
||||||
|
.HasForeignKey("UserUID")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired()
|
||||||
|
.HasConstraintName("fk_group_pair_preferred_permissions_users_user_uid");
|
||||||
|
|
||||||
|
b.Navigation("Group");
|
||||||
|
|
||||||
|
b.Navigation("User");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("MareSynchronosShared.Models.GroupTempInvite", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("MareSynchronosShared.Models.Group", "Group")
|
||||||
|
.WithMany()
|
||||||
|
.HasForeignKey("GroupGID")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired()
|
||||||
|
.HasConstraintName("fk_group_temp_invites_groups_group_gid");
|
||||||
|
|
||||||
|
b.Navigation("Group");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("MareSynchronosShared.Models.LodeStoneAuth", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("MareSynchronosShared.Models.User", "User")
|
||||||
|
.WithMany()
|
||||||
|
.HasForeignKey("UserUID")
|
||||||
|
.HasConstraintName("fk_lodestone_auth_users_user_uid");
|
||||||
|
|
||||||
|
b.Navigation("User");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("MareSynchronosShared.Models.UserDefaultPreferredPermission", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("MareSynchronosShared.Models.User", "User")
|
||||||
|
.WithMany()
|
||||||
|
.HasForeignKey("UserUID")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired()
|
||||||
|
.HasConstraintName("fk_user_default_preferred_permissions_users_user_uid");
|
||||||
|
|
||||||
|
b.Navigation("User");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("MareSynchronosShared.Models.UserPermissionSet", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("MareSynchronosShared.Models.User", "OtherUser")
|
||||||
|
.WithMany()
|
||||||
|
.HasForeignKey("OtherUserUID")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired()
|
||||||
|
.HasConstraintName("fk_user_permission_sets_users_other_user_uid");
|
||||||
|
|
||||||
|
b.HasOne("MareSynchronosShared.Models.User", "User")
|
||||||
|
.WithMany()
|
||||||
|
.HasForeignKey("UserUID")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired()
|
||||||
|
.HasConstraintName("fk_user_permission_sets_users_user_uid");
|
||||||
|
|
||||||
|
b.Navigation("OtherUser");
|
||||||
|
|
||||||
|
b.Navigation("User");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("MareSynchronosShared.Models.UserProfileData", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("MareSynchronosShared.Models.User", "User")
|
||||||
|
.WithMany()
|
||||||
|
.HasForeignKey("UserUID")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired()
|
||||||
|
.HasConstraintName("fk_user_profile_data_users_user_uid");
|
||||||
|
|
||||||
|
b.Navigation("User");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("MareSynchronosShared.Models.UserProfileDataReport", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("MareSynchronosShared.Models.User", "ReportedUser")
|
||||||
|
.WithMany()
|
||||||
|
.HasForeignKey("ReportedUserUID")
|
||||||
|
.HasConstraintName("fk_user_profile_data_reports_users_reported_user_uid");
|
||||||
|
|
||||||
|
b.HasOne("MareSynchronosShared.Models.User", "ReportingUser")
|
||||||
|
.WithMany()
|
||||||
|
.HasForeignKey("ReportingUserUID")
|
||||||
|
.HasConstraintName("fk_user_profile_data_reports_users_reporting_user_uid");
|
||||||
|
|
||||||
|
b.Navigation("ReportedUser");
|
||||||
|
|
||||||
|
b.Navigation("ReportingUser");
|
||||||
|
});
|
||||||
|
#pragma warning restore 612, 618
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,309 @@
|
|||||||
|
using Microsoft.EntityFrameworkCore.Migrations;
|
||||||
|
|
||||||
|
#nullable disable
|
||||||
|
|
||||||
|
namespace MareSynchronosServer.Migrations
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
public partial class MarkForBan : Migration
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
protected override void Up(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.DropForeignKey(
|
||||||
|
name: "fk_auth_users_primary_user_temp_id",
|
||||||
|
table: "auth");
|
||||||
|
|
||||||
|
migrationBuilder.DropForeignKey(
|
||||||
|
name: "fk_auth_users_user_temp_id1",
|
||||||
|
table: "auth");
|
||||||
|
|
||||||
|
migrationBuilder.DropForeignKey(
|
||||||
|
name: "fk_client_pairs_users_other_user_temp_id2",
|
||||||
|
table: "client_pairs");
|
||||||
|
|
||||||
|
migrationBuilder.DropForeignKey(
|
||||||
|
name: "fk_client_pairs_users_user_temp_id3",
|
||||||
|
table: "client_pairs");
|
||||||
|
|
||||||
|
migrationBuilder.DropForeignKey(
|
||||||
|
name: "fk_group_bans_groups_group_temp_id",
|
||||||
|
table: "group_bans");
|
||||||
|
|
||||||
|
migrationBuilder.DropForeignKey(
|
||||||
|
name: "fk_group_bans_users_banned_by_temp_id5",
|
||||||
|
table: "group_bans");
|
||||||
|
|
||||||
|
migrationBuilder.DropForeignKey(
|
||||||
|
name: "fk_group_bans_users_banned_user_temp_id6",
|
||||||
|
table: "group_bans");
|
||||||
|
|
||||||
|
migrationBuilder.DropForeignKey(
|
||||||
|
name: "fk_group_pair_preferred_permissions_groups_group_temp_id1",
|
||||||
|
table: "group_pair_preferred_permissions");
|
||||||
|
|
||||||
|
migrationBuilder.DropForeignKey(
|
||||||
|
name: "fk_group_pair_preferred_permissions_users_user_temp_id7",
|
||||||
|
table: "group_pair_preferred_permissions");
|
||||||
|
|
||||||
|
migrationBuilder.DropForeignKey(
|
||||||
|
name: "fk_group_pairs_groups_group_temp_id2",
|
||||||
|
table: "group_pairs");
|
||||||
|
|
||||||
|
migrationBuilder.DropForeignKey(
|
||||||
|
name: "fk_group_pairs_users_group_user_temp_id8",
|
||||||
|
table: "group_pairs");
|
||||||
|
|
||||||
|
migrationBuilder.DropForeignKey(
|
||||||
|
name: "fk_groups_users_owner_temp_id9",
|
||||||
|
table: "groups");
|
||||||
|
|
||||||
|
migrationBuilder.AddColumn<bool>(
|
||||||
|
name: "mark_for_ban",
|
||||||
|
table: "auth",
|
||||||
|
type: "boolean",
|
||||||
|
nullable: false,
|
||||||
|
defaultValue: false);
|
||||||
|
|
||||||
|
migrationBuilder.AddForeignKey(
|
||||||
|
name: "fk_auth_users_primary_user_uid",
|
||||||
|
table: "auth",
|
||||||
|
column: "primary_user_uid",
|
||||||
|
principalTable: "users",
|
||||||
|
principalColumn: "uid");
|
||||||
|
|
||||||
|
migrationBuilder.AddForeignKey(
|
||||||
|
name: "fk_auth_users_user_uid",
|
||||||
|
table: "auth",
|
||||||
|
column: "user_uid",
|
||||||
|
principalTable: "users",
|
||||||
|
principalColumn: "uid");
|
||||||
|
|
||||||
|
migrationBuilder.AddForeignKey(
|
||||||
|
name: "fk_client_pairs_users_other_user_uid",
|
||||||
|
table: "client_pairs",
|
||||||
|
column: "other_user_uid",
|
||||||
|
principalTable: "users",
|
||||||
|
principalColumn: "uid",
|
||||||
|
onDelete: ReferentialAction.Cascade);
|
||||||
|
|
||||||
|
migrationBuilder.AddForeignKey(
|
||||||
|
name: "fk_client_pairs_users_user_uid",
|
||||||
|
table: "client_pairs",
|
||||||
|
column: "user_uid",
|
||||||
|
principalTable: "users",
|
||||||
|
principalColumn: "uid",
|
||||||
|
onDelete: ReferentialAction.Cascade);
|
||||||
|
|
||||||
|
migrationBuilder.AddForeignKey(
|
||||||
|
name: "fk_group_bans_groups_group_gid",
|
||||||
|
table: "group_bans",
|
||||||
|
column: "group_gid",
|
||||||
|
principalTable: "groups",
|
||||||
|
principalColumn: "gid",
|
||||||
|
onDelete: ReferentialAction.Cascade);
|
||||||
|
|
||||||
|
migrationBuilder.AddForeignKey(
|
||||||
|
name: "fk_group_bans_users_banned_by_uid",
|
||||||
|
table: "group_bans",
|
||||||
|
column: "banned_by_uid",
|
||||||
|
principalTable: "users",
|
||||||
|
principalColumn: "uid");
|
||||||
|
|
||||||
|
migrationBuilder.AddForeignKey(
|
||||||
|
name: "fk_group_bans_users_banned_user_uid",
|
||||||
|
table: "group_bans",
|
||||||
|
column: "banned_user_uid",
|
||||||
|
principalTable: "users",
|
||||||
|
principalColumn: "uid",
|
||||||
|
onDelete: ReferentialAction.Cascade);
|
||||||
|
|
||||||
|
migrationBuilder.AddForeignKey(
|
||||||
|
name: "fk_group_pair_preferred_permissions_groups_group_gid",
|
||||||
|
table: "group_pair_preferred_permissions",
|
||||||
|
column: "group_gid",
|
||||||
|
principalTable: "groups",
|
||||||
|
principalColumn: "gid",
|
||||||
|
onDelete: ReferentialAction.Cascade);
|
||||||
|
|
||||||
|
migrationBuilder.AddForeignKey(
|
||||||
|
name: "fk_group_pair_preferred_permissions_users_user_uid",
|
||||||
|
table: "group_pair_preferred_permissions",
|
||||||
|
column: "user_uid",
|
||||||
|
principalTable: "users",
|
||||||
|
principalColumn: "uid",
|
||||||
|
onDelete: ReferentialAction.Cascade);
|
||||||
|
|
||||||
|
migrationBuilder.AddForeignKey(
|
||||||
|
name: "fk_group_pairs_groups_group_gid",
|
||||||
|
table: "group_pairs",
|
||||||
|
column: "group_gid",
|
||||||
|
principalTable: "groups",
|
||||||
|
principalColumn: "gid",
|
||||||
|
onDelete: ReferentialAction.Cascade);
|
||||||
|
|
||||||
|
migrationBuilder.AddForeignKey(
|
||||||
|
name: "fk_group_pairs_users_group_user_uid",
|
||||||
|
table: "group_pairs",
|
||||||
|
column: "group_user_uid",
|
||||||
|
principalTable: "users",
|
||||||
|
principalColumn: "uid",
|
||||||
|
onDelete: ReferentialAction.Cascade);
|
||||||
|
|
||||||
|
migrationBuilder.AddForeignKey(
|
||||||
|
name: "fk_groups_users_owner_uid",
|
||||||
|
table: "groups",
|
||||||
|
column: "owner_uid",
|
||||||
|
principalTable: "users",
|
||||||
|
principalColumn: "uid");
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
|
protected override void Down(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.DropForeignKey(
|
||||||
|
name: "fk_auth_users_primary_user_uid",
|
||||||
|
table: "auth");
|
||||||
|
|
||||||
|
migrationBuilder.DropForeignKey(
|
||||||
|
name: "fk_auth_users_user_uid",
|
||||||
|
table: "auth");
|
||||||
|
|
||||||
|
migrationBuilder.DropForeignKey(
|
||||||
|
name: "fk_client_pairs_users_other_user_uid",
|
||||||
|
table: "client_pairs");
|
||||||
|
|
||||||
|
migrationBuilder.DropForeignKey(
|
||||||
|
name: "fk_client_pairs_users_user_uid",
|
||||||
|
table: "client_pairs");
|
||||||
|
|
||||||
|
migrationBuilder.DropForeignKey(
|
||||||
|
name: "fk_group_bans_groups_group_gid",
|
||||||
|
table: "group_bans");
|
||||||
|
|
||||||
|
migrationBuilder.DropForeignKey(
|
||||||
|
name: "fk_group_bans_users_banned_by_uid",
|
||||||
|
table: "group_bans");
|
||||||
|
|
||||||
|
migrationBuilder.DropForeignKey(
|
||||||
|
name: "fk_group_bans_users_banned_user_uid",
|
||||||
|
table: "group_bans");
|
||||||
|
|
||||||
|
migrationBuilder.DropForeignKey(
|
||||||
|
name: "fk_group_pair_preferred_permissions_groups_group_gid",
|
||||||
|
table: "group_pair_preferred_permissions");
|
||||||
|
|
||||||
|
migrationBuilder.DropForeignKey(
|
||||||
|
name: "fk_group_pair_preferred_permissions_users_user_uid",
|
||||||
|
table: "group_pair_preferred_permissions");
|
||||||
|
|
||||||
|
migrationBuilder.DropForeignKey(
|
||||||
|
name: "fk_group_pairs_groups_group_gid",
|
||||||
|
table: "group_pairs");
|
||||||
|
|
||||||
|
migrationBuilder.DropForeignKey(
|
||||||
|
name: "fk_group_pairs_users_group_user_uid",
|
||||||
|
table: "group_pairs");
|
||||||
|
|
||||||
|
migrationBuilder.DropForeignKey(
|
||||||
|
name: "fk_groups_users_owner_uid",
|
||||||
|
table: "groups");
|
||||||
|
|
||||||
|
migrationBuilder.DropColumn(
|
||||||
|
name: "mark_for_ban",
|
||||||
|
table: "auth");
|
||||||
|
|
||||||
|
migrationBuilder.AddForeignKey(
|
||||||
|
name: "fk_auth_users_primary_user_temp_id",
|
||||||
|
table: "auth",
|
||||||
|
column: "primary_user_uid",
|
||||||
|
principalTable: "users",
|
||||||
|
principalColumn: "uid");
|
||||||
|
|
||||||
|
migrationBuilder.AddForeignKey(
|
||||||
|
name: "fk_auth_users_user_temp_id1",
|
||||||
|
table: "auth",
|
||||||
|
column: "user_uid",
|
||||||
|
principalTable: "users",
|
||||||
|
principalColumn: "uid");
|
||||||
|
|
||||||
|
migrationBuilder.AddForeignKey(
|
||||||
|
name: "fk_client_pairs_users_other_user_temp_id2",
|
||||||
|
table: "client_pairs",
|
||||||
|
column: "other_user_uid",
|
||||||
|
principalTable: "users",
|
||||||
|
principalColumn: "uid",
|
||||||
|
onDelete: ReferentialAction.Cascade);
|
||||||
|
|
||||||
|
migrationBuilder.AddForeignKey(
|
||||||
|
name: "fk_client_pairs_users_user_temp_id3",
|
||||||
|
table: "client_pairs",
|
||||||
|
column: "user_uid",
|
||||||
|
principalTable: "users",
|
||||||
|
principalColumn: "uid",
|
||||||
|
onDelete: ReferentialAction.Cascade);
|
||||||
|
|
||||||
|
migrationBuilder.AddForeignKey(
|
||||||
|
name: "fk_group_bans_groups_group_temp_id",
|
||||||
|
table: "group_bans",
|
||||||
|
column: "group_gid",
|
||||||
|
principalTable: "groups",
|
||||||
|
principalColumn: "gid",
|
||||||
|
onDelete: ReferentialAction.Cascade);
|
||||||
|
|
||||||
|
migrationBuilder.AddForeignKey(
|
||||||
|
name: "fk_group_bans_users_banned_by_temp_id5",
|
||||||
|
table: "group_bans",
|
||||||
|
column: "banned_by_uid",
|
||||||
|
principalTable: "users",
|
||||||
|
principalColumn: "uid");
|
||||||
|
|
||||||
|
migrationBuilder.AddForeignKey(
|
||||||
|
name: "fk_group_bans_users_banned_user_temp_id6",
|
||||||
|
table: "group_bans",
|
||||||
|
column: "banned_user_uid",
|
||||||
|
principalTable: "users",
|
||||||
|
principalColumn: "uid",
|
||||||
|
onDelete: ReferentialAction.Cascade);
|
||||||
|
|
||||||
|
migrationBuilder.AddForeignKey(
|
||||||
|
name: "fk_group_pair_preferred_permissions_groups_group_temp_id1",
|
||||||
|
table: "group_pair_preferred_permissions",
|
||||||
|
column: "group_gid",
|
||||||
|
principalTable: "groups",
|
||||||
|
principalColumn: "gid",
|
||||||
|
onDelete: ReferentialAction.Cascade);
|
||||||
|
|
||||||
|
migrationBuilder.AddForeignKey(
|
||||||
|
name: "fk_group_pair_preferred_permissions_users_user_temp_id7",
|
||||||
|
table: "group_pair_preferred_permissions",
|
||||||
|
column: "user_uid",
|
||||||
|
principalTable: "users",
|
||||||
|
principalColumn: "uid",
|
||||||
|
onDelete: ReferentialAction.Cascade);
|
||||||
|
|
||||||
|
migrationBuilder.AddForeignKey(
|
||||||
|
name: "fk_group_pairs_groups_group_temp_id2",
|
||||||
|
table: "group_pairs",
|
||||||
|
column: "group_gid",
|
||||||
|
principalTable: "groups",
|
||||||
|
principalColumn: "gid",
|
||||||
|
onDelete: ReferentialAction.Cascade);
|
||||||
|
|
||||||
|
migrationBuilder.AddForeignKey(
|
||||||
|
name: "fk_group_pairs_users_group_user_temp_id8",
|
||||||
|
table: "group_pairs",
|
||||||
|
column: "group_user_uid",
|
||||||
|
principalTable: "users",
|
||||||
|
principalColumn: "uid",
|
||||||
|
onDelete: ReferentialAction.Cascade);
|
||||||
|
|
||||||
|
migrationBuilder.AddForeignKey(
|
||||||
|
name: "fk_groups_users_owner_temp_id9",
|
||||||
|
table: "groups",
|
||||||
|
column: "owner_uid",
|
||||||
|
principalTable: "users",
|
||||||
|
principalColumn: "uid");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
757
MareSynchronosServer/MareSynchronosShared/Migrations/20240718100453_RemoveReport.Designer.cs
generated
Normal file
757
MareSynchronosServer/MareSynchronosShared/Migrations/20240718100453_RemoveReport.Designer.cs
generated
Normal file
@@ -0,0 +1,757 @@
|
|||||||
|
// <auto-generated />
|
||||||
|
using System;
|
||||||
|
using MareSynchronosShared.Data;
|
||||||
|
using Microsoft.EntityFrameworkCore;
|
||||||
|
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||||
|
using Microsoft.EntityFrameworkCore.Migrations;
|
||||||
|
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||||
|
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
|
||||||
|
|
||||||
|
#nullable disable
|
||||||
|
|
||||||
|
namespace MareSynchronosServer.Migrations
|
||||||
|
{
|
||||||
|
[DbContext(typeof(MareDbContext))]
|
||||||
|
[Migration("20240718100453_RemoveReport")]
|
||||||
|
partial class RemoveReport
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
||||||
|
{
|
||||||
|
#pragma warning disable 612, 618
|
||||||
|
modelBuilder
|
||||||
|
.HasAnnotation("ProductVersion", "8.0.4")
|
||||||
|
.HasAnnotation("Relational:MaxIdentifierLength", 63);
|
||||||
|
|
||||||
|
NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
|
||||||
|
|
||||||
|
modelBuilder.Entity("MareSynchronosShared.Models.Auth", b =>
|
||||||
|
{
|
||||||
|
b.Property<string>("HashedKey")
|
||||||
|
.HasMaxLength(64)
|
||||||
|
.HasColumnType("character varying(64)")
|
||||||
|
.HasColumnName("hashed_key");
|
||||||
|
|
||||||
|
b.Property<bool>("IsBanned")
|
||||||
|
.HasColumnType("boolean")
|
||||||
|
.HasColumnName("is_banned");
|
||||||
|
|
||||||
|
b.Property<bool>("MarkForBan")
|
||||||
|
.HasColumnType("boolean")
|
||||||
|
.HasColumnName("mark_for_ban");
|
||||||
|
|
||||||
|
b.Property<string>("PrimaryUserUID")
|
||||||
|
.HasColumnType("character varying(10)")
|
||||||
|
.HasColumnName("primary_user_uid");
|
||||||
|
|
||||||
|
b.Property<string>("UserUID")
|
||||||
|
.HasColumnType("character varying(10)")
|
||||||
|
.HasColumnName("user_uid");
|
||||||
|
|
||||||
|
b.HasKey("HashedKey")
|
||||||
|
.HasName("pk_auth");
|
||||||
|
|
||||||
|
b.HasIndex("PrimaryUserUID")
|
||||||
|
.HasDatabaseName("ix_auth_primary_user_uid");
|
||||||
|
|
||||||
|
b.HasIndex("UserUID")
|
||||||
|
.HasDatabaseName("ix_auth_user_uid");
|
||||||
|
|
||||||
|
b.ToTable("auth", (string)null);
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("MareSynchronosShared.Models.Banned", b =>
|
||||||
|
{
|
||||||
|
b.Property<string>("CharacterIdentification")
|
||||||
|
.HasMaxLength(100)
|
||||||
|
.HasColumnType("character varying(100)")
|
||||||
|
.HasColumnName("character_identification");
|
||||||
|
|
||||||
|
b.Property<string>("Reason")
|
||||||
|
.HasColumnType("text")
|
||||||
|
.HasColumnName("reason");
|
||||||
|
|
||||||
|
b.Property<byte[]>("Timestamp")
|
||||||
|
.IsConcurrencyToken()
|
||||||
|
.ValueGeneratedOnAddOrUpdate()
|
||||||
|
.HasColumnType("bytea")
|
||||||
|
.HasColumnName("timestamp");
|
||||||
|
|
||||||
|
b.HasKey("CharacterIdentification")
|
||||||
|
.HasName("pk_banned_users");
|
||||||
|
|
||||||
|
b.ToTable("banned_users", (string)null);
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("MareSynchronosShared.Models.BannedRegistrations", b =>
|
||||||
|
{
|
||||||
|
b.Property<string>("DiscordIdOrLodestoneAuth")
|
||||||
|
.HasMaxLength(100)
|
||||||
|
.HasColumnType("character varying(100)")
|
||||||
|
.HasColumnName("discord_id_or_lodestone_auth");
|
||||||
|
|
||||||
|
b.HasKey("DiscordIdOrLodestoneAuth")
|
||||||
|
.HasName("pk_banned_registrations");
|
||||||
|
|
||||||
|
b.ToTable("banned_registrations", (string)null);
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("MareSynchronosShared.Models.ClientPair", b =>
|
||||||
|
{
|
||||||
|
b.Property<string>("UserUID")
|
||||||
|
.HasMaxLength(10)
|
||||||
|
.HasColumnType("character varying(10)")
|
||||||
|
.HasColumnName("user_uid");
|
||||||
|
|
||||||
|
b.Property<string>("OtherUserUID")
|
||||||
|
.HasMaxLength(10)
|
||||||
|
.HasColumnType("character varying(10)")
|
||||||
|
.HasColumnName("other_user_uid");
|
||||||
|
|
||||||
|
b.Property<byte[]>("Timestamp")
|
||||||
|
.IsConcurrencyToken()
|
||||||
|
.ValueGeneratedOnAddOrUpdate()
|
||||||
|
.HasColumnType("bytea")
|
||||||
|
.HasColumnName("timestamp");
|
||||||
|
|
||||||
|
b.HasKey("UserUID", "OtherUserUID")
|
||||||
|
.HasName("pk_client_pairs");
|
||||||
|
|
||||||
|
b.HasIndex("OtherUserUID")
|
||||||
|
.HasDatabaseName("ix_client_pairs_other_user_uid");
|
||||||
|
|
||||||
|
b.HasIndex("UserUID")
|
||||||
|
.HasDatabaseName("ix_client_pairs_user_uid");
|
||||||
|
|
||||||
|
b.ToTable("client_pairs", (string)null);
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("MareSynchronosShared.Models.FileCache", b =>
|
||||||
|
{
|
||||||
|
b.Property<string>("Hash")
|
||||||
|
.HasMaxLength(40)
|
||||||
|
.HasColumnType("character varying(40)")
|
||||||
|
.HasColumnName("hash");
|
||||||
|
|
||||||
|
b.Property<long>("Size")
|
||||||
|
.HasColumnType("bigint")
|
||||||
|
.HasColumnName("size");
|
||||||
|
|
||||||
|
b.Property<byte[]>("Timestamp")
|
||||||
|
.IsConcurrencyToken()
|
||||||
|
.ValueGeneratedOnAddOrUpdate()
|
||||||
|
.HasColumnType("bytea")
|
||||||
|
.HasColumnName("timestamp");
|
||||||
|
|
||||||
|
b.Property<DateTime>("UploadDate")
|
||||||
|
.HasColumnType("timestamp with time zone")
|
||||||
|
.HasColumnName("upload_date");
|
||||||
|
|
||||||
|
b.Property<bool>("Uploaded")
|
||||||
|
.HasColumnType("boolean")
|
||||||
|
.HasColumnName("uploaded");
|
||||||
|
|
||||||
|
b.Property<string>("UploaderUID")
|
||||||
|
.HasMaxLength(10)
|
||||||
|
.HasColumnType("character varying(10)")
|
||||||
|
.HasColumnName("uploader_uid");
|
||||||
|
|
||||||
|
b.HasKey("Hash")
|
||||||
|
.HasName("pk_file_caches");
|
||||||
|
|
||||||
|
b.HasIndex("UploaderUID")
|
||||||
|
.HasDatabaseName("ix_file_caches_uploader_uid");
|
||||||
|
|
||||||
|
b.ToTable("file_caches", (string)null);
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("MareSynchronosShared.Models.ForbiddenUploadEntry", b =>
|
||||||
|
{
|
||||||
|
b.Property<string>("Hash")
|
||||||
|
.HasMaxLength(40)
|
||||||
|
.HasColumnType("character varying(40)")
|
||||||
|
.HasColumnName("hash");
|
||||||
|
|
||||||
|
b.Property<string>("ForbiddenBy")
|
||||||
|
.HasMaxLength(100)
|
||||||
|
.HasColumnType("character varying(100)")
|
||||||
|
.HasColumnName("forbidden_by");
|
||||||
|
|
||||||
|
b.Property<byte[]>("Timestamp")
|
||||||
|
.IsConcurrencyToken()
|
||||||
|
.ValueGeneratedOnAddOrUpdate()
|
||||||
|
.HasColumnType("bytea")
|
||||||
|
.HasColumnName("timestamp");
|
||||||
|
|
||||||
|
b.HasKey("Hash")
|
||||||
|
.HasName("pk_forbidden_upload_entries");
|
||||||
|
|
||||||
|
b.ToTable("forbidden_upload_entries", (string)null);
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("MareSynchronosShared.Models.Group", b =>
|
||||||
|
{
|
||||||
|
b.Property<string>("GID")
|
||||||
|
.HasMaxLength(20)
|
||||||
|
.HasColumnType("character varying(20)")
|
||||||
|
.HasColumnName("gid");
|
||||||
|
|
||||||
|
b.Property<string>("Alias")
|
||||||
|
.HasMaxLength(50)
|
||||||
|
.HasColumnType("character varying(50)")
|
||||||
|
.HasColumnName("alias");
|
||||||
|
|
||||||
|
b.Property<string>("HashedPassword")
|
||||||
|
.HasColumnType("text")
|
||||||
|
.HasColumnName("hashed_password");
|
||||||
|
|
||||||
|
b.Property<bool>("InvitesEnabled")
|
||||||
|
.HasColumnType("boolean")
|
||||||
|
.HasColumnName("invites_enabled");
|
||||||
|
|
||||||
|
b.Property<string>("OwnerUID")
|
||||||
|
.HasColumnType("character varying(10)")
|
||||||
|
.HasColumnName("owner_uid");
|
||||||
|
|
||||||
|
b.Property<bool>("PreferDisableAnimations")
|
||||||
|
.HasColumnType("boolean")
|
||||||
|
.HasColumnName("prefer_disable_animations");
|
||||||
|
|
||||||
|
b.Property<bool>("PreferDisableSounds")
|
||||||
|
.HasColumnType("boolean")
|
||||||
|
.HasColumnName("prefer_disable_sounds");
|
||||||
|
|
||||||
|
b.Property<bool>("PreferDisableVFX")
|
||||||
|
.HasColumnType("boolean")
|
||||||
|
.HasColumnName("prefer_disable_vfx");
|
||||||
|
|
||||||
|
b.HasKey("GID")
|
||||||
|
.HasName("pk_groups");
|
||||||
|
|
||||||
|
b.HasIndex("OwnerUID")
|
||||||
|
.HasDatabaseName("ix_groups_owner_uid");
|
||||||
|
|
||||||
|
b.ToTable("groups", (string)null);
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("MareSynchronosShared.Models.GroupBan", b =>
|
||||||
|
{
|
||||||
|
b.Property<string>("GroupGID")
|
||||||
|
.HasColumnType("character varying(20)")
|
||||||
|
.HasColumnName("group_gid");
|
||||||
|
|
||||||
|
b.Property<string>("BannedUserUID")
|
||||||
|
.HasColumnType("character varying(10)")
|
||||||
|
.HasColumnName("banned_user_uid");
|
||||||
|
|
||||||
|
b.Property<string>("BannedByUID")
|
||||||
|
.HasColumnType("character varying(10)")
|
||||||
|
.HasColumnName("banned_by_uid");
|
||||||
|
|
||||||
|
b.Property<DateTime>("BannedOn")
|
||||||
|
.HasColumnType("timestamp with time zone")
|
||||||
|
.HasColumnName("banned_on");
|
||||||
|
|
||||||
|
b.Property<string>("BannedReason")
|
||||||
|
.HasColumnType("text")
|
||||||
|
.HasColumnName("banned_reason");
|
||||||
|
|
||||||
|
b.HasKey("GroupGID", "BannedUserUID")
|
||||||
|
.HasName("pk_group_bans");
|
||||||
|
|
||||||
|
b.HasIndex("BannedByUID")
|
||||||
|
.HasDatabaseName("ix_group_bans_banned_by_uid");
|
||||||
|
|
||||||
|
b.HasIndex("BannedUserUID")
|
||||||
|
.HasDatabaseName("ix_group_bans_banned_user_uid");
|
||||||
|
|
||||||
|
b.HasIndex("GroupGID")
|
||||||
|
.HasDatabaseName("ix_group_bans_group_gid");
|
||||||
|
|
||||||
|
b.ToTable("group_bans", (string)null);
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("MareSynchronosShared.Models.GroupPair", b =>
|
||||||
|
{
|
||||||
|
b.Property<string>("GroupGID")
|
||||||
|
.HasColumnType("character varying(20)")
|
||||||
|
.HasColumnName("group_gid");
|
||||||
|
|
||||||
|
b.Property<string>("GroupUserUID")
|
||||||
|
.HasColumnType("character varying(10)")
|
||||||
|
.HasColumnName("group_user_uid");
|
||||||
|
|
||||||
|
b.Property<bool>("IsModerator")
|
||||||
|
.HasColumnType("boolean")
|
||||||
|
.HasColumnName("is_moderator");
|
||||||
|
|
||||||
|
b.Property<bool>("IsPinned")
|
||||||
|
.HasColumnType("boolean")
|
||||||
|
.HasColumnName("is_pinned");
|
||||||
|
|
||||||
|
b.HasKey("GroupGID", "GroupUserUID")
|
||||||
|
.HasName("pk_group_pairs");
|
||||||
|
|
||||||
|
b.HasIndex("GroupGID")
|
||||||
|
.HasDatabaseName("ix_group_pairs_group_gid");
|
||||||
|
|
||||||
|
b.HasIndex("GroupUserUID")
|
||||||
|
.HasDatabaseName("ix_group_pairs_group_user_uid");
|
||||||
|
|
||||||
|
b.ToTable("group_pairs", (string)null);
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("MareSynchronosShared.Models.GroupPairPreferredPermission", b =>
|
||||||
|
{
|
||||||
|
b.Property<string>("UserUID")
|
||||||
|
.HasColumnType("character varying(10)")
|
||||||
|
.HasColumnName("user_uid");
|
||||||
|
|
||||||
|
b.Property<string>("GroupGID")
|
||||||
|
.HasColumnType("character varying(20)")
|
||||||
|
.HasColumnName("group_gid");
|
||||||
|
|
||||||
|
b.Property<bool>("DisableAnimations")
|
||||||
|
.HasColumnType("boolean")
|
||||||
|
.HasColumnName("disable_animations");
|
||||||
|
|
||||||
|
b.Property<bool>("DisableSounds")
|
||||||
|
.HasColumnType("boolean")
|
||||||
|
.HasColumnName("disable_sounds");
|
||||||
|
|
||||||
|
b.Property<bool>("DisableVFX")
|
||||||
|
.HasColumnType("boolean")
|
||||||
|
.HasColumnName("disable_vfx");
|
||||||
|
|
||||||
|
b.Property<bool>("IsPaused")
|
||||||
|
.HasColumnType("boolean")
|
||||||
|
.HasColumnName("is_paused");
|
||||||
|
|
||||||
|
b.HasKey("UserUID", "GroupGID")
|
||||||
|
.HasName("pk_group_pair_preferred_permissions");
|
||||||
|
|
||||||
|
b.HasIndex("GroupGID")
|
||||||
|
.HasDatabaseName("ix_group_pair_preferred_permissions_group_gid");
|
||||||
|
|
||||||
|
b.HasIndex("UserUID")
|
||||||
|
.HasDatabaseName("ix_group_pair_preferred_permissions_user_uid");
|
||||||
|
|
||||||
|
b.ToTable("group_pair_preferred_permissions", (string)null);
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("MareSynchronosShared.Models.GroupTempInvite", b =>
|
||||||
|
{
|
||||||
|
b.Property<string>("GroupGID")
|
||||||
|
.HasColumnType("character varying(20)")
|
||||||
|
.HasColumnName("group_gid");
|
||||||
|
|
||||||
|
b.Property<string>("Invite")
|
||||||
|
.HasMaxLength(64)
|
||||||
|
.HasColumnType("character varying(64)")
|
||||||
|
.HasColumnName("invite");
|
||||||
|
|
||||||
|
b.Property<DateTime>("ExpirationDate")
|
||||||
|
.HasColumnType("timestamp with time zone")
|
||||||
|
.HasColumnName("expiration_date");
|
||||||
|
|
||||||
|
b.HasKey("GroupGID", "Invite")
|
||||||
|
.HasName("pk_group_temp_invites");
|
||||||
|
|
||||||
|
b.HasIndex("GroupGID")
|
||||||
|
.HasDatabaseName("ix_group_temp_invites_group_gid");
|
||||||
|
|
||||||
|
b.HasIndex("Invite")
|
||||||
|
.HasDatabaseName("ix_group_temp_invites_invite");
|
||||||
|
|
||||||
|
b.ToTable("group_temp_invites", (string)null);
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("MareSynchronosShared.Models.LodeStoneAuth", b =>
|
||||||
|
{
|
||||||
|
b.Property<decimal>("DiscordId")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("numeric(20,0)")
|
||||||
|
.HasColumnName("discord_id");
|
||||||
|
|
||||||
|
b.Property<string>("HashedLodestoneId")
|
||||||
|
.HasMaxLength(100)
|
||||||
|
.HasColumnType("character varying(100)")
|
||||||
|
.HasColumnName("hashed_lodestone_id");
|
||||||
|
|
||||||
|
b.Property<string>("LodestoneAuthString")
|
||||||
|
.HasMaxLength(100)
|
||||||
|
.HasColumnType("character varying(100)")
|
||||||
|
.HasColumnName("lodestone_auth_string");
|
||||||
|
|
||||||
|
b.Property<DateTime?>("StartedAt")
|
||||||
|
.HasColumnType("timestamp with time zone")
|
||||||
|
.HasColumnName("started_at");
|
||||||
|
|
||||||
|
b.Property<string>("UserUID")
|
||||||
|
.HasColumnType("character varying(10)")
|
||||||
|
.HasColumnName("user_uid");
|
||||||
|
|
||||||
|
b.HasKey("DiscordId")
|
||||||
|
.HasName("pk_lodestone_auth");
|
||||||
|
|
||||||
|
b.HasIndex("UserUID")
|
||||||
|
.HasDatabaseName("ix_lodestone_auth_user_uid");
|
||||||
|
|
||||||
|
b.ToTable("lodestone_auth", (string)null);
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("MareSynchronosShared.Models.User", b =>
|
||||||
|
{
|
||||||
|
b.Property<string>("UID")
|
||||||
|
.HasMaxLength(10)
|
||||||
|
.HasColumnType("character varying(10)")
|
||||||
|
.HasColumnName("uid");
|
||||||
|
|
||||||
|
b.Property<string>("Alias")
|
||||||
|
.HasMaxLength(15)
|
||||||
|
.HasColumnType("character varying(15)")
|
||||||
|
.HasColumnName("alias");
|
||||||
|
|
||||||
|
b.Property<bool>("IsAdmin")
|
||||||
|
.HasColumnType("boolean")
|
||||||
|
.HasColumnName("is_admin");
|
||||||
|
|
||||||
|
b.Property<bool>("IsModerator")
|
||||||
|
.HasColumnType("boolean")
|
||||||
|
.HasColumnName("is_moderator");
|
||||||
|
|
||||||
|
b.Property<DateTime>("LastLoggedIn")
|
||||||
|
.HasColumnType("timestamp with time zone")
|
||||||
|
.HasColumnName("last_logged_in");
|
||||||
|
|
||||||
|
b.Property<byte[]>("Timestamp")
|
||||||
|
.IsConcurrencyToken()
|
||||||
|
.ValueGeneratedOnAddOrUpdate()
|
||||||
|
.HasColumnType("bytea")
|
||||||
|
.HasColumnName("timestamp");
|
||||||
|
|
||||||
|
b.HasKey("UID")
|
||||||
|
.HasName("pk_users");
|
||||||
|
|
||||||
|
b.ToTable("users", (string)null);
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("MareSynchronosShared.Models.UserDefaultPreferredPermission", b =>
|
||||||
|
{
|
||||||
|
b.Property<string>("UserUID")
|
||||||
|
.HasMaxLength(10)
|
||||||
|
.HasColumnType("character varying(10)")
|
||||||
|
.HasColumnName("user_uid");
|
||||||
|
|
||||||
|
b.Property<bool>("DisableGroupAnimations")
|
||||||
|
.HasColumnType("boolean")
|
||||||
|
.HasColumnName("disable_group_animations");
|
||||||
|
|
||||||
|
b.Property<bool>("DisableGroupSounds")
|
||||||
|
.HasColumnType("boolean")
|
||||||
|
.HasColumnName("disable_group_sounds");
|
||||||
|
|
||||||
|
b.Property<bool>("DisableGroupVFX")
|
||||||
|
.HasColumnType("boolean")
|
||||||
|
.HasColumnName("disable_group_vfx");
|
||||||
|
|
||||||
|
b.Property<bool>("DisableIndividualAnimations")
|
||||||
|
.HasColumnType("boolean")
|
||||||
|
.HasColumnName("disable_individual_animations");
|
||||||
|
|
||||||
|
b.Property<bool>("DisableIndividualSounds")
|
||||||
|
.HasColumnType("boolean")
|
||||||
|
.HasColumnName("disable_individual_sounds");
|
||||||
|
|
||||||
|
b.Property<bool>("DisableIndividualVFX")
|
||||||
|
.HasColumnType("boolean")
|
||||||
|
.HasColumnName("disable_individual_vfx");
|
||||||
|
|
||||||
|
b.Property<bool>("IndividualIsSticky")
|
||||||
|
.HasColumnType("boolean")
|
||||||
|
.HasColumnName("individual_is_sticky");
|
||||||
|
|
||||||
|
b.HasKey("UserUID")
|
||||||
|
.HasName("pk_user_default_preferred_permissions");
|
||||||
|
|
||||||
|
b.HasIndex("UserUID")
|
||||||
|
.HasDatabaseName("ix_user_default_preferred_permissions_user_uid");
|
||||||
|
|
||||||
|
b.ToTable("user_default_preferred_permissions", (string)null);
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("MareSynchronosShared.Models.UserPermissionSet", b =>
|
||||||
|
{
|
||||||
|
b.Property<string>("UserUID")
|
||||||
|
.HasColumnType("character varying(10)")
|
||||||
|
.HasColumnName("user_uid");
|
||||||
|
|
||||||
|
b.Property<string>("OtherUserUID")
|
||||||
|
.HasColumnType("character varying(10)")
|
||||||
|
.HasColumnName("other_user_uid");
|
||||||
|
|
||||||
|
b.Property<bool>("DisableAnimations")
|
||||||
|
.HasColumnType("boolean")
|
||||||
|
.HasColumnName("disable_animations");
|
||||||
|
|
||||||
|
b.Property<bool>("DisableSounds")
|
||||||
|
.HasColumnType("boolean")
|
||||||
|
.HasColumnName("disable_sounds");
|
||||||
|
|
||||||
|
b.Property<bool>("DisableVFX")
|
||||||
|
.HasColumnType("boolean")
|
||||||
|
.HasColumnName("disable_vfx");
|
||||||
|
|
||||||
|
b.Property<bool>("IsPaused")
|
||||||
|
.HasColumnType("boolean")
|
||||||
|
.HasColumnName("is_paused");
|
||||||
|
|
||||||
|
b.Property<bool>("Sticky")
|
||||||
|
.HasColumnType("boolean")
|
||||||
|
.HasColumnName("sticky");
|
||||||
|
|
||||||
|
b.HasKey("UserUID", "OtherUserUID")
|
||||||
|
.HasName("pk_user_permission_sets");
|
||||||
|
|
||||||
|
b.HasIndex("OtherUserUID")
|
||||||
|
.HasDatabaseName("ix_user_permission_sets_other_user_uid");
|
||||||
|
|
||||||
|
b.HasIndex("UserUID")
|
||||||
|
.HasDatabaseName("ix_user_permission_sets_user_uid");
|
||||||
|
|
||||||
|
b.HasIndex("UserUID", "OtherUserUID", "IsPaused")
|
||||||
|
.HasDatabaseName("ix_user_permission_sets_user_uid_other_user_uid_is_paused");
|
||||||
|
|
||||||
|
b.ToTable("user_permission_sets", (string)null);
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("MareSynchronosShared.Models.UserProfileData", b =>
|
||||||
|
{
|
||||||
|
b.Property<string>("UserUID")
|
||||||
|
.HasColumnType("character varying(10)")
|
||||||
|
.HasColumnName("user_uid");
|
||||||
|
|
||||||
|
b.Property<string>("Base64ProfileImage")
|
||||||
|
.HasColumnType("text")
|
||||||
|
.HasColumnName("base64profile_image");
|
||||||
|
|
||||||
|
b.Property<bool>("FlaggedForReport")
|
||||||
|
.HasColumnType("boolean")
|
||||||
|
.HasColumnName("flagged_for_report");
|
||||||
|
|
||||||
|
b.Property<bool>("IsNSFW")
|
||||||
|
.HasColumnType("boolean")
|
||||||
|
.HasColumnName("is_nsfw");
|
||||||
|
|
||||||
|
b.Property<bool>("ProfileDisabled")
|
||||||
|
.HasColumnType("boolean")
|
||||||
|
.HasColumnName("profile_disabled");
|
||||||
|
|
||||||
|
b.Property<string>("UserDescription")
|
||||||
|
.HasColumnType("text")
|
||||||
|
.HasColumnName("user_description");
|
||||||
|
|
||||||
|
b.HasKey("UserUID")
|
||||||
|
.HasName("pk_user_profile_data");
|
||||||
|
|
||||||
|
b.ToTable("user_profile_data", (string)null);
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("MareSynchronosShared.Models.Auth", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("MareSynchronosShared.Models.User", "PrimaryUser")
|
||||||
|
.WithMany()
|
||||||
|
.HasForeignKey("PrimaryUserUID")
|
||||||
|
.HasConstraintName("fk_auth_users_primary_user_uid");
|
||||||
|
|
||||||
|
b.HasOne("MareSynchronosShared.Models.User", "User")
|
||||||
|
.WithMany()
|
||||||
|
.HasForeignKey("UserUID")
|
||||||
|
.HasConstraintName("fk_auth_users_user_uid");
|
||||||
|
|
||||||
|
b.Navigation("PrimaryUser");
|
||||||
|
|
||||||
|
b.Navigation("User");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("MareSynchronosShared.Models.ClientPair", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("MareSynchronosShared.Models.User", "OtherUser")
|
||||||
|
.WithMany()
|
||||||
|
.HasForeignKey("OtherUserUID")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired()
|
||||||
|
.HasConstraintName("fk_client_pairs_users_other_user_uid");
|
||||||
|
|
||||||
|
b.HasOne("MareSynchronosShared.Models.User", "User")
|
||||||
|
.WithMany()
|
||||||
|
.HasForeignKey("UserUID")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired()
|
||||||
|
.HasConstraintName("fk_client_pairs_users_user_uid");
|
||||||
|
|
||||||
|
b.Navigation("OtherUser");
|
||||||
|
|
||||||
|
b.Navigation("User");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("MareSynchronosShared.Models.FileCache", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("MareSynchronosShared.Models.User", "Uploader")
|
||||||
|
.WithMany()
|
||||||
|
.HasForeignKey("UploaderUID")
|
||||||
|
.HasConstraintName("fk_file_caches_users_uploader_uid");
|
||||||
|
|
||||||
|
b.Navigation("Uploader");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("MareSynchronosShared.Models.Group", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("MareSynchronosShared.Models.User", "Owner")
|
||||||
|
.WithMany()
|
||||||
|
.HasForeignKey("OwnerUID")
|
||||||
|
.HasConstraintName("fk_groups_users_owner_uid");
|
||||||
|
|
||||||
|
b.Navigation("Owner");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("MareSynchronosShared.Models.GroupBan", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("MareSynchronosShared.Models.User", "BannedBy")
|
||||||
|
.WithMany()
|
||||||
|
.HasForeignKey("BannedByUID")
|
||||||
|
.HasConstraintName("fk_group_bans_users_banned_by_uid");
|
||||||
|
|
||||||
|
b.HasOne("MareSynchronosShared.Models.User", "BannedUser")
|
||||||
|
.WithMany()
|
||||||
|
.HasForeignKey("BannedUserUID")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired()
|
||||||
|
.HasConstraintName("fk_group_bans_users_banned_user_uid");
|
||||||
|
|
||||||
|
b.HasOne("MareSynchronosShared.Models.Group", "Group")
|
||||||
|
.WithMany()
|
||||||
|
.HasForeignKey("GroupGID")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired()
|
||||||
|
.HasConstraintName("fk_group_bans_groups_group_gid");
|
||||||
|
|
||||||
|
b.Navigation("BannedBy");
|
||||||
|
|
||||||
|
b.Navigation("BannedUser");
|
||||||
|
|
||||||
|
b.Navigation("Group");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("MareSynchronosShared.Models.GroupPair", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("MareSynchronosShared.Models.Group", "Group")
|
||||||
|
.WithMany()
|
||||||
|
.HasForeignKey("GroupGID")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired()
|
||||||
|
.HasConstraintName("fk_group_pairs_groups_group_gid");
|
||||||
|
|
||||||
|
b.HasOne("MareSynchronosShared.Models.User", "GroupUser")
|
||||||
|
.WithMany()
|
||||||
|
.HasForeignKey("GroupUserUID")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired()
|
||||||
|
.HasConstraintName("fk_group_pairs_users_group_user_uid");
|
||||||
|
|
||||||
|
b.Navigation("Group");
|
||||||
|
|
||||||
|
b.Navigation("GroupUser");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("MareSynchronosShared.Models.GroupPairPreferredPermission", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("MareSynchronosShared.Models.Group", "Group")
|
||||||
|
.WithMany()
|
||||||
|
.HasForeignKey("GroupGID")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired()
|
||||||
|
.HasConstraintName("fk_group_pair_preferred_permissions_groups_group_gid");
|
||||||
|
|
||||||
|
b.HasOne("MareSynchronosShared.Models.User", "User")
|
||||||
|
.WithMany()
|
||||||
|
.HasForeignKey("UserUID")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired()
|
||||||
|
.HasConstraintName("fk_group_pair_preferred_permissions_users_user_uid");
|
||||||
|
|
||||||
|
b.Navigation("Group");
|
||||||
|
|
||||||
|
b.Navigation("User");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("MareSynchronosShared.Models.GroupTempInvite", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("MareSynchronosShared.Models.Group", "Group")
|
||||||
|
.WithMany()
|
||||||
|
.HasForeignKey("GroupGID")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired()
|
||||||
|
.HasConstraintName("fk_group_temp_invites_groups_group_gid");
|
||||||
|
|
||||||
|
b.Navigation("Group");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("MareSynchronosShared.Models.LodeStoneAuth", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("MareSynchronosShared.Models.User", "User")
|
||||||
|
.WithMany()
|
||||||
|
.HasForeignKey("UserUID")
|
||||||
|
.HasConstraintName("fk_lodestone_auth_users_user_uid");
|
||||||
|
|
||||||
|
b.Navigation("User");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("MareSynchronosShared.Models.UserDefaultPreferredPermission", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("MareSynchronosShared.Models.User", "User")
|
||||||
|
.WithMany()
|
||||||
|
.HasForeignKey("UserUID")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired()
|
||||||
|
.HasConstraintName("fk_user_default_preferred_permissions_users_user_uid");
|
||||||
|
|
||||||
|
b.Navigation("User");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("MareSynchronosShared.Models.UserPermissionSet", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("MareSynchronosShared.Models.User", "OtherUser")
|
||||||
|
.WithMany()
|
||||||
|
.HasForeignKey("OtherUserUID")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired()
|
||||||
|
.HasConstraintName("fk_user_permission_sets_users_other_user_uid");
|
||||||
|
|
||||||
|
b.HasOne("MareSynchronosShared.Models.User", "User")
|
||||||
|
.WithMany()
|
||||||
|
.HasForeignKey("UserUID")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired()
|
||||||
|
.HasConstraintName("fk_user_permission_sets_users_user_uid");
|
||||||
|
|
||||||
|
b.Navigation("OtherUser");
|
||||||
|
|
||||||
|
b.Navigation("User");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("MareSynchronosShared.Models.UserProfileData", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("MareSynchronosShared.Models.User", "User")
|
||||||
|
.WithMany()
|
||||||
|
.HasForeignKey("UserUID")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired()
|
||||||
|
.HasConstraintName("fk_user_profile_data_users_user_uid");
|
||||||
|
|
||||||
|
b.Navigation("User");
|
||||||
|
});
|
||||||
|
#pragma warning restore 612, 618
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,59 @@
|
|||||||
|
using System;
|
||||||
|
using Microsoft.EntityFrameworkCore.Migrations;
|
||||||
|
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
|
||||||
|
|
||||||
|
#nullable disable
|
||||||
|
|
||||||
|
namespace MareSynchronosServer.Migrations
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
public partial class RemoveReport : Migration
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
protected override void Up(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.DropTable(
|
||||||
|
name: "user_profile_data_reports");
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
|
protected override void Down(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.CreateTable(
|
||||||
|
name: "user_profile_data_reports",
|
||||||
|
columns: table => new
|
||||||
|
{
|
||||||
|
id = table.Column<int>(type: "integer", nullable: false)
|
||||||
|
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
|
||||||
|
reported_user_uid = table.Column<string>(type: "character varying(10)", nullable: true),
|
||||||
|
reporting_user_uid = table.Column<string>(type: "character varying(10)", nullable: true),
|
||||||
|
report_date = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),
|
||||||
|
report_reason = table.Column<string>(type: "text", nullable: true)
|
||||||
|
},
|
||||||
|
constraints: table =>
|
||||||
|
{
|
||||||
|
table.PrimaryKey("pk_user_profile_data_reports", x => x.id);
|
||||||
|
table.ForeignKey(
|
||||||
|
name: "fk_user_profile_data_reports_users_reported_user_uid",
|
||||||
|
column: x => x.reported_user_uid,
|
||||||
|
principalTable: "users",
|
||||||
|
principalColumn: "uid");
|
||||||
|
table.ForeignKey(
|
||||||
|
name: "fk_user_profile_data_reports_users_reporting_user_uid",
|
||||||
|
column: x => x.reporting_user_uid,
|
||||||
|
principalTable: "users",
|
||||||
|
principalColumn: "uid");
|
||||||
|
});
|
||||||
|
|
||||||
|
migrationBuilder.CreateIndex(
|
||||||
|
name: "ix_user_profile_data_reports_reported_user_uid",
|
||||||
|
table: "user_profile_data_reports",
|
||||||
|
column: "reported_user_uid");
|
||||||
|
|
||||||
|
migrationBuilder.CreateIndex(
|
||||||
|
name: "ix_user_profile_data_reports_reporting_user_uid",
|
||||||
|
table: "user_profile_data_reports",
|
||||||
|
column: "reporting_user_uid");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -17,7 +17,7 @@ namespace MareSynchronosServer.Migrations
|
|||||||
{
|
{
|
||||||
#pragma warning disable 612, 618
|
#pragma warning disable 612, 618
|
||||||
modelBuilder
|
modelBuilder
|
||||||
.HasAnnotation("ProductVersion", "7.0.12")
|
.HasAnnotation("ProductVersion", "8.0.4")
|
||||||
.HasAnnotation("Relational:MaxIdentifierLength", 63);
|
.HasAnnotation("Relational:MaxIdentifierLength", 63);
|
||||||
|
|
||||||
NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
|
NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
|
||||||
@@ -33,6 +33,10 @@ namespace MareSynchronosServer.Migrations
|
|||||||
.HasColumnType("boolean")
|
.HasColumnType("boolean")
|
||||||
.HasColumnName("is_banned");
|
.HasColumnName("is_banned");
|
||||||
|
|
||||||
|
b.Property<bool>("MarkForBan")
|
||||||
|
.HasColumnType("boolean")
|
||||||
|
.HasColumnName("mark_for_ban");
|
||||||
|
|
||||||
b.Property<string>("PrimaryUserUID")
|
b.Property<string>("PrimaryUserUID")
|
||||||
.HasColumnType("character varying(10)")
|
.HasColumnType("character varying(10)")
|
||||||
.HasColumnName("primary_user_uid");
|
.HasColumnName("primary_user_uid");
|
||||||
@@ -550,54 +554,17 @@ namespace MareSynchronosServer.Migrations
|
|||||||
b.ToTable("user_profile_data", (string)null);
|
b.ToTable("user_profile_data", (string)null);
|
||||||
});
|
});
|
||||||
|
|
||||||
modelBuilder.Entity("MareSynchronosShared.Models.UserProfileDataReport", b =>
|
|
||||||
{
|
|
||||||
b.Property<int>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("integer")
|
|
||||||
.HasColumnName("id");
|
|
||||||
|
|
||||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
|
||||||
|
|
||||||
b.Property<DateTime>("ReportDate")
|
|
||||||
.HasColumnType("timestamp with time zone")
|
|
||||||
.HasColumnName("report_date");
|
|
||||||
|
|
||||||
b.Property<string>("ReportReason")
|
|
||||||
.HasColumnType("text")
|
|
||||||
.HasColumnName("report_reason");
|
|
||||||
|
|
||||||
b.Property<string>("ReportedUserUID")
|
|
||||||
.HasColumnType("character varying(10)")
|
|
||||||
.HasColumnName("reported_user_uid");
|
|
||||||
|
|
||||||
b.Property<string>("ReportingUserUID")
|
|
||||||
.HasColumnType("character varying(10)")
|
|
||||||
.HasColumnName("reporting_user_uid");
|
|
||||||
|
|
||||||
b.HasKey("Id")
|
|
||||||
.HasName("pk_user_profile_data_reports");
|
|
||||||
|
|
||||||
b.HasIndex("ReportedUserUID")
|
|
||||||
.HasDatabaseName("ix_user_profile_data_reports_reported_user_uid");
|
|
||||||
|
|
||||||
b.HasIndex("ReportingUserUID")
|
|
||||||
.HasDatabaseName("ix_user_profile_data_reports_reporting_user_uid");
|
|
||||||
|
|
||||||
b.ToTable("user_profile_data_reports", (string)null);
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("MareSynchronosShared.Models.Auth", b =>
|
modelBuilder.Entity("MareSynchronosShared.Models.Auth", b =>
|
||||||
{
|
{
|
||||||
b.HasOne("MareSynchronosShared.Models.User", "PrimaryUser")
|
b.HasOne("MareSynchronosShared.Models.User", "PrimaryUser")
|
||||||
.WithMany()
|
.WithMany()
|
||||||
.HasForeignKey("PrimaryUserUID")
|
.HasForeignKey("PrimaryUserUID")
|
||||||
.HasConstraintName("fk_auth_users_primary_user_temp_id");
|
.HasConstraintName("fk_auth_users_primary_user_uid");
|
||||||
|
|
||||||
b.HasOne("MareSynchronosShared.Models.User", "User")
|
b.HasOne("MareSynchronosShared.Models.User", "User")
|
||||||
.WithMany()
|
.WithMany()
|
||||||
.HasForeignKey("UserUID")
|
.HasForeignKey("UserUID")
|
||||||
.HasConstraintName("fk_auth_users_user_temp_id1");
|
.HasConstraintName("fk_auth_users_user_uid");
|
||||||
|
|
||||||
b.Navigation("PrimaryUser");
|
b.Navigation("PrimaryUser");
|
||||||
|
|
||||||
@@ -611,14 +578,14 @@ namespace MareSynchronosServer.Migrations
|
|||||||
.HasForeignKey("OtherUserUID")
|
.HasForeignKey("OtherUserUID")
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
.IsRequired()
|
.IsRequired()
|
||||||
.HasConstraintName("fk_client_pairs_users_other_user_temp_id2");
|
.HasConstraintName("fk_client_pairs_users_other_user_uid");
|
||||||
|
|
||||||
b.HasOne("MareSynchronosShared.Models.User", "User")
|
b.HasOne("MareSynchronosShared.Models.User", "User")
|
||||||
.WithMany()
|
.WithMany()
|
||||||
.HasForeignKey("UserUID")
|
.HasForeignKey("UserUID")
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
.IsRequired()
|
.IsRequired()
|
||||||
.HasConstraintName("fk_client_pairs_users_user_temp_id3");
|
.HasConstraintName("fk_client_pairs_users_user_uid");
|
||||||
|
|
||||||
b.Navigation("OtherUser");
|
b.Navigation("OtherUser");
|
||||||
|
|
||||||
@@ -640,7 +607,7 @@ namespace MareSynchronosServer.Migrations
|
|||||||
b.HasOne("MareSynchronosShared.Models.User", "Owner")
|
b.HasOne("MareSynchronosShared.Models.User", "Owner")
|
||||||
.WithMany()
|
.WithMany()
|
||||||
.HasForeignKey("OwnerUID")
|
.HasForeignKey("OwnerUID")
|
||||||
.HasConstraintName("fk_groups_users_owner_temp_id9");
|
.HasConstraintName("fk_groups_users_owner_uid");
|
||||||
|
|
||||||
b.Navigation("Owner");
|
b.Navigation("Owner");
|
||||||
});
|
});
|
||||||
@@ -650,21 +617,21 @@ namespace MareSynchronosServer.Migrations
|
|||||||
b.HasOne("MareSynchronosShared.Models.User", "BannedBy")
|
b.HasOne("MareSynchronosShared.Models.User", "BannedBy")
|
||||||
.WithMany()
|
.WithMany()
|
||||||
.HasForeignKey("BannedByUID")
|
.HasForeignKey("BannedByUID")
|
||||||
.HasConstraintName("fk_group_bans_users_banned_by_temp_id5");
|
.HasConstraintName("fk_group_bans_users_banned_by_uid");
|
||||||
|
|
||||||
b.HasOne("MareSynchronosShared.Models.User", "BannedUser")
|
b.HasOne("MareSynchronosShared.Models.User", "BannedUser")
|
||||||
.WithMany()
|
.WithMany()
|
||||||
.HasForeignKey("BannedUserUID")
|
.HasForeignKey("BannedUserUID")
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
.IsRequired()
|
.IsRequired()
|
||||||
.HasConstraintName("fk_group_bans_users_banned_user_temp_id6");
|
.HasConstraintName("fk_group_bans_users_banned_user_uid");
|
||||||
|
|
||||||
b.HasOne("MareSynchronosShared.Models.Group", "Group")
|
b.HasOne("MareSynchronosShared.Models.Group", "Group")
|
||||||
.WithMany()
|
.WithMany()
|
||||||
.HasForeignKey("GroupGID")
|
.HasForeignKey("GroupGID")
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
.IsRequired()
|
.IsRequired()
|
||||||
.HasConstraintName("fk_group_bans_groups_group_temp_id");
|
.HasConstraintName("fk_group_bans_groups_group_gid");
|
||||||
|
|
||||||
b.Navigation("BannedBy");
|
b.Navigation("BannedBy");
|
||||||
|
|
||||||
@@ -680,14 +647,14 @@ namespace MareSynchronosServer.Migrations
|
|||||||
.HasForeignKey("GroupGID")
|
.HasForeignKey("GroupGID")
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
.IsRequired()
|
.IsRequired()
|
||||||
.HasConstraintName("fk_group_pairs_groups_group_temp_id2");
|
.HasConstraintName("fk_group_pairs_groups_group_gid");
|
||||||
|
|
||||||
b.HasOne("MareSynchronosShared.Models.User", "GroupUser")
|
b.HasOne("MareSynchronosShared.Models.User", "GroupUser")
|
||||||
.WithMany()
|
.WithMany()
|
||||||
.HasForeignKey("GroupUserUID")
|
.HasForeignKey("GroupUserUID")
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
.IsRequired()
|
.IsRequired()
|
||||||
.HasConstraintName("fk_group_pairs_users_group_user_temp_id8");
|
.HasConstraintName("fk_group_pairs_users_group_user_uid");
|
||||||
|
|
||||||
b.Navigation("Group");
|
b.Navigation("Group");
|
||||||
|
|
||||||
@@ -701,14 +668,14 @@ namespace MareSynchronosServer.Migrations
|
|||||||
.HasForeignKey("GroupGID")
|
.HasForeignKey("GroupGID")
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
.IsRequired()
|
.IsRequired()
|
||||||
.HasConstraintName("fk_group_pair_preferred_permissions_groups_group_temp_id1");
|
.HasConstraintName("fk_group_pair_preferred_permissions_groups_group_gid");
|
||||||
|
|
||||||
b.HasOne("MareSynchronosShared.Models.User", "User")
|
b.HasOne("MareSynchronosShared.Models.User", "User")
|
||||||
.WithMany()
|
.WithMany()
|
||||||
.HasForeignKey("UserUID")
|
.HasForeignKey("UserUID")
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
.IsRequired()
|
.IsRequired()
|
||||||
.HasConstraintName("fk_group_pair_preferred_permissions_users_user_temp_id7");
|
.HasConstraintName("fk_group_pair_preferred_permissions_users_user_uid");
|
||||||
|
|
||||||
b.Navigation("Group");
|
b.Navigation("Group");
|
||||||
|
|
||||||
@@ -781,23 +748,6 @@ namespace MareSynchronosServer.Migrations
|
|||||||
|
|
||||||
b.Navigation("User");
|
b.Navigation("User");
|
||||||
});
|
});
|
||||||
|
|
||||||
modelBuilder.Entity("MareSynchronosShared.Models.UserProfileDataReport", b =>
|
|
||||||
{
|
|
||||||
b.HasOne("MareSynchronosShared.Models.User", "ReportedUser")
|
|
||||||
.WithMany()
|
|
||||||
.HasForeignKey("ReportedUserUID")
|
|
||||||
.HasConstraintName("fk_user_profile_data_reports_users_reported_user_uid");
|
|
||||||
|
|
||||||
b.HasOne("MareSynchronosShared.Models.User", "ReportingUser")
|
|
||||||
.WithMany()
|
|
||||||
.HasForeignKey("ReportingUserUID")
|
|
||||||
.HasConstraintName("fk_user_profile_data_reports_users_reporting_user_uid");
|
|
||||||
|
|
||||||
b.Navigation("ReportedUser");
|
|
||||||
|
|
||||||
b.Navigation("ReportingUser");
|
|
||||||
});
|
|
||||||
#pragma warning restore 612, 618
|
#pragma warning restore 612, 618
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ public class Auth
|
|||||||
|
|
||||||
public string UserUID { get; set; }
|
public string UserUID { get; set; }
|
||||||
public User User { get; set; }
|
public User User { get; set; }
|
||||||
|
public bool MarkForBan { get; set; }
|
||||||
public bool IsBanned { get; set; }
|
public bool IsBanned { get; set; }
|
||||||
public string? PrimaryUserUID { get; set; }
|
public string? PrimaryUserUID { get; set; }
|
||||||
public User? PrimaryUser { get; set; }
|
public User? PrimaryUser { get; set; }
|
||||||
|
|||||||
@@ -1,24 +0,0 @@
|
|||||||
using System.ComponentModel.DataAnnotations;
|
|
||||||
using System.ComponentModel.DataAnnotations.Schema;
|
|
||||||
|
|
||||||
namespace MareSynchronosShared.Models;
|
|
||||||
|
|
||||||
public class UserProfileDataReport
|
|
||||||
{
|
|
||||||
[Key]
|
|
||||||
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
|
||||||
public int Id { get; set; }
|
|
||||||
|
|
||||||
public DateTime ReportDate { get; set; }
|
|
||||||
public User ReportedUser { get; set; }
|
|
||||||
|
|
||||||
[ForeignKey(nameof(ReportedUser))]
|
|
||||||
public string ReportedUserUID { get; set; }
|
|
||||||
|
|
||||||
public User ReportingUser { get; set; }
|
|
||||||
|
|
||||||
[ForeignKey(nameof(ReportingUser))]
|
|
||||||
public string ReportingUserUID { get; set; }
|
|
||||||
|
|
||||||
public string ReportReason { get; set; }
|
|
||||||
}
|
|
||||||
@@ -6,7 +6,6 @@ public class ServicesConfiguration : MareConfigurationBase
|
|||||||
{
|
{
|
||||||
public string DiscordBotToken { get; set; } = string.Empty;
|
public string DiscordBotToken { get; set; } = string.Empty;
|
||||||
public ulong? DiscordChannelForMessages { get; set; } = null;
|
public ulong? DiscordChannelForMessages { get; set; } = null;
|
||||||
public ulong? DiscordChannelForReports { get; set; } = null;
|
|
||||||
public ulong? DiscordChannelForCommands { get; set; } = null;
|
public ulong? DiscordChannelForCommands { get; set; } = null;
|
||||||
public ulong? DiscordRoleAprilFools2024 { get; set; } = null;
|
public ulong? DiscordRoleAprilFools2024 { get; set; } = null;
|
||||||
public Uri MainServerAddress { get; set; } = null;
|
public Uri MainServerAddress { get; set; } = null;
|
||||||
@@ -19,7 +18,6 @@ public class ServicesConfiguration : MareConfigurationBase
|
|||||||
sb.AppendLine($"{nameof(DiscordBotToken)} => {DiscordBotToken}");
|
sb.AppendLine($"{nameof(DiscordBotToken)} => {DiscordBotToken}");
|
||||||
sb.AppendLine($"{nameof(MainServerAddress)} => {MainServerAddress}");
|
sb.AppendLine($"{nameof(MainServerAddress)} => {MainServerAddress}");
|
||||||
sb.AppendLine($"{nameof(DiscordChannelForMessages)} => {DiscordChannelForMessages}");
|
sb.AppendLine($"{nameof(DiscordChannelForMessages)} => {DiscordChannelForMessages}");
|
||||||
sb.AppendLine($"{nameof(DiscordChannelForReports)} => {DiscordChannelForReports}");
|
|
||||||
sb.AppendLine($"{nameof(DiscordChannelForCommands)} => {DiscordChannelForCommands}");
|
sb.AppendLine($"{nameof(DiscordChannelForCommands)} => {DiscordChannelForCommands}");
|
||||||
sb.AppendLine($"{nameof(DiscordRoleAprilFools2024)} => {DiscordRoleAprilFools2024}");
|
sb.AppendLine($"{nameof(DiscordRoleAprilFools2024)} => {DiscordRoleAprilFools2024}");
|
||||||
foreach (var role in VanityRoles)
|
foreach (var role in VanityRoles)
|
||||||
|
|||||||
Reference in New Issue
Block a user