diff --git a/mixyboos-api/Controllers/AccountController.cs b/mixyboos-api/Controllers/AccountController.cs index 6370e8c..292cc2f 100644 --- a/mixyboos-api/Controllers/AccountController.cs +++ b/mixyboos-api/Controllers/AccountController.cs @@ -1,9 +1,6 @@ -using System.IO; -using System.Linq; using System.Security.Claims; using System.Threading.Tasks; using Bogus; -using Mapster; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Identity; using Microsoft.AspNetCore.Mvc; @@ -13,72 +10,69 @@ using MixyBoos.Api.Data.DTO; using MixyBoos.Api.Data.Models; using MixyBoos.Api.Data.Utils; -using MixyBoos.Api.Services.Extensions; -using MixyBoos.Api.Services.Helpers; -using OpenIddict.Validation.AspNetCore; namespace MixyBoos.Api.Controllers { - [Authorize(AuthenticationSchemes = OpenIddictValidationAspNetCoreDefaults.AuthenticationScheme)] - [Route("[controller]")] - public class AccountController : _Controller { - private readonly UserManager _userManager; - private readonly MixyBoosContext _context; - private readonly IConfiguration _config; - private readonly ImageCacher _imageCacher; + [Authorize] + [Route("[controller]")] + public class AccountController : _Controller { + private readonly UserManager _userManager; + private readonly MixyBoosContext _context; + private readonly IConfiguration _config; + private readonly ImageCacher _imageCacher; - public AccountController( - UserManager userManager, - MixyBoosContext dbContext, - IConfiguration config, - ImageCacher imageCacher, - ILogger logger) : base(logger) { - _userManager = userManager; - _context = dbContext; - _config = config; - _imageCacher = imageCacher; - } - - // - // POST: /Account/Register - [HttpPost("register")] - [AllowAnonymous] - public async Task Register([FromBody] RegisterDTO model) { - if (!ModelState.IsValid) { - return BadRequest(ModelState); - } + public AccountController( + UserManager userManager, + MixyBoosContext dbContext, + IConfiguration config, + ImageCacher imageCacher, + ILogger logger) : base(logger) { + _userManager = userManager; + _context = dbContext; + _config = config; + _imageCacher = imageCacher; + } - var faker = new Faker("en"); - var user = new MixyBoosUser { - UserName = model.UserName, - Email = model.UserName, - DisplayName = model.DisplayName, - Title = faker.Name.JobTitle() - }; - var result = await _userManager.CreateAsync(user, model.Password); + // + // POST: /Account/Register + [HttpPost("register")] + [AllowAnonymous] + public async Task Register([FromBody] RegisterDTO model) { + if (!ModelState.IsValid) { + return BadRequest(ModelState); + } - if (result.Succeeded) { - await _imageCacher.CacheUserImages(user, _config); + var faker = new Faker("en"); + var user = new MixyBoosUser { + UserName = model.UserName, + Email = model.UserName, + DisplayName = model.DisplayName, + Title = faker.Name.JobTitle() + }; + var result = await _userManager.CreateAsync(user, model.Password); - await _userManager.UpdateAsync(user); - await _userManager.AddClaimAsync(user, new Claim(ClaimTypes.Email, user.Email)); - return Ok(model); - } + if (result.Succeeded) { + await _imageCacher.CacheUserImages(user, _config); - AddErrors(result); + await _userManager.UpdateAsync(user); + await _userManager.AddClaimAsync(user, new Claim(ClaimTypes.Email, user.Email)); + return Ok(model); + } - // If we got this far, something failed. - return BadRequest(ModelState); - } + AddErrors(result); + // If we got this far, something failed. + return BadRequest(ModelState); + } - #region Helpers - private void AddErrors(IdentityResult result) { - foreach (var error in result.Errors) { - ModelState.AddModelError(string.Empty, error.Description); - } - } + #region Helpers - #endregion + private void AddErrors(IdentityResult result) { + foreach (var error in result.Errors) { + ModelState.AddModelError(string.Empty, error.Description); + } } + + #endregion + } } diff --git a/mixyboos-api/Controllers/AuthorizationController.cs b/mixyboos-api/Controllers/AuthorizationController.cs deleted file mode 100644 index 139e615..0000000 --- a/mixyboos-api/Controllers/AuthorizationController.cs +++ /dev/null @@ -1,235 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Security.Claims; -using System.Threading.Tasks; -using Microsoft.AspNetCore; -using Microsoft.AspNetCore.Authentication; -using Microsoft.AspNetCore.Authentication.Cookies; -using Microsoft.AspNetCore.Authorization; -using Microsoft.AspNetCore.Http; -using Microsoft.AspNetCore.Identity; -using Microsoft.AspNetCore.Mvc; -using Microsoft.Extensions.Logging; -using Microsoft.IdentityModel.Tokens; -using MixyBoos.Api.Data; -using MixyBoos.Api.Data.Models; -using MixyBoos.Api.Services.Helpers; -using OpenIddict.Abstractions; -using OpenIddict.Server.AspNetCore; -using static OpenIddict.Abstractions.OpenIddictConstants; - - -namespace MixyBoos.Api.Controllers { - public class AuthorizationController : _Controller { - const int ACCESS_TOKEN_EXPIRY = 43800; //minutes - const int REFRESH_TOKEN_EXPIRY = 30; //days - - private readonly SignInManager _signInManager; - private readonly UserManager _userManager; - private readonly ImageHelper _imageHelper; - - public AuthorizationController( - SignInManager signInManager, - UserManager userManager, - ImageHelper imageHelper, - ILogger logger) : base(logger) { - _signInManager = signInManager; - _userManager = userManager; - _imageHelper = imageHelper; - } - - - [HttpPost("~/connect/token")] - [Produces("application/json")] - public async Task Exchange() { - var request = HttpContext.GetOpenIddictServerRequest(); - if (request.IsClientCredentialsGrantType() || request.IsPasswordGrantType()) { - var user = await _userManager.FindByNameAsync(request.Username); - if (user == null) { - var properties = new AuthenticationProperties(new Dictionary { - [OpenIddictServerAspNetCoreConstants.Properties.Error] = Errors.InvalidGrant, - [OpenIddictServerAspNetCoreConstants.Properties.ErrorDescription] = - "The username/password couple is invalid." - }); - - return Forbid(properties, OpenIddictServerAspNetCoreDefaults.AuthenticationScheme); - } - - if (!await _signInManager.CanSignInAsync(user) || - (_userManager.SupportsUserLockout && await _userManager.IsLockedOutAsync(user))) { - var properties = new AuthenticationProperties(new Dictionary { - [OpenIddictServerAspNetCoreConstants.Properties.Error] = Errors.InvalidGrant, - [OpenIddictServerAspNetCoreConstants.Properties.ErrorDescription] = - "This user is currently not allowed to sign in." - }); - return Forbid(properties, OpenIddictServerAspNetCoreDefaults.AuthenticationScheme); - } - - var result = - await _signInManager.CheckPasswordSignInAsync(user, request.Password, lockoutOnFailure: true); - if (!result.Succeeded) { - var properties = new AuthenticationProperties(new Dictionary { - [OpenIddictServerAspNetCoreConstants.Properties.Error] = Errors.InvalidGrant, - [OpenIddictServerAspNetCoreConstants.Properties.ErrorDescription] = - "The username/password couple is invalid." - }); - return Forbid(properties, OpenIddictServerAspNetCoreDefaults.AuthenticationScheme); - } - - if (_userManager.SupportsUserLockout) { - await _userManager.ResetAccessFailedCountAsync(user); - } - - //TODO: This probably shouldn't be here - - // Create a new ClaimsPrincipal containing the claims that - // will be used to create an id_token, a token or a code. - var principal = await _signInManager.CreateUserPrincipalAsync(user); - - // Set the list of scopes granted to the client application. - // Note: the offline_access scope must be granted - // to allow OpenIddict to return a refresh token. - principal.SetScopes(new[] { - Scopes.OpenId, - Scopes.Email, - Scopes.Profile, - Scopes.OfflineAccess, - Scopes.Roles - }.Intersect(request.GetScopes())); - - principal.SetAccessTokenLifetime(TimeSpan.FromMinutes(ACCESS_TOKEN_EXPIRY)) - .SetAuthorizationCodeLifetime(TimeSpan.FromMinutes(ACCESS_TOKEN_EXPIRY)) - .SetIdentityTokenLifetime(TimeSpan.FromMinutes(ACCESS_TOKEN_EXPIRY)) - .SetRefreshTokenLifetime(TimeSpan.FromDays(REFRESH_TOKEN_EXPIRY)); - - foreach (var claim in principal.Claims) { - claim.SetDestinations(GetDestinations(claim, principal)); - } - - return SignIn(principal, OpenIddictServerAspNetCoreDefaults.AuthenticationScheme); - } - - if (request.IsRefreshTokenGrantType()) { - // Retrieve the claims principal stored in^ the refresh token. - var info = await HttpContext.AuthenticateAsync(OpenIddictServerAspNetCoreDefaults.AuthenticationScheme); - - // Retrieve the user profile corresponding to the refresh token. - // Note: if you want to automatically invalidate the refresh token - // when the user password/roles change, use the following line instead: - // var user = _signInManager.ValidateSecurityStampAsync(info.Principal); - var user = await _userManager.GetUserAsync(info.Principal); - if (user == null) { - var properties = new AuthenticationProperties(new Dictionary { - [OpenIddictServerAspNetCoreConstants.Properties.Error] = Errors.InvalidGrant, - [OpenIddictServerAspNetCoreConstants.Properties.ErrorDescription] = - "The refresh token is no longer valid." - }); - - return Forbid(properties, OpenIddictServerAspNetCoreDefaults.AuthenticationScheme); - } - - // Ensure the user is still allowed to sign in. - if (!await _signInManager.CanSignInAsync(user)) { - var properties = new AuthenticationProperties(new Dictionary { - [OpenIddictServerAspNetCoreConstants.Properties.Error] = Errors.InvalidGrant, - [OpenIddictServerAspNetCoreConstants.Properties.ErrorDescription] = - "The user is no longer allowed to sign in." - }); - - return Forbid(properties, OpenIddictServerAspNetCoreDefaults.AuthenticationScheme); - } - - // Create a new ClaimsPrincipal containing the claims that - // will be used to create an id_token, a token or a code. - var principal = await _signInManager.CreateUserPrincipalAsync(user); - - foreach (var claim in principal.Claims) { - claim.SetDestinations(GetDestinations(claim, principal)); - } - - return SignIn(principal, OpenIddictServerAspNetCoreDefaults.AuthenticationScheme); - } - - throw new NotImplementedException("The specified grant type is not implemented."); - } - - [HttpGet("~/connect/authorize")] - [HttpPost("~/connect/authorize")] - [IgnoreAntiforgeryToken] - public async Task Authorize() { - var request = HttpContext.GetOpenIddictServerRequest() ?? - throw new InvalidOperationException("The OpenID Connect request cannot be retrieved."); - - // Retrieve the user principal stored in the authentication cookie. - var result = await HttpContext.AuthenticateAsync(CookieAuthenticationDefaults.AuthenticationScheme); - - // If the user principal can't be extracted, redirect the user to the login page. - if (!result.Succeeded) { - return Challenge( - authenticationSchemes: CookieAuthenticationDefaults.AuthenticationScheme, - properties: new AuthenticationProperties { - RedirectUri = Request.PathBase + Request.Path + QueryString.Create( - Request.HasFormContentType ? Request.Form.ToList() : Request.Query.ToList()) - }); - } - - // Create a new claims principal - var claims = new List { - // 'subject' claim which is required - new Claim(OpenIddictConstants.Claims.Subject, result.Principal.Identity.Name), - new Claim("some claim", "some value").SetDestinations(OpenIddictConstants.Destinations.AccessToken) - }; - - var claimsIdentity = new ClaimsIdentity(claims, OpenIddictServerAspNetCoreDefaults.AuthenticationScheme); - - var claimsPrincipal = new ClaimsPrincipal(claimsIdentity); - - // Set requested scopes (this is not done automatically) - claimsPrincipal.SetScopes(request.GetScopes()); - - // Signing in with the OpenIddict authentiction scheme trigger OpenIddict to issue a code (which can be exchanged for an access token) - return SignIn(claimsPrincipal, OpenIddictServerAspNetCoreDefaults.AuthenticationScheme); - } - - private IEnumerable GetDestinations(Claim claim, ClaimsPrincipal principal) { - // Note: by default, claims are NOT automatically included in the access and identity tokens. - // To allow OpenIddict to serialize them, you must attach them a destination, that specifies - // whether they should be included in access tokens, in identity tokens or in both. - - switch (claim.Type) { - case Claims.Name: - yield return Destinations.AccessToken; - - if (principal.HasScope(Scopes.Profile)) - yield return Destinations.IdentityToken; - - yield break; - - case Claims.Email: - yield return Destinations.AccessToken; - - if (principal.HasScope(Scopes.Email)) - yield return Destinations.IdentityToken; - - yield break; - - case Claims.Role: - yield return Destinations.AccessToken; - - if (principal.HasScope(Scopes.Roles)) - yield return Destinations.IdentityToken; - - yield break; - - // Never include the security stamp in the access and identity tokens, as it's a secret value. - case "AspNet.Identity.SecurityStamp": yield break; - - default: - yield return Destinations.AccessToken; - - yield break; - } - } - } -} diff --git a/mixyboos-api/Controllers/ChatController.cs b/mixyboos-api/Controllers/ChatController.cs index f664d2e..8f1e3ca 100644 --- a/mixyboos-api/Controllers/ChatController.cs +++ b/mixyboos-api/Controllers/ChatController.cs @@ -7,11 +7,10 @@ using MixyBoos.Api.Controllers.Hubs; using MixyBoos.Api.Data; using MixyBoos.Api.Data.Models; -using OpenIddict.Validation.AspNetCore; namespace MixyBoos.Api.Controllers; -[Authorize(AuthenticationSchemes = OpenIddictValidationAspNetCoreDefaults.AuthenticationScheme)] +[Authorize] [Route("[controller]")] public class ChatController : _Controller { private readonly UserManager _userManager; diff --git a/mixyboos-api/Controllers/DebugController.cs b/mixyboos-api/Controllers/DebugController.cs index 9c53861..6667dfa 100644 --- a/mixyboos-api/Controllers/DebugController.cs +++ b/mixyboos-api/Controllers/DebugController.cs @@ -1,3 +1,4 @@ +using System; using System.Linq; using System.Reflection; using System.Runtime.Versioning; @@ -13,47 +14,45 @@ using MixyBoos.Api.Data; using MixyBoos.Api.Data.DTO; using MixyBoos.Api.Data.Models; -using OpenIddict.Validation.AspNetCore; namespace MixyBoos.Api.Controllers { - [Authorize(AuthenticationSchemes = OpenIddictValidationAspNetCoreDefaults.AuthenticationScheme)] - [Route("[controller]")] - public class DebugController : _Controller { - private readonly UserManager _userManager; - private readonly IConfiguration _configuration; - private readonly IHubContext _hub; + [Authorize] + [Route("[controller]")] + public class DebugController : _Controller { + private readonly UserManager _userManager; + private readonly IConfiguration _configuration; + private readonly IHubContext _hub; - public DebugController(UserManager userManager, IConfiguration configuration, - ILogger logger, - IHubContext hub) : base(logger) { - _userManager = userManager; - _configuration = configuration; - _hub = hub; - } + public DebugController(ILogger logger) : base(logger) { } - [HttpGet] - public async Task GetOsInfo() { - var config = _configuration.AsEnumerable().ToDictionary(k => k.Key, v => v.Value); - return await Task.FromResult(new DebugDTO { - LibVersion = Assembly - .GetEntryAssembly()? - .GetCustomAttribute()? - .FrameworkName, - OSVersion = System.Runtime.InteropServices.RuntimeInformation.OSDescription, - Config = config - }); - } + [HttpGet("ping")] + public ActionResult Ping() { + return Ok($"Pong{Environment.NewLine}"); + } + + [HttpGet] + public async Task GetOsInfo() { + var config = _configuration.AsEnumerable().ToDictionary(k => k.Key, v => v.Value); + return await Task.FromResult(new DebugDTO { + LibVersion = Assembly + .GetEntryAssembly()? + .GetCustomAttribute()? + .FrameworkName, + OSVersion = System.Runtime.InteropServices.RuntimeInformation.OSDescription, + Config = config + }); + } - [HttpGet("sendhub")] - public async Task SendHubMessage() { - var user = await _userManager.FindByNameAsync(User.Identity.Name); - if (user is null) { - return Unauthorized(); - } + [HttpGet("sendhub")] + public async Task SendHubMessage() { + var user = await _userManager.FindByNameAsync(User.Identity.Name); + if (user is null) { + return Unauthorized(); + } - await _hub.Clients.User(user.Email) - .SendAsync("Debuggles", "I'm a little teapot", "Fucking loads of tae"); - return Ok(); - } + await _hub.Clients.User(user.Email) + .SendAsync("Debuggles", "I'm a little teapot", "Fucking loads of tae"); + return Ok(); } + } } diff --git a/mixyboos-api/Controllers/Hubs/ChatHub.cs b/mixyboos-api/Controllers/Hubs/ChatHub.cs index 50a43fc..46ae778 100644 --- a/mixyboos-api/Controllers/Hubs/ChatHub.cs +++ b/mixyboos-api/Controllers/Hubs/ChatHub.cs @@ -10,11 +10,10 @@ using MixyBoos.Api.Data; using MixyBoos.Api.Data.DTO; using MixyBoos.Api.Data.Models; -using OpenIddict.Validation.AspNetCore; namespace MixyBoos.Api.Controllers.Hubs; -[Authorize(AuthenticationSchemes = OpenIddictValidationAspNetCoreDefaults.AuthenticationScheme)] +[Authorize] public class ChatHub : Hub { private readonly MixyBoosContext _context; private readonly UserManager _userManager; diff --git a/mixyboos-api/Controllers/Hubs/DebugHub.cs b/mixyboos-api/Controllers/Hubs/DebugHub.cs index 3f484a6..71fbc50 100644 --- a/mixyboos-api/Controllers/Hubs/DebugHub.cs +++ b/mixyboos-api/Controllers/Hubs/DebugHub.cs @@ -1,9 +1,8 @@ using System.Threading.Tasks; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.SignalR; -using OpenIddict.Validation.AspNetCore; namespace MixyBoos.Api.Controllers.Hubs; -[Authorize(AuthenticationSchemes = OpenIddictValidationAspNetCoreDefaults.AuthenticationScheme)] +[Authorize] public class DebugHub : Hub { } diff --git a/mixyboos-api/Controllers/Hubs/LiveHub.cs b/mixyboos-api/Controllers/Hubs/LiveHub.cs index fc85476..e826427 100644 --- a/mixyboos-api/Controllers/Hubs/LiveHub.cs +++ b/mixyboos-api/Controllers/Hubs/LiveHub.cs @@ -1,11 +1,10 @@ using System.Threading.Tasks; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.SignalR; -using OpenIddict.Validation.AspNetCore; namespace MixyBoos.Api.Controllers.Hubs; -[Authorize(AuthenticationSchemes = OpenIddictValidationAspNetCoreDefaults.AuthenticationScheme)] +[Authorize] public class LiveHub : Hub { public async Task SendMessage(string userId, string message) { await Clients.User(userId).SendAsync("ReceiveMessage", message); diff --git a/mixyboos-api/Controllers/Hubs/UpdatesHub.cs b/mixyboos-api/Controllers/Hubs/UpdatesHub.cs index 2470ee9..2b47e22 100644 --- a/mixyboos-api/Controllers/Hubs/UpdatesHub.cs +++ b/mixyboos-api/Controllers/Hubs/UpdatesHub.cs @@ -1,11 +1,10 @@ using System.Threading.Tasks; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.SignalR; -using OpenIddict.Validation.AspNetCore; namespace MixyBoos.Api.Controllers.Hubs; -[Authorize(AuthenticationSchemes = OpenIddictValidationAspNetCoreDefaults.AuthenticationScheme)] +[Authorize] public class UpdatesHub : Hub { public async Task SendMessage(string userId, string message) { await Clients.User(userId).SendAsync("ReceiveMessage", message); diff --git a/mixyboos-api/Controllers/JobController.cs b/mixyboos-api/Controllers/JobController.cs index 6aeb7fd..c02940e 100644 --- a/mixyboos-api/Controllers/JobController.cs +++ b/mixyboos-api/Controllers/JobController.cs @@ -9,12 +9,11 @@ using MixyBoos.Api.Data; using MixyBoos.Api.Services; using MixyBoos.Api.Services.Helpers.IO; -using OpenIddict.Validation.AspNetCore; using Quartz; namespace MixyBoos.Api.Controllers; -[Authorize(AuthenticationSchemes = OpenIddictValidationAspNetCoreDefaults.AuthenticationScheme)] +[Authorize] [Route("[controller]")] public class JobController : _Controller { private readonly MixyBoosContext _context; diff --git a/mixyboos-api/Controllers/LiveController.cs b/mixyboos-api/Controllers/LiveController.cs index badfad4..550b266 100644 --- a/mixyboos-api/Controllers/LiveController.cs +++ b/mixyboos-api/Controllers/LiveController.cs @@ -18,11 +18,10 @@ using MixyBoos.Api.Data.DTO.Wire; using MixyBoos.Api.Data.Models; using MixyBoos.Api.Services.Extensions; -using OpenIddict.Validation.AspNetCore; using Quartz; namespace MixyBoos.Api.Controllers { - [Authorize(AuthenticationSchemes = OpenIddictValidationAspNetCoreDefaults.AuthenticationScheme)] + [Authorize] [Route("[controller]")] public class LiveController : _Controller { private readonly UserManager _userManager; diff --git a/mixyboos-api/Controllers/MixController.cs b/mixyboos-api/Controllers/MixController.cs index f1f4b15..d19ffa0 100644 --- a/mixyboos-api/Controllers/MixController.cs +++ b/mixyboos-api/Controllers/MixController.cs @@ -19,7 +19,6 @@ using MixyBoos.Api.Data.DTO; using MixyBoos.Api.Data.Models; using MixyBoos.Api.Services.Extensions; -using OpenIddict.Validation.AspNetCore; namespace MixyBoos.Api.Controllers; @@ -103,7 +102,7 @@ public async Task> GetAudioUrl([FromQuery] string id) { return Ok(Flurl.Url.Combine(_config["LiveServices:ListenUrl"], mix.Id.ToString(), $"{mix.Id}.m3u8")); } - [Authorize(AuthenticationSchemes = OpenIddictValidationAspNetCoreDefaults.AuthenticationScheme)] + [Authorize] [HttpGet("feed")] [Produces(MediaTypeNames.Application.Json)] [ProducesResponseType(StatusCodes.Status200OK)] @@ -119,7 +118,7 @@ public async Task>> GetFeed() { } [HttpPost] - [Authorize(AuthenticationSchemes = OpenIddictValidationAspNetCoreDefaults.AuthenticationScheme)] + [Authorize] [Consumes(MediaTypeNames.Application.Json)] [ProducesResponseType(StatusCodes.Status201Created)] [ProducesResponseType(StatusCodes.Status400BadRequest)] @@ -147,7 +146,7 @@ public async Task> Post([FromBody] MixDTO mix) { } [HttpPatch] - [Authorize(AuthenticationSchemes = OpenIddictValidationAspNetCoreDefaults.AuthenticationScheme)] + [Authorize] [Consumes(MediaTypeNames.Application.Json)] [ProducesResponseType(StatusCodes.Status201Created)] [ProducesResponseType(StatusCodes.Status400BadRequest)] @@ -175,7 +174,7 @@ public async Task> Patch([FromBody] MixDTO mix) { } [HttpPost("addlike")] - [Authorize(AuthenticationSchemes = OpenIddictValidationAspNetCoreDefaults.AuthenticationScheme)] + [Authorize] [Consumes(MediaTypeNames.Application.Json)] [ProducesResponseType(StatusCodes.Status204NoContent)] [ProducesResponseType(StatusCodes.Status400BadRequest)] @@ -201,7 +200,7 @@ public async Task> AddLike([FromBody] string id) { } [HttpDelete] - [Authorize(AuthenticationSchemes = OpenIddictValidationAspNetCoreDefaults.AuthenticationScheme)] + [Authorize] [ProducesResponseType(StatusCodes.Status204NoContent)] [ProducesResponseType(StatusCodes.Status400BadRequest)] [ProducesResponseType(StatusCodes.Status404NotFound)] diff --git a/mixyboos-api/Controllers/PingController.cs b/mixyboos-api/Controllers/PingController.cs index 3375ffc..d4c217d 100644 --- a/mixyboos-api/Controllers/PingController.cs +++ b/mixyboos-api/Controllers/PingController.cs @@ -6,10 +6,10 @@ namespace MixyBoos.Api.Controllers; [Route("[controller]")] public class PingController : _Controller { - public PingController(ILogger logger) : base(logger) { } + public PingController(ILogger logger) : base(logger) { } - [HttpGet] - public string Get() { - return $"Pong{Environment.NewLine}"; - } + [HttpGet] + public string Get() { + return $"Pong{Environment.NewLine}"; + } } diff --git a/mixyboos-api/Controllers/ProfileController.cs b/mixyboos-api/Controllers/ProfileController.cs index 75276c0..63913ec 100644 --- a/mixyboos-api/Controllers/ProfileController.cs +++ b/mixyboos-api/Controllers/ProfileController.cs @@ -12,12 +12,10 @@ using MixyBoos.Api.Data.Models; using MixyBoos.Api.Services.Extensions; using MixyBoos.Api.Services.Helpers; -using OpenIddict.Validation.AspNetCore; -using Guid = System.Guid; namespace MixyBoos.Api.Controllers; -[Authorize(AuthenticationSchemes = OpenIddictValidationAspNetCoreDefaults.AuthenticationScheme)] +[Authorize] [Route("[controller]")] public class ProfileController : _Controller { private readonly UserManager _userManager; @@ -105,7 +103,7 @@ public async Task> GetBySlug([FromQuery] string slug) { } [HttpPost] - [Authorize(AuthenticationSchemes = OpenIddictValidationAspNetCoreDefaults.AuthenticationScheme)] + [Authorize] [Consumes(MediaTypeNames.Application.Json)] [ProducesResponseType(StatusCodes.Status200OK)] [ProducesResponseType(StatusCodes.Status404NotFound)] diff --git a/mixyboos-api/Controllers/TagController.cs b/mixyboos-api/Controllers/TagController.cs index 8cdf313..4e3c1f8 100644 --- a/mixyboos-api/Controllers/TagController.cs +++ b/mixyboos-api/Controllers/TagController.cs @@ -8,12 +8,11 @@ using Microsoft.Extensions.Logging; using MixyBoos.Api.Data; using MixyBoos.Api.Data.Models; -using OpenIddict.Validation.AspNetCore; namespace MixyBoos.Api.Controllers; [Route("[controller]")] -[Authorize(AuthenticationSchemes = OpenIddictValidationAspNetCoreDefaults.AuthenticationScheme)] +[Authorize] public class TagController : _Controller { private readonly MixyBoosContext _context; private readonly UserManager _userManager; diff --git a/mixyboos-api/Controllers/UploadController.cs b/mixyboos-api/Controllers/UploadController.cs index d9d0923..cdb3adb 100644 --- a/mixyboos-api/Controllers/UploadController.cs +++ b/mixyboos-api/Controllers/UploadController.cs @@ -18,8 +18,6 @@ using MixyBoos.Api.Data.Models; using MixyBoos.Api.Services; using MixyBoos.Api.Services.Extensions; -using MixyBoos.Api.Services.Helpers; -using OpenIddict.Validation.AspNetCore; using Quartz; public class InvalidFileUploadException : Exception { @@ -32,7 +30,7 @@ public class FileUploadModel { public IFormFile File { get; set; } } - [Authorize(AuthenticationSchemes = OpenIddictValidationAspNetCoreDefaults.AuthenticationScheme)] + [Authorize] [Route("[controller]")] public class UploadController : _Controller { private readonly UserManager _userManager; diff --git a/mixyboos-api/Data/MixyBoosContext.cs b/mixyboos-api/Data/MixyBoosContext.cs index 85fbbda..f6daf42 100644 --- a/mixyboos-api/Data/MixyBoosContext.cs +++ b/mixyboos-api/Data/MixyBoosContext.cs @@ -11,7 +11,6 @@ using MixyBoos.Api.Data.Models; using MixyBoos.Api.Data.Utils; using MixyBoos.Api.Services.Extensions; -using OpenIddict.EntityFrameworkCore.Models; #nullable disable @@ -19,7 +18,6 @@ namespace MixyBoos.Api.Data; public class MixyBoosContext : IdentityDbContext, Guid> { private readonly ILogger _logger; - private const string IDENTITY_PREFIX = "openiddict"; public DbSet Mixes { get; set; } public DbSet MixPlays { get; set; } @@ -77,11 +75,6 @@ protected override void OnModelCreating(ModelBuilder mb) { mb.Entity>().ToTable("role_claim", "oid"); mb.Entity>().ToTable("user_token", "oid"); mb.Entity>().ToTable("user_identity_role", "oid"); - - mb.Entity().ToTable($"{IDENTITY_PREFIX}_{"application"}", "oid"); - mb.Entity().ToTable($"{IDENTITY_PREFIX}_{"authorization"}", "oid"); - mb.Entity().ToTable($"{IDENTITY_PREFIX}_{"scope"}", "oid"); - mb.Entity().ToTable($"{IDENTITY_PREFIX}_{"token"}", "oid"); //end identity stuff mb.Entity().ToTable("mixes"); diff --git a/mixyboos-api/Data/Models/MixyBoosUser.cs b/mixyboos-api/Data/Models/MixyBoosUser.cs index f6f35dc..e7b6b58 100644 --- a/mixyboos-api/Data/Models/MixyBoosUser.cs +++ b/mixyboos-api/Data/Models/MixyBoosUser.cs @@ -23,7 +23,7 @@ public MixyBoosUser() { public string ProfileImage { get; set; } public string HeaderImage { get; set; } - [SlugField(SourceField = "DisplayName")] + [SlugField(SourceField = "UserName")] public string Slug { get; set; } [MaxLength(100)] public string City { get; set; } diff --git a/mixyboos-api/Migrations/20230921212309_Initial.Designer.cs b/mixyboos-api/Migrations/20230921212309_Initial.Designer.cs deleted file mode 100644 index 77fac26..0000000 --- a/mixyboos-api/Migrations/20230921212309_Initial.Designer.cs +++ /dev/null @@ -1,1163 +0,0 @@ -// -using System; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using MixyBoos.Api.Data; -using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; - -#nullable disable - -namespace MixyBoos.Api.Migrations -{ - [DbContext(typeof(MixyBoosContext))] - [Migration("20230921212309_Initial")] - partial class Initial - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasDefaultSchema("mixyboos") - .UseCollation("en_US.utf8") - .HasAnnotation("ProductVersion", "8.0.0-rc.1.23419.6") - .HasAnnotation("Relational:MaxIdentifierLength", 63); - - NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); - - modelBuilder.Entity("LiveShowTag", b => - { - b.Property("LiveShowId") - .HasColumnType("character varying(36)"); - - b.Property("TagsId") - .HasColumnType("character varying(36)"); - - b.HasKey("LiveShowId", "TagsId"); - - b.HasIndex("TagsId"); - - b.ToTable("show_tags", "mixyboos"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRole", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uuid"); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken() - .HasColumnType("text"); - - b.Property("Name") - .HasMaxLength(256) - .HasColumnType("character varying(256)"); - - b.Property("NormalizedName") - .HasMaxLength(256) - .HasColumnType("character varying(256)"); - - b.HasKey("Id"); - - b.HasIndex("NormalizedName") - .IsUnique() - .HasDatabaseName("RoleNameIndex"); - - b.ToTable("user_user_role", "oid"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ClaimType") - .HasColumnType("text"); - - b.Property("ClaimValue") - .HasColumnType("text"); - - b.Property("RoleId") - .HasColumnType("uuid"); - - b.HasKey("Id"); - - b.HasIndex("RoleId"); - - b.ToTable("role_claim", "oid"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUser", b => - { - b.Property("Id") - .HasColumnType("text"); - - b.Property("AccessFailedCount") - .HasColumnType("integer"); - - b.Property("ConcurrencyStamp") - .HasColumnType("text"); - - b.Property("Email") - .HasColumnType("text"); - - b.Property("EmailConfirmed") - .HasColumnType("boolean"); - - b.Property("LockoutEnabled") - .HasColumnType("boolean"); - - b.Property("LockoutEnd") - .HasColumnType("timestamp with time zone"); - - b.Property("NormalizedEmail") - .HasColumnType("text"); - - b.Property("NormalizedUserName") - .HasColumnType("text"); - - b.Property("PasswordHash") - .HasColumnType("text"); - - b.Property("PhoneNumber") - .HasColumnType("text"); - - b.Property("PhoneNumberConfirmed") - .HasColumnType("boolean"); - - b.Property("SecurityStamp") - .HasColumnType("text"); - - b.Property("TwoFactorEnabled") - .HasColumnType("boolean"); - - b.Property("UserName") - .HasColumnType("text"); - - b.HasKey("Id"); - - b.ToTable("identity_user_base", "oid"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUser", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uuid"); - - b.Property("AccessFailedCount") - .HasColumnType("integer"); - - b.Property("ConcurrencyStamp") - .HasColumnType("text"); - - b.Property("Email") - .HasColumnType("text"); - - b.Property("EmailConfirmed") - .HasColumnType("boolean"); - - b.Property("LockoutEnabled") - .HasColumnType("boolean"); - - b.Property("LockoutEnd") - .HasColumnType("timestamp with time zone"); - - b.Property("NormalizedEmail") - .HasColumnType("text"); - - b.Property("NormalizedUserName") - .HasColumnType("text"); - - b.Property("PasswordHash") - .HasColumnType("text"); - - b.Property("PhoneNumber") - .HasColumnType("text"); - - b.Property("PhoneNumberConfirmed") - .HasColumnType("boolean"); - - b.Property("SecurityStamp") - .HasColumnType("text"); - - b.Property("TwoFactorEnabled") - .HasColumnType("boolean"); - - b.Property("UserName") - .HasColumnType("text"); - - b.HasKey("Id"); - - b.ToTable("identity_user", "oid"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ClaimType") - .HasColumnType("text"); - - b.Property("ClaimValue") - .HasColumnType("text"); - - b.Property("UserId") - .HasColumnType("uuid"); - - b.HasKey("Id"); - - b.HasIndex("UserId"); - - b.ToTable("user_claim", "oid"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => - { - b.Property("LoginProvider") - .HasColumnType("text"); - - b.Property("ProviderKey") - .HasColumnType("text"); - - b.Property("ProviderDisplayName") - .HasColumnType("text"); - - b.Property("UserId") - .HasColumnType("uuid"); - - b.HasKey("LoginProvider", "ProviderKey"); - - b.HasIndex("UserId"); - - b.ToTable("user_login", "oid"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => - { - b.Property("UserId") - .HasColumnType("uuid"); - - b.Property("RoleId") - .HasColumnType("uuid"); - - b.HasKey("UserId", "RoleId"); - - b.HasIndex("RoleId"); - - b.ToTable("user_identity_role", "oid"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => - { - b.Property("UserId") - .HasColumnType("uuid"); - - b.Property("LoginProvider") - .HasColumnType("text"); - - b.Property("Name") - .HasColumnType("text"); - - b.Property("Value") - .HasColumnType("text"); - - b.HasKey("UserId", "LoginProvider", "Name"); - - b.ToTable("user_token", "oid"); - }); - - modelBuilder.Entity("MixTag", b => - { - b.Property("MixId") - .HasColumnType("character varying(36)"); - - b.Property("TagsId") - .HasColumnType("character varying(36)"); - - b.HasKey("MixId", "TagsId"); - - b.HasIndex("TagsId"); - - b.ToTable("mix_tags", "mixyboos"); - }); - - modelBuilder.Entity("MixyBoos.Api.Data.Models.LiveShow", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("character varying(36)"); - - b.Property("DateCreated") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("DateUpdated") - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("Description") - .HasColumnType("text"); - - b.Property("StartDate") - .HasColumnType("timestamp with time zone"); - - b.Property("Status") - .HasColumnType("integer"); - - b.Property("Title") - .HasColumnType("text"); - - b.Property("UserId") - .HasColumnType("uuid"); - - b.HasKey("Id"); - - b.HasIndex("UserId"); - - b.ToTable("live_shows", "mixyboos"); - }); - - modelBuilder.Entity("MixyBoos.Api.Data.Models.Mix", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("character varying(36)"); - - b.Property("AudioUrl") - .HasColumnType("text"); - - b.Property("DateCreated") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("DateUpdated") - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("Description") - .IsRequired() - .HasColumnType("text"); - - b.Property("Image") - .HasColumnType("text"); - - b.Property("IsProcessed") - .HasColumnType("boolean"); - - b.Property("Slug") - .HasColumnType("text"); - - b.Property("Title") - .IsRequired() - .HasColumnType("text"); - - b.Property("UserId") - .HasColumnType("uuid"); - - b.HasKey("Id"); - - b.HasIndex("Slug") - .IsUnique(); - - b.HasIndex("UserId"); - - b.ToTable("mixes", "mixyboos"); - }); - - modelBuilder.Entity("MixyBoos.Api.Data.Models.MixDownload", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("character varying(36)"); - - b.Property("DateCreated") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("DateUpdated") - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("MixId") - .IsRequired() - .HasColumnType("character varying(36)"); - - b.Property("UserId") - .HasColumnType("uuid"); - - b.HasKey("Id"); - - b.HasIndex("MixId"); - - b.HasIndex("UserId"); - - b.ToTable("mix_download", "mixyboos"); - }); - - modelBuilder.Entity("MixyBoos.Api.Data.Models.MixLike", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("character varying(36)"); - - b.Property("DateCreated") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("DateUpdated") - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("MixId") - .IsRequired() - .HasColumnType("character varying(36)"); - - b.Property("UserId") - .HasColumnType("uuid"); - - b.HasKey("Id"); - - b.HasIndex("MixId"); - - b.HasIndex("UserId"); - - b.ToTable("mix_likes", "mixyboos"); - }); - - modelBuilder.Entity("MixyBoos.Api.Data.Models.MixPlay", b => - { - b.Property("MixId") - .HasColumnType("character varying(36)"); - - b.Property("UserId") - .HasColumnType("uuid"); - - b.Property("DateCreated") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("DateUpdated") - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("Id") - .IsRequired() - .ValueGeneratedOnAdd() - .HasColumnType("character varying(36)"); - - b.HasKey("MixId", "UserId"); - - b.HasIndex("UserId"); - - b.ToTable("mix_plays", "mixyboos"); - }); - - modelBuilder.Entity("MixyBoos.Api.Data.Models.MixShare", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("character varying(36)"); - - b.Property("DateCreated") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("DateUpdated") - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("MixId") - .IsRequired() - .HasColumnType("character varying(36)"); - - b.Property("UserId") - .HasColumnType("uuid"); - - b.HasKey("Id"); - - b.HasIndex("MixId"); - - b.HasIndex("UserId"); - - b.ToTable("mix_shares", "mixyboos"); - }); - - modelBuilder.Entity("MixyBoos.Api.Data.Models.MixyBoosUser", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uuid"); - - b.Property("AccessFailedCount") - .HasColumnType("integer"); - - b.Property("Biography") - .HasMaxLength(2048) - .HasColumnType("character varying(2048)"); - - b.Property("City") - .HasMaxLength(100) - .HasColumnType("character varying(100)"); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken() - .HasColumnType("text"); - - b.Property("Country") - .HasMaxLength(100) - .HasColumnType("character varying(100)"); - - b.Property("DisplayName") - .HasMaxLength(30) - .HasColumnType("character varying(30)"); - - b.Property("Email") - .HasMaxLength(256) - .HasColumnType("character varying(256)"); - - b.Property("EmailConfirmed") - .HasColumnType("boolean"); - - b.Property("HeaderImage") - .HasColumnType("text"); - - b.Property("LockoutEnabled") - .HasColumnType("boolean"); - - b.Property("LockoutEnd") - .HasColumnType("timestamp with time zone"); - - b.Property("NormalizedEmail") - .HasMaxLength(256) - .HasColumnType("character varying(256)"); - - b.Property("NormalizedUserName") - .HasMaxLength(256) - .HasColumnType("character varying(256)"); - - b.Property("PasswordHash") - .HasColumnType("text"); - - b.Property("PhoneNumber") - .HasColumnType("text"); - - b.Property("PhoneNumberConfirmed") - .HasColumnType("boolean"); - - b.Property("ProfileImage") - .HasColumnType("text"); - - b.Property("SecurityStamp") - .HasColumnType("text"); - - b.Property("Slug") - .HasColumnType("text"); - - b.Property("StreamKey") - .HasColumnType("text"); - - b.Property("Title") - .HasMaxLength(50) - .HasColumnType("character varying(50)"); - - b.Property("TwoFactorEnabled") - .HasColumnType("boolean"); - - b.Property("UserName") - .HasMaxLength(256) - .HasColumnType("character varying(256)"); - - b.HasKey("Id"); - - b.HasIndex("NormalizedEmail") - .HasDatabaseName("EmailIndex"); - - b.HasIndex("NormalizedUserName") - .IsUnique() - .HasDatabaseName("UserNameIndex"); - - b.HasIndex("Slug") - .IsUnique(); - - b.ToTable("user", "oid"); - }); - - modelBuilder.Entity("MixyBoos.Api.Data.Models.ShowChat", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("character varying(36)"); - - b.Property("DateCreated") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("DateSent") - .HasColumnType("timestamp with time zone"); - - b.Property("DateUpdated") - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("FromUserId") - .HasColumnType("uuid"); - - b.Property("Message") - .IsRequired() - .HasColumnType("text"); - - b.Property("ShowId") - .IsRequired() - .HasColumnType("character varying(36)"); - - b.Property("ToUserId") - .HasColumnType("uuid"); - - b.HasKey("Id"); - - b.HasIndex("FromUserId"); - - b.HasIndex("ShowId"); - - b.HasIndex("ToUserId"); - - b.ToTable("show_chats", "mixyboos"); - }); - - modelBuilder.Entity("MixyBoos.Api.Data.Models.Tag", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("character varying(36)"); - - b.Property("DateCreated") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("DateUpdated") - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("TagName") - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("TagName") - .IsUnique(); - - b.ToTable("tags", "mixyboos"); - }); - - modelBuilder.Entity("MixyBoosUserMixyBoosUser", b => - { - b.Property("FollowersId") - .HasColumnType("uuid"); - - b.Property("FollowingId") - .HasColumnType("uuid"); - - b.HasKey("FollowersId", "FollowingId"); - - b.HasIndex("FollowingId"); - - b.ToTable("user_followers", "oid"); - }); - - modelBuilder.Entity("OpenIddict.EntityFrameworkCore.Models.OpenIddictEntityFrameworkCoreApplication", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("ClientId") - .HasMaxLength(100) - .HasColumnType("character varying(100)"); - - b.Property("ClientSecret") - .HasColumnType("text"); - - b.Property("ConcurrencyToken") - .IsConcurrencyToken() - .HasMaxLength(50) - .HasColumnType("character varying(50)"); - - b.Property("ConsentType") - .HasMaxLength(50) - .HasColumnType("character varying(50)"); - - b.Property("DisplayName") - .HasColumnType("text"); - - b.Property("DisplayNames") - .HasColumnType("text"); - - b.Property("Permissions") - .HasColumnType("text"); - - b.Property("PostLogoutRedirectUris") - .HasColumnType("text"); - - b.Property("Properties") - .HasColumnType("text"); - - b.Property("RedirectUris") - .HasColumnType("text"); - - b.Property("Requirements") - .HasColumnType("text"); - - b.Property("Type") - .HasMaxLength(50) - .HasColumnType("character varying(50)"); - - b.HasKey("Id"); - - b.HasIndex("ClientId") - .IsUnique(); - - b.ToTable("openiddict_application", "oid"); - }); - - modelBuilder.Entity("OpenIddict.EntityFrameworkCore.Models.OpenIddictEntityFrameworkCoreAuthorization", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("ApplicationId") - .HasColumnType("text"); - - b.Property("ConcurrencyToken") - .IsConcurrencyToken() - .HasMaxLength(50) - .HasColumnType("character varying(50)"); - - b.Property("CreationDate") - .HasColumnType("timestamp with time zone"); - - b.Property("Properties") - .HasColumnType("text"); - - b.Property("Scopes") - .HasColumnType("text"); - - b.Property("Status") - .HasMaxLength(50) - .HasColumnType("character varying(50)"); - - b.Property("Subject") - .HasMaxLength(400) - .HasColumnType("character varying(400)"); - - b.Property("Type") - .HasMaxLength(50) - .HasColumnType("character varying(50)"); - - b.HasKey("Id"); - - b.HasIndex("ApplicationId", "Status", "Subject", "Type"); - - b.ToTable("openiddict_authorization", "oid"); - }); - - modelBuilder.Entity("OpenIddict.EntityFrameworkCore.Models.OpenIddictEntityFrameworkCoreScope", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("ConcurrencyToken") - .IsConcurrencyToken() - .HasMaxLength(50) - .HasColumnType("character varying(50)"); - - b.Property("Description") - .HasColumnType("text"); - - b.Property("Descriptions") - .HasColumnType("text"); - - b.Property("DisplayName") - .HasColumnType("text"); - - b.Property("DisplayNames") - .HasColumnType("text"); - - b.Property("Name") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("Properties") - .HasColumnType("text"); - - b.Property("Resources") - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("Name") - .IsUnique(); - - b.ToTable("openiddict_scope", "oid"); - }); - - modelBuilder.Entity("OpenIddict.EntityFrameworkCore.Models.OpenIddictEntityFrameworkCoreToken", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("ApplicationId") - .HasColumnType("text"); - - b.Property("AuthorizationId") - .HasColumnType("text"); - - b.Property("ConcurrencyToken") - .IsConcurrencyToken() - .HasMaxLength(50) - .HasColumnType("character varying(50)"); - - b.Property("CreationDate") - .HasColumnType("timestamp with time zone"); - - b.Property("ExpirationDate") - .HasColumnType("timestamp with time zone"); - - b.Property("Payload") - .HasColumnType("text"); - - b.Property("Properties") - .HasColumnType("text"); - - b.Property("RedemptionDate") - .HasColumnType("timestamp with time zone"); - - b.Property("ReferenceId") - .HasMaxLength(100) - .HasColumnType("character varying(100)"); - - b.Property("Status") - .HasMaxLength(50) - .HasColumnType("character varying(50)"); - - b.Property("Subject") - .HasMaxLength(400) - .HasColumnType("character varying(400)"); - - b.Property("Type") - .HasMaxLength(50) - .HasColumnType("character varying(50)"); - - b.HasKey("Id"); - - b.HasIndex("AuthorizationId"); - - b.HasIndex("ReferenceId") - .IsUnique(); - - b.HasIndex("ApplicationId", "Status", "Subject", "Type"); - - b.ToTable("openiddict_token", "oid"); - }); - - modelBuilder.Entity("LiveShowTag", b => - { - b.HasOne("MixyBoos.Api.Data.Models.LiveShow", null) - .WithMany() - .HasForeignKey("LiveShowId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("MixyBoos.Api.Data.Models.Tag", null) - .WithMany() - .HasForeignKey("TagsId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => - { - b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole", null) - .WithMany() - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => - { - b.HasOne("MixyBoos.Api.Data.Models.MixyBoosUser", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => - { - b.HasOne("MixyBoos.Api.Data.Models.MixyBoosUser", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => - { - b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole", null) - .WithMany() - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("MixyBoos.Api.Data.Models.MixyBoosUser", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => - { - b.HasOne("MixyBoos.Api.Data.Models.MixyBoosUser", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("MixTag", b => - { - b.HasOne("MixyBoos.Api.Data.Models.Mix", null) - .WithMany() - .HasForeignKey("MixId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("MixyBoos.Api.Data.Models.Tag", null) - .WithMany() - .HasForeignKey("TagsId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("MixyBoos.Api.Data.Models.LiveShow", b => - { - b.HasOne("MixyBoos.Api.Data.Models.MixyBoosUser", "User") - .WithMany() - .HasForeignKey("UserId"); - - b.Navigation("User"); - }); - - modelBuilder.Entity("MixyBoos.Api.Data.Models.Mix", b => - { - b.HasOne("MixyBoos.Api.Data.Models.MixyBoosUser", "User") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("User"); - }); - - modelBuilder.Entity("MixyBoos.Api.Data.Models.MixDownload", b => - { - b.HasOne("MixyBoos.Api.Data.Models.Mix", "Mix") - .WithMany("Downloads") - .HasForeignKey("MixId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("MixyBoos.Api.Data.Models.MixyBoosUser", "User") - .WithMany("Downloads") - .HasForeignKey("UserId"); - - b.Navigation("Mix"); - - b.Navigation("User"); - }); - - modelBuilder.Entity("MixyBoos.Api.Data.Models.MixLike", b => - { - b.HasOne("MixyBoos.Api.Data.Models.Mix", "Mix") - .WithMany("Likes") - .HasForeignKey("MixId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("MixyBoos.Api.Data.Models.MixyBoosUser", "User") - .WithMany("Likes") - .HasForeignKey("UserId"); - - b.Navigation("Mix"); - - b.Navigation("User"); - }); - - modelBuilder.Entity("MixyBoos.Api.Data.Models.MixPlay", b => - { - b.HasOne("MixyBoos.Api.Data.Models.Mix", "Mix") - .WithMany("Plays") - .HasForeignKey("MixId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("MixyBoos.Api.Data.Models.MixyBoosUser", "User") - .WithMany("Plays") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Mix"); - - b.Navigation("User"); - }); - - modelBuilder.Entity("MixyBoos.Api.Data.Models.MixShare", b => - { - b.HasOne("MixyBoos.Api.Data.Models.Mix", "Mix") - .WithMany("Shares") - .HasForeignKey("MixId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("MixyBoos.Api.Data.Models.MixyBoosUser", "User") - .WithMany("Shares") - .HasForeignKey("UserId"); - - b.Navigation("Mix"); - - b.Navigation("User"); - }); - - modelBuilder.Entity("MixyBoos.Api.Data.Models.ShowChat", b => - { - b.HasOne("MixyBoos.Api.Data.Models.MixyBoosUser", "FromUser") - .WithMany() - .HasForeignKey("FromUserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("MixyBoos.Api.Data.Models.LiveShow", "Show") - .WithMany() - .HasForeignKey("ShowId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("MixyBoos.Api.Data.Models.MixyBoosUser", "ToUser") - .WithMany() - .HasForeignKey("ToUserId"); - - b.Navigation("FromUser"); - - b.Navigation("Show"); - - b.Navigation("ToUser"); - }); - - modelBuilder.Entity("MixyBoosUserMixyBoosUser", b => - { - b.HasOne("MixyBoos.Api.Data.Models.MixyBoosUser", null) - .WithMany() - .HasForeignKey("FollowersId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("MixyBoos.Api.Data.Models.MixyBoosUser", null) - .WithMany() - .HasForeignKey("FollowingId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("OpenIddict.EntityFrameworkCore.Models.OpenIddictEntityFrameworkCoreAuthorization", b => - { - b.HasOne("OpenIddict.EntityFrameworkCore.Models.OpenIddictEntityFrameworkCoreApplication", "Application") - .WithMany("Authorizations") - .HasForeignKey("ApplicationId"); - - b.Navigation("Application"); - }); - - modelBuilder.Entity("OpenIddict.EntityFrameworkCore.Models.OpenIddictEntityFrameworkCoreToken", b => - { - b.HasOne("OpenIddict.EntityFrameworkCore.Models.OpenIddictEntityFrameworkCoreApplication", "Application") - .WithMany("Tokens") - .HasForeignKey("ApplicationId"); - - b.HasOne("OpenIddict.EntityFrameworkCore.Models.OpenIddictEntityFrameworkCoreAuthorization", "Authorization") - .WithMany("Tokens") - .HasForeignKey("AuthorizationId"); - - b.Navigation("Application"); - - b.Navigation("Authorization"); - }); - - modelBuilder.Entity("MixyBoos.Api.Data.Models.Mix", b => - { - b.Navigation("Downloads"); - - b.Navigation("Likes"); - - b.Navigation("Plays"); - - b.Navigation("Shares"); - }); - - modelBuilder.Entity("MixyBoos.Api.Data.Models.MixyBoosUser", b => - { - b.Navigation("Downloads"); - - b.Navigation("Likes"); - - b.Navigation("Plays"); - - b.Navigation("Shares"); - }); - - modelBuilder.Entity("OpenIddict.EntityFrameworkCore.Models.OpenIddictEntityFrameworkCoreApplication", b => - { - b.Navigation("Authorizations"); - - b.Navigation("Tokens"); - }); - - modelBuilder.Entity("OpenIddict.EntityFrameworkCore.Models.OpenIddictEntityFrameworkCoreAuthorization", b => - { - b.Navigation("Tokens"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/mixyboos-api/Migrations/20230921212309_Initial.cs b/mixyboos-api/Migrations/20230921212309_Initial.cs deleted file mode 100644 index 96aad65..0000000 --- a/mixyboos-api/Migrations/20230921212309_Initial.cs +++ /dev/null @@ -1,946 +0,0 @@ -using System; -using Microsoft.EntityFrameworkCore.Migrations; -using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; - -#nullable disable - -namespace MixyBoos.Api.Migrations -{ - /// - public partial class Initial : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.EnsureSchema( - name: "oid"); - - migrationBuilder.EnsureSchema( - name: "mixyboos"); - - migrationBuilder.CreateTable( - name: "identity_user", - schema: "oid", - columns: table => new - { - Id = table.Column(type: "uuid", nullable: false), - UserName = table.Column(type: "text", nullable: true), - NormalizedUserName = table.Column(type: "text", nullable: true), - Email = table.Column(type: "text", nullable: true), - NormalizedEmail = table.Column(type: "text", nullable: true), - EmailConfirmed = table.Column(type: "boolean", nullable: false), - PasswordHash = table.Column(type: "text", nullable: true), - SecurityStamp = table.Column(type: "text", nullable: true), - ConcurrencyStamp = table.Column(type: "text", nullable: true), - PhoneNumber = table.Column(type: "text", nullable: true), - PhoneNumberConfirmed = table.Column(type: "boolean", nullable: false), - TwoFactorEnabled = table.Column(type: "boolean", nullable: false), - LockoutEnd = table.Column(type: "timestamp with time zone", nullable: true), - LockoutEnabled = table.Column(type: "boolean", nullable: false), - AccessFailedCount = table.Column(type: "integer", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_identity_user", x => x.Id); - }); - - migrationBuilder.CreateTable( - name: "identity_user_base", - schema: "oid", - columns: table => new - { - Id = table.Column(type: "text", nullable: false), - UserName = table.Column(type: "text", nullable: true), - NormalizedUserName = table.Column(type: "text", nullable: true), - Email = table.Column(type: "text", nullable: true), - NormalizedEmail = table.Column(type: "text", nullable: true), - EmailConfirmed = table.Column(type: "boolean", nullable: false), - PasswordHash = table.Column(type: "text", nullable: true), - SecurityStamp = table.Column(type: "text", nullable: true), - ConcurrencyStamp = table.Column(type: "text", nullable: true), - PhoneNumber = table.Column(type: "text", nullable: true), - PhoneNumberConfirmed = table.Column(type: "boolean", nullable: false), - TwoFactorEnabled = table.Column(type: "boolean", nullable: false), - LockoutEnd = table.Column(type: "timestamp with time zone", nullable: true), - LockoutEnabled = table.Column(type: "boolean", nullable: false), - AccessFailedCount = table.Column(type: "integer", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_identity_user_base", x => x.Id); - }); - - migrationBuilder.CreateTable( - name: "openiddict_application", - schema: "oid", - columns: table => new - { - Id = table.Column(type: "text", nullable: false), - ClientId = table.Column(type: "character varying(100)", maxLength: 100, nullable: true), - ClientSecret = table.Column(type: "text", nullable: true), - ConcurrencyToken = table.Column(type: "character varying(50)", maxLength: 50, nullable: true), - ConsentType = table.Column(type: "character varying(50)", maxLength: 50, nullable: true), - DisplayName = table.Column(type: "text", nullable: true), - DisplayNames = table.Column(type: "text", nullable: true), - Permissions = table.Column(type: "text", nullable: true), - PostLogoutRedirectUris = table.Column(type: "text", nullable: true), - Properties = table.Column(type: "text", nullable: true), - RedirectUris = table.Column(type: "text", nullable: true), - Requirements = table.Column(type: "text", nullable: true), - Type = table.Column(type: "character varying(50)", maxLength: 50, nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_openiddict_application", x => x.Id); - }); - - migrationBuilder.CreateTable( - name: "openiddict_scope", - schema: "oid", - columns: table => new - { - Id = table.Column(type: "text", nullable: false), - ConcurrencyToken = table.Column(type: "character varying(50)", maxLength: 50, nullable: true), - Description = table.Column(type: "text", nullable: true), - Descriptions = table.Column(type: "text", nullable: true), - DisplayName = table.Column(type: "text", nullable: true), - DisplayNames = table.Column(type: "text", nullable: true), - Name = table.Column(type: "character varying(200)", maxLength: 200, nullable: true), - Properties = table.Column(type: "text", nullable: true), - Resources = table.Column(type: "text", nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_openiddict_scope", x => x.Id); - }); - - migrationBuilder.CreateTable( - name: "tags", - schema: "mixyboos", - columns: table => new - { - Id = table.Column(type: "character varying(36)", nullable: false), - TagName = table.Column(type: "text", nullable: true), - DateCreated = table.Column(type: "timestamp with time zone", nullable: false, defaultValueSql: "now()"), - DateUpdated = table.Column(type: "timestamp with time zone", nullable: false, defaultValueSql: "now()") - }, - constraints: table => - { - table.PrimaryKey("PK_tags", x => x.Id); - }); - - migrationBuilder.CreateTable( - name: "user", - schema: "oid", - columns: table => new - { - Id = table.Column(type: "uuid", nullable: false), - Title = table.Column(type: "character varying(50)", maxLength: 50, nullable: true), - DisplayName = table.Column(type: "character varying(30)", maxLength: 30, nullable: true), - ProfileImage = table.Column(type: "text", nullable: true), - HeaderImage = table.Column(type: "text", nullable: true), - Slug = table.Column(type: "text", nullable: true), - City = table.Column(type: "character varying(100)", maxLength: 100, nullable: true), - Country = table.Column(type: "character varying(100)", maxLength: 100, nullable: true), - Biography = table.Column(type: "character varying(2048)", maxLength: 2048, nullable: true), - StreamKey = table.Column(type: "text", nullable: true), - UserName = table.Column(type: "character varying(256)", maxLength: 256, nullable: true), - NormalizedUserName = table.Column(type: "character varying(256)", maxLength: 256, nullable: true), - Email = table.Column(type: "character varying(256)", maxLength: 256, nullable: true), - NormalizedEmail = table.Column(type: "character varying(256)", maxLength: 256, nullable: true), - EmailConfirmed = table.Column(type: "boolean", nullable: false), - PasswordHash = table.Column(type: "text", nullable: true), - SecurityStamp = table.Column(type: "text", nullable: true), - ConcurrencyStamp = table.Column(type: "text", nullable: true), - PhoneNumber = table.Column(type: "text", nullable: true), - PhoneNumberConfirmed = table.Column(type: "boolean", nullable: false), - TwoFactorEnabled = table.Column(type: "boolean", nullable: false), - LockoutEnd = table.Column(type: "timestamp with time zone", nullable: true), - LockoutEnabled = table.Column(type: "boolean", nullable: false), - AccessFailedCount = table.Column(type: "integer", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_user", x => x.Id); - }); - - migrationBuilder.CreateTable( - name: "user_user_role", - schema: "oid", - columns: table => new - { - Id = table.Column(type: "uuid", nullable: false), - Name = table.Column(type: "character varying(256)", maxLength: 256, nullable: true), - NormalizedName = table.Column(type: "character varying(256)", maxLength: 256, nullable: true), - ConcurrencyStamp = table.Column(type: "text", nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_user_user_role", x => x.Id); - }); - - migrationBuilder.CreateTable( - name: "openiddict_authorization", - schema: "oid", - columns: table => new - { - Id = table.Column(type: "text", nullable: false), - ApplicationId = table.Column(type: "text", nullable: true), - ConcurrencyToken = table.Column(type: "character varying(50)", maxLength: 50, nullable: true), - CreationDate = table.Column(type: "timestamp with time zone", nullable: true), - Properties = table.Column(type: "text", nullable: true), - Scopes = table.Column(type: "text", nullable: true), - Status = table.Column(type: "character varying(50)", maxLength: 50, nullable: true), - Subject = table.Column(type: "character varying(400)", maxLength: 400, nullable: true), - Type = table.Column(type: "character varying(50)", maxLength: 50, nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_openiddict_authorization", x => x.Id); - table.ForeignKey( - name: "FK_openiddict_authorization_openiddict_application_Application~", - column: x => x.ApplicationId, - principalSchema: "oid", - principalTable: "openiddict_application", - principalColumn: "Id"); - }); - - migrationBuilder.CreateTable( - name: "live_shows", - schema: "mixyboos", - columns: table => new - { - Id = table.Column(type: "character varying(36)", nullable: false), - Title = table.Column(type: "text", nullable: true), - Description = table.Column(type: "text", nullable: true), - StartDate = table.Column(type: "timestamp with time zone", nullable: false), - Status = table.Column(type: "integer", nullable: false), - UserId = table.Column(type: "uuid", nullable: true), - DateCreated = table.Column(type: "timestamp with time zone", nullable: false, defaultValueSql: "now()"), - DateUpdated = table.Column(type: "timestamp with time zone", nullable: false, defaultValueSql: "now()") - }, - constraints: table => - { - table.PrimaryKey("PK_live_shows", x => x.Id); - table.ForeignKey( - name: "FK_live_shows_user_UserId", - column: x => x.UserId, - principalSchema: "oid", - principalTable: "user", - principalColumn: "Id"); - }); - - migrationBuilder.CreateTable( - name: "mixes", - schema: "mixyboos", - columns: table => new - { - Id = table.Column(type: "character varying(36)", nullable: false), - Slug = table.Column(type: "text", nullable: true), - Title = table.Column(type: "text", nullable: false), - Description = table.Column(type: "text", nullable: false), - Image = table.Column(type: "text", nullable: true), - AudioUrl = table.Column(type: "text", nullable: true), - IsProcessed = table.Column(type: "boolean", nullable: false), - UserId = table.Column(type: "uuid", nullable: false), - DateCreated = table.Column(type: "timestamp with time zone", nullable: false, defaultValueSql: "now()"), - DateUpdated = table.Column(type: "timestamp with time zone", nullable: false, defaultValueSql: "now()") - }, - constraints: table => - { - table.PrimaryKey("PK_mixes", x => x.Id); - table.ForeignKey( - name: "FK_mixes_user_UserId", - column: x => x.UserId, - principalSchema: "oid", - principalTable: "user", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateTable( - name: "user_claim", - schema: "oid", - columns: table => new - { - Id = table.Column(type: "integer", nullable: false) - .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), - UserId = table.Column(type: "uuid", nullable: false), - ClaimType = table.Column(type: "text", nullable: true), - ClaimValue = table.Column(type: "text", nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_user_claim", x => x.Id); - table.ForeignKey( - name: "FK_user_claim_user_UserId", - column: x => x.UserId, - principalSchema: "oid", - principalTable: "user", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateTable( - name: "user_followers", - schema: "oid", - columns: table => new - { - FollowersId = table.Column(type: "uuid", nullable: false), - FollowingId = table.Column(type: "uuid", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_user_followers", x => new { x.FollowersId, x.FollowingId }); - table.ForeignKey( - name: "FK_user_followers_user_FollowersId", - column: x => x.FollowersId, - principalSchema: "oid", - principalTable: "user", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - table.ForeignKey( - name: "FK_user_followers_user_FollowingId", - column: x => x.FollowingId, - principalSchema: "oid", - principalTable: "user", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateTable( - name: "user_login", - schema: "oid", - columns: table => new - { - LoginProvider = table.Column(type: "text", nullable: false), - ProviderKey = table.Column(type: "text", nullable: false), - ProviderDisplayName = table.Column(type: "text", nullable: true), - UserId = table.Column(type: "uuid", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_user_login", x => new { x.LoginProvider, x.ProviderKey }); - table.ForeignKey( - name: "FK_user_login_user_UserId", - column: x => x.UserId, - principalSchema: "oid", - principalTable: "user", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateTable( - name: "user_token", - schema: "oid", - columns: table => new - { - UserId = table.Column(type: "uuid", nullable: false), - LoginProvider = table.Column(type: "text", nullable: false), - Name = table.Column(type: "text", nullable: false), - Value = table.Column(type: "text", nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_user_token", x => new { x.UserId, x.LoginProvider, x.Name }); - table.ForeignKey( - name: "FK_user_token_user_UserId", - column: x => x.UserId, - principalSchema: "oid", - principalTable: "user", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateTable( - name: "role_claim", - schema: "oid", - columns: table => new - { - Id = table.Column(type: "integer", nullable: false) - .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), - RoleId = table.Column(type: "uuid", nullable: false), - ClaimType = table.Column(type: "text", nullable: true), - ClaimValue = table.Column(type: "text", nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_role_claim", x => x.Id); - table.ForeignKey( - name: "FK_role_claim_user_user_role_RoleId", - column: x => x.RoleId, - principalSchema: "oid", - principalTable: "user_user_role", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateTable( - name: "user_identity_role", - schema: "oid", - columns: table => new - { - UserId = table.Column(type: "uuid", nullable: false), - RoleId = table.Column(type: "uuid", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_user_identity_role", x => new { x.UserId, x.RoleId }); - table.ForeignKey( - name: "FK_user_identity_role_user_UserId", - column: x => x.UserId, - principalSchema: "oid", - principalTable: "user", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - table.ForeignKey( - name: "FK_user_identity_role_user_user_role_RoleId", - column: x => x.RoleId, - principalSchema: "oid", - principalTable: "user_user_role", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateTable( - name: "openiddict_token", - schema: "oid", - columns: table => new - { - Id = table.Column(type: "text", nullable: false), - ApplicationId = table.Column(type: "text", nullable: true), - AuthorizationId = table.Column(type: "text", nullable: true), - ConcurrencyToken = table.Column(type: "character varying(50)", maxLength: 50, nullable: true), - CreationDate = table.Column(type: "timestamp with time zone", nullable: true), - ExpirationDate = table.Column(type: "timestamp with time zone", nullable: true), - Payload = table.Column(type: "text", nullable: true), - Properties = table.Column(type: "text", nullable: true), - RedemptionDate = table.Column(type: "timestamp with time zone", nullable: true), - ReferenceId = table.Column(type: "character varying(100)", maxLength: 100, nullable: true), - Status = table.Column(type: "character varying(50)", maxLength: 50, nullable: true), - Subject = table.Column(type: "character varying(400)", maxLength: 400, nullable: true), - Type = table.Column(type: "character varying(50)", maxLength: 50, nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_openiddict_token", x => x.Id); - table.ForeignKey( - name: "FK_openiddict_token_openiddict_application_ApplicationId", - column: x => x.ApplicationId, - principalSchema: "oid", - principalTable: "openiddict_application", - principalColumn: "Id"); - table.ForeignKey( - name: "FK_openiddict_token_openiddict_authorization_AuthorizationId", - column: x => x.AuthorizationId, - principalSchema: "oid", - principalTable: "openiddict_authorization", - principalColumn: "Id"); - }); - - migrationBuilder.CreateTable( - name: "show_chats", - schema: "mixyboos", - columns: table => new - { - Id = table.Column(type: "character varying(36)", nullable: false), - FromUserId = table.Column(type: "uuid", nullable: false), - ToUserId = table.Column(type: "uuid", nullable: true), - DateSent = table.Column(type: "timestamp with time zone", nullable: false), - Message = table.Column(type: "text", nullable: false), - ShowId = table.Column(type: "character varying(36)", nullable: false), - DateCreated = table.Column(type: "timestamp with time zone", nullable: false, defaultValueSql: "now()"), - DateUpdated = table.Column(type: "timestamp with time zone", nullable: false, defaultValueSql: "now()") - }, - constraints: table => - { - table.PrimaryKey("PK_show_chats", x => x.Id); - table.ForeignKey( - name: "FK_show_chats_live_shows_ShowId", - column: x => x.ShowId, - principalSchema: "mixyboos", - principalTable: "live_shows", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - table.ForeignKey( - name: "FK_show_chats_user_FromUserId", - column: x => x.FromUserId, - principalSchema: "oid", - principalTable: "user", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - table.ForeignKey( - name: "FK_show_chats_user_ToUserId", - column: x => x.ToUserId, - principalSchema: "oid", - principalTable: "user", - principalColumn: "Id"); - }); - - migrationBuilder.CreateTable( - name: "show_tags", - schema: "mixyboos", - columns: table => new - { - LiveShowId = table.Column(type: "character varying(36)", nullable: false), - TagsId = table.Column(type: "character varying(36)", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_show_tags", x => new { x.LiveShowId, x.TagsId }); - table.ForeignKey( - name: "FK_show_tags_live_shows_LiveShowId", - column: x => x.LiveShowId, - principalSchema: "mixyboos", - principalTable: "live_shows", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - table.ForeignKey( - name: "FK_show_tags_tags_TagsId", - column: x => x.TagsId, - principalSchema: "mixyboos", - principalTable: "tags", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateTable( - name: "mix_download", - schema: "mixyboos", - columns: table => new - { - Id = table.Column(type: "character varying(36)", nullable: false), - DateCreated = table.Column(type: "timestamp with time zone", nullable: false, defaultValueSql: "now()"), - DateUpdated = table.Column(type: "timestamp with time zone", nullable: false, defaultValueSql: "now()"), - MixId = table.Column(type: "character varying(36)", nullable: false), - UserId = table.Column(type: "uuid", nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_mix_download", x => x.Id); - table.ForeignKey( - name: "FK_mix_download_mixes_MixId", - column: x => x.MixId, - principalSchema: "mixyboos", - principalTable: "mixes", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - table.ForeignKey( - name: "FK_mix_download_user_UserId", - column: x => x.UserId, - principalSchema: "oid", - principalTable: "user", - principalColumn: "Id"); - }); - - migrationBuilder.CreateTable( - name: "mix_likes", - schema: "mixyboos", - columns: table => new - { - Id = table.Column(type: "character varying(36)", nullable: false), - DateCreated = table.Column(type: "timestamp with time zone", nullable: false, defaultValueSql: "now()"), - DateUpdated = table.Column(type: "timestamp with time zone", nullable: false, defaultValueSql: "now()"), - MixId = table.Column(type: "character varying(36)", nullable: false), - UserId = table.Column(type: "uuid", nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_mix_likes", x => x.Id); - table.ForeignKey( - name: "FK_mix_likes_mixes_MixId", - column: x => x.MixId, - principalSchema: "mixyboos", - principalTable: "mixes", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - table.ForeignKey( - name: "FK_mix_likes_user_UserId", - column: x => x.UserId, - principalSchema: "oid", - principalTable: "user", - principalColumn: "Id"); - }); - - migrationBuilder.CreateTable( - name: "mix_plays", - schema: "mixyboos", - columns: table => new - { - MixId = table.Column(type: "character varying(36)", nullable: false), - UserId = table.Column(type: "uuid", nullable: false), - Id = table.Column(type: "character varying(36)", nullable: false), - DateCreated = table.Column(type: "timestamp with time zone", nullable: false, defaultValueSql: "now()"), - DateUpdated = table.Column(type: "timestamp with time zone", nullable: false, defaultValueSql: "now()") - }, - constraints: table => - { - table.PrimaryKey("PK_mix_plays", x => new { x.MixId, x.UserId }); - table.ForeignKey( - name: "FK_mix_plays_mixes_MixId", - column: x => x.MixId, - principalSchema: "mixyboos", - principalTable: "mixes", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - table.ForeignKey( - name: "FK_mix_plays_user_UserId", - column: x => x.UserId, - principalSchema: "oid", - principalTable: "user", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateTable( - name: "mix_shares", - schema: "mixyboos", - columns: table => new - { - Id = table.Column(type: "character varying(36)", nullable: false), - DateCreated = table.Column(type: "timestamp with time zone", nullable: false, defaultValueSql: "now()"), - DateUpdated = table.Column(type: "timestamp with time zone", nullable: false, defaultValueSql: "now()"), - MixId = table.Column(type: "character varying(36)", nullable: false), - UserId = table.Column(type: "uuid", nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_mix_shares", x => x.Id); - table.ForeignKey( - name: "FK_mix_shares_mixes_MixId", - column: x => x.MixId, - principalSchema: "mixyboos", - principalTable: "mixes", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - table.ForeignKey( - name: "FK_mix_shares_user_UserId", - column: x => x.UserId, - principalSchema: "oid", - principalTable: "user", - principalColumn: "Id"); - }); - - migrationBuilder.CreateTable( - name: "mix_tags", - schema: "mixyboos", - columns: table => new - { - MixId = table.Column(type: "character varying(36)", nullable: false), - TagsId = table.Column(type: "character varying(36)", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_mix_tags", x => new { x.MixId, x.TagsId }); - table.ForeignKey( - name: "FK_mix_tags_mixes_MixId", - column: x => x.MixId, - principalSchema: "mixyboos", - principalTable: "mixes", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - table.ForeignKey( - name: "FK_mix_tags_tags_TagsId", - column: x => x.TagsId, - principalSchema: "mixyboos", - principalTable: "tags", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateIndex( - name: "IX_live_shows_UserId", - schema: "mixyboos", - table: "live_shows", - column: "UserId"); - - migrationBuilder.CreateIndex( - name: "IX_mix_download_MixId", - schema: "mixyboos", - table: "mix_download", - column: "MixId"); - - migrationBuilder.CreateIndex( - name: "IX_mix_download_UserId", - schema: "mixyboos", - table: "mix_download", - column: "UserId"); - - migrationBuilder.CreateIndex( - name: "IX_mix_likes_MixId", - schema: "mixyboos", - table: "mix_likes", - column: "MixId"); - - migrationBuilder.CreateIndex( - name: "IX_mix_likes_UserId", - schema: "mixyboos", - table: "mix_likes", - column: "UserId"); - - migrationBuilder.CreateIndex( - name: "IX_mix_plays_UserId", - schema: "mixyboos", - table: "mix_plays", - column: "UserId"); - - migrationBuilder.CreateIndex( - name: "IX_mix_shares_MixId", - schema: "mixyboos", - table: "mix_shares", - column: "MixId"); - - migrationBuilder.CreateIndex( - name: "IX_mix_shares_UserId", - schema: "mixyboos", - table: "mix_shares", - column: "UserId"); - - migrationBuilder.CreateIndex( - name: "IX_mix_tags_TagsId", - schema: "mixyboos", - table: "mix_tags", - column: "TagsId"); - - migrationBuilder.CreateIndex( - name: "IX_mixes_Slug", - schema: "mixyboos", - table: "mixes", - column: "Slug", - unique: true); - - migrationBuilder.CreateIndex( - name: "IX_mixes_UserId", - schema: "mixyboos", - table: "mixes", - column: "UserId"); - - migrationBuilder.CreateIndex( - name: "IX_openiddict_application_ClientId", - schema: "oid", - table: "openiddict_application", - column: "ClientId", - unique: true); - - migrationBuilder.CreateIndex( - name: "IX_openiddict_authorization_ApplicationId_Status_Subject_Type", - schema: "oid", - table: "openiddict_authorization", - columns: new[] { "ApplicationId", "Status", "Subject", "Type" }); - - migrationBuilder.CreateIndex( - name: "IX_openiddict_scope_Name", - schema: "oid", - table: "openiddict_scope", - column: "Name", - unique: true); - - migrationBuilder.CreateIndex( - name: "IX_openiddict_token_ApplicationId_Status_Subject_Type", - schema: "oid", - table: "openiddict_token", - columns: new[] { "ApplicationId", "Status", "Subject", "Type" }); - - migrationBuilder.CreateIndex( - name: "IX_openiddict_token_AuthorizationId", - schema: "oid", - table: "openiddict_token", - column: "AuthorizationId"); - - migrationBuilder.CreateIndex( - name: "IX_openiddict_token_ReferenceId", - schema: "oid", - table: "openiddict_token", - column: "ReferenceId", - unique: true); - - migrationBuilder.CreateIndex( - name: "IX_role_claim_RoleId", - schema: "oid", - table: "role_claim", - column: "RoleId"); - - migrationBuilder.CreateIndex( - name: "IX_show_chats_FromUserId", - schema: "mixyboos", - table: "show_chats", - column: "FromUserId"); - - migrationBuilder.CreateIndex( - name: "IX_show_chats_ShowId", - schema: "mixyboos", - table: "show_chats", - column: "ShowId"); - - migrationBuilder.CreateIndex( - name: "IX_show_chats_ToUserId", - schema: "mixyboos", - table: "show_chats", - column: "ToUserId"); - - migrationBuilder.CreateIndex( - name: "IX_show_tags_TagsId", - schema: "mixyboos", - table: "show_tags", - column: "TagsId"); - - migrationBuilder.CreateIndex( - name: "IX_tags_TagName", - schema: "mixyboos", - table: "tags", - column: "TagName", - unique: true); - - migrationBuilder.CreateIndex( - name: "EmailIndex", - schema: "oid", - table: "user", - column: "NormalizedEmail"); - - migrationBuilder.CreateIndex( - name: "IX_user_Slug", - schema: "oid", - table: "user", - column: "Slug", - unique: true); - - migrationBuilder.CreateIndex( - name: "UserNameIndex", - schema: "oid", - table: "user", - column: "NormalizedUserName", - unique: true); - - migrationBuilder.CreateIndex( - name: "IX_user_claim_UserId", - schema: "oid", - table: "user_claim", - column: "UserId"); - - migrationBuilder.CreateIndex( - name: "IX_user_followers_FollowingId", - schema: "oid", - table: "user_followers", - column: "FollowingId"); - - migrationBuilder.CreateIndex( - name: "IX_user_identity_role_RoleId", - schema: "oid", - table: "user_identity_role", - column: "RoleId"); - - migrationBuilder.CreateIndex( - name: "IX_user_login_UserId", - schema: "oid", - table: "user_login", - column: "UserId"); - - migrationBuilder.CreateIndex( - name: "RoleNameIndex", - schema: "oid", - table: "user_user_role", - column: "NormalizedName", - unique: true); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropTable( - name: "identity_user", - schema: "oid"); - - migrationBuilder.DropTable( - name: "identity_user_base", - schema: "oid"); - - migrationBuilder.DropTable( - name: "mix_download", - schema: "mixyboos"); - - migrationBuilder.DropTable( - name: "mix_likes", - schema: "mixyboos"); - - migrationBuilder.DropTable( - name: "mix_plays", - schema: "mixyboos"); - - migrationBuilder.DropTable( - name: "mix_shares", - schema: "mixyboos"); - - migrationBuilder.DropTable( - name: "mix_tags", - schema: "mixyboos"); - - migrationBuilder.DropTable( - name: "openiddict_scope", - schema: "oid"); - - migrationBuilder.DropTable( - name: "openiddict_token", - schema: "oid"); - - migrationBuilder.DropTable( - name: "role_claim", - schema: "oid"); - - migrationBuilder.DropTable( - name: "show_chats", - schema: "mixyboos"); - - migrationBuilder.DropTable( - name: "show_tags", - schema: "mixyboos"); - - migrationBuilder.DropTable( - name: "user_claim", - schema: "oid"); - - migrationBuilder.DropTable( - name: "user_followers", - schema: "oid"); - - migrationBuilder.DropTable( - name: "user_identity_role", - schema: "oid"); - - migrationBuilder.DropTable( - name: "user_login", - schema: "oid"); - - migrationBuilder.DropTable( - name: "user_token", - schema: "oid"); - - migrationBuilder.DropTable( - name: "mixes", - schema: "mixyboos"); - - migrationBuilder.DropTable( - name: "openiddict_authorization", - schema: "oid"); - - migrationBuilder.DropTable( - name: "live_shows", - schema: "mixyboos"); - - migrationBuilder.DropTable( - name: "tags", - schema: "mixyboos"); - - migrationBuilder.DropTable( - name: "user_user_role", - schema: "oid"); - - migrationBuilder.DropTable( - name: "openiddict_application", - schema: "oid"); - - migrationBuilder.DropTable( - name: "user", - schema: "oid"); - } - } -} diff --git a/mixyboos-api/Migrations/MixyBoosContextModelSnapshot.cs b/mixyboos-api/Migrations/MixyBoosContextModelSnapshot.cs deleted file mode 100644 index 531f98e..0000000 --- a/mixyboos-api/Migrations/MixyBoosContextModelSnapshot.cs +++ /dev/null @@ -1,1160 +0,0 @@ -// -using System; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using MixyBoos.Api.Data; -using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; - -#nullable disable - -namespace MixyBoos.Api.Migrations -{ - [DbContext(typeof(MixyBoosContext))] - partial class MixyBoosContextModelSnapshot : ModelSnapshot - { - protected override void BuildModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasDefaultSchema("mixyboos") - .UseCollation("en_US.utf8") - .HasAnnotation("ProductVersion", "8.0.0-rc.1.23419.6") - .HasAnnotation("Relational:MaxIdentifierLength", 63); - - NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); - - modelBuilder.Entity("LiveShowTag", b => - { - b.Property("LiveShowId") - .HasColumnType("character varying(36)"); - - b.Property("TagsId") - .HasColumnType("character varying(36)"); - - b.HasKey("LiveShowId", "TagsId"); - - b.HasIndex("TagsId"); - - b.ToTable("show_tags", "mixyboos"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRole", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uuid"); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken() - .HasColumnType("text"); - - b.Property("Name") - .HasMaxLength(256) - .HasColumnType("character varying(256)"); - - b.Property("NormalizedName") - .HasMaxLength(256) - .HasColumnType("character varying(256)"); - - b.HasKey("Id"); - - b.HasIndex("NormalizedName") - .IsUnique() - .HasDatabaseName("RoleNameIndex"); - - b.ToTable("user_user_role", "oid"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ClaimType") - .HasColumnType("text"); - - b.Property("ClaimValue") - .HasColumnType("text"); - - b.Property("RoleId") - .HasColumnType("uuid"); - - b.HasKey("Id"); - - b.HasIndex("RoleId"); - - b.ToTable("role_claim", "oid"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUser", b => - { - b.Property("Id") - .HasColumnType("text"); - - b.Property("AccessFailedCount") - .HasColumnType("integer"); - - b.Property("ConcurrencyStamp") - .HasColumnType("text"); - - b.Property("Email") - .HasColumnType("text"); - - b.Property("EmailConfirmed") - .HasColumnType("boolean"); - - b.Property("LockoutEnabled") - .HasColumnType("boolean"); - - b.Property("LockoutEnd") - .HasColumnType("timestamp with time zone"); - - b.Property("NormalizedEmail") - .HasColumnType("text"); - - b.Property("NormalizedUserName") - .HasColumnType("text"); - - b.Property("PasswordHash") - .HasColumnType("text"); - - b.Property("PhoneNumber") - .HasColumnType("text"); - - b.Property("PhoneNumberConfirmed") - .HasColumnType("boolean"); - - b.Property("SecurityStamp") - .HasColumnType("text"); - - b.Property("TwoFactorEnabled") - .HasColumnType("boolean"); - - b.Property("UserName") - .HasColumnType("text"); - - b.HasKey("Id"); - - b.ToTable("identity_user_base", "oid"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUser", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uuid"); - - b.Property("AccessFailedCount") - .HasColumnType("integer"); - - b.Property("ConcurrencyStamp") - .HasColumnType("text"); - - b.Property("Email") - .HasColumnType("text"); - - b.Property("EmailConfirmed") - .HasColumnType("boolean"); - - b.Property("LockoutEnabled") - .HasColumnType("boolean"); - - b.Property("LockoutEnd") - .HasColumnType("timestamp with time zone"); - - b.Property("NormalizedEmail") - .HasColumnType("text"); - - b.Property("NormalizedUserName") - .HasColumnType("text"); - - b.Property("PasswordHash") - .HasColumnType("text"); - - b.Property("PhoneNumber") - .HasColumnType("text"); - - b.Property("PhoneNumberConfirmed") - .HasColumnType("boolean"); - - b.Property("SecurityStamp") - .HasColumnType("text"); - - b.Property("TwoFactorEnabled") - .HasColumnType("boolean"); - - b.Property("UserName") - .HasColumnType("text"); - - b.HasKey("Id"); - - b.ToTable("identity_user", "oid"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ClaimType") - .HasColumnType("text"); - - b.Property("ClaimValue") - .HasColumnType("text"); - - b.Property("UserId") - .HasColumnType("uuid"); - - b.HasKey("Id"); - - b.HasIndex("UserId"); - - b.ToTable("user_claim", "oid"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => - { - b.Property("LoginProvider") - .HasColumnType("text"); - - b.Property("ProviderKey") - .HasColumnType("text"); - - b.Property("ProviderDisplayName") - .HasColumnType("text"); - - b.Property("UserId") - .HasColumnType("uuid"); - - b.HasKey("LoginProvider", "ProviderKey"); - - b.HasIndex("UserId"); - - b.ToTable("user_login", "oid"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => - { - b.Property("UserId") - .HasColumnType("uuid"); - - b.Property("RoleId") - .HasColumnType("uuid"); - - b.HasKey("UserId", "RoleId"); - - b.HasIndex("RoleId"); - - b.ToTable("user_identity_role", "oid"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => - { - b.Property("UserId") - .HasColumnType("uuid"); - - b.Property("LoginProvider") - .HasColumnType("text"); - - b.Property("Name") - .HasColumnType("text"); - - b.Property("Value") - .HasColumnType("text"); - - b.HasKey("UserId", "LoginProvider", "Name"); - - b.ToTable("user_token", "oid"); - }); - - modelBuilder.Entity("MixTag", b => - { - b.Property("MixId") - .HasColumnType("character varying(36)"); - - b.Property("TagsId") - .HasColumnType("character varying(36)"); - - b.HasKey("MixId", "TagsId"); - - b.HasIndex("TagsId"); - - b.ToTable("mix_tags", "mixyboos"); - }); - - modelBuilder.Entity("MixyBoos.Api.Data.Models.LiveShow", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("character varying(36)"); - - b.Property("DateCreated") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("DateUpdated") - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("Description") - .HasColumnType("text"); - - b.Property("StartDate") - .HasColumnType("timestamp with time zone"); - - b.Property("Status") - .HasColumnType("integer"); - - b.Property("Title") - .HasColumnType("text"); - - b.Property("UserId") - .HasColumnType("uuid"); - - b.HasKey("Id"); - - b.HasIndex("UserId"); - - b.ToTable("live_shows", "mixyboos"); - }); - - modelBuilder.Entity("MixyBoos.Api.Data.Models.Mix", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("character varying(36)"); - - b.Property("AudioUrl") - .HasColumnType("text"); - - b.Property("DateCreated") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("DateUpdated") - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("Description") - .IsRequired() - .HasColumnType("text"); - - b.Property("Image") - .HasColumnType("text"); - - b.Property("IsProcessed") - .HasColumnType("boolean"); - - b.Property("Slug") - .HasColumnType("text"); - - b.Property("Title") - .IsRequired() - .HasColumnType("text"); - - b.Property("UserId") - .HasColumnType("uuid"); - - b.HasKey("Id"); - - b.HasIndex("Slug") - .IsUnique(); - - b.HasIndex("UserId"); - - b.ToTable("mixes", "mixyboos"); - }); - - modelBuilder.Entity("MixyBoos.Api.Data.Models.MixDownload", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("character varying(36)"); - - b.Property("DateCreated") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("DateUpdated") - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("MixId") - .IsRequired() - .HasColumnType("character varying(36)"); - - b.Property("UserId") - .HasColumnType("uuid"); - - b.HasKey("Id"); - - b.HasIndex("MixId"); - - b.HasIndex("UserId"); - - b.ToTable("mix_download", "mixyboos"); - }); - - modelBuilder.Entity("MixyBoos.Api.Data.Models.MixLike", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("character varying(36)"); - - b.Property("DateCreated") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("DateUpdated") - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("MixId") - .IsRequired() - .HasColumnType("character varying(36)"); - - b.Property("UserId") - .HasColumnType("uuid"); - - b.HasKey("Id"); - - b.HasIndex("MixId"); - - b.HasIndex("UserId"); - - b.ToTable("mix_likes", "mixyboos"); - }); - - modelBuilder.Entity("MixyBoos.Api.Data.Models.MixPlay", b => - { - b.Property("MixId") - .HasColumnType("character varying(36)"); - - b.Property("UserId") - .HasColumnType("uuid"); - - b.Property("DateCreated") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("DateUpdated") - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("Id") - .IsRequired() - .ValueGeneratedOnAdd() - .HasColumnType("character varying(36)"); - - b.HasKey("MixId", "UserId"); - - b.HasIndex("UserId"); - - b.ToTable("mix_plays", "mixyboos"); - }); - - modelBuilder.Entity("MixyBoos.Api.Data.Models.MixShare", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("character varying(36)"); - - b.Property("DateCreated") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("DateUpdated") - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("MixId") - .IsRequired() - .HasColumnType("character varying(36)"); - - b.Property("UserId") - .HasColumnType("uuid"); - - b.HasKey("Id"); - - b.HasIndex("MixId"); - - b.HasIndex("UserId"); - - b.ToTable("mix_shares", "mixyboos"); - }); - - modelBuilder.Entity("MixyBoos.Api.Data.Models.MixyBoosUser", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uuid"); - - b.Property("AccessFailedCount") - .HasColumnType("integer"); - - b.Property("Biography") - .HasMaxLength(2048) - .HasColumnType("character varying(2048)"); - - b.Property("City") - .HasMaxLength(100) - .HasColumnType("character varying(100)"); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken() - .HasColumnType("text"); - - b.Property("Country") - .HasMaxLength(100) - .HasColumnType("character varying(100)"); - - b.Property("DisplayName") - .HasMaxLength(30) - .HasColumnType("character varying(30)"); - - b.Property("Email") - .HasMaxLength(256) - .HasColumnType("character varying(256)"); - - b.Property("EmailConfirmed") - .HasColumnType("boolean"); - - b.Property("HeaderImage") - .HasColumnType("text"); - - b.Property("LockoutEnabled") - .HasColumnType("boolean"); - - b.Property("LockoutEnd") - .HasColumnType("timestamp with time zone"); - - b.Property("NormalizedEmail") - .HasMaxLength(256) - .HasColumnType("character varying(256)"); - - b.Property("NormalizedUserName") - .HasMaxLength(256) - .HasColumnType("character varying(256)"); - - b.Property("PasswordHash") - .HasColumnType("text"); - - b.Property("PhoneNumber") - .HasColumnType("text"); - - b.Property("PhoneNumberConfirmed") - .HasColumnType("boolean"); - - b.Property("ProfileImage") - .HasColumnType("text"); - - b.Property("SecurityStamp") - .HasColumnType("text"); - - b.Property("Slug") - .HasColumnType("text"); - - b.Property("StreamKey") - .HasColumnType("text"); - - b.Property("Title") - .HasMaxLength(50) - .HasColumnType("character varying(50)"); - - b.Property("TwoFactorEnabled") - .HasColumnType("boolean"); - - b.Property("UserName") - .HasMaxLength(256) - .HasColumnType("character varying(256)"); - - b.HasKey("Id"); - - b.HasIndex("NormalizedEmail") - .HasDatabaseName("EmailIndex"); - - b.HasIndex("NormalizedUserName") - .IsUnique() - .HasDatabaseName("UserNameIndex"); - - b.HasIndex("Slug") - .IsUnique(); - - b.ToTable("user", "oid"); - }); - - modelBuilder.Entity("MixyBoos.Api.Data.Models.ShowChat", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("character varying(36)"); - - b.Property("DateCreated") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("DateSent") - .HasColumnType("timestamp with time zone"); - - b.Property("DateUpdated") - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("FromUserId") - .HasColumnType("uuid"); - - b.Property("Message") - .IsRequired() - .HasColumnType("text"); - - b.Property("ShowId") - .IsRequired() - .HasColumnType("character varying(36)"); - - b.Property("ToUserId") - .HasColumnType("uuid"); - - b.HasKey("Id"); - - b.HasIndex("FromUserId"); - - b.HasIndex("ShowId"); - - b.HasIndex("ToUserId"); - - b.ToTable("show_chats", "mixyboos"); - }); - - modelBuilder.Entity("MixyBoos.Api.Data.Models.Tag", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("character varying(36)"); - - b.Property("DateCreated") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("DateUpdated") - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("now()"); - - b.Property("TagName") - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("TagName") - .IsUnique(); - - b.ToTable("tags", "mixyboos"); - }); - - modelBuilder.Entity("MixyBoosUserMixyBoosUser", b => - { - b.Property("FollowersId") - .HasColumnType("uuid"); - - b.Property("FollowingId") - .HasColumnType("uuid"); - - b.HasKey("FollowersId", "FollowingId"); - - b.HasIndex("FollowingId"); - - b.ToTable("user_followers", "oid"); - }); - - modelBuilder.Entity("OpenIddict.EntityFrameworkCore.Models.OpenIddictEntityFrameworkCoreApplication", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("ClientId") - .HasMaxLength(100) - .HasColumnType("character varying(100)"); - - b.Property("ClientSecret") - .HasColumnType("text"); - - b.Property("ConcurrencyToken") - .IsConcurrencyToken() - .HasMaxLength(50) - .HasColumnType("character varying(50)"); - - b.Property("ConsentType") - .HasMaxLength(50) - .HasColumnType("character varying(50)"); - - b.Property("DisplayName") - .HasColumnType("text"); - - b.Property("DisplayNames") - .HasColumnType("text"); - - b.Property("Permissions") - .HasColumnType("text"); - - b.Property("PostLogoutRedirectUris") - .HasColumnType("text"); - - b.Property("Properties") - .HasColumnType("text"); - - b.Property("RedirectUris") - .HasColumnType("text"); - - b.Property("Requirements") - .HasColumnType("text"); - - b.Property("Type") - .HasMaxLength(50) - .HasColumnType("character varying(50)"); - - b.HasKey("Id"); - - b.HasIndex("ClientId") - .IsUnique(); - - b.ToTable("openiddict_application", "oid"); - }); - - modelBuilder.Entity("OpenIddict.EntityFrameworkCore.Models.OpenIddictEntityFrameworkCoreAuthorization", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("ApplicationId") - .HasColumnType("text"); - - b.Property("ConcurrencyToken") - .IsConcurrencyToken() - .HasMaxLength(50) - .HasColumnType("character varying(50)"); - - b.Property("CreationDate") - .HasColumnType("timestamp with time zone"); - - b.Property("Properties") - .HasColumnType("text"); - - b.Property("Scopes") - .HasColumnType("text"); - - b.Property("Status") - .HasMaxLength(50) - .HasColumnType("character varying(50)"); - - b.Property("Subject") - .HasMaxLength(400) - .HasColumnType("character varying(400)"); - - b.Property("Type") - .HasMaxLength(50) - .HasColumnType("character varying(50)"); - - b.HasKey("Id"); - - b.HasIndex("ApplicationId", "Status", "Subject", "Type"); - - b.ToTable("openiddict_authorization", "oid"); - }); - - modelBuilder.Entity("OpenIddict.EntityFrameworkCore.Models.OpenIddictEntityFrameworkCoreScope", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("ConcurrencyToken") - .IsConcurrencyToken() - .HasMaxLength(50) - .HasColumnType("character varying(50)"); - - b.Property("Description") - .HasColumnType("text"); - - b.Property("Descriptions") - .HasColumnType("text"); - - b.Property("DisplayName") - .HasColumnType("text"); - - b.Property("DisplayNames") - .HasColumnType("text"); - - b.Property("Name") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("Properties") - .HasColumnType("text"); - - b.Property("Resources") - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("Name") - .IsUnique(); - - b.ToTable("openiddict_scope", "oid"); - }); - - modelBuilder.Entity("OpenIddict.EntityFrameworkCore.Models.OpenIddictEntityFrameworkCoreToken", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("text"); - - b.Property("ApplicationId") - .HasColumnType("text"); - - b.Property("AuthorizationId") - .HasColumnType("text"); - - b.Property("ConcurrencyToken") - .IsConcurrencyToken() - .HasMaxLength(50) - .HasColumnType("character varying(50)"); - - b.Property("CreationDate") - .HasColumnType("timestamp with time zone"); - - b.Property("ExpirationDate") - .HasColumnType("timestamp with time zone"); - - b.Property("Payload") - .HasColumnType("text"); - - b.Property("Properties") - .HasColumnType("text"); - - b.Property("RedemptionDate") - .HasColumnType("timestamp with time zone"); - - b.Property("ReferenceId") - .HasMaxLength(100) - .HasColumnType("character varying(100)"); - - b.Property("Status") - .HasMaxLength(50) - .HasColumnType("character varying(50)"); - - b.Property("Subject") - .HasMaxLength(400) - .HasColumnType("character varying(400)"); - - b.Property("Type") - .HasMaxLength(50) - .HasColumnType("character varying(50)"); - - b.HasKey("Id"); - - b.HasIndex("AuthorizationId"); - - b.HasIndex("ReferenceId") - .IsUnique(); - - b.HasIndex("ApplicationId", "Status", "Subject", "Type"); - - b.ToTable("openiddict_token", "oid"); - }); - - modelBuilder.Entity("LiveShowTag", b => - { - b.HasOne("MixyBoos.Api.Data.Models.LiveShow", null) - .WithMany() - .HasForeignKey("LiveShowId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("MixyBoos.Api.Data.Models.Tag", null) - .WithMany() - .HasForeignKey("TagsId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => - { - b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole", null) - .WithMany() - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => - { - b.HasOne("MixyBoos.Api.Data.Models.MixyBoosUser", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => - { - b.HasOne("MixyBoos.Api.Data.Models.MixyBoosUser", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => - { - b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole", null) - .WithMany() - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("MixyBoos.Api.Data.Models.MixyBoosUser", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => - { - b.HasOne("MixyBoos.Api.Data.Models.MixyBoosUser", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("MixTag", b => - { - b.HasOne("MixyBoos.Api.Data.Models.Mix", null) - .WithMany() - .HasForeignKey("MixId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("MixyBoos.Api.Data.Models.Tag", null) - .WithMany() - .HasForeignKey("TagsId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("MixyBoos.Api.Data.Models.LiveShow", b => - { - b.HasOne("MixyBoos.Api.Data.Models.MixyBoosUser", "User") - .WithMany() - .HasForeignKey("UserId"); - - b.Navigation("User"); - }); - - modelBuilder.Entity("MixyBoos.Api.Data.Models.Mix", b => - { - b.HasOne("MixyBoos.Api.Data.Models.MixyBoosUser", "User") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("User"); - }); - - modelBuilder.Entity("MixyBoos.Api.Data.Models.MixDownload", b => - { - b.HasOne("MixyBoos.Api.Data.Models.Mix", "Mix") - .WithMany("Downloads") - .HasForeignKey("MixId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("MixyBoos.Api.Data.Models.MixyBoosUser", "User") - .WithMany("Downloads") - .HasForeignKey("UserId"); - - b.Navigation("Mix"); - - b.Navigation("User"); - }); - - modelBuilder.Entity("MixyBoos.Api.Data.Models.MixLike", b => - { - b.HasOne("MixyBoos.Api.Data.Models.Mix", "Mix") - .WithMany("Likes") - .HasForeignKey("MixId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("MixyBoos.Api.Data.Models.MixyBoosUser", "User") - .WithMany("Likes") - .HasForeignKey("UserId"); - - b.Navigation("Mix"); - - b.Navigation("User"); - }); - - modelBuilder.Entity("MixyBoos.Api.Data.Models.MixPlay", b => - { - b.HasOne("MixyBoos.Api.Data.Models.Mix", "Mix") - .WithMany("Plays") - .HasForeignKey("MixId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("MixyBoos.Api.Data.Models.MixyBoosUser", "User") - .WithMany("Plays") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Mix"); - - b.Navigation("User"); - }); - - modelBuilder.Entity("MixyBoos.Api.Data.Models.MixShare", b => - { - b.HasOne("MixyBoos.Api.Data.Models.Mix", "Mix") - .WithMany("Shares") - .HasForeignKey("MixId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("MixyBoos.Api.Data.Models.MixyBoosUser", "User") - .WithMany("Shares") - .HasForeignKey("UserId"); - - b.Navigation("Mix"); - - b.Navigation("User"); - }); - - modelBuilder.Entity("MixyBoos.Api.Data.Models.ShowChat", b => - { - b.HasOne("MixyBoos.Api.Data.Models.MixyBoosUser", "FromUser") - .WithMany() - .HasForeignKey("FromUserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("MixyBoos.Api.Data.Models.LiveShow", "Show") - .WithMany() - .HasForeignKey("ShowId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("MixyBoos.Api.Data.Models.MixyBoosUser", "ToUser") - .WithMany() - .HasForeignKey("ToUserId"); - - b.Navigation("FromUser"); - - b.Navigation("Show"); - - b.Navigation("ToUser"); - }); - - modelBuilder.Entity("MixyBoosUserMixyBoosUser", b => - { - b.HasOne("MixyBoos.Api.Data.Models.MixyBoosUser", null) - .WithMany() - .HasForeignKey("FollowersId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("MixyBoos.Api.Data.Models.MixyBoosUser", null) - .WithMany() - .HasForeignKey("FollowingId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("OpenIddict.EntityFrameworkCore.Models.OpenIddictEntityFrameworkCoreAuthorization", b => - { - b.HasOne("OpenIddict.EntityFrameworkCore.Models.OpenIddictEntityFrameworkCoreApplication", "Application") - .WithMany("Authorizations") - .HasForeignKey("ApplicationId"); - - b.Navigation("Application"); - }); - - modelBuilder.Entity("OpenIddict.EntityFrameworkCore.Models.OpenIddictEntityFrameworkCoreToken", b => - { - b.HasOne("OpenIddict.EntityFrameworkCore.Models.OpenIddictEntityFrameworkCoreApplication", "Application") - .WithMany("Tokens") - .HasForeignKey("ApplicationId"); - - b.HasOne("OpenIddict.EntityFrameworkCore.Models.OpenIddictEntityFrameworkCoreAuthorization", "Authorization") - .WithMany("Tokens") - .HasForeignKey("AuthorizationId"); - - b.Navigation("Application"); - - b.Navigation("Authorization"); - }); - - modelBuilder.Entity("MixyBoos.Api.Data.Models.Mix", b => - { - b.Navigation("Downloads"); - - b.Navigation("Likes"); - - b.Navigation("Plays"); - - b.Navigation("Shares"); - }); - - modelBuilder.Entity("MixyBoos.Api.Data.Models.MixyBoosUser", b => - { - b.Navigation("Downloads"); - - b.Navigation("Likes"); - - b.Navigation("Plays"); - - b.Navigation("Shares"); - }); - - modelBuilder.Entity("OpenIddict.EntityFrameworkCore.Models.OpenIddictEntityFrameworkCoreApplication", b => - { - b.Navigation("Authorizations"); - - b.Navigation("Tokens"); - }); - - modelBuilder.Entity("OpenIddict.EntityFrameworkCore.Models.OpenIddictEntityFrameworkCoreAuthorization", b => - { - b.Navigation("Tokens"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/mixyboos-api/Program.cs b/mixyboos-api/Program.cs index 1d80acf..0203b56 100644 --- a/mixyboos-api/Program.cs +++ b/mixyboos-api/Program.cs @@ -1,71 +1,108 @@ -using System; -using System.IO; -using System.Net; -using System.Security.Cryptography.X509Certificates; -using Microsoft.AspNetCore.Hosting; -using Microsoft.Extensions.Configuration; -using Microsoft.Extensions.Hosting; -using Microsoft.Extensions.Logging; -using Serilog; - -namespace MixyBoos.Api; - -public class Program { - private static readonly string _environment = Environment.GetEnvironmentVariable("ASPNETCORE_ENVIRONMENT"); - - public static void Main(string[] args) { - Log.Logger = new LoggerConfiguration() - .WriteTo.Console() - .CreateBootstrapLogger(); - - try { - CreateHostBuilder(args).Build().Run(); - Log.Information("Stopped cleanly"); - } catch (Exception e) { - Log.Fatal(e, "An unhandled exception occured during bootstrapping {Error}", e.Message); - Log.CloseAndFlush(); - } - } - - private static IHostBuilder CreateHostBuilder(string[] args) { - var builder = new ConfigurationBuilder() - .SetBasePath(Directory.GetCurrentDirectory()) - .AddJsonFile("appsettings.json", optional: true, reloadOnChange: true) - .AddJsonFile($"appsettings.{_environment}.json", optional: true) - .AddEnvironmentVariables(); - - - var configuration = builder.Build(); - return Host.CreateDefaultBuilder(args) - .UseSerilog((context, services, seriLogConfig) => seriLogConfig - .ReadFrom.Configuration(context.Configuration) - .ReadFrom.Services(services) - .Enrich.FromLogContext() - .WriteTo.Console()) - .UseDefaultServiceProvider(o => { - o.ValidateOnBuild = false; - }) - .ConfigureWebHostDefaults(webBuilder => { - webBuilder - .UseKestrel(options => { - var pemFile = configuration["SSL:PemFile"]; - var keyFile = configuration["SSL:KeyFile"]; - if (string.IsNullOrEmpty(pemFile) || string.IsNullOrEmpty(keyFile)) { - return; - } - - options.Listen(IPAddress.Any, 5001, listenOptions => { - var certPem = File.ReadAllText("/etc/letsencrypt/live/dev.fergl.ie/fullchain.pem"); - var keyPem = File.ReadAllText("/etc/letsencrypt/live/dev.fergl.ie/privkey.pem"); - var x509 = X509Certificate2.CreateFromPem(certPem, keyPem); - - listenOptions.UseHttps(x509); - }); - }) - .UseStartup(); - }).ConfigureLogging(builder => { - builder.ClearProviders(); - builder.AddConsole(); - }); - } -} +using System.IO; +using System.Net; +using System.Security.Cryptography.X509Certificates; +using System.Text; +using Microsoft.AspNetCore.Authentication; +using Microsoft.AspNetCore.Builder; +using Microsoft.AspNetCore.Hosting; +using Microsoft.AspNetCore.Http; +using Microsoft.AspNetCore.Identity; +using Microsoft.AspNetCore.Identity.UI.Services; +using Microsoft.AspNetCore.Routing; +using Microsoft.AspNetCore.SignalR; +using Microsoft.EntityFrameworkCore; +using Microsoft.Extensions.Configuration; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.FileProviders; +using Microsoft.Extensions.Hosting; +using MixyBoos.Api.Data; +using MixyBoos.Api.Data.Models; +using MixyBoos.Api.Data.Seeders; +using MixyBoos.Api.Data.Utils; +using MixyBoos.Api.Services.Auth; +using MixyBoos.Api.Services.Helpers; +using MixyBoos.Api.Services.Helpers.Audio; + +var builder = WebApplication.CreateBuilder(args); + +var instance = CodePagesEncodingProvider.Instance; +Encoding.RegisterProvider(instance); + +builder.WebHost.ConfigureKestrel(options => { + var pemFile = builder.Configuration["SSL:PemFile"]; + var keyFile = builder.Configuration["SSL:KeyFile"]; + if (string.IsNullOrEmpty(pemFile) || string.IsNullOrEmpty(keyFile)) { + return; + } + + options.Listen(IPAddress.Any, 5001, listenOptions => { + var certPem = File.ReadAllText("/etc/letsencrypt/live/dev.fergl.ie/fullchain.pem"); + var keyPem = File.ReadAllText("/etc/letsencrypt/live/dev.fergl.ie/privkey.pem"); + var x509 = X509Certificate2.CreateFromPem(certPem, keyPem); + listenOptions.UseHttps(x509); + }); +}); + + +builder.Services.AddScoped(); +builder.Services.AddScoped(); +builder.Services.AddTransient(); +builder.Services.AddSingleton(); +builder.Services.AddSingleton(); +builder.Services.AddSingleton(); +builder.Services.AddSingleton(); +builder.Services.AddSingleton(_ => + new PhysicalFileProvider( + builder.Configuration["ImageProcessing:ImageRootFolder"] ?? ".pn-cache")); + +builder.Services.AddAuthentication().AddBearerToken(IdentityConstants.BearerScheme); +builder.Services.AddAuthorizationBuilder(); + +builder.Services.AddDbContext(options => + options + .UseNpgsql(builder.Configuration.GetConnectionString("MixyBoos"), options => { + options + .UseQuerySplittingBehavior(QuerySplittingBehavior.SplitQuery) + .MigrationsHistoryTable("migrations", "sys"); + }).EnableSensitiveDataLogging(builder.Environment.IsDevelopment())); + +builder.Services + .AddIdentityCore() + .AddEntityFrameworkStores() + .AddApiEndpoints(); + +builder.Services.Configure(options => { + // Default Password settings. + options.Password.RequireDigit = false; + options.Password.RequireLowercase = false; + options.Password.RequireNonAlphanumeric = false; + options.Password.RequireUppercase = false; + options.Password.RequiredLength = 4; + options.Password.RequiredUniqueChars = 0; +}); + +// Add services to the container. +// Learn more about configuring Swagger/OpenAPI at https://aka.ms/aspnetcore/swashbuckle +builder.Services.AddEndpointsApiExplorer(); +builder.Services.AddSwaggerGen(); +builder.Services.AddControllers(); + +builder.Services.Configure(options => { + options.LowercaseUrls = true; +}); + +var app = builder.Build(); + +// Configure the HTTP request pipeline. +if (app.Environment.IsDevelopment()) { + app.UseSwagger(); + app.UseSwaggerUI(); +} + +app.MapGroup("/auth") + .MapIdentityApi() + .WithTags("Auth"); + +app.UseHttpsRedirection(); +app.MapControllers(); +app.Run(); diff --git a/mixyboos-api/Services/Auth/ClaimsPrincipalFactory.cs b/mixyboos-api/Services/Auth/ClaimsPrincipalFactory.cs deleted file mode 100644 index e2c5250..0000000 --- a/mixyboos-api/Services/Auth/ClaimsPrincipalFactory.cs +++ /dev/null @@ -1,37 +0,0 @@ -using System; -using System.Security.Claims; -using System.Threading.Tasks; -using Microsoft.AspNetCore.Identity; -using Microsoft.Extensions.Options; -using MixyBoos.Api.Data; -using MixyBoos.Api.Data.Models; -using MixyBoos.Api.Services.Helpers; -using OpenIddict.Abstractions; - -namespace MixyBoos.Api.Services.Auth { - public class ClaimsPrincipalFactory : UserClaimsPrincipalFactory> { - private readonly ImageHelper _imageHelper; - - public ClaimsPrincipalFactory( - UserManager userManager, - RoleManager> roleManager, - IOptions optionsAccessor, - ImageHelper imageHelper) - : base(userManager, roleManager, optionsAccessor) { - _imageHelper = imageHelper; - } - - protected override async Task GenerateClaimsAsync(MixyBoosUser user) { - var identity = await base.GenerateClaimsAsync(user); - identity.AddClaims(new[] { - new Claim(OpenIddictConstants.Claims.Name, user.UserName ?? string.Empty), - new Claim(OpenIddictConstants.Claims.Subject, user.Id.ToString()), - new Claim("id", user.Id.ToString()), - new Claim("displayName", user.DisplayName), - new Claim("profileImage", _imageHelper.GetSmallImageUrl("users/avatars", user.ProfileImage)), - new Claim("slug", user.Slug) - }); - return identity; - } - } -} diff --git a/mixyboos-api/Services/Startup/HttpClientBuilders.cs b/mixyboos-api/Services/Startup/HttpClientBuilders.cs index c7c361f..6633018 100644 --- a/mixyboos-api/Services/Startup/HttpClientBuilders.cs +++ b/mixyboos-api/Services/Startup/HttpClientBuilders.cs @@ -2,29 +2,28 @@ using System.Net.Http; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; -using Microsoft.Net.Http.Headers; using Polly; using Polly.Extensions.Http; namespace MixyBoos.Api.Services.Startup; public static class HttpClientBuilders { - static IAsyncPolicy GetRetryPolicy() { - return HttpPolicyExtensions - .HandleTransientHttpError() - .OrResult(msg => { - Console.WriteLine($"Failed getting RTMP stream {msg.StatusCode} - {msg.ReasonPhrase}"); - return msg.StatusCode == System.Net.HttpStatusCode.NotFound; - }) - .WaitAndRetryAsync(5, retryAttempt => TimeSpan.FromSeconds(Math.Pow(2, retryAttempt))); - } + static IAsyncPolicy GetRetryPolicy() { + return HttpPolicyExtensions + .HandleTransientHttpError() + .OrResult(msg => { + Console.WriteLine($"Failed getting RTMP stream {msg.StatusCode} - {msg.ReasonPhrase}"); + return msg.StatusCode == System.Net.HttpStatusCode.NotFound; + }) + .WaitAndRetryAsync(5, retryAttempt => TimeSpan.FromSeconds(Math.Pow(2, retryAttempt))); + } - public static void RegisterHttpClients(this IServiceCollection services, IConfiguration configuration) { - services.AddHttpClient("RTMP", httpClient => { - httpClient.BaseAddress = - new Uri(configuration["LiveServices:RtmpUrl"] ?? "https://live.mixyboos.com"); - }) - .SetHandlerLifetime(TimeSpan.FromMinutes(5)) //Set lifetime to five minutes - .AddPolicyHandler(GetRetryPolicy()); - } + public static void RegisterHttpClients(this IServiceCollection services, IConfiguration configuration) { + services.AddHttpClient("RTMP", httpClient => { + httpClient.BaseAddress = + new Uri(configuration["LiveServices:RtmpUrl"] ?? "https://live.mixyboos.com"); + }) + .SetHandlerLifetime(TimeSpan.FromMinutes(5)) //Set lifetime to five minutes + .AddPolicyHandler(GetRetryPolicy()); + } } diff --git a/mixyboos-api/Services/Workers/OpenIdDictWorker.cs b/mixyboos-api/Services/Workers/OpenIdDictWorker.cs deleted file mode 100644 index e4ca167..0000000 --- a/mixyboos-api/Services/Workers/OpenIdDictWorker.cs +++ /dev/null @@ -1,70 +0,0 @@ -using System; -using System.Threading; -using System.Threading.Tasks; -using Microsoft.Extensions.DependencyInjection; -using Microsoft.Extensions.Hosting; -using Microsoft.Extensions.Logging; -using OpenIddict.Abstractions; -using static OpenIddict.Abstractions.OpenIddictConstants; - -namespace MixyBoos.Api.Services.Workers { - public class OpenIdDictWorker : IHostedService { - private readonly IServiceProvider _serviceProvider; - private readonly ILogger _logger; - - public OpenIdDictWorker(IServiceProvider serviceProvider, ILogger logger) { - _serviceProvider = serviceProvider; - _logger = logger; - } - - public async Task StartAsync(CancellationToken cancellationToken) { - using var scope = _serviceProvider.CreateScope(); - - var manager = scope - .ServiceProvider - .GetRequiredService(); - try { - _logger.LogInformation("Creating the webclient OpenIddict application"); - if (await manager.FindByClientIdAsync("webclient", cancellationToken) is null) { - _logger.LogInformation("App webclient does not exist, creating"); - await manager.CreateAsync(new OpenIddictApplicationDescriptor { - ClientId = "webclient", - DisplayName = "MixyBoos Web Client", - ConsentType = ConsentTypes.Implicit, - Permissions = { - Permissions.Endpoints.Authorization, - Permissions.Endpoints.Logout, - Permissions.Endpoints.Token, - Permissions.GrantTypes.Password, - Permissions.GrantTypes.RefreshToken, - "urn:ietf:params:oauth:grant-type:google_identity_token", - Permissions.Prefixes.Scope + "api" - } - }, cancellationToken); - _logger.LogInformation("App webclient created"); - } - - if (await manager.FindByClientIdAsync("testharness", cancellationToken) is null) { - await manager.CreateAsync(new OpenIddictApplicationDescriptor { - ClientId = "testharness", - DisplayName = "Test Harness", - ConsentType = ConsentTypes.Explicit, - Permissions = { - Permissions.Endpoints.Authorization, - Permissions.Endpoints.Logout, - Permissions.Endpoints.Token, - Permissions.GrantTypes.Password, - Permissions.GrantTypes.RefreshToken, - Permissions.Prefixes.Scope + "api" - } - }, cancellationToken); - } - } catch (Npgsql.PostgresException e) { - _logger.LogInformation("Error creating openiddict app {Error}", e.Message); - //most likely the db hasn't been created yet - } - } - - public Task StopAsync(CancellationToken cancellationToken) => Task.CompletedTask; - } -} diff --git a/mixyboos-api/Startup.cs b/mixyboos-api/Startup.cs deleted file mode 100644 index 37188da..0000000 --- a/mixyboos-api/Startup.cs +++ /dev/null @@ -1,253 +0,0 @@ -using System; -using System.Linq.Expressions; -using System.Text; -using System.Text.Json; -using System.Threading.Tasks; -using Mapster; -using Microsoft.AspNetCore.Authentication; -using Microsoft.AspNetCore.Authentication.Cookies; -using Microsoft.AspNetCore.Builder; -using Microsoft.AspNetCore.Hosting; -using Microsoft.AspNetCore.HttpOverrides; -using Microsoft.AspNetCore.Identity; -using Microsoft.AspNetCore.SignalR; -using Microsoft.Extensions.Configuration; -using Microsoft.Extensions.DependencyInjection; -using Microsoft.Extensions.Hosting; -using Microsoft.OpenApi.Models; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Diagnostics; -using Microsoft.Extensions.FileProviders; -using MixyBoos.Api.Controllers.Hubs; -using MixyBoos.Api.Data; -using MixyBoos.Api.Data.Models; -using MixyBoos.Api.Data.Seeders; -using MixyBoos.Api.Data.Utils; -using MixyBoos.Api.Services.Auth; -using MixyBoos.Api.Services.Helpers; -using MixyBoos.Api.Services.Helpers.Audio; -using MixyBoos.Api.Services.Startup; -using MixyBoos.Api.Services.Startup.Mapster; -using MixyBoos.Api.Services.Workers; -using OpenIddict.Abstractions; -using OpenIddict.Validation.AspNetCore; -using SixLabors.ImageSharp.Web.DependencyInjection; - -namespace MixyBoos.Api { - public class Startup { - private readonly IConfiguration _configuration; - private readonly IWebHostEnvironment _env; - - public Startup(IConfiguration configuration, IWebHostEnvironment env) { - _configuration = configuration; - _env = env; - } - - // This method gets called by the runtime. Use this method to add services to the container. - public void ConfigureServices(IServiceCollection services) { - services.AddScoped(); - services.AddScoped(); - services.AddScoped, ClaimsPrincipalFactory>(); - services.AddSingleton(); - services.AddSingleton(); - services.AddSingleton(); - services.AddSingleton(); - services.AddSingleton(_ => - new PhysicalFileProvider(_configuration["ImageProcessing:ImageRootFolder"] ?? ".pn-cache")); - - //register the codepages (required for slugify) - var instance = CodePagesEncodingProvider.Instance; - Encoding.RegisterProvider(instance); - var connectionString = _configuration.GetConnectionString("MixyBoos"); - Console.WriteLine("Connecting to database"); - Console.WriteLine($"\t{connectionString}"); - - services.AddDbContext(options => { - options - .UseNpgsql(connectionString, pgoptions => { - pgoptions.UseQuerySplittingBehavior(QuerySplittingBehavior.SplitQuery); - pgoptions.MigrationsHistoryTable("migrations", "sys"); - }) - .ConfigureWarnings(w => - w.Throw(RelationalEventId.MultipleCollectionIncludeWarning)) - //TODO: Re-enable this once - // https://github.com/efcore/EFCore.NamingConventions/issues/209 - // is resolved - //.UseSnakeCaseNamingConvention() - .UseOpenIddict(); - if (_env.IsDevelopment()) { - options.EnableSensitiveDataLogging(); - } - }); - - services.AddIdentity>() - .AddEntityFrameworkStores() - .AddDefaultTokenProviders(); - - - services.AddImaging(_configuration); - - services.Configure(options => { - options.ClaimsIdentity.UserNameClaimType = OpenIddictConstants.Claims.Email; - options.ClaimsIdentity.UserIdClaimType = OpenIddictConstants.Claims.Subject; - options.ClaimsIdentity.RoleClaimType = OpenIddictConstants.Claims.Role; - }); - - TypeAdapterConfig.GlobalSettings.Compiler = exp => exp.CompileWithDebugInfo(); - - services.RegisterMapsterConfiguration(_configuration); - services.RegisterHttpClients(_configuration); - - services.AddSignalR().AddJsonProtocol(options => { - options.PayloadSerializerOptions.PropertyNamingPolicy = JsonNamingPolicy.CamelCase; - }); - - // .AddCore() - // .AddServer(options => { - // - services.AddOpenIddict() - .AddServer(options => { - options - .AllowPasswordFlow() - .AllowClientCredentialsFlow() - .AllowAuthorizationCodeFlow() - .AcceptAnonymousClients() - .AllowRefreshTokenFlow() - .RequireProofKeyForCodeExchange() - .AcceptAnonymousClients() - .AllowCustomFlow("urn:ietf:params:oauth:grant-type:google_identity_token"); - - options - .SetAuthorizationEndpointUris("/connect/authorize") - .SetTokenEndpointUris("/connect/token") - .SetUserinfoEndpointUris("/connect/userinfo"); - - // if (_env.IsDevelopment()) { - // options - // .AddEphemeralEncryptionKey() - // .AddEphemeralSigningKey() - // .DisableAccessTokenEncryption(); - //ConnectionStrings - // options.AddDevelopmentEncryptionCertificate() - // .AddDevelopmentSigningCertificate(); - // } else { - // options.AddEncryptionKey(new SymmetricSecurityKey( - // Convert.FromBase64String(_configuration["Auth:SigningKey"] ?? string.Empty))); - // options.AddSigningCertificate(SigningCertificateGenerator.CreateSigningCertificate()); - // options.AddEncryptionCertificate(SigningCertificateGenerator.CreateEncryptionCertificate()); - // } - options - .AddEphemeralEncryptionKey() - .AddEphemeralSigningKey() - .DisableAccessTokenEncryption(); - - options.AddDevelopmentEncryptionCertificate() - .AddDevelopmentSigningCertificate(); - - options.RegisterScopes("api"); - options - .UseAspNetCore() - .EnableAuthorizationEndpointPassthrough() - .EnableTokenEndpointPassthrough() - .DisableTransportSecurityRequirement(); - }).AddValidation(options => { - options.UseLocalServer(); - options.UseAspNetCore(); - }); - - services.Configure(options => { - options.ForwardedHeaders = - ForwardedHeaders.XForwardedFor | ForwardedHeaders.XForwardedProto; - }); - - services.AddOpenIddict() - .AddCore() - .UseEntityFrameworkCore(options => { - options.UseDbContext(); - }); - - services.ConfigureApplicationCookie(options => { - options.Cookie.Name = "API__AUTH"; - options.Cookie.HttpOnly = true; - options.Cookie.Domain = "*.mixyboos.com"; - options.Events.OnRedirectToLogin = context => { - context.Response.StatusCode = 401; - return Task.CompletedTask; - }; - }); - // services.AddHostedService(); - services.LoadScheduler(); - - services - .AddAuthentication(options => { - options.DefaultScheme = OpenIddictValidationAspNetCoreDefaults.AuthenticationScheme; - }) - .AddCookie(CookieAuthenticationDefaults.AuthenticationScheme, options => { - options.LoginPath = "/auth/login"; - }); - - services.Configure(options => { - // Default Password settings. - //jp1QhhMTysXddk6LiYv2UUU3tVubLvJrjwpsYt1fkM0= - - options.Password.RequireDigit = false; - options.Password.RequireUppercase = false; - options.Password.RequireLowercase = false; - options.Password.RequireNonAlphanumeric = false; - options.Password.RequiredLength = 6; - options.Password.RequiredUniqueChars = 1; - }); - services.AddRouting(options => options.LowercaseUrls = true); - services.AddControllers(); - services.AddSwaggerGen(c => { - c.SwaggerDoc("v1", new OpenApiInfo {Title = "MixyBoos.Api", Version = "v1"}); - }); - - services.AddHostedService(); - } - - public void Configure(IApplicationBuilder app, IWebHostEnvironment env, MixyBoosContext context) { - if (env.IsDevelopment()) { - app.UseDeveloperExceptionPage(); - app.UseHttpsRedirection(); - } - - var scopeFactory = app.ApplicationServices.GetRequiredService(); - using var scope = scopeFactory.CreateScope(); - var dbInitializer = scope.ServiceProvider.GetService(); - dbInitializer.Initialize(); - dbInitializer.SeedData(); - - app.UseStaticFiles(); - app.UseImageSharp(); - app.UseForwardedHeaders(); - - app.UseSwagger(); - app.UseCors(builder => builder - .WithOrigins("http://localhost:3000") - .WithOrigins("https://mixyboos.dev.fergl.ie:3000") - .WithOrigins("http://mixyboos.dev.fergl.ie:3000") - .WithOrigins("https://www.mixyboos.com") - .WithOrigins("https://mixyboos.com") - .AllowCredentials() - .AllowAnyHeader() - .AllowAnyMethod() - ); - app.UseRouting(); - - app.UseAuthentication(); - app.UseAuthorization(); - // app.UseSerilogRequestLogging(); - app.UseEndpoints(endpoints => { - endpoints.MapControllers(); - endpoints.MapDefaultControllerRoute(); - endpoints.MapHub("/hubs/debug"); - endpoints.MapHub("/hubs/live"); - endpoints.MapHub("/hubs/chat"); - endpoints.MapHub("/hubs/updates"); - }); - - app.UseSwaggerUI(c => c.SwaggerEndpoint("/swagger/v1/swagger.json", "MixyBoos Api v1")); - } - } -} diff --git a/mixyboos-api/mixyboos-api.csproj b/mixyboos-api/mixyboos-api.csproj index 5fcc20b..1dc3b54 100644 --- a/mixyboos-api/mixyboos-api.csproj +++ b/mixyboos-api/mixyboos-api.csproj @@ -6,6 +6,7 @@ MixyBoos.Api mixyboos-api mcr.microsoft.com/dotnet/aspnet:7.0-alpine + preview @@ -17,24 +18,22 @@ - - - + + runtime; build; native; contentfiles; analyzers; buildtransitive all - - - - - - - - - - + + + + + + + + + @@ -45,7 +44,7 @@ - + @@ -60,5 +59,4 @@ - diff --git a/mixyboos-backend.sln b/mixyboos-backend.sln index b56428e..6d00205 100644 --- a/mixyboos-backend.sln +++ b/mixyboos-backend.sln @@ -2,8 +2,6 @@ Microsoft Visual Studio Solution File, Format Version 12.00 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "mixyboos-api", "mixyboos-api\mixyboos-api.csproj", "{8F110C92-052F-45FB-BD75-19CBAE13482E}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "mixyboos-api-tests", "mixyboos-api-tests\mixyboos-api-tests.csproj", "{BE8D22D9-8B78-4F0D-824E-B3E598899349}" -EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -14,10 +12,6 @@ Global {8F110C92-052F-45FB-BD75-19CBAE13482E}.Debug|Any CPU.Build.0 = Debug|Any CPU {8F110C92-052F-45FB-BD75-19CBAE13482E}.Release|Any CPU.ActiveCfg = Release|Any CPU {8F110C92-052F-45FB-BD75-19CBAE13482E}.Release|Any CPU.Build.0 = Release|Any CPU - {BE8D22D9-8B78-4F0D-824E-B3E598899349}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {BE8D22D9-8B78-4F0D-824E-B3E598899349}.Debug|Any CPU.Build.0 = Debug|Any CPU - {BE8D22D9-8B78-4F0D-824E-B3E598899349}.Release|Any CPU.ActiveCfg = Release|Any CPU - {BE8D22D9-8B78-4F0D-824E-B3E598899349}.Release|Any CPU.Build.0 = Release|Any CPU {54C7E716-D2FE-4FCA-9B87-C1A64F845A5A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {54C7E716-D2FE-4FCA-9B87-C1A64F845A5A}.Debug|Any CPU.Build.0 = Debug|Any CPU {54C7E716-D2FE-4FCA-9B87-C1A64F845A5A}.Release|Any CPU.ActiveCfg = Release|Any CPU