diff --git a/Aberwyn/Aberwyn.csproj b/Aberwyn/Aberwyn.csproj index b681382..005d93a 100644 --- a/Aberwyn/Aberwyn.csproj +++ b/Aberwyn/Aberwyn.csproj @@ -9,7 +9,7 @@ Linux - + @@ -56,8 +56,21 @@ + + + + Always + + + Always + + + Always + + + diff --git a/Aberwyn/Areas/Identity/Pages/Account/Login.cshtml b/Aberwyn/Areas/Identity/Pages/Account/Login.cshtml index 64f7b27..61f2bf6 100644 --- a/Aberwyn/Areas/Identity/Pages/Account/Login.cshtml +++ b/Aberwyn/Areas/Identity/Pages/Account/Login.cshtml @@ -14,9 +14,9 @@
- - - + + +
@@ -48,36 +48,6 @@
-
-
-

Use another service to log in.

-
- @{ - if ((Model.ExternalLogins?.Count ?? 0) == 0) - { -
-

- There are no external authentication services configured. See this article - about setting up this ASP.NET application to support logging in via external services. -

-
- } - else - { -
-
-

- @foreach (var provider in Model.ExternalLogins!) - { - - } -

-
-
- } - } -
-
@section Scripts { diff --git a/Aberwyn/Areas/Identity/Pages/Account/Login.cshtml.cs b/Aberwyn/Areas/Identity/Pages/Account/Login.cshtml.cs index bd5b726..7b28fcc 100644 --- a/Aberwyn/Areas/Identity/Pages/Account/Login.cshtml.cs +++ b/Aberwyn/Areas/Identity/Pages/Account/Login.cshtml.cs @@ -61,27 +61,14 @@ namespace Aberwyn.Areas.Identity.Pages.Account /// public class InputModel { - /// - /// This API supports the ASP.NET Core Identity default UI infrastructure and is not intended to be used - /// directly from your code. This API may change or be removed in future releases. - /// [Required] - [EmailAddress] - public string Email { get; set; } + [Display(Name = "Användarnamn")] + public string UserName { get; set; } - /// - /// This API supports the ASP.NET Core Identity default UI infrastructure and is not intended to be used - /// directly from your code. This API may change or be removed in future releases. - /// [Required] [DataType(DataType.Password)] public string Password { get; set; } - /// - /// This API supports the ASP.NET Core Identity default UI infrastructure and is not intended to be used - /// directly from your code. This API may change or be removed in future releases. - /// - [Display(Name = "Remember me?")] public bool RememberMe { get; set; } } @@ -112,7 +99,7 @@ namespace Aberwyn.Areas.Identity.Pages.Account { // This doesn't count login failures towards account lockout // To enable password failures to trigger account lockout, set lockoutOnFailure: true - var result = await _signInManager.PasswordSignInAsync(Input.Email, Input.Password, Input.RememberMe, lockoutOnFailure: false); + var result = await _signInManager.PasswordSignInAsync(Input.UserName, Input.Password, Input.RememberMe, lockoutOnFailure: false); if (result.Succeeded) { _logger.LogInformation("User logged in."); diff --git a/Aberwyn/Areas/Identity/Pages/Account/Manage/ChangePassword.cshtml.cs b/Aberwyn/Areas/Identity/Pages/Account/Manage/ChangePassword.cshtml.cs index e71286c..dd70d22 100644 --- a/Aberwyn/Areas/Identity/Pages/Account/Manage/ChangePassword.cshtml.cs +++ b/Aberwyn/Areas/Identity/Pages/Account/Manage/ChangePassword.cshtml.cs @@ -53,6 +53,11 @@ namespace Aberwyn.Areas.Identity.Pages.Account.Manage /// This API supports the ASP.NET Core Identity default UI infrastructure and is not intended to be used /// directly from your code. This API may change or be removed in future releases. /// + /// + [Required] + [Display(Name = "Användarnamn")] + public string UserName { get; set; } + [Required] [DataType(DataType.Password)] [Display(Name = "Current password")] diff --git a/Aberwyn/Controllers/AdminController.cs b/Aberwyn/Controllers/AdminController.cs index 0be2d3d..7599e0f 100644 --- a/Aberwyn/Controllers/AdminController.cs +++ b/Aberwyn/Controllers/AdminController.cs @@ -3,6 +3,7 @@ using Microsoft.AspNetCore.Identity; using Microsoft.AspNetCore.Mvc; using Aberwyn.Models; using Aberwyn.Data; +using Microsoft.EntityFrameworkCore; namespace Aberwyn.Controllers { @@ -100,62 +101,225 @@ namespace Aberwyn.Controllers return RedirectToAction("Index"); } [HttpPost] -[Authorize(Roles = "Admin")] -public IActionResult ImportMealsFromProd() -{ - var prodService = MenuService.CreateWithConfig(_configuration, _env, useProdDb: true); - var devService = new MenuService(_context); // injicerad context anvĂ€nds - - var prodMeals = prodService.GetMealsDetailed(); - - foreach (var meal in prodMeals) - { - // Kopiera utan ID (för att undvika konflikt) och spara - var newMeal = new Meal + [Authorize(Roles = "Admin")] + public IActionResult ImportMealsFromProd() { - Name = meal.Name, - Description = meal.Description, - ProteinType = meal.ProteinType, - Category = meal.Category, - CarbType = meal.CarbType, - RecipeUrl = meal.RecipeUrl, - ImageUrl = meal.ImageUrl, - IsAvailable = meal.IsAvailable, - CreatedAt = meal.CreatedAt, - Instructions = meal.Instructions, - ImageData = meal.ImageData, - ImageMimeType = meal.ImageMimeType, - Ingredients = meal.Ingredients.Select(i => new Ingredient + var prodService = MenuService.CreateWithConfig(_configuration, _env, useProdDb: true); + var devService = new MenuService(_context); // injicerad context anvĂ€nds + + var prodMeals = prodService.GetMealsDetailed(); + + foreach (var meal in prodMeals) { - Quantity = i.Quantity, - Item = i.Item - }).ToList() - }; + // Kopiera utan ID (för att undvika konflikt) och spara + var newMeal = new Meal + { + Name = meal.Name, + Description = meal.Description, + ProteinType = meal.ProteinType, + Category = meal.Category, + CarbType = meal.CarbType, + RecipeUrl = meal.RecipeUrl, + ImageUrl = meal.ImageUrl, + IsAvailable = meal.IsAvailable, + CreatedAt = meal.CreatedAt, + Instructions = meal.Instructions, + ImageData = meal.ImageData, + ImageMimeType = meal.ImageMimeType, + Ingredients = meal.Ingredients.Select(i => new Ingredient + { + Quantity = i.Quantity, + Item = i.Item + }).ToList() + }; - devService.SaveOrUpdateMealWithIngredients(newMeal); - } + devService.SaveOrUpdateMealWithIngredients(newMeal); + } - return Content("Import klar!"); -} -[HttpPost] -[Authorize(Roles = "Admin")] -public IActionResult ImportMenusFromProd() -{ - var prodService = MenuService.CreateWithConfig(_configuration, _env, useProdDb: true); - var devService = new MenuService(_context); + return Content("Import klar!"); + } - var allProdMenus = prodService.GetAllWeeklyMenus(); - var allMeals = devService.GetMeals(); + [HttpPost] + [Authorize(Roles = "Admin")] + public IActionResult ImportMenusFromProd() + { + var prodService = MenuService.CreateWithConfig(_configuration, _env, useProdDb: true); + var devService = new MenuService(_context); + var allProdMenus = prodService.GetAllWeeklyMenus(); + var allMeals = devService.GetMeals(); + + foreach (var menu in allProdMenus) + { + var newMenu = new WeeklyMenu + { + DayOfWeek = menu.DayOfWeek, + WeekNumber = menu.WeekNumber, + Year = menu.Year, + Cook = menu.Cook, + BreakfastMealId = null, + LunchMealId = null, + DinnerMealId = null + }; + + if (!string.IsNullOrEmpty(menu.BreakfastMealName)) + newMenu.BreakfastMealId = allMeals.FirstOrDefault(m => m.Name == menu.BreakfastMealName)?.Id; + + if (!string.IsNullOrEmpty(menu.LunchMealName)) + newMenu.LunchMealId = allMeals.FirstOrDefault(m => m.Name == menu.LunchMealName)?.Id; + + if (!string.IsNullOrEmpty(menu.DinnerMealName)) + newMenu.DinnerMealId = allMeals.FirstOrDefault(m => m.Name == menu.DinnerMealName)?.Id; + + _context.WeeklyMenus.Add(newMenu); + } + + _context.SaveChanges(); + TempData["Message"] = "Import av veckomenyer klar."; + return RedirectToAction("Index"); + } + + [HttpPost] + [Authorize(Roles = "Admin")] + public IActionResult ImportBudgetFromProd() + { + // HĂ€mta connection till produktion + using var prodContext = ApplicationDbContextFactory.CreateWithConfig(_configuration, _env, useProdDb: true); + + // Importera definitioner först + var prodCategoryDefs = prodContext.BudgetCategoryDefinitions.ToList(); + var prodItemDefs = prodContext.BudgetItemDefinitions.ToList(); + + foreach (var def in prodCategoryDefs) + { + if (!_context.BudgetCategoryDefinitions.Any(d => d.Name == def.Name)) + { + _context.BudgetCategoryDefinitions.Add(new BudgetCategoryDefinition + { + Name = def.Name, + Color = def.Color ?? "#cccccc" + }); + + } + } + + foreach (var def in prodItemDefs) + { + if (!_context.BudgetItemDefinitions.Any(d => d.Name == def.Name)) + { + _context.BudgetItemDefinitions.Add(new BudgetItemDefinition { Name = def.Name }); + } + } + + _context.SaveChanges(); // Se till att ID:n finns för FK:n nedan + + // Ladda definitioner i minnet för snabb lookup + var devCategoryDefs = _context.BudgetCategoryDefinitions.ToList(); + var devItemDefs = _context.BudgetItemDefinitions.ToList(); + + // Importera budgetperioder med kategorier och items + var prodPeriods = prodContext.BudgetPeriods + .Include(p => p.Categories) + .ThenInclude(c => c.Items) + .ToList(); + + foreach (var period in prodPeriods) + { + var exists = _context.BudgetPeriods + .Any(p => p.Year == period.Year && p.Month == period.Month); + + if (exists) + continue; + + var newPeriod = new BudgetPeriod + { + Year = period.Year, + Month = period.Month, + Categories = period.Categories.Select(c => new BudgetCategory + { + Name = c.Name, + Color = string.IsNullOrWhiteSpace(c.Color) ? "#cccccc" : c.Color, + Order = c.Order, + BudgetCategoryDefinitionId = devCategoryDefs + .FirstOrDefault(d => d.Name == c.Definition?.Name)?.Id, + Items = c.Items.Select(i => new BudgetItem + { + Name = i.Name, + Amount = i.Amount, + IsExpense = i.IsExpense, + IncludeInSummary = i.IncludeInSummary, + Order = i.Order, + BudgetItemDefinitionId = devItemDefs + .FirstOrDefault(d => d.Name == i.BudgetItemDefinition?.Name)?.Id + }).ToList() + }).ToList() + }; + + _context.BudgetPeriods.Add(newPeriod); + } + + _context.SaveChanges(); + TempData["Message"] = "✅ Import av budgetdata frĂ„n produktion Ă€r klar."; return RedirectToAction("Index"); } - } - public class AdminUserViewModel - { - public string UserId { get; set; } - public string Email { get; set; } - public List Roles { get; set; } + //Todo + + [HttpGet] + public IActionResult Todo() + { + return View(); + } + + + [HttpGet] + public IActionResult GetTodoTasks() + { + var tasks = _context.TodoTasks + .OrderByDescending(t => t.CreatedAt) + .ToList(); + return Json(tasks); + } + + [HttpPost] + public IActionResult AddTodoTask([FromBody] TodoTask task) + { + if (string.IsNullOrWhiteSpace(task?.Title)) + return BadRequest("Titel krĂ€vs"); + + task.CreatedAt = DateTime.UtcNow; + _context.TodoTasks.Add(task); + _context.SaveChanges(); + + return Json(task); + } + + [HttpPost] + public IActionResult UpdateTodoTask([FromBody] TodoTask task) + { + var existing = _context.TodoTasks.FirstOrDefault(t => t.Id == task.Id); + if (existing == null) + return NotFound(); + + existing.Title = task.Title; + existing.Status = task.Status; + existing.Priority = task.Priority; + + _context.SaveChanges(); + + return Ok(); + } + + + + } + + public class AdminUserViewModel + { + public string UserId { get; set; } + public string Email { get; set; } + public List Roles { get; set; } + } } diff --git a/Aberwyn/Controllers/FoodMenuController.cs b/Aberwyn/Controllers/FoodMenuController.cs index f0143d2..e76b821 100644 --- a/Aberwyn/Controllers/FoodMenuController.cs +++ b/Aberwyn/Controllers/FoodMenuController.cs @@ -202,7 +202,7 @@ namespace Aberwyn.Controllers .GetMenuEntriesByDateRange(DateTime.Now.AddDays(-28), DateTime.Now) .Select(x => new WeeklyMenuViewModel.RecentMenuEntry { - Date = x.Date, + Date = x.CreatedAt, BreakfastMealName = x.BreakfastMealName, LunchMealName = x.LunchMealName, DinnerMealName = x.DinnerMealName diff --git a/Aberwyn/Data/ApplicationDbContext.cs b/Aberwyn/Data/ApplicationDbContext.cs index 27c6bee..e5ece4e 100644 --- a/Aberwyn/Data/ApplicationDbContext.cs +++ b/Aberwyn/Data/ApplicationDbContext.cs @@ -25,9 +25,12 @@ namespace Aberwyn.Data public DbSet PushSubscribers { get; set; } public DbSet PizzaOrders { get; set; } public DbSet AppSettings { get; set; } + public DbSet TodoTasks { get; set; } public DbSet BudgetItemDefinitions { get; set; } public DbSet BudgetCategoryDefinitions { get; set; } - + public DbSet Meals { get; set; } + public DbSet WeeklyMenus { get; set; } + public DbSet Ingredients { get; set; } } } diff --git a/Aberwyn/Data/ApplicationDbContextFactory.cs b/Aberwyn/Data/ApplicationDbContextFactory.cs index 5baf6c4..5916799 100644 --- a/Aberwyn/Data/ApplicationDbContextFactory.cs +++ b/Aberwyn/Data/ApplicationDbContextFactory.cs @@ -13,13 +13,14 @@ namespace Aberwyn.Data var basePath = Directory.GetCurrentDirectory(); var config = new ConfigurationBuilder() .SetBasePath(basePath) - .AddJsonFile("appsettings.json") + .AddJsonFile("appsettings.json", optional: false) + .AddJsonFile("appsettings.Development.json", optional: true) + .AddEnvironmentVariables() .Build(); - var connectionString = config.GetConnectionString("DefaultConnection"); - File.WriteAllText("connection-log.txt", $"Connection string: {connectionString}"); + File.WriteAllText("connection-log.txt", $"Connection string: {connectionString}"); Console.WriteLine($"AnslutningsstrĂ€ng: {connectionString}"); if (string.IsNullOrEmpty(connectionString)) @@ -34,5 +35,22 @@ namespace Aberwyn.Data return new ApplicationDbContext(optionsBuilder.Options); } + public static ApplicationDbContext CreateWithConfig(IConfiguration config, IHostEnvironment env, bool useProdDb = false) + { + var connectionString = useProdDb + ? config.GetConnectionString("ProdConnection") // <--- FIX HÄR + : config.GetConnectionString("DefaultConnection"); + + if (string.IsNullOrWhiteSpace(connectionString)) + throw new InvalidOperationException("Connection string saknas."); + + var optionsBuilder = new DbContextOptionsBuilder(); + optionsBuilder.UseMySql(connectionString, new MySqlServerVersion(new Version(8, 0, 36))); + + return new ApplicationDbContext(optionsBuilder.Options); + } + + + } } diff --git a/Aberwyn/Data/IdentityDataInitializer.cs b/Aberwyn/Data/IdentityDataInitializer.cs index bfda97d..35be21e 100644 --- a/Aberwyn/Data/IdentityDataInitializer.cs +++ b/Aberwyn/Data/IdentityDataInitializer.cs @@ -11,7 +11,7 @@ namespace Aberwyn.Data var userManager = serviceProvider.GetRequiredService>(); var roleManager = serviceProvider.GetRequiredService>(); - string[] roles = { "Admin" }; + string[] roles = { "Admin", "Chef", "Budget" }; foreach (var role in roles) { @@ -19,14 +19,15 @@ namespace Aberwyn.Data await roleManager.CreateAsync(new IdentityRole(role)); } - string adminEmail = "tai@zcz.se"; + string adminUsername = "admin"; + string adminEmail = "admin@localhost"; string password = "Admin123!"; if (await userManager.FindByEmailAsync(adminEmail) == null) { var user = new ApplicationUser { - UserName = adminEmail, + UserName = adminUsername, Email = adminEmail, EmailConfirmed = true }; diff --git a/Aberwyn/Data/MenuService.cs b/Aberwyn/Data/MenuService.cs index 7b7edde..405dc2b 100644 --- a/Aberwyn/Data/MenuService.cs +++ b/Aberwyn/Data/MenuService.cs @@ -159,11 +159,31 @@ public List GetAllWeeklyMenus() } public List GetWeeklyMenu(int weekNumber, int year) { - return _context.WeeklyMenus + var menus = _context.WeeklyMenus .Where(m => m.WeekNumber == weekNumber && m.Year == year) .ToList(); + + var allMeals = _context.Meals.ToDictionary(m => m.Id, m => m.Name); + + foreach (var wm in menus) + { + wm.BreakfastMealName = wm.BreakfastMealId.HasValue && allMeals.TryGetValue(wm.BreakfastMealId.Value, out var breakfast) + ? breakfast + : null; + + wm.LunchMealName = wm.LunchMealId.HasValue && allMeals.TryGetValue(wm.LunchMealId.Value, out var lunch) + ? lunch + : null; + + wm.DinnerMealName = wm.DinnerMealId.HasValue && allMeals.TryGetValue(wm.DinnerMealId.Value, out var dinner) + ? dinner + : null; + } + + return menus; } + public List GetMenuEntriesByDateRange(DateTime startDate, DateTime endDate) { var results = new List(); @@ -186,7 +206,7 @@ public List GetAllWeeklyMenus() var date = ISOWeek.ToDateTime(menu.Year, menu.WeekNumber, dow); if (date.Date >= startDate.Date && date.Date <= endDate.Date) { - menu.Date = date; + menu.CreatedAt = date; results.Add(menu); } } diff --git a/Aberwyn/Dockerfile b/Aberwyn/Dockerfile index 59f5135..142b95b 100644 --- a/Aberwyn/Dockerfile +++ b/Aberwyn/Dockerfile @@ -1,16 +1,23 @@ -#See https://aka.ms/containerfastmode to understand how Visual Studio uses this Dockerfile to build your images for faster debugging. - FROM mcr.microsoft.com/dotnet/aspnet:6.0 AS base + +RUN apt-get update && \ + apt-get install -y locales && \ + locale-gen sv_SE.UTF-8 + +ENV LANG=sv_SE.UTF-8 +ENV LANGUAGE=sv_SE:sv +ENV LC_ALL=sv_SE.UTF-8 +ENV DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=false + WORKDIR /app EXPOSE 80 EXPOSE 443 FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build WORKDIR /src -COPY ["Aberwyn/Aberwyn.csproj", "Aberwyn/"] -RUN dotnet restore "Aberwyn/Aberwyn.csproj" +COPY ["Aberwyn.csproj", "."] +RUN dotnet restore "Aberwyn.csproj" COPY . . -WORKDIR "/src/Aberwyn" RUN dotnet build "Aberwyn.csproj" -c Release -o /app/build FROM build AS publish @@ -20,21 +27,3 @@ FROM base AS final WORKDIR /app COPY --from=publish /app/publish . ENTRYPOINT ["dotnet", "Aberwyn.dll"] - -version: '3.8' -services: - db: - image: mysql:8 - container_name: dev-mysql - ports: - - "3306:3306" - environment: - MYSQL_ROOT_PASSWORD: root - MYSQL_DATABASE: aberwyn - MYSQL_USER: aberwyn - MYSQL_PASSWORD: devpass - volumes: - - mysql-data:/var/lib/mysql - -volumes: - mysql-data: diff --git a/Aberwyn/Infrastructure/docker-compose.dev.yml b/Aberwyn/Infrastructure/docker-compose.dev.yml new file mode 100644 index 0000000..fcf3e6d --- /dev/null +++ b/Aberwyn/Infrastructure/docker-compose.dev.yml @@ -0,0 +1,38 @@ +version: '3.8' + +services: + aberwyn-app: + image: aberwyn:latest + build: + context: ../ + dockerfile: Dockerfile + ports: + - "5000:80" + environment: + ASPNETCORE_ENVIRONMENT: Development + DB_NAME: aberwyn_dev + + depends_on: + - mysql + networks: + - aberwyn-net + + mysql: + image: mysql:8 + container_name: aberwyn-mysql-dev + restart: always + environment: + MYSQL_ROOT_PASSWORD: rootpass + MYSQL_DATABASE: aberwyn_dev + MYSQL_USER: aberwyn + MYSQL_PASSWORD: 3edc4RFV + volumes: + - mysql-dev-data:/var/lib/mysql + networks: + - aberwyn-net + +volumes: + mysql-dev-data: + +networks: + aberwyn-net: diff --git a/Aberwyn/Infrastructure/docker-compose.prod.yml b/Aberwyn/Infrastructure/docker-compose.prod.yml new file mode 100644 index 0000000..d9acc43 --- /dev/null +++ b/Aberwyn/Infrastructure/docker-compose.prod.yml @@ -0,0 +1,38 @@ +version: '3.8' + +services: + aberwyn-app: + image: aberwyn:latest + build: + context: ../ + dockerfile: Dockerfile + ports: + - "8080:80" + environment: + ASPNETCORE_ENVIRONMENT: Production + DB_NAME: aberwyn_prod + + depends_on: + - mysql + networks: + - aberwyn-net + + mysql: + image: mysql:8 + container_name: aberwyn-mysql-prod + restart: always + environment: + MYSQL_ROOT_PASSWORD: rootpass + MYSQL_DATABASE: aberwyn_prod + MYSQL_USER: aberwyn + MYSQL_PASSWORD: 3edc4RFV + volumes: + - mysql-prod-data:/var/lib/mysql + networks: + - aberwyn-net + +volumes: + mysql-prod-data: + +networks: + aberwyn-net: diff --git a/Aberwyn/Infrastructure/docker-compose.yml b/Aberwyn/Infrastructure/docker-compose.yml deleted file mode 100644 index 54caf67..0000000 --- a/Aberwyn/Infrastructure/docker-compose.yml +++ /dev/null @@ -1,17 +0,0 @@ -version: '3.8' -services: - dev-db: - image: mysql:8 - container_name: aberwyn-dev-db - ports: - - "3306:3306" - environment: - MYSQL_ROOT_PASSWORD: root - MYSQL_DATABASE: aberwyn - MYSQL_USER: aberwyn - MYSQL_PASSWORD: devpass - volumes: - - dev-mysql-data:/var/lib/mysql - -volumes: - dev-mysql-data: diff --git a/Aberwyn/Migrations/20250506132522_CreateIdentitySchema.Designer.cs b/Aberwyn/Migrations/20250506132522_CreateIdentitySchema.Designer.cs deleted file mode 100644 index 25f870f..0000000 --- a/Aberwyn/Migrations/20250506132522_CreateIdentitySchema.Designer.cs +++ /dev/null @@ -1,269 +0,0 @@ -ï»ż// -using System; -using Aberwyn.Data; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; - -#nullable disable - -namespace Aberwyn.Migrations -{ - [DbContext(typeof(ApplicationDbContext))] - [Migration("20250506132522_CreateIdentitySchema")] - partial class CreateIdentitySchema - { - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "6.0.36") - .HasAnnotation("Relational:MaxIdentifierLength", 64); - - modelBuilder.Entity("Aberwyn.Models.ApplicationUser", b => - { - b.Property("Id") - .HasColumnType("varchar(255)"); - - b.Property("AccessFailedCount") - .HasColumnType("int"); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken() - .HasColumnType("longtext"); - - b.Property("Email") - .HasMaxLength(256) - .HasColumnType("varchar(256)"); - - b.Property("EmailConfirmed") - .HasColumnType("tinyint(1)"); - - b.Property("LockoutEnabled") - .HasColumnType("tinyint(1)"); - - b.Property("LockoutEnd") - .HasColumnType("datetime(6)"); - - b.Property("NormalizedEmail") - .HasMaxLength(256) - .HasColumnType("varchar(256)"); - - b.Property("NormalizedUserName") - .HasMaxLength(256) - .HasColumnType("varchar(256)"); - - b.Property("PasswordHash") - .HasColumnType("longtext"); - - b.Property("PhoneNumber") - .HasColumnType("longtext"); - - b.Property("PhoneNumberConfirmed") - .HasColumnType("tinyint(1)"); - - b.Property("SecurityStamp") - .HasColumnType("longtext"); - - b.Property("TwoFactorEnabled") - .HasColumnType("tinyint(1)"); - - b.Property("UserName") - .HasMaxLength(256) - .HasColumnType("varchar(256)"); - - b.HasKey("Id"); - - b.HasIndex("NormalizedEmail") - .HasDatabaseName("EmailIndex"); - - b.HasIndex("NormalizedUserName") - .IsUnique() - .HasDatabaseName("UserNameIndex"); - - b.ToTable("AspNetUsers", (string)null); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRole", b => - { - b.Property("Id") - .HasColumnType("varchar(255)"); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken() - .HasColumnType("longtext"); - - b.Property("Name") - .HasMaxLength(256) - .HasColumnType("varchar(256)"); - - b.Property("NormalizedName") - .HasMaxLength(256) - .HasColumnType("varchar(256)"); - - b.HasKey("Id"); - - b.HasIndex("NormalizedName") - .IsUnique() - .HasDatabaseName("RoleNameIndex"); - - b.ToTable("AspNetRoles", (string)null); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - b.Property("ClaimType") - .HasColumnType("longtext"); - - b.Property("ClaimValue") - .HasColumnType("longtext"); - - b.Property("RoleId") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.HasKey("Id"); - - b.HasIndex("RoleId"); - - b.ToTable("AspNetRoleClaims", (string)null); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - b.Property("ClaimType") - .HasColumnType("longtext"); - - b.Property("ClaimValue") - .HasColumnType("longtext"); - - b.Property("UserId") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.HasKey("Id"); - - b.HasIndex("UserId"); - - b.ToTable("AspNetUserClaims", (string)null); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => - { - b.Property("LoginProvider") - .HasColumnType("varchar(255)"); - - b.Property("ProviderKey") - .HasColumnType("varchar(255)"); - - b.Property("ProviderDisplayName") - .HasColumnType("longtext"); - - b.Property("UserId") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.HasKey("LoginProvider", "ProviderKey"); - - b.HasIndex("UserId"); - - b.ToTable("AspNetUserLogins", (string)null); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => - { - b.Property("UserId") - .HasColumnType("varchar(255)"); - - b.Property("RoleId") - .HasColumnType("varchar(255)"); - - b.HasKey("UserId", "RoleId"); - - b.HasIndex("RoleId"); - - b.ToTable("AspNetUserRoles", (string)null); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => - { - b.Property("UserId") - .HasColumnType("varchar(255)"); - - b.Property("LoginProvider") - .HasColumnType("varchar(255)"); - - b.Property("Name") - .HasColumnType("varchar(255)"); - - b.Property("Value") - .HasColumnType("longtext"); - - b.HasKey("UserId", "LoginProvider", "Name"); - - b.ToTable("AspNetUserTokens", (string)null); - }); - - 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("Aberwyn.Models.ApplicationUser", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => - { - b.HasOne("Aberwyn.Models.ApplicationUser", 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("Aberwyn.Models.ApplicationUser", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => - { - b.HasOne("Aberwyn.Models.ApplicationUser", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/Aberwyn/Migrations/20250506132522_CreateIdentitySchema.cs b/Aberwyn/Migrations/20250506132522_CreateIdentitySchema.cs deleted file mode 100644 index a5e2d59..0000000 --- a/Aberwyn/Migrations/20250506132522_CreateIdentitySchema.cs +++ /dev/null @@ -1,259 +0,0 @@ -ï»żusing System; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Aberwyn.Migrations -{ - public partial class CreateIdentitySchema : Migration - { - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.AlterDatabase() - .Annotation("MySql:CharSet", "utf8mb4"); - - migrationBuilder.CreateTable( - name: "AspNetRoles", - columns: table => new - { - Id = table.Column(type: "varchar(255)", nullable: false) - .Annotation("MySql:CharSet", "utf8mb4"), - Name = table.Column(type: "varchar(256)", maxLength: 256, nullable: true) - .Annotation("MySql:CharSet", "utf8mb4"), - NormalizedName = table.Column(type: "varchar(256)", maxLength: 256, nullable: true) - .Annotation("MySql:CharSet", "utf8mb4"), - ConcurrencyStamp = table.Column(type: "longtext", nullable: true) - .Annotation("MySql:CharSet", "utf8mb4") - }, - constraints: table => - { - table.PrimaryKey("PK_AspNetRoles", x => x.Id); - }) - .Annotation("MySql:CharSet", "utf8mb4"); - - migrationBuilder.CreateTable( - name: "AspNetUsers", - columns: table => new - { - Id = table.Column(type: "varchar(255)", nullable: false) - .Annotation("MySql:CharSet", "utf8mb4"), - UserName = table.Column(type: "varchar(256)", maxLength: 256, nullable: true) - .Annotation("MySql:CharSet", "utf8mb4"), - NormalizedUserName = table.Column(type: "varchar(256)", maxLength: 256, nullable: true) - .Annotation("MySql:CharSet", "utf8mb4"), - Email = table.Column(type: "varchar(256)", maxLength: 256, nullable: true) - .Annotation("MySql:CharSet", "utf8mb4"), - NormalizedEmail = table.Column(type: "varchar(256)", maxLength: 256, nullable: true) - .Annotation("MySql:CharSet", "utf8mb4"), - EmailConfirmed = table.Column(type: "tinyint(1)", nullable: false), - PasswordHash = table.Column(type: "longtext", nullable: true) - .Annotation("MySql:CharSet", "utf8mb4"), - SecurityStamp = table.Column(type: "longtext", nullable: true) - .Annotation("MySql:CharSet", "utf8mb4"), - ConcurrencyStamp = table.Column(type: "longtext", nullable: true) - .Annotation("MySql:CharSet", "utf8mb4"), - PhoneNumber = table.Column(type: "longtext", nullable: true) - .Annotation("MySql:CharSet", "utf8mb4"), - PhoneNumberConfirmed = table.Column(type: "tinyint(1)", nullable: false), - TwoFactorEnabled = table.Column(type: "tinyint(1)", nullable: false), - LockoutEnd = table.Column(type: "datetime(6)", nullable: true), - LockoutEnabled = table.Column(type: "tinyint(1)", nullable: false), - AccessFailedCount = table.Column(type: "int", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_AspNetUsers", x => x.Id); - }) - .Annotation("MySql:CharSet", "utf8mb4"); - - migrationBuilder.CreateTable( - name: "AspNetRoleClaims", - columns: table => new - { - Id = table.Column(type: "int", nullable: false) - .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), - RoleId = table.Column(type: "varchar(255)", nullable: false) - .Annotation("MySql:CharSet", "utf8mb4"), - ClaimType = table.Column(type: "longtext", nullable: true) - .Annotation("MySql:CharSet", "utf8mb4"), - ClaimValue = table.Column(type: "longtext", nullable: true) - .Annotation("MySql:CharSet", "utf8mb4") - }, - constraints: table => - { - table.PrimaryKey("PK_AspNetRoleClaims", x => x.Id); - table.ForeignKey( - name: "FK_AspNetRoleClaims_AspNetRoles_RoleId", - column: x => x.RoleId, - principalTable: "AspNetRoles", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - }) - .Annotation("MySql:CharSet", "utf8mb4"); - - migrationBuilder.CreateTable( - name: "AspNetUserClaims", - columns: table => new - { - Id = table.Column(type: "int", nullable: false) - .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), - UserId = table.Column(type: "varchar(255)", nullable: false) - .Annotation("MySql:CharSet", "utf8mb4"), - ClaimType = table.Column(type: "longtext", nullable: true) - .Annotation("MySql:CharSet", "utf8mb4"), - ClaimValue = table.Column(type: "longtext", nullable: true) - .Annotation("MySql:CharSet", "utf8mb4") - }, - constraints: table => - { - table.PrimaryKey("PK_AspNetUserClaims", x => x.Id); - table.ForeignKey( - name: "FK_AspNetUserClaims_AspNetUsers_UserId", - column: x => x.UserId, - principalTable: "AspNetUsers", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - }) - .Annotation("MySql:CharSet", "utf8mb4"); - - migrationBuilder.CreateTable( - name: "AspNetUserLogins", - columns: table => new - { - LoginProvider = table.Column(type: "varchar(255)", nullable: false) - .Annotation("MySql:CharSet", "utf8mb4"), - ProviderKey = table.Column(type: "varchar(255)", nullable: false) - .Annotation("MySql:CharSet", "utf8mb4"), - ProviderDisplayName = table.Column(type: "longtext", nullable: true) - .Annotation("MySql:CharSet", "utf8mb4"), - UserId = table.Column(type: "varchar(255)", nullable: false) - .Annotation("MySql:CharSet", "utf8mb4") - }, - constraints: table => - { - table.PrimaryKey("PK_AspNetUserLogins", x => new { x.LoginProvider, x.ProviderKey }); - table.ForeignKey( - name: "FK_AspNetUserLogins_AspNetUsers_UserId", - column: x => x.UserId, - principalTable: "AspNetUsers", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - }) - .Annotation("MySql:CharSet", "utf8mb4"); - - migrationBuilder.CreateTable( - name: "AspNetUserRoles", - columns: table => new - { - UserId = table.Column(type: "varchar(255)", nullable: false) - .Annotation("MySql:CharSet", "utf8mb4"), - RoleId = table.Column(type: "varchar(255)", nullable: false) - .Annotation("MySql:CharSet", "utf8mb4") - }, - constraints: table => - { - table.PrimaryKey("PK_AspNetUserRoles", x => new { x.UserId, x.RoleId }); - table.ForeignKey( - name: "FK_AspNetUserRoles_AspNetRoles_RoleId", - column: x => x.RoleId, - principalTable: "AspNetRoles", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - table.ForeignKey( - name: "FK_AspNetUserRoles_AspNetUsers_UserId", - column: x => x.UserId, - principalTable: "AspNetUsers", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - }) - .Annotation("MySql:CharSet", "utf8mb4"); - - migrationBuilder.CreateTable( - name: "AspNetUserTokens", - columns: table => new - { - UserId = table.Column(type: "varchar(255)", nullable: false) - .Annotation("MySql:CharSet", "utf8mb4"), - LoginProvider = table.Column(type: "varchar(255)", nullable: false) - .Annotation("MySql:CharSet", "utf8mb4"), - Name = table.Column(type: "varchar(255)", nullable: false) - .Annotation("MySql:CharSet", "utf8mb4"), - Value = table.Column(type: "longtext", nullable: true) - .Annotation("MySql:CharSet", "utf8mb4") - }, - constraints: table => - { - table.PrimaryKey("PK_AspNetUserTokens", x => new { x.UserId, x.LoginProvider, x.Name }); - table.ForeignKey( - name: "FK_AspNetUserTokens_AspNetUsers_UserId", - column: x => x.UserId, - principalTable: "AspNetUsers", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - }) - .Annotation("MySql:CharSet", "utf8mb4"); - - migrationBuilder.CreateIndex( - name: "IX_AspNetRoleClaims_RoleId", - table: "AspNetRoleClaims", - column: "RoleId"); - - migrationBuilder.CreateIndex( - name: "RoleNameIndex", - table: "AspNetRoles", - column: "NormalizedName", - unique: true); - - migrationBuilder.CreateIndex( - name: "IX_AspNetUserClaims_UserId", - table: "AspNetUserClaims", - column: "UserId"); - - migrationBuilder.CreateIndex( - name: "IX_AspNetUserLogins_UserId", - table: "AspNetUserLogins", - column: "UserId"); - - migrationBuilder.CreateIndex( - name: "IX_AspNetUserRoles_RoleId", - table: "AspNetUserRoles", - column: "RoleId"); - - migrationBuilder.CreateIndex( - name: "EmailIndex", - table: "AspNetUsers", - column: "NormalizedEmail"); - - migrationBuilder.CreateIndex( - name: "UserNameIndex", - table: "AspNetUsers", - column: "NormalizedUserName", - unique: true); - } - - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropTable( - name: "AspNetRoleClaims"); - - migrationBuilder.DropTable( - name: "AspNetUserClaims"); - - migrationBuilder.DropTable( - name: "AspNetUserLogins"); - - migrationBuilder.DropTable( - name: "AspNetUserRoles"); - - migrationBuilder.DropTable( - name: "AspNetUserTokens"); - - migrationBuilder.DropTable( - name: "AspNetRoles"); - - migrationBuilder.DropTable( - name: "AspNetUsers"); - } - } -} diff --git a/Aberwyn/Migrations/20250515202922_CreateBudgetSchema.Designer.cs b/Aberwyn/Migrations/20250515202922_CreateBudgetSchema.Designer.cs deleted file mode 100644 index dea295a..0000000 --- a/Aberwyn/Migrations/20250515202922_CreateBudgetSchema.Designer.cs +++ /dev/null @@ -1,375 +0,0 @@ -ï»ż// -using System; -using Aberwyn.Data; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; - -#nullable disable - -namespace Aberwyn.Migrations -{ - [DbContext(typeof(ApplicationDbContext))] - [Migration("20250515202922_CreateBudgetSchema")] - partial class CreateBudgetSchema - { - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "6.0.36") - .HasAnnotation("Relational:MaxIdentifierLength", 64); - - modelBuilder.Entity("Aberwyn.Models.ApplicationUser", b => - { - b.Property("Id") - .HasColumnType("varchar(255)"); - - b.Property("AccessFailedCount") - .HasColumnType("int"); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken() - .HasColumnType("longtext"); - - b.Property("Email") - .HasMaxLength(256) - .HasColumnType("varchar(256)"); - - b.Property("EmailConfirmed") - .HasColumnType("tinyint(1)"); - - b.Property("LockoutEnabled") - .HasColumnType("tinyint(1)"); - - b.Property("LockoutEnd") - .HasColumnType("datetime(6)"); - - b.Property("NormalizedEmail") - .HasMaxLength(256) - .HasColumnType("varchar(256)"); - - b.Property("NormalizedUserName") - .HasMaxLength(256) - .HasColumnType("varchar(256)"); - - b.Property("PasswordHash") - .HasColumnType("longtext"); - - b.Property("PhoneNumber") - .HasColumnType("longtext"); - - b.Property("PhoneNumberConfirmed") - .HasColumnType("tinyint(1)"); - - b.Property("SecurityStamp") - .HasColumnType("longtext"); - - b.Property("TwoFactorEnabled") - .HasColumnType("tinyint(1)"); - - b.Property("UserName") - .HasMaxLength(256) - .HasColumnType("varchar(256)"); - - b.HasKey("Id"); - - b.HasIndex("NormalizedEmail") - .HasDatabaseName("EmailIndex"); - - b.HasIndex("NormalizedUserName") - .IsUnique() - .HasDatabaseName("UserNameIndex"); - - b.ToTable("AspNetUsers", (string)null); - }); - - modelBuilder.Entity("Aberwyn.Models.BudgetCategory", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - b.Property("BudgetPeriodId") - .HasColumnType("int"); - - b.Property("Color") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.HasKey("Id"); - - b.HasIndex("BudgetPeriodId"); - - b.ToTable("BudgetCategories"); - }); - - modelBuilder.Entity("Aberwyn.Models.BudgetItem", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - b.Property("Amount") - .HasColumnType("decimal(65,30)"); - - b.Property("BudgetCategoryId") - .HasColumnType("int"); - - b.Property("IncludeInSummary") - .HasColumnType("tinyint(1)"); - - b.Property("IsExpense") - .HasColumnType("tinyint(1)"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Person") - .IsRequired() - .HasColumnType("longtext"); - - b.HasKey("Id"); - - b.HasIndex("BudgetCategoryId"); - - b.ToTable("BudgetItems"); - }); - - modelBuilder.Entity("Aberwyn.Models.BudgetPeriod", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - b.Property("Month") - .HasColumnType("int"); - - b.Property("Year") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.ToTable("BudgetPeriods"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRole", b => - { - b.Property("Id") - .HasColumnType("varchar(255)"); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken() - .HasColumnType("longtext"); - - b.Property("Name") - .HasMaxLength(256) - .HasColumnType("varchar(256)"); - - b.Property("NormalizedName") - .HasMaxLength(256) - .HasColumnType("varchar(256)"); - - b.HasKey("Id"); - - b.HasIndex("NormalizedName") - .IsUnique() - .HasDatabaseName("RoleNameIndex"); - - b.ToTable("AspNetRoles", (string)null); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - b.Property("ClaimType") - .HasColumnType("longtext"); - - b.Property("ClaimValue") - .HasColumnType("longtext"); - - b.Property("RoleId") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.HasKey("Id"); - - b.HasIndex("RoleId"); - - b.ToTable("AspNetRoleClaims", (string)null); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - b.Property("ClaimType") - .HasColumnType("longtext"); - - b.Property("ClaimValue") - .HasColumnType("longtext"); - - b.Property("UserId") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.HasKey("Id"); - - b.HasIndex("UserId"); - - b.ToTable("AspNetUserClaims", (string)null); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => - { - b.Property("LoginProvider") - .HasColumnType("varchar(255)"); - - b.Property("ProviderKey") - .HasColumnType("varchar(255)"); - - b.Property("ProviderDisplayName") - .HasColumnType("longtext"); - - b.Property("UserId") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.HasKey("LoginProvider", "ProviderKey"); - - b.HasIndex("UserId"); - - b.ToTable("AspNetUserLogins", (string)null); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => - { - b.Property("UserId") - .HasColumnType("varchar(255)"); - - b.Property("RoleId") - .HasColumnType("varchar(255)"); - - b.HasKey("UserId", "RoleId"); - - b.HasIndex("RoleId"); - - b.ToTable("AspNetUserRoles", (string)null); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => - { - b.Property("UserId") - .HasColumnType("varchar(255)"); - - b.Property("LoginProvider") - .HasColumnType("varchar(255)"); - - b.Property("Name") - .HasColumnType("varchar(255)"); - - b.Property("Value") - .HasColumnType("longtext"); - - b.HasKey("UserId", "LoginProvider", "Name"); - - b.ToTable("AspNetUserTokens", (string)null); - }); - - modelBuilder.Entity("Aberwyn.Models.BudgetCategory", b => - { - b.HasOne("Aberwyn.Models.BudgetPeriod", "BudgetPeriod") - .WithMany("Categories") - .HasForeignKey("BudgetPeriodId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("BudgetPeriod"); - }); - - modelBuilder.Entity("Aberwyn.Models.BudgetItem", b => - { - b.HasOne("Aberwyn.Models.BudgetCategory", "BudgetCategory") - .WithMany("Items") - .HasForeignKey("BudgetCategoryId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("BudgetCategory"); - }); - - 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("Aberwyn.Models.ApplicationUser", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => - { - b.HasOne("Aberwyn.Models.ApplicationUser", 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("Aberwyn.Models.ApplicationUser", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => - { - b.HasOne("Aberwyn.Models.ApplicationUser", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Aberwyn.Models.BudgetCategory", b => - { - b.Navigation("Items"); - }); - - modelBuilder.Entity("Aberwyn.Models.BudgetPeriod", b => - { - b.Navigation("Categories"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/Aberwyn/Migrations/20250515202922_CreateBudgetSchema.cs b/Aberwyn/Migrations/20250515202922_CreateBudgetSchema.cs deleted file mode 100644 index 961cca1..0000000 --- a/Aberwyn/Migrations/20250515202922_CreateBudgetSchema.cs +++ /dev/null @@ -1,101 +0,0 @@ -ï»żusing Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Aberwyn.Migrations -{ - public partial class CreateBudgetSchema : Migration - { - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.CreateTable( - name: "BudgetPeriods", - columns: table => new - { - Id = table.Column(type: "int", nullable: false) - .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), - Year = table.Column(type: "int", nullable: false), - Month = table.Column(type: "int", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_BudgetPeriods", x => x.Id); - }) - .Annotation("MySql:CharSet", "utf8mb4"); - - migrationBuilder.CreateTable( - name: "BudgetCategories", - columns: table => new - { - Id = table.Column(type: "int", nullable: false) - .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), - Name = table.Column(type: "longtext", nullable: false) - .Annotation("MySql:CharSet", "utf8mb4"), - Color = table.Column(type: "longtext", nullable: false) - .Annotation("MySql:CharSet", "utf8mb4"), - BudgetPeriodId = table.Column(type: "int", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_BudgetCategories", x => x.Id); - table.ForeignKey( - name: "FK_BudgetCategories_BudgetPeriods_BudgetPeriodId", - column: x => x.BudgetPeriodId, - principalTable: "BudgetPeriods", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - }) - .Annotation("MySql:CharSet", "utf8mb4"); - - migrationBuilder.CreateTable( - name: "BudgetItems", - columns: table => new - { - Id = table.Column(type: "int", nullable: false) - .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), - Name = table.Column(type: "longtext", nullable: false) - .Annotation("MySql:CharSet", "utf8mb4"), - Person = table.Column(type: "longtext", nullable: false) - .Annotation("MySql:CharSet", "utf8mb4"), - Amount = table.Column(type: "decimal(65,30)", nullable: false), - IsExpense = table.Column(type: "tinyint(1)", nullable: false), - IncludeInSummary = table.Column(type: "tinyint(1)", nullable: false), - BudgetCategoryId = table.Column(type: "int", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_BudgetItems", x => x.Id); - table.ForeignKey( - name: "FK_BudgetItems_BudgetCategories_BudgetCategoryId", - column: x => x.BudgetCategoryId, - principalTable: "BudgetCategories", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - }) - .Annotation("MySql:CharSet", "utf8mb4"); - - migrationBuilder.CreateIndex( - name: "IX_BudgetCategories_BudgetPeriodId", - table: "BudgetCategories", - column: "BudgetPeriodId"); - - migrationBuilder.CreateIndex( - name: "IX_BudgetItems_BudgetCategoryId", - table: "BudgetItems", - column: "BudgetCategoryId"); - } - - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropTable( - name: "BudgetItems"); - - migrationBuilder.DropTable( - name: "BudgetCategories"); - - migrationBuilder.DropTable( - name: "BudgetPeriods"); - } - } -} diff --git a/Aberwyn/Migrations/20250515204407_MakePersonNullable.Designer.cs b/Aberwyn/Migrations/20250515204407_MakePersonNullable.Designer.cs deleted file mode 100644 index 388a551..0000000 --- a/Aberwyn/Migrations/20250515204407_MakePersonNullable.Designer.cs +++ /dev/null @@ -1,374 +0,0 @@ -ï»ż// -using System; -using Aberwyn.Data; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; - -#nullable disable - -namespace Aberwyn.Migrations -{ - [DbContext(typeof(ApplicationDbContext))] - [Migration("20250515204407_MakePersonNullable")] - partial class MakePersonNullable - { - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "6.0.36") - .HasAnnotation("Relational:MaxIdentifierLength", 64); - - modelBuilder.Entity("Aberwyn.Models.ApplicationUser", b => - { - b.Property("Id") - .HasColumnType("varchar(255)"); - - b.Property("AccessFailedCount") - .HasColumnType("int"); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken() - .HasColumnType("longtext"); - - b.Property("Email") - .HasMaxLength(256) - .HasColumnType("varchar(256)"); - - b.Property("EmailConfirmed") - .HasColumnType("tinyint(1)"); - - b.Property("LockoutEnabled") - .HasColumnType("tinyint(1)"); - - b.Property("LockoutEnd") - .HasColumnType("datetime(6)"); - - b.Property("NormalizedEmail") - .HasMaxLength(256) - .HasColumnType("varchar(256)"); - - b.Property("NormalizedUserName") - .HasMaxLength(256) - .HasColumnType("varchar(256)"); - - b.Property("PasswordHash") - .HasColumnType("longtext"); - - b.Property("PhoneNumber") - .HasColumnType("longtext"); - - b.Property("PhoneNumberConfirmed") - .HasColumnType("tinyint(1)"); - - b.Property("SecurityStamp") - .HasColumnType("longtext"); - - b.Property("TwoFactorEnabled") - .HasColumnType("tinyint(1)"); - - b.Property("UserName") - .HasMaxLength(256) - .HasColumnType("varchar(256)"); - - b.HasKey("Id"); - - b.HasIndex("NormalizedEmail") - .HasDatabaseName("EmailIndex"); - - b.HasIndex("NormalizedUserName") - .IsUnique() - .HasDatabaseName("UserNameIndex"); - - b.ToTable("AspNetUsers", (string)null); - }); - - modelBuilder.Entity("Aberwyn.Models.BudgetCategory", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - b.Property("BudgetPeriodId") - .HasColumnType("int"); - - b.Property("Color") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.HasKey("Id"); - - b.HasIndex("BudgetPeriodId"); - - b.ToTable("BudgetCategories"); - }); - - modelBuilder.Entity("Aberwyn.Models.BudgetItem", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - b.Property("Amount") - .HasColumnType("decimal(65,30)"); - - b.Property("BudgetCategoryId") - .HasColumnType("int"); - - b.Property("IncludeInSummary") - .HasColumnType("tinyint(1)"); - - b.Property("IsExpense") - .HasColumnType("tinyint(1)"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Person") - .HasColumnType("longtext"); - - b.HasKey("Id"); - - b.HasIndex("BudgetCategoryId"); - - b.ToTable("BudgetItems"); - }); - - modelBuilder.Entity("Aberwyn.Models.BudgetPeriod", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - b.Property("Month") - .HasColumnType("int"); - - b.Property("Year") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.ToTable("BudgetPeriods"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRole", b => - { - b.Property("Id") - .HasColumnType("varchar(255)"); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken() - .HasColumnType("longtext"); - - b.Property("Name") - .HasMaxLength(256) - .HasColumnType("varchar(256)"); - - b.Property("NormalizedName") - .HasMaxLength(256) - .HasColumnType("varchar(256)"); - - b.HasKey("Id"); - - b.HasIndex("NormalizedName") - .IsUnique() - .HasDatabaseName("RoleNameIndex"); - - b.ToTable("AspNetRoles", (string)null); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - b.Property("ClaimType") - .HasColumnType("longtext"); - - b.Property("ClaimValue") - .HasColumnType("longtext"); - - b.Property("RoleId") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.HasKey("Id"); - - b.HasIndex("RoleId"); - - b.ToTable("AspNetRoleClaims", (string)null); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - b.Property("ClaimType") - .HasColumnType("longtext"); - - b.Property("ClaimValue") - .HasColumnType("longtext"); - - b.Property("UserId") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.HasKey("Id"); - - b.HasIndex("UserId"); - - b.ToTable("AspNetUserClaims", (string)null); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => - { - b.Property("LoginProvider") - .HasColumnType("varchar(255)"); - - b.Property("ProviderKey") - .HasColumnType("varchar(255)"); - - b.Property("ProviderDisplayName") - .HasColumnType("longtext"); - - b.Property("UserId") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.HasKey("LoginProvider", "ProviderKey"); - - b.HasIndex("UserId"); - - b.ToTable("AspNetUserLogins", (string)null); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => - { - b.Property("UserId") - .HasColumnType("varchar(255)"); - - b.Property("RoleId") - .HasColumnType("varchar(255)"); - - b.HasKey("UserId", "RoleId"); - - b.HasIndex("RoleId"); - - b.ToTable("AspNetUserRoles", (string)null); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => - { - b.Property("UserId") - .HasColumnType("varchar(255)"); - - b.Property("LoginProvider") - .HasColumnType("varchar(255)"); - - b.Property("Name") - .HasColumnType("varchar(255)"); - - b.Property("Value") - .HasColumnType("longtext"); - - b.HasKey("UserId", "LoginProvider", "Name"); - - b.ToTable("AspNetUserTokens", (string)null); - }); - - modelBuilder.Entity("Aberwyn.Models.BudgetCategory", b => - { - b.HasOne("Aberwyn.Models.BudgetPeriod", "BudgetPeriod") - .WithMany("Categories") - .HasForeignKey("BudgetPeriodId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("BudgetPeriod"); - }); - - modelBuilder.Entity("Aberwyn.Models.BudgetItem", b => - { - b.HasOne("Aberwyn.Models.BudgetCategory", "BudgetCategory") - .WithMany("Items") - .HasForeignKey("BudgetCategoryId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("BudgetCategory"); - }); - - 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("Aberwyn.Models.ApplicationUser", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => - { - b.HasOne("Aberwyn.Models.ApplicationUser", 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("Aberwyn.Models.ApplicationUser", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => - { - b.HasOne("Aberwyn.Models.ApplicationUser", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Aberwyn.Models.BudgetCategory", b => - { - b.Navigation("Items"); - }); - - modelBuilder.Entity("Aberwyn.Models.BudgetPeriod", b => - { - b.Navigation("Categories"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/Aberwyn/Migrations/20250515204407_MakePersonNullable.cs b/Aberwyn/Migrations/20250515204407_MakePersonNullable.cs deleted file mode 100644 index edab9b1..0000000 --- a/Aberwyn/Migrations/20250515204407_MakePersonNullable.cs +++ /dev/null @@ -1,43 +0,0 @@ -ï»żusing Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Aberwyn.Migrations -{ - public partial class MakePersonNullable : Migration - { - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.AlterColumn( - name: "Person", - table: "BudgetItems", - type: "longtext", - nullable: true, - oldClrType: typeof(string), - oldType: "longtext") - .Annotation("MySql:CharSet", "utf8mb4") - .OldAnnotation("MySql:CharSet", "utf8mb4"); - } - - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.UpdateData( - table: "BudgetItems", - keyColumn: "Person", - keyValue: null, - column: "Person", - value: ""); - - migrationBuilder.AlterColumn( - name: "Person", - table: "BudgetItems", - type: "longtext", - nullable: false, - oldClrType: typeof(string), - oldType: "longtext", - oldNullable: true) - .Annotation("MySql:CharSet", "utf8mb4") - .OldAnnotation("MySql:CharSet", "utf8mb4"); - } - } -} diff --git a/Aberwyn/Migrations/20250519213736_AddOrderToBudgetCategory.Designer.cs b/Aberwyn/Migrations/20250519213736_AddOrderToBudgetCategory.Designer.cs deleted file mode 100644 index 63e2e0d..0000000 --- a/Aberwyn/Migrations/20250519213736_AddOrderToBudgetCategory.Designer.cs +++ /dev/null @@ -1,380 +0,0 @@ -ï»ż// -using System; -using Aberwyn.Data; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; - -#nullable disable - -namespace Aberwyn.Migrations -{ - [DbContext(typeof(ApplicationDbContext))] - [Migration("20250519213736_AddOrderToBudgetCategory")] - partial class AddOrderToBudgetCategory - { - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "6.0.36") - .HasAnnotation("Relational:MaxIdentifierLength", 64); - - modelBuilder.Entity("Aberwyn.Models.ApplicationUser", b => - { - b.Property("Id") - .HasColumnType("varchar(255)"); - - b.Property("AccessFailedCount") - .HasColumnType("int"); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken() - .HasColumnType("longtext"); - - b.Property("Email") - .HasMaxLength(256) - .HasColumnType("varchar(256)"); - - b.Property("EmailConfirmed") - .HasColumnType("tinyint(1)"); - - b.Property("LockoutEnabled") - .HasColumnType("tinyint(1)"); - - b.Property("LockoutEnd") - .HasColumnType("datetime(6)"); - - b.Property("NormalizedEmail") - .HasMaxLength(256) - .HasColumnType("varchar(256)"); - - b.Property("NormalizedUserName") - .HasMaxLength(256) - .HasColumnType("varchar(256)"); - - b.Property("PasswordHash") - .HasColumnType("longtext"); - - b.Property("PhoneNumber") - .HasColumnType("longtext"); - - b.Property("PhoneNumberConfirmed") - .HasColumnType("tinyint(1)"); - - b.Property("SecurityStamp") - .HasColumnType("longtext"); - - b.Property("TwoFactorEnabled") - .HasColumnType("tinyint(1)"); - - b.Property("UserName") - .HasMaxLength(256) - .HasColumnType("varchar(256)"); - - b.HasKey("Id"); - - b.HasIndex("NormalizedEmail") - .HasDatabaseName("EmailIndex"); - - b.HasIndex("NormalizedUserName") - .IsUnique() - .HasDatabaseName("UserNameIndex"); - - b.ToTable("AspNetUsers", (string)null); - }); - - modelBuilder.Entity("Aberwyn.Models.BudgetCategory", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - b.Property("BudgetPeriodId") - .HasColumnType("int"); - - b.Property("Color") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Order") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("BudgetPeriodId"); - - b.ToTable("BudgetCategories"); - }); - - modelBuilder.Entity("Aberwyn.Models.BudgetItem", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - b.Property("Amount") - .HasColumnType("decimal(65,30)"); - - b.Property("BudgetCategoryId") - .HasColumnType("int"); - - b.Property("IncludeInSummary") - .HasColumnType("tinyint(1)"); - - b.Property("IsExpense") - .HasColumnType("tinyint(1)"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Order") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("BudgetCategoryId"); - - b.ToTable("BudgetItems"); - }); - - modelBuilder.Entity("Aberwyn.Models.BudgetPeriod", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - b.Property("Month") - .HasColumnType("int"); - - b.Property("Order") - .HasColumnType("int"); - - b.Property("Year") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.ToTable("BudgetPeriods"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRole", b => - { - b.Property("Id") - .HasColumnType("varchar(255)"); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken() - .HasColumnType("longtext"); - - b.Property("Name") - .HasMaxLength(256) - .HasColumnType("varchar(256)"); - - b.Property("NormalizedName") - .HasMaxLength(256) - .HasColumnType("varchar(256)"); - - b.HasKey("Id"); - - b.HasIndex("NormalizedName") - .IsUnique() - .HasDatabaseName("RoleNameIndex"); - - b.ToTable("AspNetRoles", (string)null); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - b.Property("ClaimType") - .HasColumnType("longtext"); - - b.Property("ClaimValue") - .HasColumnType("longtext"); - - b.Property("RoleId") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.HasKey("Id"); - - b.HasIndex("RoleId"); - - b.ToTable("AspNetRoleClaims", (string)null); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - b.Property("ClaimType") - .HasColumnType("longtext"); - - b.Property("ClaimValue") - .HasColumnType("longtext"); - - b.Property("UserId") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.HasKey("Id"); - - b.HasIndex("UserId"); - - b.ToTable("AspNetUserClaims", (string)null); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => - { - b.Property("LoginProvider") - .HasColumnType("varchar(255)"); - - b.Property("ProviderKey") - .HasColumnType("varchar(255)"); - - b.Property("ProviderDisplayName") - .HasColumnType("longtext"); - - b.Property("UserId") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.HasKey("LoginProvider", "ProviderKey"); - - b.HasIndex("UserId"); - - b.ToTable("AspNetUserLogins", (string)null); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => - { - b.Property("UserId") - .HasColumnType("varchar(255)"); - - b.Property("RoleId") - .HasColumnType("varchar(255)"); - - b.HasKey("UserId", "RoleId"); - - b.HasIndex("RoleId"); - - b.ToTable("AspNetUserRoles", (string)null); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => - { - b.Property("UserId") - .HasColumnType("varchar(255)"); - - b.Property("LoginProvider") - .HasColumnType("varchar(255)"); - - b.Property("Name") - .HasColumnType("varchar(255)"); - - b.Property("Value") - .HasColumnType("longtext"); - - b.HasKey("UserId", "LoginProvider", "Name"); - - b.ToTable("AspNetUserTokens", (string)null); - }); - - modelBuilder.Entity("Aberwyn.Models.BudgetCategory", b => - { - b.HasOne("Aberwyn.Models.BudgetPeriod", "BudgetPeriod") - .WithMany("Categories") - .HasForeignKey("BudgetPeriodId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("BudgetPeriod"); - }); - - modelBuilder.Entity("Aberwyn.Models.BudgetItem", b => - { - b.HasOne("Aberwyn.Models.BudgetCategory", "BudgetCategory") - .WithMany("Items") - .HasForeignKey("BudgetCategoryId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("BudgetCategory"); - }); - - 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("Aberwyn.Models.ApplicationUser", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => - { - b.HasOne("Aberwyn.Models.ApplicationUser", 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("Aberwyn.Models.ApplicationUser", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => - { - b.HasOne("Aberwyn.Models.ApplicationUser", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Aberwyn.Models.BudgetCategory", b => - { - b.Navigation("Items"); - }); - - modelBuilder.Entity("Aberwyn.Models.BudgetPeriod", b => - { - b.Navigation("Categories"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/Aberwyn/Migrations/20250519213736_AddOrderToBudgetCategory.cs b/Aberwyn/Migrations/20250519213736_AddOrderToBudgetCategory.cs deleted file mode 100644 index 481de48..0000000 --- a/Aberwyn/Migrations/20250519213736_AddOrderToBudgetCategory.cs +++ /dev/null @@ -1,59 +0,0 @@ -ï»żusing Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Aberwyn.Migrations -{ - public partial class AddOrderToBudgetCategory : Migration - { - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropColumn( - name: "Person", - table: "BudgetItems"); - - migrationBuilder.AddColumn( - name: "Order", - table: "BudgetPeriods", - type: "int", - nullable: false, - defaultValue: 0); - - migrationBuilder.AddColumn( - name: "Order", - table: "BudgetItems", - type: "int", - nullable: false, - defaultValue: 0); - - migrationBuilder.AddColumn( - name: "Order", - table: "BudgetCategories", - type: "int", - nullable: false, - defaultValue: 0); - } - - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropColumn( - name: "Order", - table: "BudgetPeriods"); - - migrationBuilder.DropColumn( - name: "Order", - table: "BudgetItems"); - - migrationBuilder.DropColumn( - name: "Order", - table: "BudgetCategories"); - - migrationBuilder.AddColumn( - name: "Person", - table: "BudgetItems", - type: "longtext", - nullable: true) - .Annotation("MySql:CharSet", "utf8mb4"); - } - } -} diff --git a/Aberwyn/Migrations/20250522074358_AddMealImageData.Designer.cs b/Aberwyn/Migrations/20250522074358_AddMealImageData.Designer.cs deleted file mode 100644 index d8ec42a..0000000 --- a/Aberwyn/Migrations/20250522074358_AddMealImageData.Designer.cs +++ /dev/null @@ -1,380 +0,0 @@ -ï»ż// -using System; -using Aberwyn.Data; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; - -#nullable disable - -namespace Aberwyn.Migrations -{ - [DbContext(typeof(ApplicationDbContext))] - [Migration("20250522074358_AddMealImageData")] - partial class AddMealImageData - { - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "6.0.36") - .HasAnnotation("Relational:MaxIdentifierLength", 64); - - modelBuilder.Entity("Aberwyn.Models.ApplicationUser", b => - { - b.Property("Id") - .HasColumnType("varchar(255)"); - - b.Property("AccessFailedCount") - .HasColumnType("int"); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken() - .HasColumnType("longtext"); - - b.Property("Email") - .HasMaxLength(256) - .HasColumnType("varchar(256)"); - - b.Property("EmailConfirmed") - .HasColumnType("tinyint(1)"); - - b.Property("LockoutEnabled") - .HasColumnType("tinyint(1)"); - - b.Property("LockoutEnd") - .HasColumnType("datetime(6)"); - - b.Property("NormalizedEmail") - .HasMaxLength(256) - .HasColumnType("varchar(256)"); - - b.Property("NormalizedUserName") - .HasMaxLength(256) - .HasColumnType("varchar(256)"); - - b.Property("PasswordHash") - .HasColumnType("longtext"); - - b.Property("PhoneNumber") - .HasColumnType("longtext"); - - b.Property("PhoneNumberConfirmed") - .HasColumnType("tinyint(1)"); - - b.Property("SecurityStamp") - .HasColumnType("longtext"); - - b.Property("TwoFactorEnabled") - .HasColumnType("tinyint(1)"); - - b.Property("UserName") - .HasMaxLength(256) - .HasColumnType("varchar(256)"); - - b.HasKey("Id"); - - b.HasIndex("NormalizedEmail") - .HasDatabaseName("EmailIndex"); - - b.HasIndex("NormalizedUserName") - .IsUnique() - .HasDatabaseName("UserNameIndex"); - - b.ToTable("AspNetUsers", (string)null); - }); - - modelBuilder.Entity("Aberwyn.Models.BudgetCategory", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - b.Property("BudgetPeriodId") - .HasColumnType("int"); - - b.Property("Color") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Order") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("BudgetPeriodId"); - - b.ToTable("BudgetCategories"); - }); - - modelBuilder.Entity("Aberwyn.Models.BudgetItem", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - b.Property("Amount") - .HasColumnType("decimal(65,30)"); - - b.Property("BudgetCategoryId") - .HasColumnType("int"); - - b.Property("IncludeInSummary") - .HasColumnType("tinyint(1)"); - - b.Property("IsExpense") - .HasColumnType("tinyint(1)"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Order") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("BudgetCategoryId"); - - b.ToTable("BudgetItems"); - }); - - modelBuilder.Entity("Aberwyn.Models.BudgetPeriod", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - b.Property("Month") - .HasColumnType("int"); - - b.Property("Order") - .HasColumnType("int"); - - b.Property("Year") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.ToTable("BudgetPeriods"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRole", b => - { - b.Property("Id") - .HasColumnType("varchar(255)"); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken() - .HasColumnType("longtext"); - - b.Property("Name") - .HasMaxLength(256) - .HasColumnType("varchar(256)"); - - b.Property("NormalizedName") - .HasMaxLength(256) - .HasColumnType("varchar(256)"); - - b.HasKey("Id"); - - b.HasIndex("NormalizedName") - .IsUnique() - .HasDatabaseName("RoleNameIndex"); - - b.ToTable("AspNetRoles", (string)null); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - b.Property("ClaimType") - .HasColumnType("longtext"); - - b.Property("ClaimValue") - .HasColumnType("longtext"); - - b.Property("RoleId") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.HasKey("Id"); - - b.HasIndex("RoleId"); - - b.ToTable("AspNetRoleClaims", (string)null); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - b.Property("ClaimType") - .HasColumnType("longtext"); - - b.Property("ClaimValue") - .HasColumnType("longtext"); - - b.Property("UserId") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.HasKey("Id"); - - b.HasIndex("UserId"); - - b.ToTable("AspNetUserClaims", (string)null); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => - { - b.Property("LoginProvider") - .HasColumnType("varchar(255)"); - - b.Property("ProviderKey") - .HasColumnType("varchar(255)"); - - b.Property("ProviderDisplayName") - .HasColumnType("longtext"); - - b.Property("UserId") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.HasKey("LoginProvider", "ProviderKey"); - - b.HasIndex("UserId"); - - b.ToTable("AspNetUserLogins", (string)null); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => - { - b.Property("UserId") - .HasColumnType("varchar(255)"); - - b.Property("RoleId") - .HasColumnType("varchar(255)"); - - b.HasKey("UserId", "RoleId"); - - b.HasIndex("RoleId"); - - b.ToTable("AspNetUserRoles", (string)null); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => - { - b.Property("UserId") - .HasColumnType("varchar(255)"); - - b.Property("LoginProvider") - .HasColumnType("varchar(255)"); - - b.Property("Name") - .HasColumnType("varchar(255)"); - - b.Property("Value") - .HasColumnType("longtext"); - - b.HasKey("UserId", "LoginProvider", "Name"); - - b.ToTable("AspNetUserTokens", (string)null); - }); - - modelBuilder.Entity("Aberwyn.Models.BudgetCategory", b => - { - b.HasOne("Aberwyn.Models.BudgetPeriod", "BudgetPeriod") - .WithMany("Categories") - .HasForeignKey("BudgetPeriodId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("BudgetPeriod"); - }); - - modelBuilder.Entity("Aberwyn.Models.BudgetItem", b => - { - b.HasOne("Aberwyn.Models.BudgetCategory", "BudgetCategory") - .WithMany("Items") - .HasForeignKey("BudgetCategoryId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("BudgetCategory"); - }); - - 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("Aberwyn.Models.ApplicationUser", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => - { - b.HasOne("Aberwyn.Models.ApplicationUser", 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("Aberwyn.Models.ApplicationUser", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => - { - b.HasOne("Aberwyn.Models.ApplicationUser", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Aberwyn.Models.BudgetCategory", b => - { - b.Navigation("Items"); - }); - - modelBuilder.Entity("Aberwyn.Models.BudgetPeriod", b => - { - b.Navigation("Categories"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/Aberwyn/Migrations/20250522074358_AddMealImageData.cs b/Aberwyn/Migrations/20250522074358_AddMealImageData.cs deleted file mode 100644 index c7c0fb2..0000000 --- a/Aberwyn/Migrations/20250522074358_AddMealImageData.cs +++ /dev/null @@ -1,19 +0,0 @@ -ï»żusing Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Aberwyn.Migrations -{ - public partial class AddMealImageData : Migration - { - protected override void Up(MigrationBuilder migrationBuilder) - { - - } - - protected override void Down(MigrationBuilder migrationBuilder) - { - - } - } -} diff --git a/Aberwyn/Migrations/20250523075931_AddPushSubscribers.Designer.cs b/Aberwyn/Migrations/20250523075931_AddPushSubscribers.Designer.cs deleted file mode 100644 index ced95c5..0000000 --- a/Aberwyn/Migrations/20250523075931_AddPushSubscribers.Designer.cs +++ /dev/null @@ -1,403 +0,0 @@ -ï»ż// -using System; -using Aberwyn.Data; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; - -#nullable disable - -namespace Aberwyn.Migrations -{ - [DbContext(typeof(ApplicationDbContext))] - [Migration("20250523075931_AddPushSubscribers")] - partial class AddPushSubscribers - { - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "6.0.36") - .HasAnnotation("Relational:MaxIdentifierLength", 64); - - modelBuilder.Entity("Aberwyn.Models.ApplicationUser", b => - { - b.Property("Id") - .HasColumnType("varchar(255)"); - - b.Property("AccessFailedCount") - .HasColumnType("int"); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken() - .HasColumnType("longtext"); - - b.Property("Email") - .HasMaxLength(256) - .HasColumnType("varchar(256)"); - - b.Property("EmailConfirmed") - .HasColumnType("tinyint(1)"); - - b.Property("LockoutEnabled") - .HasColumnType("tinyint(1)"); - - b.Property("LockoutEnd") - .HasColumnType("datetime(6)"); - - b.Property("NormalizedEmail") - .HasMaxLength(256) - .HasColumnType("varchar(256)"); - - b.Property("NormalizedUserName") - .HasMaxLength(256) - .HasColumnType("varchar(256)"); - - b.Property("PasswordHash") - .HasColumnType("longtext"); - - b.Property("PhoneNumber") - .HasColumnType("longtext"); - - b.Property("PhoneNumberConfirmed") - .HasColumnType("tinyint(1)"); - - b.Property("SecurityStamp") - .HasColumnType("longtext"); - - b.Property("TwoFactorEnabled") - .HasColumnType("tinyint(1)"); - - b.Property("UserName") - .HasMaxLength(256) - .HasColumnType("varchar(256)"); - - b.HasKey("Id"); - - b.HasIndex("NormalizedEmail") - .HasDatabaseName("EmailIndex"); - - b.HasIndex("NormalizedUserName") - .IsUnique() - .HasDatabaseName("UserNameIndex"); - - b.ToTable("AspNetUsers", (string)null); - }); - - modelBuilder.Entity("Aberwyn.Models.BudgetCategory", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - b.Property("BudgetPeriodId") - .HasColumnType("int"); - - b.Property("Color") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Order") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("BudgetPeriodId"); - - b.ToTable("BudgetCategories"); - }); - - modelBuilder.Entity("Aberwyn.Models.BudgetItem", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - b.Property("Amount") - .HasColumnType("decimal(65,30)"); - - b.Property("BudgetCategoryId") - .HasColumnType("int"); - - b.Property("IncludeInSummary") - .HasColumnType("tinyint(1)"); - - b.Property("IsExpense") - .HasColumnType("tinyint(1)"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Order") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("BudgetCategoryId"); - - b.ToTable("BudgetItems"); - }); - - modelBuilder.Entity("Aberwyn.Models.BudgetPeriod", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - b.Property("Month") - .HasColumnType("int"); - - b.Property("Order") - .HasColumnType("int"); - - b.Property("Year") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.ToTable("BudgetPeriods"); - }); - - modelBuilder.Entity("Aberwyn.Models.PushSubscriber", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - b.Property("Auth") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Endpoint") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("P256DH") - .IsRequired() - .HasColumnType("longtext"); - - b.HasKey("Id"); - - b.ToTable("PushSubscribers"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRole", b => - { - b.Property("Id") - .HasColumnType("varchar(255)"); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken() - .HasColumnType("longtext"); - - b.Property("Name") - .HasMaxLength(256) - .HasColumnType("varchar(256)"); - - b.Property("NormalizedName") - .HasMaxLength(256) - .HasColumnType("varchar(256)"); - - b.HasKey("Id"); - - b.HasIndex("NormalizedName") - .IsUnique() - .HasDatabaseName("RoleNameIndex"); - - b.ToTable("AspNetRoles", (string)null); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - b.Property("ClaimType") - .HasColumnType("longtext"); - - b.Property("ClaimValue") - .HasColumnType("longtext"); - - b.Property("RoleId") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.HasKey("Id"); - - b.HasIndex("RoleId"); - - b.ToTable("AspNetRoleClaims", (string)null); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - b.Property("ClaimType") - .HasColumnType("longtext"); - - b.Property("ClaimValue") - .HasColumnType("longtext"); - - b.Property("UserId") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.HasKey("Id"); - - b.HasIndex("UserId"); - - b.ToTable("AspNetUserClaims", (string)null); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => - { - b.Property("LoginProvider") - .HasColumnType("varchar(255)"); - - b.Property("ProviderKey") - .HasColumnType("varchar(255)"); - - b.Property("ProviderDisplayName") - .HasColumnType("longtext"); - - b.Property("UserId") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.HasKey("LoginProvider", "ProviderKey"); - - b.HasIndex("UserId"); - - b.ToTable("AspNetUserLogins", (string)null); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => - { - b.Property("UserId") - .HasColumnType("varchar(255)"); - - b.Property("RoleId") - .HasColumnType("varchar(255)"); - - b.HasKey("UserId", "RoleId"); - - b.HasIndex("RoleId"); - - b.ToTable("AspNetUserRoles", (string)null); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => - { - b.Property("UserId") - .HasColumnType("varchar(255)"); - - b.Property("LoginProvider") - .HasColumnType("varchar(255)"); - - b.Property("Name") - .HasColumnType("varchar(255)"); - - b.Property("Value") - .HasColumnType("longtext"); - - b.HasKey("UserId", "LoginProvider", "Name"); - - b.ToTable("AspNetUserTokens", (string)null); - }); - - modelBuilder.Entity("Aberwyn.Models.BudgetCategory", b => - { - b.HasOne("Aberwyn.Models.BudgetPeriod", "BudgetPeriod") - .WithMany("Categories") - .HasForeignKey("BudgetPeriodId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("BudgetPeriod"); - }); - - modelBuilder.Entity("Aberwyn.Models.BudgetItem", b => - { - b.HasOne("Aberwyn.Models.BudgetCategory", "BudgetCategory") - .WithMany("Items") - .HasForeignKey("BudgetCategoryId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("BudgetCategory"); - }); - - 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("Aberwyn.Models.ApplicationUser", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => - { - b.HasOne("Aberwyn.Models.ApplicationUser", 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("Aberwyn.Models.ApplicationUser", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => - { - b.HasOne("Aberwyn.Models.ApplicationUser", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Aberwyn.Models.BudgetCategory", b => - { - b.Navigation("Items"); - }); - - modelBuilder.Entity("Aberwyn.Models.BudgetPeriod", b => - { - b.Navigation("Categories"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/Aberwyn/Migrations/20250523075931_AddPushSubscribers.cs b/Aberwyn/Migrations/20250523075931_AddPushSubscribers.cs deleted file mode 100644 index 8e2455c..0000000 --- a/Aberwyn/Migrations/20250523075931_AddPushSubscribers.cs +++ /dev/null @@ -1,38 +0,0 @@ -ï»żusing Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Aberwyn.Migrations -{ - public partial class AddPushSubscribers : Migration - { - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.CreateTable( - name: "PushSubscribers", - columns: table => new - { - Id = table.Column(type: "int", nullable: false) - .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), - Endpoint = table.Column(type: "longtext", nullable: false) - .Annotation("MySql:CharSet", "utf8mb4"), - P256DH = table.Column(type: "longtext", nullable: false) - .Annotation("MySql:CharSet", "utf8mb4"), - Auth = table.Column(type: "longtext", nullable: false) - .Annotation("MySql:CharSet", "utf8mb4") - }, - constraints: table => - { - table.PrimaryKey("PK_PushSubscribers", x => x.Id); - }) - .Annotation("MySql:CharSet", "utf8mb4"); - } - - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropTable( - name: "PushSubscribers"); - } - } -} diff --git a/Aberwyn/Migrations/20250524103706_AddPizzaOrder.Designer.cs b/Aberwyn/Migrations/20250524103706_AddPizzaOrder.Designer.cs deleted file mode 100644 index 0a9bd2a..0000000 --- a/Aberwyn/Migrations/20250524103706_AddPizzaOrder.Designer.cs +++ /dev/null @@ -1,403 +0,0 @@ -ï»ż// -using System; -using Aberwyn.Data; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; - -#nullable disable - -namespace Aberwyn.Migrations -{ - [DbContext(typeof(ApplicationDbContext))] - [Migration("20250524103706_AddPizzaOrder")] - partial class AddPizzaOrder - { - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "6.0.36") - .HasAnnotation("Relational:MaxIdentifierLength", 64); - - modelBuilder.Entity("Aberwyn.Models.ApplicationUser", b => - { - b.Property("Id") - .HasColumnType("varchar(255)"); - - b.Property("AccessFailedCount") - .HasColumnType("int"); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken() - .HasColumnType("longtext"); - - b.Property("Email") - .HasMaxLength(256) - .HasColumnType("varchar(256)"); - - b.Property("EmailConfirmed") - .HasColumnType("tinyint(1)"); - - b.Property("LockoutEnabled") - .HasColumnType("tinyint(1)"); - - b.Property("LockoutEnd") - .HasColumnType("datetime(6)"); - - b.Property("NormalizedEmail") - .HasMaxLength(256) - .HasColumnType("varchar(256)"); - - b.Property("NormalizedUserName") - .HasMaxLength(256) - .HasColumnType("varchar(256)"); - - b.Property("PasswordHash") - .HasColumnType("longtext"); - - b.Property("PhoneNumber") - .HasColumnType("longtext"); - - b.Property("PhoneNumberConfirmed") - .HasColumnType("tinyint(1)"); - - b.Property("SecurityStamp") - .HasColumnType("longtext"); - - b.Property("TwoFactorEnabled") - .HasColumnType("tinyint(1)"); - - b.Property("UserName") - .HasMaxLength(256) - .HasColumnType("varchar(256)"); - - b.HasKey("Id"); - - b.HasIndex("NormalizedEmail") - .HasDatabaseName("EmailIndex"); - - b.HasIndex("NormalizedUserName") - .IsUnique() - .HasDatabaseName("UserNameIndex"); - - b.ToTable("AspNetUsers", (string)null); - }); - - modelBuilder.Entity("Aberwyn.Models.BudgetCategory", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - b.Property("BudgetPeriodId") - .HasColumnType("int"); - - b.Property("Color") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Order") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("BudgetPeriodId"); - - b.ToTable("BudgetCategories"); - }); - - modelBuilder.Entity("Aberwyn.Models.BudgetItem", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - b.Property("Amount") - .HasColumnType("decimal(65,30)"); - - b.Property("BudgetCategoryId") - .HasColumnType("int"); - - b.Property("IncludeInSummary") - .HasColumnType("tinyint(1)"); - - b.Property("IsExpense") - .HasColumnType("tinyint(1)"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Order") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("BudgetCategoryId"); - - b.ToTable("BudgetItems"); - }); - - modelBuilder.Entity("Aberwyn.Models.BudgetPeriod", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - b.Property("Month") - .HasColumnType("int"); - - b.Property("Order") - .HasColumnType("int"); - - b.Property("Year") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.ToTable("BudgetPeriods"); - }); - - modelBuilder.Entity("Aberwyn.Models.PushSubscriber", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - b.Property("Auth") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Endpoint") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("P256DH") - .IsRequired() - .HasColumnType("longtext"); - - b.HasKey("Id"); - - b.ToTable("PushSubscribers"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRole", b => - { - b.Property("Id") - .HasColumnType("varchar(255)"); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken() - .HasColumnType("longtext"); - - b.Property("Name") - .HasMaxLength(256) - .HasColumnType("varchar(256)"); - - b.Property("NormalizedName") - .HasMaxLength(256) - .HasColumnType("varchar(256)"); - - b.HasKey("Id"); - - b.HasIndex("NormalizedName") - .IsUnique() - .HasDatabaseName("RoleNameIndex"); - - b.ToTable("AspNetRoles", (string)null); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - b.Property("ClaimType") - .HasColumnType("longtext"); - - b.Property("ClaimValue") - .HasColumnType("longtext"); - - b.Property("RoleId") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.HasKey("Id"); - - b.HasIndex("RoleId"); - - b.ToTable("AspNetRoleClaims", (string)null); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - b.Property("ClaimType") - .HasColumnType("longtext"); - - b.Property("ClaimValue") - .HasColumnType("longtext"); - - b.Property("UserId") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.HasKey("Id"); - - b.HasIndex("UserId"); - - b.ToTable("AspNetUserClaims", (string)null); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => - { - b.Property("LoginProvider") - .HasColumnType("varchar(255)"); - - b.Property("ProviderKey") - .HasColumnType("varchar(255)"); - - b.Property("ProviderDisplayName") - .HasColumnType("longtext"); - - b.Property("UserId") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.HasKey("LoginProvider", "ProviderKey"); - - b.HasIndex("UserId"); - - b.ToTable("AspNetUserLogins", (string)null); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => - { - b.Property("UserId") - .HasColumnType("varchar(255)"); - - b.Property("RoleId") - .HasColumnType("varchar(255)"); - - b.HasKey("UserId", "RoleId"); - - b.HasIndex("RoleId"); - - b.ToTable("AspNetUserRoles", (string)null); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => - { - b.Property("UserId") - .HasColumnType("varchar(255)"); - - b.Property("LoginProvider") - .HasColumnType("varchar(255)"); - - b.Property("Name") - .HasColumnType("varchar(255)"); - - b.Property("Value") - .HasColumnType("longtext"); - - b.HasKey("UserId", "LoginProvider", "Name"); - - b.ToTable("AspNetUserTokens", (string)null); - }); - - modelBuilder.Entity("Aberwyn.Models.BudgetCategory", b => - { - b.HasOne("Aberwyn.Models.BudgetPeriod", "BudgetPeriod") - .WithMany("Categories") - .HasForeignKey("BudgetPeriodId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("BudgetPeriod"); - }); - - modelBuilder.Entity("Aberwyn.Models.BudgetItem", b => - { - b.HasOne("Aberwyn.Models.BudgetCategory", "BudgetCategory") - .WithMany("Items") - .HasForeignKey("BudgetCategoryId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("BudgetCategory"); - }); - - 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("Aberwyn.Models.ApplicationUser", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => - { - b.HasOne("Aberwyn.Models.ApplicationUser", 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("Aberwyn.Models.ApplicationUser", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => - { - b.HasOne("Aberwyn.Models.ApplicationUser", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Aberwyn.Models.BudgetCategory", b => - { - b.Navigation("Items"); - }); - - modelBuilder.Entity("Aberwyn.Models.BudgetPeriod", b => - { - b.Navigation("Categories"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/Aberwyn/Migrations/20250524103706_AddPizzaOrder.cs b/Aberwyn/Migrations/20250524103706_AddPizzaOrder.cs deleted file mode 100644 index 300b3bc..0000000 --- a/Aberwyn/Migrations/20250524103706_AddPizzaOrder.cs +++ /dev/null @@ -1,19 +0,0 @@ -ï»żusing Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Aberwyn.Migrations -{ - public partial class AddPizzaOrder : Migration - { - protected override void Up(MigrationBuilder migrationBuilder) - { - - } - - protected override void Down(MigrationBuilder migrationBuilder) - { - - } - } -} diff --git a/Aberwyn/Migrations/20250524121511_AddPizzaOrderTable.Designer.cs b/Aberwyn/Migrations/20250524121511_AddPizzaOrderTable.Designer.cs deleted file mode 100644 index dc88690..0000000 --- a/Aberwyn/Migrations/20250524121511_AddPizzaOrderTable.Designer.cs +++ /dev/null @@ -1,432 +0,0 @@ -ï»ż// -using System; -using Aberwyn.Data; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; - -#nullable disable - -namespace Aberwyn.Migrations -{ - [DbContext(typeof(ApplicationDbContext))] - [Migration("20250524121511_AddPizzaOrderTable")] - partial class AddPizzaOrderTable - { - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "6.0.36") - .HasAnnotation("Relational:MaxIdentifierLength", 64); - - modelBuilder.Entity("Aberwyn.Models.ApplicationUser", b => - { - b.Property("Id") - .HasColumnType("varchar(255)"); - - b.Property("AccessFailedCount") - .HasColumnType("int"); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken() - .HasColumnType("longtext"); - - b.Property("Email") - .HasMaxLength(256) - .HasColumnType("varchar(256)"); - - b.Property("EmailConfirmed") - .HasColumnType("tinyint(1)"); - - b.Property("LockoutEnabled") - .HasColumnType("tinyint(1)"); - - b.Property("LockoutEnd") - .HasColumnType("datetime(6)"); - - b.Property("NormalizedEmail") - .HasMaxLength(256) - .HasColumnType("varchar(256)"); - - b.Property("NormalizedUserName") - .HasMaxLength(256) - .HasColumnType("varchar(256)"); - - b.Property("PasswordHash") - .HasColumnType("longtext"); - - b.Property("PhoneNumber") - .HasColumnType("longtext"); - - b.Property("PhoneNumberConfirmed") - .HasColumnType("tinyint(1)"); - - b.Property("SecurityStamp") - .HasColumnType("longtext"); - - b.Property("TwoFactorEnabled") - .HasColumnType("tinyint(1)"); - - b.Property("UserName") - .HasMaxLength(256) - .HasColumnType("varchar(256)"); - - b.HasKey("Id"); - - b.HasIndex("NormalizedEmail") - .HasDatabaseName("EmailIndex"); - - b.HasIndex("NormalizedUserName") - .IsUnique() - .HasDatabaseName("UserNameIndex"); - - b.ToTable("AspNetUsers", (string)null); - }); - - modelBuilder.Entity("Aberwyn.Models.BudgetCategory", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - b.Property("BudgetPeriodId") - .HasColumnType("int"); - - b.Property("Color") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Order") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("BudgetPeriodId"); - - b.ToTable("BudgetCategories"); - }); - - modelBuilder.Entity("Aberwyn.Models.BudgetItem", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - b.Property("Amount") - .HasColumnType("decimal(65,30)"); - - b.Property("BudgetCategoryId") - .HasColumnType("int"); - - b.Property("IncludeInSummary") - .HasColumnType("tinyint(1)"); - - b.Property("IsExpense") - .HasColumnType("tinyint(1)"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Order") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("BudgetCategoryId"); - - b.ToTable("BudgetItems"); - }); - - modelBuilder.Entity("Aberwyn.Models.BudgetPeriod", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - b.Property("Month") - .HasColumnType("int"); - - b.Property("Order") - .HasColumnType("int"); - - b.Property("Year") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.ToTable("BudgetPeriods"); - }); - - modelBuilder.Entity("Aberwyn.Models.PizzaOrder", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - b.Property("CustomerName") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("IngredientsJson") - .HasColumnType("longtext"); - - b.Property("OrderedAt") - .HasColumnType("datetime(6)"); - - b.Property("PizzaName") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Status") - .IsRequired() - .HasColumnType("longtext"); - - b.HasKey("Id"); - - b.ToTable("PizzaOrders"); - }); - - modelBuilder.Entity("Aberwyn.Models.PushSubscriber", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - b.Property("Auth") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Endpoint") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("P256DH") - .IsRequired() - .HasColumnType("longtext"); - - b.HasKey("Id"); - - b.ToTable("PushSubscribers"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRole", b => - { - b.Property("Id") - .HasColumnType("varchar(255)"); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken() - .HasColumnType("longtext"); - - b.Property("Name") - .HasMaxLength(256) - .HasColumnType("varchar(256)"); - - b.Property("NormalizedName") - .HasMaxLength(256) - .HasColumnType("varchar(256)"); - - b.HasKey("Id"); - - b.HasIndex("NormalizedName") - .IsUnique() - .HasDatabaseName("RoleNameIndex"); - - b.ToTable("AspNetRoles", (string)null); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - b.Property("ClaimType") - .HasColumnType("longtext"); - - b.Property("ClaimValue") - .HasColumnType("longtext"); - - b.Property("RoleId") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.HasKey("Id"); - - b.HasIndex("RoleId"); - - b.ToTable("AspNetRoleClaims", (string)null); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - b.Property("ClaimType") - .HasColumnType("longtext"); - - b.Property("ClaimValue") - .HasColumnType("longtext"); - - b.Property("UserId") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.HasKey("Id"); - - b.HasIndex("UserId"); - - b.ToTable("AspNetUserClaims", (string)null); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => - { - b.Property("LoginProvider") - .HasColumnType("varchar(255)"); - - b.Property("ProviderKey") - .HasColumnType("varchar(255)"); - - b.Property("ProviderDisplayName") - .HasColumnType("longtext"); - - b.Property("UserId") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.HasKey("LoginProvider", "ProviderKey"); - - b.HasIndex("UserId"); - - b.ToTable("AspNetUserLogins", (string)null); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => - { - b.Property("UserId") - .HasColumnType("varchar(255)"); - - b.Property("RoleId") - .HasColumnType("varchar(255)"); - - b.HasKey("UserId", "RoleId"); - - b.HasIndex("RoleId"); - - b.ToTable("AspNetUserRoles", (string)null); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => - { - b.Property("UserId") - .HasColumnType("varchar(255)"); - - b.Property("LoginProvider") - .HasColumnType("varchar(255)"); - - b.Property("Name") - .HasColumnType("varchar(255)"); - - b.Property("Value") - .HasColumnType("longtext"); - - b.HasKey("UserId", "LoginProvider", "Name"); - - b.ToTable("AspNetUserTokens", (string)null); - }); - - modelBuilder.Entity("Aberwyn.Models.BudgetCategory", b => - { - b.HasOne("Aberwyn.Models.BudgetPeriod", "BudgetPeriod") - .WithMany("Categories") - .HasForeignKey("BudgetPeriodId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("BudgetPeriod"); - }); - - modelBuilder.Entity("Aberwyn.Models.BudgetItem", b => - { - b.HasOne("Aberwyn.Models.BudgetCategory", "BudgetCategory") - .WithMany("Items") - .HasForeignKey("BudgetCategoryId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("BudgetCategory"); - }); - - 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("Aberwyn.Models.ApplicationUser", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => - { - b.HasOne("Aberwyn.Models.ApplicationUser", 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("Aberwyn.Models.ApplicationUser", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => - { - b.HasOne("Aberwyn.Models.ApplicationUser", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Aberwyn.Models.BudgetCategory", b => - { - b.Navigation("Items"); - }); - - modelBuilder.Entity("Aberwyn.Models.BudgetPeriod", b => - { - b.Navigation("Categories"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/Aberwyn/Migrations/20250524121511_AddPizzaOrderTable.cs b/Aberwyn/Migrations/20250524121511_AddPizzaOrderTable.cs deleted file mode 100644 index ccd8b2f..0000000 --- a/Aberwyn/Migrations/20250524121511_AddPizzaOrderTable.cs +++ /dev/null @@ -1,42 +0,0 @@ -ï»żusing System; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Aberwyn.Migrations -{ - public partial class AddPizzaOrderTable : Migration - { - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.CreateTable( - name: "PizzaOrders", - columns: table => new - { - Id = table.Column(type: "int", nullable: false) - .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), - CustomerName = table.Column(type: "longtext", nullable: false) - .Annotation("MySql:CharSet", "utf8mb4"), - PizzaName = table.Column(type: "longtext", nullable: false) - .Annotation("MySql:CharSet", "utf8mb4"), - IngredientsJson = table.Column(type: "longtext", nullable: true) - .Annotation("MySql:CharSet", "utf8mb4"), - Status = table.Column(type: "longtext", nullable: false) - .Annotation("MySql:CharSet", "utf8mb4"), - OrderedAt = table.Column(type: "datetime(6)", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_PizzaOrders", x => x.Id); - }) - .Annotation("MySql:CharSet", "utf8mb4"); - } - - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropTable( - name: "PizzaOrders"); - } - } -} diff --git a/Aberwyn/Migrations/20250524173316_AddAppSettings.Designer.cs b/Aberwyn/Migrations/20250524173316_AddAppSettings.Designer.cs deleted file mode 100644 index 99fead8..0000000 --- a/Aberwyn/Migrations/20250524173316_AddAppSettings.Designer.cs +++ /dev/null @@ -1,451 +0,0 @@ -ï»ż// -using System; -using Aberwyn.Data; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; - -#nullable disable - -namespace Aberwyn.Migrations -{ - [DbContext(typeof(ApplicationDbContext))] - [Migration("20250524173316_AddAppSettings")] - partial class AddAppSettings - { - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "6.0.36") - .HasAnnotation("Relational:MaxIdentifierLength", 64); - - modelBuilder.Entity("Aberwyn.Models.ApplicationUser", b => - { - b.Property("Id") - .HasColumnType("varchar(255)"); - - b.Property("AccessFailedCount") - .HasColumnType("int"); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken() - .HasColumnType("longtext"); - - b.Property("Email") - .HasMaxLength(256) - .HasColumnType("varchar(256)"); - - b.Property("EmailConfirmed") - .HasColumnType("tinyint(1)"); - - b.Property("LockoutEnabled") - .HasColumnType("tinyint(1)"); - - b.Property("LockoutEnd") - .HasColumnType("datetime(6)"); - - b.Property("NormalizedEmail") - .HasMaxLength(256) - .HasColumnType("varchar(256)"); - - b.Property("NormalizedUserName") - .HasMaxLength(256) - .HasColumnType("varchar(256)"); - - b.Property("PasswordHash") - .HasColumnType("longtext"); - - b.Property("PhoneNumber") - .HasColumnType("longtext"); - - b.Property("PhoneNumberConfirmed") - .HasColumnType("tinyint(1)"); - - b.Property("SecurityStamp") - .HasColumnType("longtext"); - - b.Property("TwoFactorEnabled") - .HasColumnType("tinyint(1)"); - - b.Property("UserName") - .HasMaxLength(256) - .HasColumnType("varchar(256)"); - - b.HasKey("Id"); - - b.HasIndex("NormalizedEmail") - .HasDatabaseName("EmailIndex"); - - b.HasIndex("NormalizedUserName") - .IsUnique() - .HasDatabaseName("UserNameIndex"); - - b.ToTable("AspNetUsers", (string)null); - }); - - modelBuilder.Entity("Aberwyn.Models.AppSetting", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - b.Property("Key") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Value") - .IsRequired() - .HasColumnType("longtext"); - - b.HasKey("Id"); - - b.ToTable("AppSettings"); - }); - - modelBuilder.Entity("Aberwyn.Models.BudgetCategory", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - b.Property("BudgetPeriodId") - .HasColumnType("int"); - - b.Property("Color") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Order") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("BudgetPeriodId"); - - b.ToTable("BudgetCategories"); - }); - - modelBuilder.Entity("Aberwyn.Models.BudgetItem", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - b.Property("Amount") - .HasColumnType("decimal(65,30)"); - - b.Property("BudgetCategoryId") - .HasColumnType("int"); - - b.Property("IncludeInSummary") - .HasColumnType("tinyint(1)"); - - b.Property("IsExpense") - .HasColumnType("tinyint(1)"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Order") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("BudgetCategoryId"); - - b.ToTable("BudgetItems"); - }); - - modelBuilder.Entity("Aberwyn.Models.BudgetPeriod", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - b.Property("Month") - .HasColumnType("int"); - - b.Property("Order") - .HasColumnType("int"); - - b.Property("Year") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.ToTable("BudgetPeriods"); - }); - - modelBuilder.Entity("Aberwyn.Models.PizzaOrder", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - b.Property("CustomerName") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("IngredientsJson") - .HasColumnType("longtext"); - - b.Property("OrderedAt") - .HasColumnType("datetime(6)"); - - b.Property("PizzaName") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Status") - .IsRequired() - .HasColumnType("longtext"); - - b.HasKey("Id"); - - b.ToTable("PizzaOrders"); - }); - - modelBuilder.Entity("Aberwyn.Models.PushSubscriber", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - b.Property("Auth") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Endpoint") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("P256DH") - .IsRequired() - .HasColumnType("longtext"); - - b.HasKey("Id"); - - b.ToTable("PushSubscribers"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRole", b => - { - b.Property("Id") - .HasColumnType("varchar(255)"); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken() - .HasColumnType("longtext"); - - b.Property("Name") - .HasMaxLength(256) - .HasColumnType("varchar(256)"); - - b.Property("NormalizedName") - .HasMaxLength(256) - .HasColumnType("varchar(256)"); - - b.HasKey("Id"); - - b.HasIndex("NormalizedName") - .IsUnique() - .HasDatabaseName("RoleNameIndex"); - - b.ToTable("AspNetRoles", (string)null); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - b.Property("ClaimType") - .HasColumnType("longtext"); - - b.Property("ClaimValue") - .HasColumnType("longtext"); - - b.Property("RoleId") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.HasKey("Id"); - - b.HasIndex("RoleId"); - - b.ToTable("AspNetRoleClaims", (string)null); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - b.Property("ClaimType") - .HasColumnType("longtext"); - - b.Property("ClaimValue") - .HasColumnType("longtext"); - - b.Property("UserId") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.HasKey("Id"); - - b.HasIndex("UserId"); - - b.ToTable("AspNetUserClaims", (string)null); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => - { - b.Property("LoginProvider") - .HasColumnType("varchar(255)"); - - b.Property("ProviderKey") - .HasColumnType("varchar(255)"); - - b.Property("ProviderDisplayName") - .HasColumnType("longtext"); - - b.Property("UserId") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.HasKey("LoginProvider", "ProviderKey"); - - b.HasIndex("UserId"); - - b.ToTable("AspNetUserLogins", (string)null); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => - { - b.Property("UserId") - .HasColumnType("varchar(255)"); - - b.Property("RoleId") - .HasColumnType("varchar(255)"); - - b.HasKey("UserId", "RoleId"); - - b.HasIndex("RoleId"); - - b.ToTable("AspNetUserRoles", (string)null); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => - { - b.Property("UserId") - .HasColumnType("varchar(255)"); - - b.Property("LoginProvider") - .HasColumnType("varchar(255)"); - - b.Property("Name") - .HasColumnType("varchar(255)"); - - b.Property("Value") - .HasColumnType("longtext"); - - b.HasKey("UserId", "LoginProvider", "Name"); - - b.ToTable("AspNetUserTokens", (string)null); - }); - - modelBuilder.Entity("Aberwyn.Models.BudgetCategory", b => - { - b.HasOne("Aberwyn.Models.BudgetPeriod", "BudgetPeriod") - .WithMany("Categories") - .HasForeignKey("BudgetPeriodId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("BudgetPeriod"); - }); - - modelBuilder.Entity("Aberwyn.Models.BudgetItem", b => - { - b.HasOne("Aberwyn.Models.BudgetCategory", "BudgetCategory") - .WithMany("Items") - .HasForeignKey("BudgetCategoryId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("BudgetCategory"); - }); - - 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("Aberwyn.Models.ApplicationUser", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => - { - b.HasOne("Aberwyn.Models.ApplicationUser", 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("Aberwyn.Models.ApplicationUser", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => - { - b.HasOne("Aberwyn.Models.ApplicationUser", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Aberwyn.Models.BudgetCategory", b => - { - b.Navigation("Items"); - }); - - modelBuilder.Entity("Aberwyn.Models.BudgetPeriod", b => - { - b.Navigation("Categories"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/Aberwyn/Migrations/20250524173316_AddAppSettings.cs b/Aberwyn/Migrations/20250524173316_AddAppSettings.cs deleted file mode 100644 index 4b323c4..0000000 --- a/Aberwyn/Migrations/20250524173316_AddAppSettings.cs +++ /dev/null @@ -1,36 +0,0 @@ -ï»żusing Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Aberwyn.Migrations -{ - public partial class AddAppSettings : Migration - { - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.CreateTable( - name: "AppSettings", - columns: table => new - { - Id = table.Column(type: "int", nullable: false) - .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), - Key = table.Column(type: "longtext", nullable: false) - .Annotation("MySql:CharSet", "utf8mb4"), - Value = table.Column(type: "longtext", nullable: false) - .Annotation("MySql:CharSet", "utf8mb4") - }, - constraints: table => - { - table.PrimaryKey("PK_AppSettings", x => x.Id); - }) - .Annotation("MySql:CharSet", "utf8mb4"); - } - - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropTable( - name: "AppSettings"); - } - } -} diff --git a/Aberwyn/Migrations/20250526121643_AddBudgetDefinitions.Designer.cs b/Aberwyn/Migrations/20250526121643_AddBudgetDefinitions.Designer.cs deleted file mode 100644 index 00293c1..0000000 --- a/Aberwyn/Migrations/20250526121643_AddBudgetDefinitions.Designer.cs +++ /dev/null @@ -1,516 +0,0 @@ -ï»ż// -using System; -using Aberwyn.Data; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; - -#nullable disable - -namespace Aberwyn.Migrations -{ - [DbContext(typeof(ApplicationDbContext))] - [Migration("20250526121643_AddBudgetDefinitions")] - partial class AddBudgetDefinitions - { - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "6.0.36") - .HasAnnotation("Relational:MaxIdentifierLength", 64); - - modelBuilder.Entity("Aberwyn.Models.ApplicationUser", b => - { - b.Property("Id") - .HasColumnType("varchar(255)"); - - b.Property("AccessFailedCount") - .HasColumnType("int"); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken() - .HasColumnType("longtext"); - - b.Property("Email") - .HasMaxLength(256) - .HasColumnType("varchar(256)"); - - b.Property("EmailConfirmed") - .HasColumnType("tinyint(1)"); - - b.Property("LockoutEnabled") - .HasColumnType("tinyint(1)"); - - b.Property("LockoutEnd") - .HasColumnType("datetime(6)"); - - b.Property("NormalizedEmail") - .HasMaxLength(256) - .HasColumnType("varchar(256)"); - - b.Property("NormalizedUserName") - .HasMaxLength(256) - .HasColumnType("varchar(256)"); - - b.Property("PasswordHash") - .HasColumnType("longtext"); - - b.Property("PhoneNumber") - .HasColumnType("longtext"); - - b.Property("PhoneNumberConfirmed") - .HasColumnType("tinyint(1)"); - - b.Property("SecurityStamp") - .HasColumnType("longtext"); - - b.Property("TwoFactorEnabled") - .HasColumnType("tinyint(1)"); - - b.Property("UserName") - .HasMaxLength(256) - .HasColumnType("varchar(256)"); - - b.HasKey("Id"); - - b.HasIndex("NormalizedEmail") - .HasDatabaseName("EmailIndex"); - - b.HasIndex("NormalizedUserName") - .IsUnique() - .HasDatabaseName("UserNameIndex"); - - b.ToTable("AspNetUsers", (string)null); - }); - - modelBuilder.Entity("Aberwyn.Models.AppSetting", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - b.Property("Key") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Value") - .IsRequired() - .HasColumnType("longtext"); - - b.HasKey("Id"); - - b.ToTable("AppSettings"); - }); - - modelBuilder.Entity("Aberwyn.Models.BudgetCategory", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - b.Property("BudgetCategoryDefinitionId") - .HasColumnType("int"); - - b.Property("BudgetPeriodId") - .HasColumnType("int"); - - b.Property("Color") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Order") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("BudgetCategoryDefinitionId"); - - b.HasIndex("BudgetPeriodId"); - - b.ToTable("BudgetCategories"); - }); - - modelBuilder.Entity("Aberwyn.Models.BudgetCategoryDefinition", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - b.Property("Color") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.HasKey("Id"); - - b.ToTable("BudgetCategoryDefinition"); - }); - - modelBuilder.Entity("Aberwyn.Models.BudgetItem", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - b.Property("Amount") - .HasColumnType("decimal(65,30)"); - - b.Property("BudgetCategoryId") - .HasColumnType("int"); - - b.Property("BudgetItemDefinitionId") - .HasColumnType("int"); - - b.Property("IncludeInSummary") - .HasColumnType("tinyint(1)"); - - b.Property("IsExpense") - .HasColumnType("tinyint(1)"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Order") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("BudgetCategoryId"); - - b.HasIndex("BudgetItemDefinitionId"); - - b.ToTable("BudgetItems"); - }); - - modelBuilder.Entity("Aberwyn.Models.BudgetItemDefinition", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - b.Property("DefaultCategory") - .HasColumnType("longtext"); - - b.Property("IncludeInSummary") - .HasColumnType("tinyint(1)"); - - b.Property("IsExpense") - .HasColumnType("tinyint(1)"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.HasKey("Id"); - - b.ToTable("BudgetItemDefinition"); - }); - - modelBuilder.Entity("Aberwyn.Models.BudgetPeriod", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - b.Property("Month") - .HasColumnType("int"); - - b.Property("Order") - .HasColumnType("int"); - - b.Property("Year") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.ToTable("BudgetPeriods"); - }); - - modelBuilder.Entity("Aberwyn.Models.PizzaOrder", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - b.Property("CustomerName") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("IngredientsJson") - .HasColumnType("longtext"); - - b.Property("OrderedAt") - .HasColumnType("datetime(6)"); - - b.Property("PizzaName") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Status") - .IsRequired() - .HasColumnType("longtext"); - - b.HasKey("Id"); - - b.ToTable("PizzaOrders"); - }); - - modelBuilder.Entity("Aberwyn.Models.PushSubscriber", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - b.Property("Auth") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Endpoint") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("P256DH") - .IsRequired() - .HasColumnType("longtext"); - - b.HasKey("Id"); - - b.ToTable("PushSubscribers"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRole", b => - { - b.Property("Id") - .HasColumnType("varchar(255)"); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken() - .HasColumnType("longtext"); - - b.Property("Name") - .HasMaxLength(256) - .HasColumnType("varchar(256)"); - - b.Property("NormalizedName") - .HasMaxLength(256) - .HasColumnType("varchar(256)"); - - b.HasKey("Id"); - - b.HasIndex("NormalizedName") - .IsUnique() - .HasDatabaseName("RoleNameIndex"); - - b.ToTable("AspNetRoles", (string)null); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - b.Property("ClaimType") - .HasColumnType("longtext"); - - b.Property("ClaimValue") - .HasColumnType("longtext"); - - b.Property("RoleId") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.HasKey("Id"); - - b.HasIndex("RoleId"); - - b.ToTable("AspNetRoleClaims", (string)null); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - b.Property("ClaimType") - .HasColumnType("longtext"); - - b.Property("ClaimValue") - .HasColumnType("longtext"); - - b.Property("UserId") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.HasKey("Id"); - - b.HasIndex("UserId"); - - b.ToTable("AspNetUserClaims", (string)null); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => - { - b.Property("LoginProvider") - .HasColumnType("varchar(255)"); - - b.Property("ProviderKey") - .HasColumnType("varchar(255)"); - - b.Property("ProviderDisplayName") - .HasColumnType("longtext"); - - b.Property("UserId") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.HasKey("LoginProvider", "ProviderKey"); - - b.HasIndex("UserId"); - - b.ToTable("AspNetUserLogins", (string)null); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => - { - b.Property("UserId") - .HasColumnType("varchar(255)"); - - b.Property("RoleId") - .HasColumnType("varchar(255)"); - - b.HasKey("UserId", "RoleId"); - - b.HasIndex("RoleId"); - - b.ToTable("AspNetUserRoles", (string)null); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => - { - b.Property("UserId") - .HasColumnType("varchar(255)"); - - b.Property("LoginProvider") - .HasColumnType("varchar(255)"); - - b.Property("Name") - .HasColumnType("varchar(255)"); - - b.Property("Value") - .HasColumnType("longtext"); - - b.HasKey("UserId", "LoginProvider", "Name"); - - b.ToTable("AspNetUserTokens", (string)null); - }); - - modelBuilder.Entity("Aberwyn.Models.BudgetCategory", b => - { - b.HasOne("Aberwyn.Models.BudgetCategoryDefinition", "BudgetItemDefinition") - .WithMany() - .HasForeignKey("BudgetCategoryDefinitionId"); - - b.HasOne("Aberwyn.Models.BudgetPeriod", "BudgetPeriod") - .WithMany("Categories") - .HasForeignKey("BudgetPeriodId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("BudgetPeriod"); - - b.Navigation("BudgetItemDefinition"); - }); - - modelBuilder.Entity("Aberwyn.Models.BudgetItem", b => - { - b.HasOne("Aberwyn.Models.BudgetCategory", "BudgetCategory") - .WithMany("Items") - .HasForeignKey("BudgetCategoryId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Aberwyn.Models.BudgetItemDefinition", "BudgetItemDefinition") - .WithMany() - .HasForeignKey("BudgetItemDefinitionId"); - - b.Navigation("BudgetCategory"); - - b.Navigation("BudgetItemDefinition"); - }); - - 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("Aberwyn.Models.ApplicationUser", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => - { - b.HasOne("Aberwyn.Models.ApplicationUser", 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("Aberwyn.Models.ApplicationUser", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => - { - b.HasOne("Aberwyn.Models.ApplicationUser", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Aberwyn.Models.BudgetCategory", b => - { - b.Navigation("Items"); - }); - - modelBuilder.Entity("Aberwyn.Models.BudgetPeriod", b => - { - b.Navigation("Categories"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/Aberwyn/Migrations/20250526121643_AddBudgetDefinitions.cs b/Aberwyn/Migrations/20250526121643_AddBudgetDefinitions.cs deleted file mode 100644 index 9934288..0000000 --- a/Aberwyn/Migrations/20250526121643_AddBudgetDefinitions.cs +++ /dev/null @@ -1,118 +0,0 @@ -ï»żusing Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Aberwyn.Migrations -{ - public partial class AddBudgetDefinitions : Migration - { - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.AddColumn( - name: "BudgetItemDefinitionId", - table: "BudgetItems", - type: "int", - nullable: true); - - migrationBuilder.AddColumn( - name: "BudgetCategoryDefinitionId", - table: "BudgetCategories", - type: "int", - nullable: true); - - migrationBuilder.CreateTable( - name: "BudgetCategoryDefinition", - columns: table => new - { - Id = table.Column(type: "int", nullable: false) - .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), - Name = table.Column(type: "longtext", nullable: false) - .Annotation("MySql:CharSet", "utf8mb4"), - Color = table.Column(type: "longtext", nullable: false) - .Annotation("MySql:CharSet", "utf8mb4") - }, - constraints: table => - { - table.PrimaryKey("PK_BudgetCategoryDefinition", x => x.Id); - }) - .Annotation("MySql:CharSet", "utf8mb4"); - - migrationBuilder.CreateTable( - name: "BudgetItemDefinition", - columns: table => new - { - Id = table.Column(type: "int", nullable: false) - .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), - Name = table.Column(type: "longtext", nullable: false) - .Annotation("MySql:CharSet", "utf8mb4"), - DefaultCategory = table.Column(type: "longtext", nullable: true) - .Annotation("MySql:CharSet", "utf8mb4"), - IsExpense = table.Column(type: "tinyint(1)", nullable: false), - IncludeInSummary = table.Column(type: "tinyint(1)", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_BudgetItemDefinition", x => x.Id); - }) - .Annotation("MySql:CharSet", "utf8mb4"); - - migrationBuilder.CreateIndex( - name: "IX_BudgetItems_BudgetItemDefinitionId", - table: "BudgetItems", - column: "BudgetItemDefinitionId"); - - migrationBuilder.CreateIndex( - name: "IX_BudgetCategories_BudgetCategoryDefinitionId", - table: "BudgetCategories", - column: "BudgetCategoryDefinitionId"); - - migrationBuilder.AddForeignKey( - name: "FK_BudgetCategories_BudgetCategoryDefinition_BudgetCategoryDefi~", - table: "BudgetCategories", - column: "BudgetCategoryDefinitionId", - principalTable: "BudgetCategoryDefinition", - principalColumn: "Id"); - - migrationBuilder.AddForeignKey( - name: "FK_BudgetItems_BudgetItemDefinition_BudgetItemDefinitionId", - table: "BudgetItems", - column: "BudgetItemDefinitionId", - principalTable: "BudgetItemDefinition", - principalColumn: "Id"); - } - - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropForeignKey( - name: "FK_BudgetCategories_BudgetCategoryDefinition_BudgetCategoryDefi~", - table: "BudgetCategories"); - - migrationBuilder.DropForeignKey( - name: "FK_BudgetItems_BudgetItemDefinition_BudgetItemDefinitionId", - table: "BudgetItems"); - - migrationBuilder.DropTable( - name: "BudgetCategoryDefinition"); - - migrationBuilder.DropTable( - name: "BudgetItemDefinition"); - - migrationBuilder.DropIndex( - name: "IX_BudgetItems_BudgetItemDefinitionId", - table: "BudgetItems"); - - migrationBuilder.DropIndex( - name: "IX_BudgetCategories_BudgetCategoryDefinitionId", - table: "BudgetCategories"); - - migrationBuilder.DropColumn( - name: "BudgetItemDefinitionId", - table: "BudgetItems"); - - migrationBuilder.DropColumn( - name: "BudgetCategoryDefinitionId", - table: "BudgetCategories"); - } - } -} diff --git a/Aberwyn/Migrations/20250526133558_AddBudgetItemDefinitions.Designer.cs b/Aberwyn/Migrations/20250526133558_AddBudgetItemDefinitions.Designer.cs deleted file mode 100644 index d33f6bb..0000000 --- a/Aberwyn/Migrations/20250526133558_AddBudgetItemDefinitions.Designer.cs +++ /dev/null @@ -1,516 +0,0 @@ -ï»ż// -using System; -using Aberwyn.Data; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; - -#nullable disable - -namespace Aberwyn.Migrations -{ - [DbContext(typeof(ApplicationDbContext))] - [Migration("20250526133558_AddBudgetItemDefinitions")] - partial class AddBudgetItemDefinitions - { - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "6.0.36") - .HasAnnotation("Relational:MaxIdentifierLength", 64); - - modelBuilder.Entity("Aberwyn.Models.ApplicationUser", b => - { - b.Property("Id") - .HasColumnType("varchar(255)"); - - b.Property("AccessFailedCount") - .HasColumnType("int"); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken() - .HasColumnType("longtext"); - - b.Property("Email") - .HasMaxLength(256) - .HasColumnType("varchar(256)"); - - b.Property("EmailConfirmed") - .HasColumnType("tinyint(1)"); - - b.Property("LockoutEnabled") - .HasColumnType("tinyint(1)"); - - b.Property("LockoutEnd") - .HasColumnType("datetime(6)"); - - b.Property("NormalizedEmail") - .HasMaxLength(256) - .HasColumnType("varchar(256)"); - - b.Property("NormalizedUserName") - .HasMaxLength(256) - .HasColumnType("varchar(256)"); - - b.Property("PasswordHash") - .HasColumnType("longtext"); - - b.Property("PhoneNumber") - .HasColumnType("longtext"); - - b.Property("PhoneNumberConfirmed") - .HasColumnType("tinyint(1)"); - - b.Property("SecurityStamp") - .HasColumnType("longtext"); - - b.Property("TwoFactorEnabled") - .HasColumnType("tinyint(1)"); - - b.Property("UserName") - .HasMaxLength(256) - .HasColumnType("varchar(256)"); - - b.HasKey("Id"); - - b.HasIndex("NormalizedEmail") - .HasDatabaseName("EmailIndex"); - - b.HasIndex("NormalizedUserName") - .IsUnique() - .HasDatabaseName("UserNameIndex"); - - b.ToTable("AspNetUsers", (string)null); - }); - - modelBuilder.Entity("Aberwyn.Models.AppSetting", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - b.Property("Key") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Value") - .IsRequired() - .HasColumnType("longtext"); - - b.HasKey("Id"); - - b.ToTable("AppSettings"); - }); - - modelBuilder.Entity("Aberwyn.Models.BudgetCategory", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - b.Property("BudgetCategoryDefinitionId") - .HasColumnType("int"); - - b.Property("BudgetPeriodId") - .HasColumnType("int"); - - b.Property("Color") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Order") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("BudgetCategoryDefinitionId"); - - b.HasIndex("BudgetPeriodId"); - - b.ToTable("BudgetCategories"); - }); - - modelBuilder.Entity("Aberwyn.Models.BudgetCategoryDefinition", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - b.Property("Color") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.HasKey("Id"); - - b.ToTable("BudgetCategoryDefinitions"); - }); - - modelBuilder.Entity("Aberwyn.Models.BudgetItem", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - b.Property("Amount") - .HasColumnType("decimal(65,30)"); - - b.Property("BudgetCategoryId") - .HasColumnType("int"); - - b.Property("BudgetItemDefinitionId") - .HasColumnType("int"); - - b.Property("IncludeInSummary") - .HasColumnType("tinyint(1)"); - - b.Property("IsExpense") - .HasColumnType("tinyint(1)"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Order") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("BudgetCategoryId"); - - b.HasIndex("BudgetItemDefinitionId"); - - b.ToTable("BudgetItems"); - }); - - modelBuilder.Entity("Aberwyn.Models.BudgetItemDefinition", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - b.Property("DefaultCategory") - .HasColumnType("longtext"); - - b.Property("IncludeInSummary") - .HasColumnType("tinyint(1)"); - - b.Property("IsExpense") - .HasColumnType("tinyint(1)"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.HasKey("Id"); - - b.ToTable("BudgetItemDefinitions"); - }); - - modelBuilder.Entity("Aberwyn.Models.BudgetPeriod", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - b.Property("Month") - .HasColumnType("int"); - - b.Property("Order") - .HasColumnType("int"); - - b.Property("Year") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.ToTable("BudgetPeriods"); - }); - - modelBuilder.Entity("Aberwyn.Models.PizzaOrder", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - b.Property("CustomerName") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("IngredientsJson") - .HasColumnType("longtext"); - - b.Property("OrderedAt") - .HasColumnType("datetime(6)"); - - b.Property("PizzaName") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Status") - .IsRequired() - .HasColumnType("longtext"); - - b.HasKey("Id"); - - b.ToTable("PizzaOrders"); - }); - - modelBuilder.Entity("Aberwyn.Models.PushSubscriber", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - b.Property("Auth") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Endpoint") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("P256DH") - .IsRequired() - .HasColumnType("longtext"); - - b.HasKey("Id"); - - b.ToTable("PushSubscribers"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRole", b => - { - b.Property("Id") - .HasColumnType("varchar(255)"); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken() - .HasColumnType("longtext"); - - b.Property("Name") - .HasMaxLength(256) - .HasColumnType("varchar(256)"); - - b.Property("NormalizedName") - .HasMaxLength(256) - .HasColumnType("varchar(256)"); - - b.HasKey("Id"); - - b.HasIndex("NormalizedName") - .IsUnique() - .HasDatabaseName("RoleNameIndex"); - - b.ToTable("AspNetRoles", (string)null); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - b.Property("ClaimType") - .HasColumnType("longtext"); - - b.Property("ClaimValue") - .HasColumnType("longtext"); - - b.Property("RoleId") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.HasKey("Id"); - - b.HasIndex("RoleId"); - - b.ToTable("AspNetRoleClaims", (string)null); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - b.Property("ClaimType") - .HasColumnType("longtext"); - - b.Property("ClaimValue") - .HasColumnType("longtext"); - - b.Property("UserId") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.HasKey("Id"); - - b.HasIndex("UserId"); - - b.ToTable("AspNetUserClaims", (string)null); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => - { - b.Property("LoginProvider") - .HasColumnType("varchar(255)"); - - b.Property("ProviderKey") - .HasColumnType("varchar(255)"); - - b.Property("ProviderDisplayName") - .HasColumnType("longtext"); - - b.Property("UserId") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.HasKey("LoginProvider", "ProviderKey"); - - b.HasIndex("UserId"); - - b.ToTable("AspNetUserLogins", (string)null); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => - { - b.Property("UserId") - .HasColumnType("varchar(255)"); - - b.Property("RoleId") - .HasColumnType("varchar(255)"); - - b.HasKey("UserId", "RoleId"); - - b.HasIndex("RoleId"); - - b.ToTable("AspNetUserRoles", (string)null); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => - { - b.Property("UserId") - .HasColumnType("varchar(255)"); - - b.Property("LoginProvider") - .HasColumnType("varchar(255)"); - - b.Property("Name") - .HasColumnType("varchar(255)"); - - b.Property("Value") - .HasColumnType("longtext"); - - b.HasKey("UserId", "LoginProvider", "Name"); - - b.ToTable("AspNetUserTokens", (string)null); - }); - - modelBuilder.Entity("Aberwyn.Models.BudgetCategory", b => - { - b.HasOne("Aberwyn.Models.BudgetCategoryDefinition", "BudgetItemDefinition") - .WithMany() - .HasForeignKey("BudgetCategoryDefinitionId"); - - b.HasOne("Aberwyn.Models.BudgetPeriod", "BudgetPeriod") - .WithMany("Categories") - .HasForeignKey("BudgetPeriodId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("BudgetPeriod"); - - b.Navigation("BudgetItemDefinition"); - }); - - modelBuilder.Entity("Aberwyn.Models.BudgetItem", b => - { - b.HasOne("Aberwyn.Models.BudgetCategory", "BudgetCategory") - .WithMany("Items") - .HasForeignKey("BudgetCategoryId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Aberwyn.Models.BudgetItemDefinition", "BudgetItemDefinition") - .WithMany() - .HasForeignKey("BudgetItemDefinitionId"); - - b.Navigation("BudgetCategory"); - - b.Navigation("BudgetItemDefinition"); - }); - - 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("Aberwyn.Models.ApplicationUser", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => - { - b.HasOne("Aberwyn.Models.ApplicationUser", 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("Aberwyn.Models.ApplicationUser", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => - { - b.HasOne("Aberwyn.Models.ApplicationUser", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Aberwyn.Models.BudgetCategory", b => - { - b.Navigation("Items"); - }); - - modelBuilder.Entity("Aberwyn.Models.BudgetPeriod", b => - { - b.Navigation("Categories"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/Aberwyn/Migrations/20250526133558_AddBudgetItemDefinitions.cs b/Aberwyn/Migrations/20250526133558_AddBudgetItemDefinitions.cs deleted file mode 100644 index c5c25e5..0000000 --- a/Aberwyn/Migrations/20250526133558_AddBudgetItemDefinitions.cs +++ /dev/null @@ -1,111 +0,0 @@ -ï»żusing Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Aberwyn.Migrations -{ - public partial class AddBudgetItemDefinitions : Migration - { - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropForeignKey( - name: "FK_BudgetCategories_BudgetCategoryDefinition_BudgetCategoryDefi~", - table: "BudgetCategories"); - - migrationBuilder.DropForeignKey( - name: "FK_BudgetItems_BudgetItemDefinition_BudgetItemDefinitionId", - table: "BudgetItems"); - - migrationBuilder.DropPrimaryKey( - name: "PK_BudgetItemDefinition", - table: "BudgetItemDefinition"); - - migrationBuilder.DropPrimaryKey( - name: "PK_BudgetCategoryDefinition", - table: "BudgetCategoryDefinition"); - - migrationBuilder.RenameTable( - name: "BudgetItemDefinition", - newName: "BudgetItemDefinitions"); - - migrationBuilder.RenameTable( - name: "BudgetCategoryDefinition", - newName: "BudgetCategoryDefinitions"); - - migrationBuilder.AddPrimaryKey( - name: "PK_BudgetItemDefinitions", - table: "BudgetItemDefinitions", - column: "Id"); - - migrationBuilder.AddPrimaryKey( - name: "PK_BudgetCategoryDefinitions", - table: "BudgetCategoryDefinitions", - column: "Id"); - - migrationBuilder.AddForeignKey( - name: "FK_BudgetCategories_BudgetCategoryDefinitions_BudgetCategoryDef~", - table: "BudgetCategories", - column: "BudgetCategoryDefinitionId", - principalTable: "BudgetCategoryDefinitions", - principalColumn: "Id"); - - migrationBuilder.AddForeignKey( - name: "FK_BudgetItems_BudgetItemDefinitions_BudgetItemDefinitionId", - table: "BudgetItems", - column: "BudgetItemDefinitionId", - principalTable: "BudgetItemDefinitions", - principalColumn: "Id"); - } - - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropForeignKey( - name: "FK_BudgetCategories_BudgetCategoryDefinitions_BudgetCategoryDef~", - table: "BudgetCategories"); - - migrationBuilder.DropForeignKey( - name: "FK_BudgetItems_BudgetItemDefinitions_BudgetItemDefinitionId", - table: "BudgetItems"); - - migrationBuilder.DropPrimaryKey( - name: "PK_BudgetItemDefinitions", - table: "BudgetItemDefinitions"); - - migrationBuilder.DropPrimaryKey( - name: "PK_BudgetCategoryDefinitions", - table: "BudgetCategoryDefinitions"); - - migrationBuilder.RenameTable( - name: "BudgetItemDefinitions", - newName: "BudgetItemDefinition"); - - migrationBuilder.RenameTable( - name: "BudgetCategoryDefinitions", - newName: "BudgetCategoryDefinition"); - - migrationBuilder.AddPrimaryKey( - name: "PK_BudgetItemDefinition", - table: "BudgetItemDefinition", - column: "Id"); - - migrationBuilder.AddPrimaryKey( - name: "PK_BudgetCategoryDefinition", - table: "BudgetCategoryDefinition", - column: "Id"); - - migrationBuilder.AddForeignKey( - name: "FK_BudgetCategories_BudgetCategoryDefinition_BudgetCategoryDefi~", - table: "BudgetCategories", - column: "BudgetCategoryDefinitionId", - principalTable: "BudgetCategoryDefinition", - principalColumn: "Id"); - - migrationBuilder.AddForeignKey( - name: "FK_BudgetItems_BudgetItemDefinition_BudgetItemDefinitionId", - table: "BudgetItems", - column: "BudgetItemDefinitionId", - principalTable: "BudgetItemDefinition", - principalColumn: "Id"); - } - } -} diff --git a/Aberwyn/Migrations/20250529183339_CreateTodoTaskTable.Designer.cs b/Aberwyn/Migrations/20250529183339_CreateTodoTaskTable.Designer.cs deleted file mode 100644 index bb3d0d3..0000000 --- a/Aberwyn/Migrations/20250529183339_CreateTodoTaskTable.Designer.cs +++ /dev/null @@ -1,541 +0,0 @@ -ï»ż// -using System; -using Aberwyn.Data; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; - -#nullable disable - -namespace Aberwyn.Migrations -{ - [DbContext(typeof(ApplicationDbContext))] - [Migration("20250529183339_CreateTodoTaskTable")] - partial class CreateTodoTaskTable - { - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "6.0.36") - .HasAnnotation("Relational:MaxIdentifierLength", 64); - - modelBuilder.Entity("Aberwyn.Models.ApplicationUser", b => - { - b.Property("Id") - .HasColumnType("varchar(255)"); - - b.Property("AccessFailedCount") - .HasColumnType("int"); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken() - .HasColumnType("longtext"); - - b.Property("Email") - .HasMaxLength(256) - .HasColumnType("varchar(256)"); - - b.Property("EmailConfirmed") - .HasColumnType("tinyint(1)"); - - b.Property("LockoutEnabled") - .HasColumnType("tinyint(1)"); - - b.Property("LockoutEnd") - .HasColumnType("datetime(6)"); - - b.Property("NormalizedEmail") - .HasMaxLength(256) - .HasColumnType("varchar(256)"); - - b.Property("NormalizedUserName") - .HasMaxLength(256) - .HasColumnType("varchar(256)"); - - b.Property("PasswordHash") - .HasColumnType("longtext"); - - b.Property("PhoneNumber") - .HasColumnType("longtext"); - - b.Property("PhoneNumberConfirmed") - .HasColumnType("tinyint(1)"); - - b.Property("SecurityStamp") - .HasColumnType("longtext"); - - b.Property("TwoFactorEnabled") - .HasColumnType("tinyint(1)"); - - b.Property("UserName") - .HasMaxLength(256) - .HasColumnType("varchar(256)"); - - b.HasKey("Id"); - - b.HasIndex("NormalizedEmail") - .HasDatabaseName("EmailIndex"); - - b.HasIndex("NormalizedUserName") - .IsUnique() - .HasDatabaseName("UserNameIndex"); - - b.ToTable("AspNetUsers", (string)null); - }); - - modelBuilder.Entity("Aberwyn.Models.AppSetting", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - b.Property("Key") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Value") - .IsRequired() - .HasColumnType("longtext"); - - b.HasKey("Id"); - - b.ToTable("AppSettings"); - }); - - modelBuilder.Entity("Aberwyn.Models.BudgetCategory", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - b.Property("BudgetCategoryDefinitionId") - .HasColumnType("int"); - - b.Property("BudgetPeriodId") - .HasColumnType("int"); - - b.Property("Color") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Order") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("BudgetCategoryDefinitionId"); - - b.HasIndex("BudgetPeriodId"); - - b.ToTable("BudgetCategories"); - }); - - modelBuilder.Entity("Aberwyn.Models.BudgetCategoryDefinition", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - b.Property("Color") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.HasKey("Id"); - - b.ToTable("BudgetCategoryDefinitions"); - }); - - modelBuilder.Entity("Aberwyn.Models.BudgetItem", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - b.Property("Amount") - .HasColumnType("decimal(65,30)"); - - b.Property("BudgetCategoryId") - .HasColumnType("int"); - - b.Property("BudgetItemDefinitionId") - .HasColumnType("int"); - - b.Property("IncludeInSummary") - .HasColumnType("tinyint(1)"); - - b.Property("IsExpense") - .HasColumnType("tinyint(1)"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Order") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("BudgetCategoryId"); - - b.HasIndex("BudgetItemDefinitionId"); - - b.ToTable("BudgetItems"); - }); - - modelBuilder.Entity("Aberwyn.Models.BudgetItemDefinition", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - b.Property("DefaultCategory") - .HasColumnType("longtext"); - - b.Property("IncludeInSummary") - .HasColumnType("tinyint(1)"); - - b.Property("IsExpense") - .HasColumnType("tinyint(1)"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.HasKey("Id"); - - b.ToTable("BudgetItemDefinitions"); - }); - - modelBuilder.Entity("Aberwyn.Models.BudgetPeriod", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - b.Property("Month") - .HasColumnType("int"); - - b.Property("Order") - .HasColumnType("int"); - - b.Property("Year") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.ToTable("BudgetPeriods"); - }); - - modelBuilder.Entity("Aberwyn.Models.PizzaOrder", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - b.Property("CustomerName") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("IngredientsJson") - .HasColumnType("longtext"); - - b.Property("OrderedAt") - .HasColumnType("datetime(6)"); - - b.Property("PizzaName") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Status") - .IsRequired() - .HasColumnType("longtext"); - - b.HasKey("Id"); - - b.ToTable("PizzaOrders"); - }); - - modelBuilder.Entity("Aberwyn.Models.PushSubscriber", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - b.Property("Auth") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Endpoint") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("P256DH") - .IsRequired() - .HasColumnType("longtext"); - - b.HasKey("Id"); - - b.ToTable("PushSubscribers"); - }); - - modelBuilder.Entity("Aberwyn.Models.TodoTask", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - b.Property("CreatedAt") - .HasColumnType("datetime(6)"); - - b.Property("Priority") - .HasColumnType("int"); - - b.Property("Status") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Title") - .IsRequired() - .HasColumnType("longtext"); - - b.HasKey("Id"); - - b.ToTable("TodoTasks"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRole", b => - { - b.Property("Id") - .HasColumnType("varchar(255)"); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken() - .HasColumnType("longtext"); - - b.Property("Name") - .HasMaxLength(256) - .HasColumnType("varchar(256)"); - - b.Property("NormalizedName") - .HasMaxLength(256) - .HasColumnType("varchar(256)"); - - b.HasKey("Id"); - - b.HasIndex("NormalizedName") - .IsUnique() - .HasDatabaseName("RoleNameIndex"); - - b.ToTable("AspNetRoles", (string)null); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - b.Property("ClaimType") - .HasColumnType("longtext"); - - b.Property("ClaimValue") - .HasColumnType("longtext"); - - b.Property("RoleId") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.HasKey("Id"); - - b.HasIndex("RoleId"); - - b.ToTable("AspNetRoleClaims", (string)null); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - b.Property("ClaimType") - .HasColumnType("longtext"); - - b.Property("ClaimValue") - .HasColumnType("longtext"); - - b.Property("UserId") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.HasKey("Id"); - - b.HasIndex("UserId"); - - b.ToTable("AspNetUserClaims", (string)null); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => - { - b.Property("LoginProvider") - .HasColumnType("varchar(255)"); - - b.Property("ProviderKey") - .HasColumnType("varchar(255)"); - - b.Property("ProviderDisplayName") - .HasColumnType("longtext"); - - b.Property("UserId") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.HasKey("LoginProvider", "ProviderKey"); - - b.HasIndex("UserId"); - - b.ToTable("AspNetUserLogins", (string)null); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => - { - b.Property("UserId") - .HasColumnType("varchar(255)"); - - b.Property("RoleId") - .HasColumnType("varchar(255)"); - - b.HasKey("UserId", "RoleId"); - - b.HasIndex("RoleId"); - - b.ToTable("AspNetUserRoles", (string)null); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => - { - b.Property("UserId") - .HasColumnType("varchar(255)"); - - b.Property("LoginProvider") - .HasColumnType("varchar(255)"); - - b.Property("Name") - .HasColumnType("varchar(255)"); - - b.Property("Value") - .HasColumnType("longtext"); - - b.HasKey("UserId", "LoginProvider", "Name"); - - b.ToTable("AspNetUserTokens", (string)null); - }); - - modelBuilder.Entity("Aberwyn.Models.BudgetCategory", b => - { - b.HasOne("Aberwyn.Models.BudgetCategoryDefinition", "Definition") - .WithMany() - .HasForeignKey("BudgetCategoryDefinitionId"); - - b.HasOne("Aberwyn.Models.BudgetPeriod", "BudgetPeriod") - .WithMany("Categories") - .HasForeignKey("BudgetPeriodId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("BudgetPeriod"); - - b.Navigation("Definition"); - }); - - modelBuilder.Entity("Aberwyn.Models.BudgetItem", b => - { - b.HasOne("Aberwyn.Models.BudgetCategory", "BudgetCategory") - .WithMany("Items") - .HasForeignKey("BudgetCategoryId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Aberwyn.Models.BudgetItemDefinition", "BudgetItemDefinition") - .WithMany() - .HasForeignKey("BudgetItemDefinitionId"); - - b.Navigation("BudgetCategory"); - - b.Navigation("BudgetItemDefinition"); - }); - - 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("Aberwyn.Models.ApplicationUser", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => - { - b.HasOne("Aberwyn.Models.ApplicationUser", 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("Aberwyn.Models.ApplicationUser", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => - { - b.HasOne("Aberwyn.Models.ApplicationUser", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Aberwyn.Models.BudgetCategory", b => - { - b.Navigation("Items"); - }); - - modelBuilder.Entity("Aberwyn.Models.BudgetPeriod", b => - { - b.Navigation("Categories"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/Aberwyn/Migrations/20250529183339_CreateTodoTaskTable.cs b/Aberwyn/Migrations/20250529183339_CreateTodoTaskTable.cs deleted file mode 100644 index 6bec37e..0000000 --- a/Aberwyn/Migrations/20250529183339_CreateTodoTaskTable.cs +++ /dev/null @@ -1,39 +0,0 @@ -ï»żusing System; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Aberwyn.Migrations -{ - public partial class CreateTodoTaskTable : Migration - { - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.CreateTable( - name: "TodoTasks", - columns: table => new - { - Id = table.Column(type: "int", nullable: false) - .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), - Title = table.Column(type: "longtext", nullable: false) - .Annotation("MySql:CharSet", "utf8mb4"), - Status = table.Column(type: "longtext", nullable: false) - .Annotation("MySql:CharSet", "utf8mb4"), - CreatedAt = table.Column(type: "datetime(6)", nullable: false), - Priority = table.Column(type: "int", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_TodoTasks", x => x.Id); - }) - .Annotation("MySql:CharSet", "utf8mb4"); - } - - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropTable( - name: "TodoTasks"); - } - } -} diff --git a/Aberwyn/Migrations/20250531220325_AddMealsToEf.cs b/Aberwyn/Migrations/20250531220325_AddMealsToEf.cs deleted file mode 100644 index 5b0694a..0000000 --- a/Aberwyn/Migrations/20250531220325_AddMealsToEf.cs +++ /dev/null @@ -1,117 +0,0 @@ -ï»żusing System; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Aberwyn.Migrations -{ - public partial class AddMealsToEf : Migration - { - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.CreateTable( - name: "Meals", - columns: table => new - { - Id = table.Column(type: "int", nullable: false) - .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), - Name = table.Column(type: "longtext", nullable: false) - .Annotation("MySql:CharSet", "utf8mb4"), - Description = table.Column(type: "longtext", nullable: false) - .Annotation("MySql:CharSet", "utf8mb4"), - ProteinType = table.Column(type: "longtext", nullable: false) - .Annotation("MySql:CharSet", "utf8mb4"), - Category = table.Column(type: "longtext", nullable: false) - .Annotation("MySql:CharSet", "utf8mb4"), - CarbType = table.Column(type: "longtext", nullable: false) - .Annotation("MySql:CharSet", "utf8mb4"), - RecipeUrl = table.Column(type: "longtext", nullable: false) - .Annotation("MySql:CharSet", "utf8mb4"), - ImageUrl = table.Column(type: "longtext", nullable: false) - .Annotation("MySql:CharSet", "utf8mb4"), - IsAvailable = table.Column(type: "tinyint(1)", nullable: false), - CreatedAt = table.Column(type: "datetime(6)", nullable: false), - ImageData = table.Column(type: "longblob", nullable: false), - ImageMimeType = table.Column(type: "longtext", nullable: false) - .Annotation("MySql:CharSet", "utf8mb4"), - Instructions = table.Column(type: "longtext", nullable: false) - .Annotation("MySql:CharSet", "utf8mb4") - }, - constraints: table => - { - table.PrimaryKey("PK_Meals", x => x.Id); - }) - .Annotation("MySql:CharSet", "utf8mb4"); - - migrationBuilder.CreateTable( - name: "WeeklyMenus", - columns: table => new - { - Id = table.Column(type: "int", nullable: false) - .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), - DayOfWeek = table.Column(type: "int", nullable: false), - BreakfastMealId = table.Column(type: "int", nullable: true), - LunchMealId = table.Column(type: "int", nullable: true), - DinnerMealId = table.Column(type: "int", nullable: true), - Cook = table.Column(type: "longtext", nullable: false) - .Annotation("MySql:CharSet", "utf8mb4"), - WeekNumber = table.Column(type: "int", nullable: false), - Year = table.Column(type: "int", nullable: false), - BreakfastMealName = table.Column(type: "longtext", nullable: false) - .Annotation("MySql:CharSet", "utf8mb4"), - LunchMealName = table.Column(type: "longtext", nullable: false) - .Annotation("MySql:CharSet", "utf8mb4"), - DinnerMealName = table.Column(type: "longtext", nullable: false) - .Annotation("MySql:CharSet", "utf8mb4"), - Date = table.Column(type: "datetime(6)", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_WeeklyMenus", x => x.Id); - }) - .Annotation("MySql:CharSet", "utf8mb4"); - - migrationBuilder.CreateTable( - name: "Ingredients", - columns: table => new - { - Id = table.Column(type: "int", nullable: false) - .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), - MealId = table.Column(type: "int", nullable: false), - Quantity = table.Column(type: "longtext", nullable: false) - .Annotation("MySql:CharSet", "utf8mb4"), - Item = table.Column(type: "longtext", nullable: false) - .Annotation("MySql:CharSet", "utf8mb4") - }, - constraints: table => - { - table.PrimaryKey("PK_Ingredients", x => x.Id); - table.ForeignKey( - name: "FK_Ingredients_Meals_MealId", - column: x => x.MealId, - principalTable: "Meals", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - }) - .Annotation("MySql:CharSet", "utf8mb4"); - - migrationBuilder.CreateIndex( - name: "IX_Ingredients_MealId", - table: "Ingredients", - column: "MealId"); - } - - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropTable( - name: "Ingredients"); - - migrationBuilder.DropTable( - name: "WeeklyMenus"); - - migrationBuilder.DropTable( - name: "Meals"); - } - } -} diff --git a/Aberwyn/Migrations/20250601201238_MakeCategoryNullable.Designer.cs b/Aberwyn/Migrations/20250601201238_MakeCategoryNullable.Designer.cs deleted file mode 100644 index eeeb7b3..0000000 --- a/Aberwyn/Migrations/20250601201238_MakeCategoryNullable.Designer.cs +++ /dev/null @@ -1,650 +0,0 @@ -ï»ż// -using System; -using Aberwyn.Data; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; - -#nullable disable - -namespace Aberwyn.Migrations -{ - [DbContext(typeof(ApplicationDbContext))] - [Migration("20250601201238_MakeCategoryNullable")] - partial class MakeCategoryNullable - { - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "6.0.36") - .HasAnnotation("Relational:MaxIdentifierLength", 64); - - modelBuilder.Entity("Aberwyn.Models.ApplicationUser", b => - { - b.Property("Id") - .HasColumnType("varchar(255)"); - - b.Property("AccessFailedCount") - .HasColumnType("int"); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken() - .HasColumnType("longtext"); - - b.Property("Email") - .HasMaxLength(256) - .HasColumnType("varchar(256)"); - - b.Property("EmailConfirmed") - .HasColumnType("tinyint(1)"); - - b.Property("LockoutEnabled") - .HasColumnType("tinyint(1)"); - - b.Property("LockoutEnd") - .HasColumnType("datetime(6)"); - - b.Property("NormalizedEmail") - .HasMaxLength(256) - .HasColumnType("varchar(256)"); - - b.Property("NormalizedUserName") - .HasMaxLength(256) - .HasColumnType("varchar(256)"); - - b.Property("PasswordHash") - .HasColumnType("longtext"); - - b.Property("PhoneNumber") - .HasColumnType("longtext"); - - b.Property("PhoneNumberConfirmed") - .HasColumnType("tinyint(1)"); - - b.Property("SecurityStamp") - .HasColumnType("longtext"); - - b.Property("TwoFactorEnabled") - .HasColumnType("tinyint(1)"); - - b.Property("UserName") - .HasMaxLength(256) - .HasColumnType("varchar(256)"); - - b.HasKey("Id"); - - b.HasIndex("NormalizedEmail") - .HasDatabaseName("EmailIndex"); - - b.HasIndex("NormalizedUserName") - .IsUnique() - .HasDatabaseName("UserNameIndex"); - - b.ToTable("AspNetUsers", (string)null); - }); - - modelBuilder.Entity("Aberwyn.Models.AppSetting", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - b.Property("Key") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Value") - .IsRequired() - .HasColumnType("longtext"); - - b.HasKey("Id"); - - b.ToTable("AppSettings"); - }); - - modelBuilder.Entity("Aberwyn.Models.BudgetCategory", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - b.Property("BudgetCategoryDefinitionId") - .HasColumnType("int"); - - b.Property("BudgetPeriodId") - .HasColumnType("int"); - - b.Property("Color") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Order") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("BudgetCategoryDefinitionId"); - - b.HasIndex("BudgetPeriodId"); - - b.ToTable("BudgetCategories"); - }); - - modelBuilder.Entity("Aberwyn.Models.BudgetCategoryDefinition", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - b.Property("Color") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.HasKey("Id"); - - b.ToTable("BudgetCategoryDefinitions"); - }); - - modelBuilder.Entity("Aberwyn.Models.BudgetItem", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - b.Property("Amount") - .HasColumnType("decimal(65,30)"); - - b.Property("BudgetCategoryId") - .HasColumnType("int"); - - b.Property("BudgetItemDefinitionId") - .HasColumnType("int"); - - b.Property("IncludeInSummary") - .HasColumnType("tinyint(1)"); - - b.Property("IsExpense") - .HasColumnType("tinyint(1)"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Order") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("BudgetCategoryId"); - - b.HasIndex("BudgetItemDefinitionId"); - - b.ToTable("BudgetItems"); - }); - - modelBuilder.Entity("Aberwyn.Models.BudgetItemDefinition", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - b.Property("DefaultCategory") - .HasColumnType("longtext"); - - b.Property("IncludeInSummary") - .HasColumnType("tinyint(1)"); - - b.Property("IsExpense") - .HasColumnType("tinyint(1)"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.HasKey("Id"); - - b.ToTable("BudgetItemDefinitions"); - }); - - modelBuilder.Entity("Aberwyn.Models.BudgetPeriod", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - b.Property("Month") - .HasColumnType("int"); - - b.Property("Order") - .HasColumnType("int"); - - b.Property("Year") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.ToTable("BudgetPeriods"); - }); - - modelBuilder.Entity("Aberwyn.Models.Ingredient", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - b.Property("Item") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("MealId") - .HasColumnType("int"); - - b.Property("Quantity") - .IsRequired() - .HasColumnType("longtext"); - - b.HasKey("Id"); - - b.HasIndex("MealId"); - - b.ToTable("Ingredients"); - }); - - modelBuilder.Entity("Aberwyn.Models.Meal", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - b.Property("CarbType") - .HasColumnType("longtext"); - - b.Property("Category") - .HasColumnType("longtext"); - - b.Property("CreatedAt") - .HasColumnType("datetime(6)"); - - b.Property("Description") - .HasColumnType("longtext"); - - b.Property("ImageData") - .HasColumnType("longblob"); - - b.Property("ImageMimeType") - .HasColumnType("longtext"); - - b.Property("ImageUrl") - .HasColumnType("longtext"); - - b.Property("Instructions") - .HasColumnType("longtext"); - - b.Property("IsAvailable") - .HasColumnType("tinyint(1)"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("ProteinType") - .HasColumnType("longtext"); - - b.Property("RecipeUrl") - .HasColumnType("longtext"); - - b.HasKey("Id"); - - b.ToTable("Meals"); - }); - - modelBuilder.Entity("Aberwyn.Models.PizzaOrder", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - b.Property("CustomerName") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("IngredientsJson") - .HasColumnType("longtext"); - - b.Property("OrderedAt") - .HasColumnType("datetime(6)"); - - b.Property("PizzaName") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Status") - .IsRequired() - .HasColumnType("longtext"); - - b.HasKey("Id"); - - b.ToTable("PizzaOrders"); - }); - - modelBuilder.Entity("Aberwyn.Models.PushSubscriber", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - b.Property("Auth") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Endpoint") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("P256DH") - .IsRequired() - .HasColumnType("longtext"); - - b.HasKey("Id"); - - b.ToTable("PushSubscribers"); - }); - - modelBuilder.Entity("Aberwyn.Models.WeeklyMenu", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - b.Property("BreakfastMealId") - .HasColumnType("int"); - - b.Property("BreakfastMealName") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Cook") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Date") - .HasColumnType("datetime(6)"); - - b.Property("DayOfWeek") - .HasColumnType("int"); - - b.Property("DinnerMealId") - .HasColumnType("int"); - - b.Property("DinnerMealName") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("LunchMealId") - .HasColumnType("int"); - - b.Property("LunchMealName") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("WeekNumber") - .HasColumnType("int"); - - b.Property("Year") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.ToTable("WeeklyMenus"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRole", b => - { - b.Property("Id") - .HasColumnType("varchar(255)"); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken() - .HasColumnType("longtext"); - - b.Property("Name") - .HasMaxLength(256) - .HasColumnType("varchar(256)"); - - b.Property("NormalizedName") - .HasMaxLength(256) - .HasColumnType("varchar(256)"); - - b.HasKey("Id"); - - b.HasIndex("NormalizedName") - .IsUnique() - .HasDatabaseName("RoleNameIndex"); - - b.ToTable("AspNetRoles", (string)null); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - b.Property("ClaimType") - .HasColumnType("longtext"); - - b.Property("ClaimValue") - .HasColumnType("longtext"); - - b.Property("RoleId") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.HasKey("Id"); - - b.HasIndex("RoleId"); - - b.ToTable("AspNetRoleClaims", (string)null); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - b.Property("ClaimType") - .HasColumnType("longtext"); - - b.Property("ClaimValue") - .HasColumnType("longtext"); - - b.Property("UserId") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.HasKey("Id"); - - b.HasIndex("UserId"); - - b.ToTable("AspNetUserClaims", (string)null); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => - { - b.Property("LoginProvider") - .HasColumnType("varchar(255)"); - - b.Property("ProviderKey") - .HasColumnType("varchar(255)"); - - b.Property("ProviderDisplayName") - .HasColumnType("longtext"); - - b.Property("UserId") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.HasKey("LoginProvider", "ProviderKey"); - - b.HasIndex("UserId"); - - b.ToTable("AspNetUserLogins", (string)null); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => - { - b.Property("UserId") - .HasColumnType("varchar(255)"); - - b.Property("RoleId") - .HasColumnType("varchar(255)"); - - b.HasKey("UserId", "RoleId"); - - b.HasIndex("RoleId"); - - b.ToTable("AspNetUserRoles", (string)null); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => - { - b.Property("UserId") - .HasColumnType("varchar(255)"); - - b.Property("LoginProvider") - .HasColumnType("varchar(255)"); - - b.Property("Name") - .HasColumnType("varchar(255)"); - - b.Property("Value") - .HasColumnType("longtext"); - - b.HasKey("UserId", "LoginProvider", "Name"); - - b.ToTable("AspNetUserTokens", (string)null); - }); - - modelBuilder.Entity("Aberwyn.Models.BudgetCategory", b => - { - b.HasOne("Aberwyn.Models.BudgetCategoryDefinition", "Definition") - .WithMany() - .HasForeignKey("BudgetCategoryDefinitionId"); - - b.HasOne("Aberwyn.Models.BudgetPeriod", "BudgetPeriod") - .WithMany("Categories") - .HasForeignKey("BudgetPeriodId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("BudgetPeriod"); - - b.Navigation("Definition"); - }); - - modelBuilder.Entity("Aberwyn.Models.BudgetItem", b => - { - b.HasOne("Aberwyn.Models.BudgetCategory", "BudgetCategory") - .WithMany("Items") - .HasForeignKey("BudgetCategoryId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Aberwyn.Models.BudgetItemDefinition", "BudgetItemDefinition") - .WithMany() - .HasForeignKey("BudgetItemDefinitionId"); - - b.Navigation("BudgetCategory"); - - b.Navigation("BudgetItemDefinition"); - }); - - modelBuilder.Entity("Aberwyn.Models.Ingredient", b => - { - b.HasOne("Aberwyn.Models.Meal", null) - .WithMany("Ingredients") - .HasForeignKey("MealId") - .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("Aberwyn.Models.ApplicationUser", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => - { - b.HasOne("Aberwyn.Models.ApplicationUser", 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("Aberwyn.Models.ApplicationUser", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => - { - b.HasOne("Aberwyn.Models.ApplicationUser", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Aberwyn.Models.BudgetCategory", b => - { - b.Navigation("Items"); - }); - - modelBuilder.Entity("Aberwyn.Models.BudgetPeriod", b => - { - b.Navigation("Categories"); - }); - - modelBuilder.Entity("Aberwyn.Models.Meal", b => - { - b.Navigation("Ingredients"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/Aberwyn/Migrations/20250601201238_MakeCategoryNullable.cs b/Aberwyn/Migrations/20250601201238_MakeCategoryNullable.cs deleted file mode 100644 index 550626b..0000000 --- a/Aberwyn/Migrations/20250601201238_MakeCategoryNullable.cs +++ /dev/null @@ -1,258 +0,0 @@ -ï»żusing System; -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Aberwyn.Migrations -{ - public partial class MakeCategoryNullable : Migration - { - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.AlterColumn( - name: "RecipeUrl", - table: "Meals", - type: "longtext", - nullable: true, - oldClrType: typeof(string), - oldType: "longtext") - .Annotation("MySql:CharSet", "utf8mb4") - .OldAnnotation("MySql:CharSet", "utf8mb4"); - - migrationBuilder.AlterColumn( - name: "ProteinType", - table: "Meals", - type: "longtext", - nullable: true, - oldClrType: typeof(string), - oldType: "longtext") - .Annotation("MySql:CharSet", "utf8mb4") - .OldAnnotation("MySql:CharSet", "utf8mb4"); - - migrationBuilder.AlterColumn( - name: "Instructions", - table: "Meals", - type: "longtext", - nullable: true, - oldClrType: typeof(string), - oldType: "longtext") - .Annotation("MySql:CharSet", "utf8mb4") - .OldAnnotation("MySql:CharSet", "utf8mb4"); - - migrationBuilder.AlterColumn( - name: "ImageUrl", - table: "Meals", - type: "longtext", - nullable: true, - oldClrType: typeof(string), - oldType: "longtext") - .Annotation("MySql:CharSet", "utf8mb4") - .OldAnnotation("MySql:CharSet", "utf8mb4"); - - migrationBuilder.AlterColumn( - name: "ImageMimeType", - table: "Meals", - type: "longtext", - nullable: true, - oldClrType: typeof(string), - oldType: "longtext") - .Annotation("MySql:CharSet", "utf8mb4") - .OldAnnotation("MySql:CharSet", "utf8mb4"); - - migrationBuilder.AlterColumn( - name: "ImageData", - table: "Meals", - type: "longblob", - nullable: true, - oldClrType: typeof(byte[]), - oldType: "longblob"); - - migrationBuilder.AlterColumn( - name: "Description", - table: "Meals", - type: "longtext", - nullable: true, - oldClrType: typeof(string), - oldType: "longtext") - .Annotation("MySql:CharSet", "utf8mb4") - .OldAnnotation("MySql:CharSet", "utf8mb4"); - - migrationBuilder.AlterColumn( - name: "Category", - table: "Meals", - type: "longtext", - nullable: true, - oldClrType: typeof(string), - oldType: "longtext") - .Annotation("MySql:CharSet", "utf8mb4") - .OldAnnotation("MySql:CharSet", "utf8mb4"); - - migrationBuilder.AlterColumn( - name: "CarbType", - table: "Meals", - type: "longtext", - nullable: true, - oldClrType: typeof(string), - oldType: "longtext") - .Annotation("MySql:CharSet", "utf8mb4") - .OldAnnotation("MySql:CharSet", "utf8mb4"); - } - - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.UpdateData( - table: "Meals", - keyColumn: "RecipeUrl", - keyValue: null, - column: "RecipeUrl", - value: ""); - - migrationBuilder.AlterColumn( - name: "RecipeUrl", - table: "Meals", - type: "longtext", - nullable: false, - oldClrType: typeof(string), - oldType: "longtext", - oldNullable: true) - .Annotation("MySql:CharSet", "utf8mb4") - .OldAnnotation("MySql:CharSet", "utf8mb4"); - - migrationBuilder.UpdateData( - table: "Meals", - keyColumn: "ProteinType", - keyValue: null, - column: "ProteinType", - value: ""); - - migrationBuilder.AlterColumn( - name: "ProteinType", - table: "Meals", - type: "longtext", - nullable: false, - oldClrType: typeof(string), - oldType: "longtext", - oldNullable: true) - .Annotation("MySql:CharSet", "utf8mb4") - .OldAnnotation("MySql:CharSet", "utf8mb4"); - - migrationBuilder.UpdateData( - table: "Meals", - keyColumn: "Instructions", - keyValue: null, - column: "Instructions", - value: ""); - - migrationBuilder.AlterColumn( - name: "Instructions", - table: "Meals", - type: "longtext", - nullable: false, - oldClrType: typeof(string), - oldType: "longtext", - oldNullable: true) - .Annotation("MySql:CharSet", "utf8mb4") - .OldAnnotation("MySql:CharSet", "utf8mb4"); - - migrationBuilder.UpdateData( - table: "Meals", - keyColumn: "ImageUrl", - keyValue: null, - column: "ImageUrl", - value: ""); - - migrationBuilder.AlterColumn( - name: "ImageUrl", - table: "Meals", - type: "longtext", - nullable: false, - oldClrType: typeof(string), - oldType: "longtext", - oldNullable: true) - .Annotation("MySql:CharSet", "utf8mb4") - .OldAnnotation("MySql:CharSet", "utf8mb4"); - - migrationBuilder.UpdateData( - table: "Meals", - keyColumn: "ImageMimeType", - keyValue: null, - column: "ImageMimeType", - value: ""); - - migrationBuilder.AlterColumn( - name: "ImageMimeType", - table: "Meals", - type: "longtext", - nullable: false, - oldClrType: typeof(string), - oldType: "longtext", - oldNullable: true) - .Annotation("MySql:CharSet", "utf8mb4") - .OldAnnotation("MySql:CharSet", "utf8mb4"); - - migrationBuilder.AlterColumn( - name: "ImageData", - table: "Meals", - type: "longblob", - nullable: false, - defaultValue: new byte[0], - oldClrType: typeof(byte[]), - oldType: "longblob", - oldNullable: true); - - migrationBuilder.UpdateData( - table: "Meals", - keyColumn: "Description", - keyValue: null, - column: "Description", - value: ""); - - migrationBuilder.AlterColumn( - name: "Description", - table: "Meals", - type: "longtext", - nullable: false, - oldClrType: typeof(string), - oldType: "longtext", - oldNullable: true) - .Annotation("MySql:CharSet", "utf8mb4") - .OldAnnotation("MySql:CharSet", "utf8mb4"); - - migrationBuilder.UpdateData( - table: "Meals", - keyColumn: "Category", - keyValue: null, - column: "Category", - value: ""); - - migrationBuilder.AlterColumn( - name: "Category", - table: "Meals", - type: "longtext", - nullable: false, - oldClrType: typeof(string), - oldType: "longtext", - oldNullable: true) - .Annotation("MySql:CharSet", "utf8mb4") - .OldAnnotation("MySql:CharSet", "utf8mb4"); - - migrationBuilder.UpdateData( - table: "Meals", - keyColumn: "CarbType", - keyValue: null, - column: "CarbType", - value: ""); - - migrationBuilder.AlterColumn( - name: "CarbType", - table: "Meals", - type: "longtext", - nullable: false, - oldClrType: typeof(string), - oldType: "longtext", - oldNullable: true) - .Annotation("MySql:CharSet", "utf8mb4") - .OldAnnotation("MySql:CharSet", "utf8mb4"); - } - } -} diff --git a/Aberwyn/Migrations/20250601201642_CreateWeeklyMenus.Designer.cs b/Aberwyn/Migrations/20250601201642_CreateWeeklyMenus.Designer.cs deleted file mode 100644 index 661c9c5..0000000 --- a/Aberwyn/Migrations/20250601201642_CreateWeeklyMenus.Designer.cs +++ /dev/null @@ -1,650 +0,0 @@ -ï»ż// -using System; -using Aberwyn.Data; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; - -#nullable disable - -namespace Aberwyn.Migrations -{ - [DbContext(typeof(ApplicationDbContext))] - [Migration("20250601201642_CreateWeeklyMenus")] - partial class CreateWeeklyMenus - { - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "6.0.36") - .HasAnnotation("Relational:MaxIdentifierLength", 64); - - modelBuilder.Entity("Aberwyn.Models.ApplicationUser", b => - { - b.Property("Id") - .HasColumnType("varchar(255)"); - - b.Property("AccessFailedCount") - .HasColumnType("int"); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken() - .HasColumnType("longtext"); - - b.Property("Email") - .HasMaxLength(256) - .HasColumnType("varchar(256)"); - - b.Property("EmailConfirmed") - .HasColumnType("tinyint(1)"); - - b.Property("LockoutEnabled") - .HasColumnType("tinyint(1)"); - - b.Property("LockoutEnd") - .HasColumnType("datetime(6)"); - - b.Property("NormalizedEmail") - .HasMaxLength(256) - .HasColumnType("varchar(256)"); - - b.Property("NormalizedUserName") - .HasMaxLength(256) - .HasColumnType("varchar(256)"); - - b.Property("PasswordHash") - .HasColumnType("longtext"); - - b.Property("PhoneNumber") - .HasColumnType("longtext"); - - b.Property("PhoneNumberConfirmed") - .HasColumnType("tinyint(1)"); - - b.Property("SecurityStamp") - .HasColumnType("longtext"); - - b.Property("TwoFactorEnabled") - .HasColumnType("tinyint(1)"); - - b.Property("UserName") - .HasMaxLength(256) - .HasColumnType("varchar(256)"); - - b.HasKey("Id"); - - b.HasIndex("NormalizedEmail") - .HasDatabaseName("EmailIndex"); - - b.HasIndex("NormalizedUserName") - .IsUnique() - .HasDatabaseName("UserNameIndex"); - - b.ToTable("AspNetUsers", (string)null); - }); - - modelBuilder.Entity("Aberwyn.Models.AppSetting", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - b.Property("Key") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Value") - .IsRequired() - .HasColumnType("longtext"); - - b.HasKey("Id"); - - b.ToTable("AppSettings"); - }); - - modelBuilder.Entity("Aberwyn.Models.BudgetCategory", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - b.Property("BudgetCategoryDefinitionId") - .HasColumnType("int"); - - b.Property("BudgetPeriodId") - .HasColumnType("int"); - - b.Property("Color") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Order") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("BudgetCategoryDefinitionId"); - - b.HasIndex("BudgetPeriodId"); - - b.ToTable("BudgetCategories"); - }); - - modelBuilder.Entity("Aberwyn.Models.BudgetCategoryDefinition", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - b.Property("Color") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.HasKey("Id"); - - b.ToTable("BudgetCategoryDefinitions"); - }); - - modelBuilder.Entity("Aberwyn.Models.BudgetItem", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - b.Property("Amount") - .HasColumnType("decimal(65,30)"); - - b.Property("BudgetCategoryId") - .HasColumnType("int"); - - b.Property("BudgetItemDefinitionId") - .HasColumnType("int"); - - b.Property("IncludeInSummary") - .HasColumnType("tinyint(1)"); - - b.Property("IsExpense") - .HasColumnType("tinyint(1)"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Order") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("BudgetCategoryId"); - - b.HasIndex("BudgetItemDefinitionId"); - - b.ToTable("BudgetItems"); - }); - - modelBuilder.Entity("Aberwyn.Models.BudgetItemDefinition", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - b.Property("DefaultCategory") - .HasColumnType("longtext"); - - b.Property("IncludeInSummary") - .HasColumnType("tinyint(1)"); - - b.Property("IsExpense") - .HasColumnType("tinyint(1)"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.HasKey("Id"); - - b.ToTable("BudgetItemDefinitions"); - }); - - modelBuilder.Entity("Aberwyn.Models.BudgetPeriod", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - b.Property("Month") - .HasColumnType("int"); - - b.Property("Order") - .HasColumnType("int"); - - b.Property("Year") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.ToTable("BudgetPeriods"); - }); - - modelBuilder.Entity("Aberwyn.Models.Ingredient", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - b.Property("Item") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("MealId") - .HasColumnType("int"); - - b.Property("Quantity") - .IsRequired() - .HasColumnType("longtext"); - - b.HasKey("Id"); - - b.HasIndex("MealId"); - - b.ToTable("Ingredients"); - }); - - modelBuilder.Entity("Aberwyn.Models.Meal", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - b.Property("CarbType") - .HasColumnType("longtext"); - - b.Property("Category") - .HasColumnType("longtext"); - - b.Property("CreatedAt") - .HasColumnType("datetime(6)"); - - b.Property("Description") - .HasColumnType("longtext"); - - b.Property("ImageData") - .HasColumnType("longblob"); - - b.Property("ImageMimeType") - .HasColumnType("longtext"); - - b.Property("ImageUrl") - .HasColumnType("longtext"); - - b.Property("Instructions") - .HasColumnType("longtext"); - - b.Property("IsAvailable") - .HasColumnType("tinyint(1)"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("ProteinType") - .HasColumnType("longtext"); - - b.Property("RecipeUrl") - .HasColumnType("longtext"); - - b.HasKey("Id"); - - b.ToTable("Meals"); - }); - - modelBuilder.Entity("Aberwyn.Models.PizzaOrder", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - b.Property("CustomerName") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("IngredientsJson") - .HasColumnType("longtext"); - - b.Property("OrderedAt") - .HasColumnType("datetime(6)"); - - b.Property("PizzaName") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Status") - .IsRequired() - .HasColumnType("longtext"); - - b.HasKey("Id"); - - b.ToTable("PizzaOrders"); - }); - - modelBuilder.Entity("Aberwyn.Models.PushSubscriber", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - b.Property("Auth") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Endpoint") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("P256DH") - .IsRequired() - .HasColumnType("longtext"); - - b.HasKey("Id"); - - b.ToTable("PushSubscribers"); - }); - - modelBuilder.Entity("Aberwyn.Models.WeeklyMenu", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - b.Property("BreakfastMealId") - .HasColumnType("int"); - - b.Property("BreakfastMealName") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Cook") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Date") - .HasColumnType("datetime(6)"); - - b.Property("DayOfWeek") - .HasColumnType("int"); - - b.Property("DinnerMealId") - .HasColumnType("int"); - - b.Property("DinnerMealName") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("LunchMealId") - .HasColumnType("int"); - - b.Property("LunchMealName") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("WeekNumber") - .HasColumnType("int"); - - b.Property("Year") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.ToTable("WeeklyMenus"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRole", b => - { - b.Property("Id") - .HasColumnType("varchar(255)"); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken() - .HasColumnType("longtext"); - - b.Property("Name") - .HasMaxLength(256) - .HasColumnType("varchar(256)"); - - b.Property("NormalizedName") - .HasMaxLength(256) - .HasColumnType("varchar(256)"); - - b.HasKey("Id"); - - b.HasIndex("NormalizedName") - .IsUnique() - .HasDatabaseName("RoleNameIndex"); - - b.ToTable("AspNetRoles", (string)null); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - b.Property("ClaimType") - .HasColumnType("longtext"); - - b.Property("ClaimValue") - .HasColumnType("longtext"); - - b.Property("RoleId") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.HasKey("Id"); - - b.HasIndex("RoleId"); - - b.ToTable("AspNetRoleClaims", (string)null); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - b.Property("ClaimType") - .HasColumnType("longtext"); - - b.Property("ClaimValue") - .HasColumnType("longtext"); - - b.Property("UserId") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.HasKey("Id"); - - b.HasIndex("UserId"); - - b.ToTable("AspNetUserClaims", (string)null); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => - { - b.Property("LoginProvider") - .HasColumnType("varchar(255)"); - - b.Property("ProviderKey") - .HasColumnType("varchar(255)"); - - b.Property("ProviderDisplayName") - .HasColumnType("longtext"); - - b.Property("UserId") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.HasKey("LoginProvider", "ProviderKey"); - - b.HasIndex("UserId"); - - b.ToTable("AspNetUserLogins", (string)null); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => - { - b.Property("UserId") - .HasColumnType("varchar(255)"); - - b.Property("RoleId") - .HasColumnType("varchar(255)"); - - b.HasKey("UserId", "RoleId"); - - b.HasIndex("RoleId"); - - b.ToTable("AspNetUserRoles", (string)null); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => - { - b.Property("UserId") - .HasColumnType("varchar(255)"); - - b.Property("LoginProvider") - .HasColumnType("varchar(255)"); - - b.Property("Name") - .HasColumnType("varchar(255)"); - - b.Property("Value") - .HasColumnType("longtext"); - - b.HasKey("UserId", "LoginProvider", "Name"); - - b.ToTable("AspNetUserTokens", (string)null); - }); - - modelBuilder.Entity("Aberwyn.Models.BudgetCategory", b => - { - b.HasOne("Aberwyn.Models.BudgetCategoryDefinition", "Definition") - .WithMany() - .HasForeignKey("BudgetCategoryDefinitionId"); - - b.HasOne("Aberwyn.Models.BudgetPeriod", "BudgetPeriod") - .WithMany("Categories") - .HasForeignKey("BudgetPeriodId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("BudgetPeriod"); - - b.Navigation("Definition"); - }); - - modelBuilder.Entity("Aberwyn.Models.BudgetItem", b => - { - b.HasOne("Aberwyn.Models.BudgetCategory", "BudgetCategory") - .WithMany("Items") - .HasForeignKey("BudgetCategoryId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Aberwyn.Models.BudgetItemDefinition", "BudgetItemDefinition") - .WithMany() - .HasForeignKey("BudgetItemDefinitionId"); - - b.Navigation("BudgetCategory"); - - b.Navigation("BudgetItemDefinition"); - }); - - modelBuilder.Entity("Aberwyn.Models.Ingredient", b => - { - b.HasOne("Aberwyn.Models.Meal", null) - .WithMany("Ingredients") - .HasForeignKey("MealId") - .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("Aberwyn.Models.ApplicationUser", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => - { - b.HasOne("Aberwyn.Models.ApplicationUser", 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("Aberwyn.Models.ApplicationUser", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => - { - b.HasOne("Aberwyn.Models.ApplicationUser", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Aberwyn.Models.BudgetCategory", b => - { - b.Navigation("Items"); - }); - - modelBuilder.Entity("Aberwyn.Models.BudgetPeriod", b => - { - b.Navigation("Categories"); - }); - - modelBuilder.Entity("Aberwyn.Models.Meal", b => - { - b.Navigation("Ingredients"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/Aberwyn/Migrations/20250601201642_CreateWeeklyMenus.cs b/Aberwyn/Migrations/20250601201642_CreateWeeklyMenus.cs deleted file mode 100644 index 8bb909c..0000000 --- a/Aberwyn/Migrations/20250601201642_CreateWeeklyMenus.cs +++ /dev/null @@ -1,19 +0,0 @@ -ï»żusing Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Aberwyn.Migrations -{ - public partial class CreateWeeklyMenus : Migration - { - protected override void Up(MigrationBuilder migrationBuilder) - { - - } - - protected override void Down(MigrationBuilder migrationBuilder) - { - - } - } -} diff --git a/Aberwyn/Migrations/20250601204720_RenameWeeklyMenusToWeeklyMenu.Designer.cs b/Aberwyn/Migrations/20250601204720_RenameWeeklyMenusToWeeklyMenu.Designer.cs deleted file mode 100644 index 93538d5..0000000 --- a/Aberwyn/Migrations/20250601204720_RenameWeeklyMenusToWeeklyMenu.Designer.cs +++ /dev/null @@ -1,650 +0,0 @@ -ï»ż// -using System; -using Aberwyn.Data; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; - -#nullable disable - -namespace Aberwyn.Migrations -{ - [DbContext(typeof(ApplicationDbContext))] - [Migration("20250601204720_RenameWeeklyMenusToWeeklyMenu")] - partial class RenameWeeklyMenusToWeeklyMenu - { - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "6.0.36") - .HasAnnotation("Relational:MaxIdentifierLength", 64); - - modelBuilder.Entity("Aberwyn.Models.ApplicationUser", b => - { - b.Property("Id") - .HasColumnType("varchar(255)"); - - b.Property("AccessFailedCount") - .HasColumnType("int"); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken() - .HasColumnType("longtext"); - - b.Property("Email") - .HasMaxLength(256) - .HasColumnType("varchar(256)"); - - b.Property("EmailConfirmed") - .HasColumnType("tinyint(1)"); - - b.Property("LockoutEnabled") - .HasColumnType("tinyint(1)"); - - b.Property("LockoutEnd") - .HasColumnType("datetime(6)"); - - b.Property("NormalizedEmail") - .HasMaxLength(256) - .HasColumnType("varchar(256)"); - - b.Property("NormalizedUserName") - .HasMaxLength(256) - .HasColumnType("varchar(256)"); - - b.Property("PasswordHash") - .HasColumnType("longtext"); - - b.Property("PhoneNumber") - .HasColumnType("longtext"); - - b.Property("PhoneNumberConfirmed") - .HasColumnType("tinyint(1)"); - - b.Property("SecurityStamp") - .HasColumnType("longtext"); - - b.Property("TwoFactorEnabled") - .HasColumnType("tinyint(1)"); - - b.Property("UserName") - .HasMaxLength(256) - .HasColumnType("varchar(256)"); - - b.HasKey("Id"); - - b.HasIndex("NormalizedEmail") - .HasDatabaseName("EmailIndex"); - - b.HasIndex("NormalizedUserName") - .IsUnique() - .HasDatabaseName("UserNameIndex"); - - b.ToTable("AspNetUsers", (string)null); - }); - - modelBuilder.Entity("Aberwyn.Models.AppSetting", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - b.Property("Key") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Value") - .IsRequired() - .HasColumnType("longtext"); - - b.HasKey("Id"); - - b.ToTable("AppSettings"); - }); - - modelBuilder.Entity("Aberwyn.Models.BudgetCategory", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - b.Property("BudgetCategoryDefinitionId") - .HasColumnType("int"); - - b.Property("BudgetPeriodId") - .HasColumnType("int"); - - b.Property("Color") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Order") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("BudgetCategoryDefinitionId"); - - b.HasIndex("BudgetPeriodId"); - - b.ToTable("BudgetCategories"); - }); - - modelBuilder.Entity("Aberwyn.Models.BudgetCategoryDefinition", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - b.Property("Color") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.HasKey("Id"); - - b.ToTable("BudgetCategoryDefinitions"); - }); - - modelBuilder.Entity("Aberwyn.Models.BudgetItem", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - b.Property("Amount") - .HasColumnType("decimal(65,30)"); - - b.Property("BudgetCategoryId") - .HasColumnType("int"); - - b.Property("BudgetItemDefinitionId") - .HasColumnType("int"); - - b.Property("IncludeInSummary") - .HasColumnType("tinyint(1)"); - - b.Property("IsExpense") - .HasColumnType("tinyint(1)"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Order") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("BudgetCategoryId"); - - b.HasIndex("BudgetItemDefinitionId"); - - b.ToTable("BudgetItems"); - }); - - modelBuilder.Entity("Aberwyn.Models.BudgetItemDefinition", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - b.Property("DefaultCategory") - .HasColumnType("longtext"); - - b.Property("IncludeInSummary") - .HasColumnType("tinyint(1)"); - - b.Property("IsExpense") - .HasColumnType("tinyint(1)"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.HasKey("Id"); - - b.ToTable("BudgetItemDefinitions"); - }); - - modelBuilder.Entity("Aberwyn.Models.BudgetPeriod", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - b.Property("Month") - .HasColumnType("int"); - - b.Property("Order") - .HasColumnType("int"); - - b.Property("Year") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.ToTable("BudgetPeriods"); - }); - - modelBuilder.Entity("Aberwyn.Models.Ingredient", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - b.Property("Item") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("MealId") - .HasColumnType("int"); - - b.Property("Quantity") - .IsRequired() - .HasColumnType("longtext"); - - b.HasKey("Id"); - - b.HasIndex("MealId"); - - b.ToTable("Ingredients"); - }); - - modelBuilder.Entity("Aberwyn.Models.Meal", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - b.Property("CarbType") - .HasColumnType("longtext"); - - b.Property("Category") - .HasColumnType("longtext"); - - b.Property("CreatedAt") - .HasColumnType("datetime(6)"); - - b.Property("Description") - .HasColumnType("longtext"); - - b.Property("ImageData") - .HasColumnType("longblob"); - - b.Property("ImageMimeType") - .HasColumnType("longtext"); - - b.Property("ImageUrl") - .HasColumnType("longtext"); - - b.Property("Instructions") - .HasColumnType("longtext"); - - b.Property("IsAvailable") - .HasColumnType("tinyint(1)"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("ProteinType") - .HasColumnType("longtext"); - - b.Property("RecipeUrl") - .HasColumnType("longtext"); - - b.HasKey("Id"); - - b.ToTable("Meals"); - }); - - modelBuilder.Entity("Aberwyn.Models.PizzaOrder", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - b.Property("CustomerName") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("IngredientsJson") - .HasColumnType("longtext"); - - b.Property("OrderedAt") - .HasColumnType("datetime(6)"); - - b.Property("PizzaName") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Status") - .IsRequired() - .HasColumnType("longtext"); - - b.HasKey("Id"); - - b.ToTable("PizzaOrders"); - }); - - modelBuilder.Entity("Aberwyn.Models.PushSubscriber", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - b.Property("Auth") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Endpoint") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("P256DH") - .IsRequired() - .HasColumnType("longtext"); - - b.HasKey("Id"); - - b.ToTable("PushSubscribers"); - }); - - modelBuilder.Entity("Aberwyn.Models.WeeklyMenu", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - b.Property("BreakfastMealId") - .HasColumnType("int"); - - b.Property("BreakfastMealName") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Cook") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Date") - .HasColumnType("datetime(6)"); - - b.Property("DayOfWeek") - .HasColumnType("int"); - - b.Property("DinnerMealId") - .HasColumnType("int"); - - b.Property("DinnerMealName") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("LunchMealId") - .HasColumnType("int"); - - b.Property("LunchMealName") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("WeekNumber") - .HasColumnType("int"); - - b.Property("Year") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.ToTable("WeeklyMenus"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRole", b => - { - b.Property("Id") - .HasColumnType("varchar(255)"); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken() - .HasColumnType("longtext"); - - b.Property("Name") - .HasMaxLength(256) - .HasColumnType("varchar(256)"); - - b.Property("NormalizedName") - .HasMaxLength(256) - .HasColumnType("varchar(256)"); - - b.HasKey("Id"); - - b.HasIndex("NormalizedName") - .IsUnique() - .HasDatabaseName("RoleNameIndex"); - - b.ToTable("AspNetRoles", (string)null); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - b.Property("ClaimType") - .HasColumnType("longtext"); - - b.Property("ClaimValue") - .HasColumnType("longtext"); - - b.Property("RoleId") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.HasKey("Id"); - - b.HasIndex("RoleId"); - - b.ToTable("AspNetRoleClaims", (string)null); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - b.Property("ClaimType") - .HasColumnType("longtext"); - - b.Property("ClaimValue") - .HasColumnType("longtext"); - - b.Property("UserId") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.HasKey("Id"); - - b.HasIndex("UserId"); - - b.ToTable("AspNetUserClaims", (string)null); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => - { - b.Property("LoginProvider") - .HasColumnType("varchar(255)"); - - b.Property("ProviderKey") - .HasColumnType("varchar(255)"); - - b.Property("ProviderDisplayName") - .HasColumnType("longtext"); - - b.Property("UserId") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.HasKey("LoginProvider", "ProviderKey"); - - b.HasIndex("UserId"); - - b.ToTable("AspNetUserLogins", (string)null); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => - { - b.Property("UserId") - .HasColumnType("varchar(255)"); - - b.Property("RoleId") - .HasColumnType("varchar(255)"); - - b.HasKey("UserId", "RoleId"); - - b.HasIndex("RoleId"); - - b.ToTable("AspNetUserRoles", (string)null); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => - { - b.Property("UserId") - .HasColumnType("varchar(255)"); - - b.Property("LoginProvider") - .HasColumnType("varchar(255)"); - - b.Property("Name") - .HasColumnType("varchar(255)"); - - b.Property("Value") - .HasColumnType("longtext"); - - b.HasKey("UserId", "LoginProvider", "Name"); - - b.ToTable("AspNetUserTokens", (string)null); - }); - - modelBuilder.Entity("Aberwyn.Models.BudgetCategory", b => - { - b.HasOne("Aberwyn.Models.BudgetCategoryDefinition", "Definition") - .WithMany() - .HasForeignKey("BudgetCategoryDefinitionId"); - - b.HasOne("Aberwyn.Models.BudgetPeriod", "BudgetPeriod") - .WithMany("Categories") - .HasForeignKey("BudgetPeriodId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("BudgetPeriod"); - - b.Navigation("Definition"); - }); - - modelBuilder.Entity("Aberwyn.Models.BudgetItem", b => - { - b.HasOne("Aberwyn.Models.BudgetCategory", "BudgetCategory") - .WithMany("Items") - .HasForeignKey("BudgetCategoryId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Aberwyn.Models.BudgetItemDefinition", "BudgetItemDefinition") - .WithMany() - .HasForeignKey("BudgetItemDefinitionId"); - - b.Navigation("BudgetCategory"); - - b.Navigation("BudgetItemDefinition"); - }); - - modelBuilder.Entity("Aberwyn.Models.Ingredient", b => - { - b.HasOne("Aberwyn.Models.Meal", null) - .WithMany("Ingredients") - .HasForeignKey("MealId") - .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("Aberwyn.Models.ApplicationUser", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => - { - b.HasOne("Aberwyn.Models.ApplicationUser", 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("Aberwyn.Models.ApplicationUser", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => - { - b.HasOne("Aberwyn.Models.ApplicationUser", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Aberwyn.Models.BudgetCategory", b => - { - b.Navigation("Items"); - }); - - modelBuilder.Entity("Aberwyn.Models.BudgetPeriod", b => - { - b.Navigation("Categories"); - }); - - modelBuilder.Entity("Aberwyn.Models.Meal", b => - { - b.Navigation("Ingredients"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/Aberwyn/Migrations/20250601204720_RenameWeeklyMenusToWeeklyMenu.cs b/Aberwyn/Migrations/20250601204720_RenameWeeklyMenusToWeeklyMenu.cs deleted file mode 100644 index d6a0438..0000000 --- a/Aberwyn/Migrations/20250601204720_RenameWeeklyMenusToWeeklyMenu.cs +++ /dev/null @@ -1,19 +0,0 @@ -ï»żusing Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Aberwyn.Migrations -{ - public partial class RenameWeeklyMenusToWeeklyMenu : Migration - { - protected override void Up(MigrationBuilder migrationBuilder) - { - - } - - protected override void Down(MigrationBuilder migrationBuilder) - { - - } - } -} diff --git a/Aberwyn/Migrations/20250601210321_AddMealNamesToWeeklyMenu.Designer.cs b/Aberwyn/Migrations/20250601210321_AddMealNamesToWeeklyMenu.Designer.cs deleted file mode 100644 index 5c8c31e..0000000 --- a/Aberwyn/Migrations/20250601210321_AddMealNamesToWeeklyMenu.Designer.cs +++ /dev/null @@ -1,646 +0,0 @@ -ï»ż// -using System; -using Aberwyn.Data; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; - -#nullable disable - -namespace Aberwyn.Migrations -{ - [DbContext(typeof(ApplicationDbContext))] - [Migration("20250601210321_AddMealNamesToWeeklyMenu")] - partial class AddMealNamesToWeeklyMenu - { - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "6.0.36") - .HasAnnotation("Relational:MaxIdentifierLength", 64); - - modelBuilder.Entity("Aberwyn.Models.ApplicationUser", b => - { - b.Property("Id") - .HasColumnType("varchar(255)"); - - b.Property("AccessFailedCount") - .HasColumnType("int"); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken() - .HasColumnType("longtext"); - - b.Property("Email") - .HasMaxLength(256) - .HasColumnType("varchar(256)"); - - b.Property("EmailConfirmed") - .HasColumnType("tinyint(1)"); - - b.Property("LockoutEnabled") - .HasColumnType("tinyint(1)"); - - b.Property("LockoutEnd") - .HasColumnType("datetime(6)"); - - b.Property("NormalizedEmail") - .HasMaxLength(256) - .HasColumnType("varchar(256)"); - - b.Property("NormalizedUserName") - .HasMaxLength(256) - .HasColumnType("varchar(256)"); - - b.Property("PasswordHash") - .HasColumnType("longtext"); - - b.Property("PhoneNumber") - .HasColumnType("longtext"); - - b.Property("PhoneNumberConfirmed") - .HasColumnType("tinyint(1)"); - - b.Property("SecurityStamp") - .HasColumnType("longtext"); - - b.Property("TwoFactorEnabled") - .HasColumnType("tinyint(1)"); - - b.Property("UserName") - .HasMaxLength(256) - .HasColumnType("varchar(256)"); - - b.HasKey("Id"); - - b.HasIndex("NormalizedEmail") - .HasDatabaseName("EmailIndex"); - - b.HasIndex("NormalizedUserName") - .IsUnique() - .HasDatabaseName("UserNameIndex"); - - b.ToTable("AspNetUsers", (string)null); - }); - - modelBuilder.Entity("Aberwyn.Models.AppSetting", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - b.Property("Key") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Value") - .IsRequired() - .HasColumnType("longtext"); - - b.HasKey("Id"); - - b.ToTable("AppSettings"); - }); - - modelBuilder.Entity("Aberwyn.Models.BudgetCategory", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - b.Property("BudgetCategoryDefinitionId") - .HasColumnType("int"); - - b.Property("BudgetPeriodId") - .HasColumnType("int"); - - b.Property("Color") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Order") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("BudgetCategoryDefinitionId"); - - b.HasIndex("BudgetPeriodId"); - - b.ToTable("BudgetCategories"); - }); - - modelBuilder.Entity("Aberwyn.Models.BudgetCategoryDefinition", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - b.Property("Color") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.HasKey("Id"); - - b.ToTable("BudgetCategoryDefinitions"); - }); - - modelBuilder.Entity("Aberwyn.Models.BudgetItem", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - b.Property("Amount") - .HasColumnType("decimal(65,30)"); - - b.Property("BudgetCategoryId") - .HasColumnType("int"); - - b.Property("BudgetItemDefinitionId") - .HasColumnType("int"); - - b.Property("IncludeInSummary") - .HasColumnType("tinyint(1)"); - - b.Property("IsExpense") - .HasColumnType("tinyint(1)"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Order") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("BudgetCategoryId"); - - b.HasIndex("BudgetItemDefinitionId"); - - b.ToTable("BudgetItems"); - }); - - modelBuilder.Entity("Aberwyn.Models.BudgetItemDefinition", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - b.Property("DefaultCategory") - .HasColumnType("longtext"); - - b.Property("IncludeInSummary") - .HasColumnType("tinyint(1)"); - - b.Property("IsExpense") - .HasColumnType("tinyint(1)"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.HasKey("Id"); - - b.ToTable("BudgetItemDefinitions"); - }); - - modelBuilder.Entity("Aberwyn.Models.BudgetPeriod", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - b.Property("Month") - .HasColumnType("int"); - - b.Property("Order") - .HasColumnType("int"); - - b.Property("Year") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.ToTable("BudgetPeriods"); - }); - - modelBuilder.Entity("Aberwyn.Models.Ingredient", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - b.Property("Item") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("MealId") - .HasColumnType("int"); - - b.Property("Quantity") - .IsRequired() - .HasColumnType("longtext"); - - b.HasKey("Id"); - - b.HasIndex("MealId"); - - b.ToTable("Ingredients"); - }); - - modelBuilder.Entity("Aberwyn.Models.Meal", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - b.Property("CarbType") - .HasColumnType("longtext"); - - b.Property("Category") - .HasColumnType("longtext"); - - b.Property("CreatedAt") - .HasColumnType("datetime(6)"); - - b.Property("Description") - .HasColumnType("longtext"); - - b.Property("ImageData") - .HasColumnType("longblob"); - - b.Property("ImageMimeType") - .HasColumnType("longtext"); - - b.Property("ImageUrl") - .HasColumnType("longtext"); - - b.Property("Instructions") - .HasColumnType("longtext"); - - b.Property("IsAvailable") - .HasColumnType("tinyint(1)"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("ProteinType") - .HasColumnType("longtext"); - - b.Property("RecipeUrl") - .HasColumnType("longtext"); - - b.HasKey("Id"); - - b.ToTable("Meals"); - }); - - modelBuilder.Entity("Aberwyn.Models.PizzaOrder", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - b.Property("CustomerName") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("IngredientsJson") - .HasColumnType("longtext"); - - b.Property("OrderedAt") - .HasColumnType("datetime(6)"); - - b.Property("PizzaName") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Status") - .IsRequired() - .HasColumnType("longtext"); - - b.HasKey("Id"); - - b.ToTable("PizzaOrders"); - }); - - modelBuilder.Entity("Aberwyn.Models.PushSubscriber", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - b.Property("Auth") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Endpoint") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("P256DH") - .IsRequired() - .HasColumnType("longtext"); - - b.HasKey("Id"); - - b.ToTable("PushSubscribers"); - }); - - modelBuilder.Entity("Aberwyn.Models.WeeklyMenu", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - b.Property("BreakfastMealId") - .HasColumnType("int"); - - b.Property("BreakfastMealName") - .HasColumnType("longtext"); - - b.Property("Cook") - .HasColumnType("longtext"); - - b.Property("Date") - .HasColumnType("datetime(6)"); - - b.Property("DayOfWeek") - .HasColumnType("int"); - - b.Property("DinnerMealId") - .HasColumnType("int"); - - b.Property("DinnerMealName") - .HasColumnType("longtext"); - - b.Property("LunchMealId") - .HasColumnType("int"); - - b.Property("LunchMealName") - .HasColumnType("longtext"); - - b.Property("WeekNumber") - .HasColumnType("int"); - - b.Property("Year") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.ToTable("WeeklyMenu", (string)null); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRole", b => - { - b.Property("Id") - .HasColumnType("varchar(255)"); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken() - .HasColumnType("longtext"); - - b.Property("Name") - .HasMaxLength(256) - .HasColumnType("varchar(256)"); - - b.Property("NormalizedName") - .HasMaxLength(256) - .HasColumnType("varchar(256)"); - - b.HasKey("Id"); - - b.HasIndex("NormalizedName") - .IsUnique() - .HasDatabaseName("RoleNameIndex"); - - b.ToTable("AspNetRoles", (string)null); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - b.Property("ClaimType") - .HasColumnType("longtext"); - - b.Property("ClaimValue") - .HasColumnType("longtext"); - - b.Property("RoleId") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.HasKey("Id"); - - b.HasIndex("RoleId"); - - b.ToTable("AspNetRoleClaims", (string)null); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - b.Property("ClaimType") - .HasColumnType("longtext"); - - b.Property("ClaimValue") - .HasColumnType("longtext"); - - b.Property("UserId") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.HasKey("Id"); - - b.HasIndex("UserId"); - - b.ToTable("AspNetUserClaims", (string)null); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => - { - b.Property("LoginProvider") - .HasColumnType("varchar(255)"); - - b.Property("ProviderKey") - .HasColumnType("varchar(255)"); - - b.Property("ProviderDisplayName") - .HasColumnType("longtext"); - - b.Property("UserId") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.HasKey("LoginProvider", "ProviderKey"); - - b.HasIndex("UserId"); - - b.ToTable("AspNetUserLogins", (string)null); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => - { - b.Property("UserId") - .HasColumnType("varchar(255)"); - - b.Property("RoleId") - .HasColumnType("varchar(255)"); - - b.HasKey("UserId", "RoleId"); - - b.HasIndex("RoleId"); - - b.ToTable("AspNetUserRoles", (string)null); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => - { - b.Property("UserId") - .HasColumnType("varchar(255)"); - - b.Property("LoginProvider") - .HasColumnType("varchar(255)"); - - b.Property("Name") - .HasColumnType("varchar(255)"); - - b.Property("Value") - .HasColumnType("longtext"); - - b.HasKey("UserId", "LoginProvider", "Name"); - - b.ToTable("AspNetUserTokens", (string)null); - }); - - modelBuilder.Entity("Aberwyn.Models.BudgetCategory", b => - { - b.HasOne("Aberwyn.Models.BudgetCategoryDefinition", "Definition") - .WithMany() - .HasForeignKey("BudgetCategoryDefinitionId"); - - b.HasOne("Aberwyn.Models.BudgetPeriod", "BudgetPeriod") - .WithMany("Categories") - .HasForeignKey("BudgetPeriodId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("BudgetPeriod"); - - b.Navigation("Definition"); - }); - - modelBuilder.Entity("Aberwyn.Models.BudgetItem", b => - { - b.HasOne("Aberwyn.Models.BudgetCategory", "BudgetCategory") - .WithMany("Items") - .HasForeignKey("BudgetCategoryId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Aberwyn.Models.BudgetItemDefinition", "BudgetItemDefinition") - .WithMany() - .HasForeignKey("BudgetItemDefinitionId"); - - b.Navigation("BudgetCategory"); - - b.Navigation("BudgetItemDefinition"); - }); - - modelBuilder.Entity("Aberwyn.Models.Ingredient", b => - { - b.HasOne("Aberwyn.Models.Meal", null) - .WithMany("Ingredients") - .HasForeignKey("MealId") - .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("Aberwyn.Models.ApplicationUser", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => - { - b.HasOne("Aberwyn.Models.ApplicationUser", 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("Aberwyn.Models.ApplicationUser", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => - { - b.HasOne("Aberwyn.Models.ApplicationUser", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Aberwyn.Models.BudgetCategory", b => - { - b.Navigation("Items"); - }); - - modelBuilder.Entity("Aberwyn.Models.BudgetPeriod", b => - { - b.Navigation("Categories"); - }); - - modelBuilder.Entity("Aberwyn.Models.Meal", b => - { - b.Navigation("Ingredients"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/Aberwyn/Migrations/20250601210321_AddMealNamesToWeeklyMenu.cs b/Aberwyn/Migrations/20250601210321_AddMealNamesToWeeklyMenu.cs deleted file mode 100644 index 0944b37..0000000 --- a/Aberwyn/Migrations/20250601210321_AddMealNamesToWeeklyMenu.cs +++ /dev/null @@ -1,153 +0,0 @@ -ï»żusing Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Aberwyn.Migrations -{ - public partial class AddMealNamesToWeeklyMenu : Migration - { - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropPrimaryKey( - name: "PK_WeeklyMenus", - table: "WeeklyMenus"); - - migrationBuilder.RenameTable( - name: "WeeklyMenus", - newName: "WeeklyMenu"); - - migrationBuilder.AlterColumn( - name: "LunchMealName", - table: "WeeklyMenu", - type: "longtext", - nullable: true, - oldClrType: typeof(string), - oldType: "longtext") - .Annotation("MySql:CharSet", "utf8mb4") - .OldAnnotation("MySql:CharSet", "utf8mb4"); - - migrationBuilder.AlterColumn( - name: "DinnerMealName", - table: "WeeklyMenu", - type: "longtext", - nullable: true, - oldClrType: typeof(string), - oldType: "longtext") - .Annotation("MySql:CharSet", "utf8mb4") - .OldAnnotation("MySql:CharSet", "utf8mb4"); - - migrationBuilder.AlterColumn( - name: "Cook", - table: "WeeklyMenu", - type: "longtext", - nullable: true, - oldClrType: typeof(string), - oldType: "longtext") - .Annotation("MySql:CharSet", "utf8mb4") - .OldAnnotation("MySql:CharSet", "utf8mb4"); - - migrationBuilder.AlterColumn( - name: "BreakfastMealName", - table: "WeeklyMenu", - type: "longtext", - nullable: true, - oldClrType: typeof(string), - oldType: "longtext") - .Annotation("MySql:CharSet", "utf8mb4") - .OldAnnotation("MySql:CharSet", "utf8mb4"); - - migrationBuilder.AddPrimaryKey( - name: "PK_WeeklyMenu", - table: "WeeklyMenu", - column: "Id"); - } - - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropPrimaryKey( - name: "PK_WeeklyMenu", - table: "WeeklyMenu"); - - migrationBuilder.RenameTable( - name: "WeeklyMenu", - newName: "WeeklyMenus"); - - migrationBuilder.UpdateData( - table: "WeeklyMenus", - keyColumn: "LunchMealName", - keyValue: null, - column: "LunchMealName", - value: ""); - - migrationBuilder.AlterColumn( - name: "LunchMealName", - table: "WeeklyMenus", - type: "longtext", - nullable: false, - oldClrType: typeof(string), - oldType: "longtext", - oldNullable: true) - .Annotation("MySql:CharSet", "utf8mb4") - .OldAnnotation("MySql:CharSet", "utf8mb4"); - - migrationBuilder.UpdateData( - table: "WeeklyMenus", - keyColumn: "DinnerMealName", - keyValue: null, - column: "DinnerMealName", - value: ""); - - migrationBuilder.AlterColumn( - name: "DinnerMealName", - table: "WeeklyMenus", - type: "longtext", - nullable: false, - oldClrType: typeof(string), - oldType: "longtext", - oldNullable: true) - .Annotation("MySql:CharSet", "utf8mb4") - .OldAnnotation("MySql:CharSet", "utf8mb4"); - - migrationBuilder.UpdateData( - table: "WeeklyMenus", - keyColumn: "Cook", - keyValue: null, - column: "Cook", - value: ""); - - migrationBuilder.AlterColumn( - name: "Cook", - table: "WeeklyMenus", - type: "longtext", - nullable: false, - oldClrType: typeof(string), - oldType: "longtext", - oldNullable: true) - .Annotation("MySql:CharSet", "utf8mb4") - .OldAnnotation("MySql:CharSet", "utf8mb4"); - - migrationBuilder.UpdateData( - table: "WeeklyMenus", - keyColumn: "BreakfastMealName", - keyValue: null, - column: "BreakfastMealName", - value: ""); - - migrationBuilder.AlterColumn( - name: "BreakfastMealName", - table: "WeeklyMenus", - type: "longtext", - nullable: false, - oldClrType: typeof(string), - oldType: "longtext", - oldNullable: true) - .Annotation("MySql:CharSet", "utf8mb4") - .OldAnnotation("MySql:CharSet", "utf8mb4"); - - migrationBuilder.AddPrimaryKey( - name: "PK_WeeklyMenus", - table: "WeeklyMenus", - column: "Id"); - } - } -} diff --git a/Aberwyn/Migrations/20250531220325_AddMealsToEf.Designer.cs b/Aberwyn/Migrations/20250602131723_InitCleanSlate.Designer.cs similarity index 94% rename from Aberwyn/Migrations/20250531220325_AddMealsToEf.Designer.cs rename to Aberwyn/Migrations/20250602131723_InitCleanSlate.Designer.cs index 50f9484..ece46f1 100644 --- a/Aberwyn/Migrations/20250531220325_AddMealsToEf.Designer.cs +++ b/Aberwyn/Migrations/20250602131723_InitCleanSlate.Designer.cs @@ -11,8 +11,8 @@ using Microsoft.EntityFrameworkCore.Storage.ValueConversion; namespace Aberwyn.Migrations { [DbContext(typeof(ApplicationDbContext))] - [Migration("20250531220325_AddMealsToEf")] - partial class AddMealsToEf + [Migration("20250602131723_InitCleanSlate")] + partial class InitCleanSlate { protected override void BuildTargetModel(ModelBuilder modelBuilder) { @@ -267,34 +267,27 @@ namespace Aberwyn.Migrations .HasColumnType("int"); b.Property("CarbType") - .IsRequired() .HasColumnType("longtext"); b.Property("Category") - .IsRequired() .HasColumnType("longtext"); b.Property("CreatedAt") .HasColumnType("datetime(6)"); b.Property("Description") - .IsRequired() .HasColumnType("longtext"); b.Property("ImageData") - .IsRequired() .HasColumnType("longblob"); b.Property("ImageMimeType") - .IsRequired() .HasColumnType("longtext"); b.Property("ImageUrl") - .IsRequired() .HasColumnType("longtext"); b.Property("Instructions") - .IsRequired() .HasColumnType("longtext"); b.Property("IsAvailable") @@ -305,11 +298,9 @@ namespace Aberwyn.Migrations .HasColumnType("longtext"); b.Property("ProteinType") - .IsRequired() .HasColumnType("longtext"); b.Property("RecipeUrl") - .IsRequired() .HasColumnType("longtext"); b.HasKey("Id"); @@ -369,6 +360,46 @@ namespace Aberwyn.Migrations b.ToTable("PushSubscribers"); }); + modelBuilder.Entity("Aberwyn.Models.TodoTask", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("AssignedTo") + .IsRequired() + .HasColumnType("longtext"); + + b.Property("CreatedAt") + .HasColumnType("datetime(6)"); + + b.Property("Description") + .IsRequired() + .HasColumnType("longtext"); + + b.Property("IsArchived") + .HasColumnType("tinyint(1)"); + + b.Property("Priority") + .HasColumnType("int"); + + b.Property("Status") + .IsRequired() + .HasColumnType("longtext"); + + b.Property("Tags") + .IsRequired() + .HasColumnType("longtext"); + + b.Property("Title") + .IsRequired() + .HasColumnType("longtext"); + + b.HasKey("Id"); + + b.ToTable("TodoTasks"); + }); + modelBuilder.Entity("Aberwyn.Models.WeeklyMenu", b => { b.Property("Id") @@ -378,15 +409,10 @@ namespace Aberwyn.Migrations b.Property("BreakfastMealId") .HasColumnType("int"); - b.Property("BreakfastMealName") - .IsRequired() - .HasColumnType("longtext"); - b.Property("Cook") - .IsRequired() .HasColumnType("longtext"); - b.Property("Date") + b.Property("CreatedAt") .HasColumnType("datetime(6)"); b.Property("DayOfWeek") @@ -395,17 +421,9 @@ namespace Aberwyn.Migrations b.Property("DinnerMealId") .HasColumnType("int"); - b.Property("DinnerMealName") - .IsRequired() - .HasColumnType("longtext"); - b.Property("LunchMealId") .HasColumnType("int"); - b.Property("LunchMealName") - .IsRequired() - .HasColumnType("longtext"); - b.Property("WeekNumber") .HasColumnType("int"); @@ -414,7 +432,7 @@ namespace Aberwyn.Migrations b.HasKey("Id"); - b.ToTable("WeeklyMenus"); + b.ToTable("WeeklyMenu", (string)null); }); modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRole", b => diff --git a/Aberwyn/Migrations/20250602131723_InitCleanSlate.cs b/Aberwyn/Migrations/20250602131723_InitCleanSlate.cs new file mode 100644 index 0000000..6fd52a5 --- /dev/null +++ b/Aberwyn/Migrations/20250602131723_InitCleanSlate.cs @@ -0,0 +1,599 @@ +ï»żusing System; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.Migrations; + +#nullable disable + +namespace Aberwyn.Migrations +{ + public partial class InitCleanSlate : Migration + { + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.AlterDatabase() + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "AppSettings", + columns: table => new + { + Id = table.Column(type: "int", nullable: false) + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + Key = table.Column(type: "longtext", nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + Value = table.Column(type: "longtext", nullable: false) + .Annotation("MySql:CharSet", "utf8mb4") + }, + constraints: table => + { + table.PrimaryKey("PK_AppSettings", x => x.Id); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "AspNetRoles", + columns: table => new + { + Id = table.Column(type: "varchar(255)", nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + Name = table.Column(type: "varchar(256)", maxLength: 256, nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + NormalizedName = table.Column(type: "varchar(256)", maxLength: 256, nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + ConcurrencyStamp = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4") + }, + constraints: table => + { + table.PrimaryKey("PK_AspNetRoles", x => x.Id); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "AspNetUsers", + columns: table => new + { + Id = table.Column(type: "varchar(255)", nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + UserName = table.Column(type: "varchar(256)", maxLength: 256, nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + NormalizedUserName = table.Column(type: "varchar(256)", maxLength: 256, nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + Email = table.Column(type: "varchar(256)", maxLength: 256, nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + NormalizedEmail = table.Column(type: "varchar(256)", maxLength: 256, nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + EmailConfirmed = table.Column(type: "tinyint(1)", nullable: false), + PasswordHash = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + SecurityStamp = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + ConcurrencyStamp = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + PhoneNumber = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + PhoneNumberConfirmed = table.Column(type: "tinyint(1)", nullable: false), + TwoFactorEnabled = table.Column(type: "tinyint(1)", nullable: false), + LockoutEnd = table.Column(type: "datetime(6)", nullable: true), + LockoutEnabled = table.Column(type: "tinyint(1)", nullable: false), + AccessFailedCount = table.Column(type: "int", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_AspNetUsers", x => x.Id); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "BudgetCategoryDefinitions", + columns: table => new + { + Id = table.Column(type: "int", nullable: false) + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + Name = table.Column(type: "longtext", nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + Color = table.Column(type: "longtext", nullable: false) + .Annotation("MySql:CharSet", "utf8mb4") + }, + constraints: table => + { + table.PrimaryKey("PK_BudgetCategoryDefinitions", x => x.Id); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "BudgetItemDefinitions", + columns: table => new + { + Id = table.Column(type: "int", nullable: false) + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + Name = table.Column(type: "longtext", nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + DefaultCategory = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + IsExpense = table.Column(type: "tinyint(1)", nullable: false), + IncludeInSummary = table.Column(type: "tinyint(1)", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_BudgetItemDefinitions", x => x.Id); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "BudgetPeriods", + columns: table => new + { + Id = table.Column(type: "int", nullable: false) + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + Year = table.Column(type: "int", nullable: false), + Month = table.Column(type: "int", nullable: false), + Order = table.Column(type: "int", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_BudgetPeriods", x => x.Id); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "Meals", + columns: table => new + { + Id = table.Column(type: "int", nullable: false) + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + Name = table.Column(type: "longtext", nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + Description = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + ProteinType = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + Category = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + CarbType = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + RecipeUrl = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + ImageUrl = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + IsAvailable = table.Column(type: "tinyint(1)", nullable: false), + CreatedAt = table.Column(type: "datetime(6)", nullable: false), + ImageData = table.Column(type: "longblob", nullable: true), + ImageMimeType = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + Instructions = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4") + }, + constraints: table => + { + table.PrimaryKey("PK_Meals", x => x.Id); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "PizzaOrders", + columns: table => new + { + Id = table.Column(type: "int", nullable: false) + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + CustomerName = table.Column(type: "longtext", nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + PizzaName = table.Column(type: "longtext", nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + IngredientsJson = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + Status = table.Column(type: "longtext", nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + OrderedAt = table.Column(type: "datetime(6)", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_PizzaOrders", x => x.Id); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "PushSubscribers", + columns: table => new + { + Id = table.Column(type: "int", nullable: false) + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + Endpoint = table.Column(type: "longtext", nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + P256DH = table.Column(type: "longtext", nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + Auth = table.Column(type: "longtext", nullable: false) + .Annotation("MySql:CharSet", "utf8mb4") + }, + constraints: table => + { + table.PrimaryKey("PK_PushSubscribers", x => x.Id); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "TodoTasks", + columns: table => new + { + Id = table.Column(type: "int", nullable: false) + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + Title = table.Column(type: "longtext", nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + Description = table.Column(type: "longtext", nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + Priority = table.Column(type: "int", nullable: false), + Status = table.Column(type: "longtext", nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + CreatedAt = table.Column(type: "datetime(6)", nullable: false), + AssignedTo = table.Column(type: "longtext", nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + IsArchived = table.Column(type: "tinyint(1)", nullable: false), + Tags = table.Column(type: "longtext", nullable: false) + .Annotation("MySql:CharSet", "utf8mb4") + }, + constraints: table => + { + table.PrimaryKey("PK_TodoTasks", x => x.Id); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "WeeklyMenu", + columns: table => new + { + Id = table.Column(type: "int", nullable: false) + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + DayOfWeek = table.Column(type: "int", nullable: false), + BreakfastMealId = table.Column(type: "int", nullable: true), + LunchMealId = table.Column(type: "int", nullable: true), + DinnerMealId = table.Column(type: "int", nullable: true), + Cook = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + WeekNumber = table.Column(type: "int", nullable: false), + Year = table.Column(type: "int", nullable: false), + CreatedAt = table.Column(type: "datetime(6)", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_WeeklyMenu", x => x.Id); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "AspNetRoleClaims", + columns: table => new + { + Id = table.Column(type: "int", nullable: false) + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + RoleId = table.Column(type: "varchar(255)", nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + ClaimType = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + ClaimValue = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4") + }, + constraints: table => + { + table.PrimaryKey("PK_AspNetRoleClaims", x => x.Id); + table.ForeignKey( + name: "FK_AspNetRoleClaims_AspNetRoles_RoleId", + column: x => x.RoleId, + principalTable: "AspNetRoles", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "AspNetUserClaims", + columns: table => new + { + Id = table.Column(type: "int", nullable: false) + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + UserId = table.Column(type: "varchar(255)", nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + ClaimType = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + ClaimValue = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4") + }, + constraints: table => + { + table.PrimaryKey("PK_AspNetUserClaims", x => x.Id); + table.ForeignKey( + name: "FK_AspNetUserClaims_AspNetUsers_UserId", + column: x => x.UserId, + principalTable: "AspNetUsers", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "AspNetUserLogins", + columns: table => new + { + LoginProvider = table.Column(type: "varchar(255)", nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + ProviderKey = table.Column(type: "varchar(255)", nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + ProviderDisplayName = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + UserId = table.Column(type: "varchar(255)", nullable: false) + .Annotation("MySql:CharSet", "utf8mb4") + }, + constraints: table => + { + table.PrimaryKey("PK_AspNetUserLogins", x => new { x.LoginProvider, x.ProviderKey }); + table.ForeignKey( + name: "FK_AspNetUserLogins_AspNetUsers_UserId", + column: x => x.UserId, + principalTable: "AspNetUsers", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "AspNetUserRoles", + columns: table => new + { + UserId = table.Column(type: "varchar(255)", nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + RoleId = table.Column(type: "varchar(255)", nullable: false) + .Annotation("MySql:CharSet", "utf8mb4") + }, + constraints: table => + { + table.PrimaryKey("PK_AspNetUserRoles", x => new { x.UserId, x.RoleId }); + table.ForeignKey( + name: "FK_AspNetUserRoles_AspNetRoles_RoleId", + column: x => x.RoleId, + principalTable: "AspNetRoles", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + table.ForeignKey( + name: "FK_AspNetUserRoles_AspNetUsers_UserId", + column: x => x.UserId, + principalTable: "AspNetUsers", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "AspNetUserTokens", + columns: table => new + { + UserId = table.Column(type: "varchar(255)", nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + LoginProvider = table.Column(type: "varchar(255)", nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + Name = table.Column(type: "varchar(255)", nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + Value = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4") + }, + constraints: table => + { + table.PrimaryKey("PK_AspNetUserTokens", x => new { x.UserId, x.LoginProvider, x.Name }); + table.ForeignKey( + name: "FK_AspNetUserTokens_AspNetUsers_UserId", + column: x => x.UserId, + principalTable: "AspNetUsers", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "BudgetCategories", + columns: table => new + { + Id = table.Column(type: "int", nullable: false) + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + Name = table.Column(type: "longtext", nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + Color = table.Column(type: "longtext", nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + BudgetPeriodId = table.Column(type: "int", nullable: false), + Order = table.Column(type: "int", nullable: false), + BudgetCategoryDefinitionId = table.Column(type: "int", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_BudgetCategories", x => x.Id); + table.ForeignKey( + name: "FK_BudgetCategories_BudgetCategoryDefinitions_BudgetCategoryDef~", + column: x => x.BudgetCategoryDefinitionId, + principalTable: "BudgetCategoryDefinitions", + principalColumn: "Id"); + table.ForeignKey( + name: "FK_BudgetCategories_BudgetPeriods_BudgetPeriodId", + column: x => x.BudgetPeriodId, + principalTable: "BudgetPeriods", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "Ingredients", + columns: table => new + { + Id = table.Column(type: "int", nullable: false) + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + MealId = table.Column(type: "int", nullable: false), + Quantity = table.Column(type: "longtext", nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + Item = table.Column(type: "longtext", nullable: false) + .Annotation("MySql:CharSet", "utf8mb4") + }, + constraints: table => + { + table.PrimaryKey("PK_Ingredients", x => x.Id); + table.ForeignKey( + name: "FK_Ingredients_Meals_MealId", + column: x => x.MealId, + principalTable: "Meals", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "BudgetItems", + columns: table => new + { + Id = table.Column(type: "int", nullable: false) + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + Name = table.Column(type: "longtext", nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + Amount = table.Column(type: "decimal(65,30)", nullable: false), + IsExpense = table.Column(type: "tinyint(1)", nullable: false), + IncludeInSummary = table.Column(type: "tinyint(1)", nullable: false), + Order = table.Column(type: "int", nullable: false), + BudgetItemDefinitionId = table.Column(type: "int", nullable: true), + BudgetCategoryId = table.Column(type: "int", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_BudgetItems", x => x.Id); + table.ForeignKey( + name: "FK_BudgetItems_BudgetCategories_BudgetCategoryId", + column: x => x.BudgetCategoryId, + principalTable: "BudgetCategories", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + table.ForeignKey( + name: "FK_BudgetItems_BudgetItemDefinitions_BudgetItemDefinitionId", + column: x => x.BudgetItemDefinitionId, + principalTable: "BudgetItemDefinitions", + principalColumn: "Id"); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateIndex( + name: "IX_AspNetRoleClaims_RoleId", + table: "AspNetRoleClaims", + column: "RoleId"); + + migrationBuilder.CreateIndex( + name: "RoleNameIndex", + table: "AspNetRoles", + column: "NormalizedName", + unique: true); + + migrationBuilder.CreateIndex( + name: "IX_AspNetUserClaims_UserId", + table: "AspNetUserClaims", + column: "UserId"); + + migrationBuilder.CreateIndex( + name: "IX_AspNetUserLogins_UserId", + table: "AspNetUserLogins", + column: "UserId"); + + migrationBuilder.CreateIndex( + name: "IX_AspNetUserRoles_RoleId", + table: "AspNetUserRoles", + column: "RoleId"); + + migrationBuilder.CreateIndex( + name: "EmailIndex", + table: "AspNetUsers", + column: "NormalizedEmail"); + + migrationBuilder.CreateIndex( + name: "UserNameIndex", + table: "AspNetUsers", + column: "NormalizedUserName", + unique: true); + + migrationBuilder.CreateIndex( + name: "IX_BudgetCategories_BudgetCategoryDefinitionId", + table: "BudgetCategories", + column: "BudgetCategoryDefinitionId"); + + migrationBuilder.CreateIndex( + name: "IX_BudgetCategories_BudgetPeriodId", + table: "BudgetCategories", + column: "BudgetPeriodId"); + + migrationBuilder.CreateIndex( + name: "IX_BudgetItems_BudgetCategoryId", + table: "BudgetItems", + column: "BudgetCategoryId"); + + migrationBuilder.CreateIndex( + name: "IX_BudgetItems_BudgetItemDefinitionId", + table: "BudgetItems", + column: "BudgetItemDefinitionId"); + + migrationBuilder.CreateIndex( + name: "IX_Ingredients_MealId", + table: "Ingredients", + column: "MealId"); + } + + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropTable( + name: "AppSettings"); + + migrationBuilder.DropTable( + name: "AspNetRoleClaims"); + + migrationBuilder.DropTable( + name: "AspNetUserClaims"); + + migrationBuilder.DropTable( + name: "AspNetUserLogins"); + + migrationBuilder.DropTable( + name: "AspNetUserRoles"); + + migrationBuilder.DropTable( + name: "AspNetUserTokens"); + + migrationBuilder.DropTable( + name: "BudgetItems"); + + migrationBuilder.DropTable( + name: "Ingredients"); + + migrationBuilder.DropTable( + name: "PizzaOrders"); + + migrationBuilder.DropTable( + name: "PushSubscribers"); + + migrationBuilder.DropTable( + name: "TodoTasks"); + + migrationBuilder.DropTable( + name: "WeeklyMenu"); + + migrationBuilder.DropTable( + name: "AspNetRoles"); + + migrationBuilder.DropTable( + name: "AspNetUsers"); + + migrationBuilder.DropTable( + name: "BudgetCategories"); + + migrationBuilder.DropTable( + name: "BudgetItemDefinitions"); + + migrationBuilder.DropTable( + name: "Meals"); + + migrationBuilder.DropTable( + name: "BudgetCategoryDefinitions"); + + migrationBuilder.DropTable( + name: "BudgetPeriods"); + } + } +} diff --git a/Aberwyn/Migrations/ApplicationDbContextModelSnapshot.cs b/Aberwyn/Migrations/ApplicationDbContextModelSnapshot.cs index 783f134..7796a58 100644 --- a/Aberwyn/Migrations/ApplicationDbContextModelSnapshot.cs +++ b/Aberwyn/Migrations/ApplicationDbContextModelSnapshot.cs @@ -358,6 +358,81 @@ namespace Aberwyn.Migrations b.ToTable("PushSubscribers"); }); + modelBuilder.Entity("Aberwyn.Models.TodoTask", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("AssignedTo") + .IsRequired() + .HasColumnType("longtext"); + + b.Property("CreatedAt") + .HasColumnType("datetime(6)"); + + b.Property("Description") + .IsRequired() + .HasColumnType("longtext"); + + b.Property("IsArchived") + .HasColumnType("tinyint(1)"); + + b.Property("Priority") + .HasColumnType("int"); + + b.Property("Status") + .IsRequired() + .HasColumnType("longtext"); + + b.Property("Tags") + .IsRequired() + .HasColumnType("longtext"); + + b.Property("Title") + .IsRequired() + .HasColumnType("longtext"); + + b.HasKey("Id"); + + b.ToTable("TodoTasks"); + }); + + modelBuilder.Entity("Aberwyn.Models.WeeklyMenu", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("BreakfastMealId") + .HasColumnType("int"); + + b.Property("Cook") + .HasColumnType("longtext"); + + b.Property("CreatedAt") + .HasColumnType("datetime(6)"); + + b.Property("DayOfWeek") + .HasColumnType("int"); + + b.Property("DinnerMealId") + .HasColumnType("int"); + + b.Property("LunchMealId") + .HasColumnType("int"); + + b.Property("WeekNumber") + .HasColumnType("int"); + + b.Property("Year") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.ToTable("WeeklyMenu", (string)null); + }); + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRole", b => { b.Property("Id") diff --git a/Aberwyn/Models/AppSetting.cs b/Aberwyn/Models/AppSetting.cs index 2674ce2..0ec1c95 100644 --- a/Aberwyn/Models/AppSetting.cs +++ b/Aberwyn/Models/AppSetting.cs @@ -11,10 +11,16 @@ { public int Id { get; set; } public string Title { get; set; } - public string Status { get; set; } // "ideas", "doing", "done" - public DateTime CreatedAt { get; set; } + public string Description { get; set; } public int Priority { get; set; } + public string Status { get; set; } // e.g., "ideas", "doing", "done" + public DateTime CreatedAt { get; set; } + public string AssignedTo { get; set; } // Ex: namn eller anvĂ€ndarnamn + public bool IsArchived { get; set; } + public string Tags { get; set; } // Komma-separerad t.ex. "frontend,bug" } + + } diff --git a/Aberwyn/Models/MenuViewModel.cs b/Aberwyn/Models/MenuViewModel.cs index b73721b..57ee9d0 100644 --- a/Aberwyn/Models/MenuViewModel.cs +++ b/Aberwyn/Models/MenuViewModel.cs @@ -22,12 +22,13 @@ public class WeeklyMenu public string? Cook { get; set; } public int WeekNumber { get; set; } public int Year { get; set; } + public DateTime CreatedAt { get; set; } - [NotMapped] public string? BreakfastMealName { get; set; } + [NotMapped] public string? BreakfastMealName { get; set; } [NotMapped] public string? LunchMealName { get; set; } [NotMapped] public string? DinnerMealName { get; set; } - [NotMapped] public DateTime Date { get; set; } + } diff --git a/Aberwyn/Program.cs b/Aberwyn/Program.cs index d4b8af4..19d3574 100644 --- a/Aberwyn/Program.cs +++ b/Aberwyn/Program.cs @@ -10,7 +10,23 @@ using Aberwyn.Models; using Microsoft.AspNetCore.Identity; using Microsoft.AspNetCore.Identity.EntityFrameworkCore; -var builder = WebApplication.CreateBuilder(args); +var config = new ConfigurationBuilder() + .SetBasePath(Directory.GetCurrentDirectory()) + .AddJsonFile("appsettings.json", optional: false) + .AddJsonFile($"appsettings.{Environment.GetEnvironmentVariable("ASPNETCORE_ENVIRONMENT") ?? "Production"}.json", optional: true) + .AddEnvironmentVariables() + .Build(); +Console.WriteLine("📩 DEBUG: laddad raw-connectionstring: " + config.GetConnectionString("DefaultConnection")); + +var builder = WebApplication.CreateBuilder(new WebApplicationOptions +{ + Args = args, + EnvironmentName = Environment.GetEnvironmentVariable("ASPNETCORE_ENVIRONMENT") ?? "Production" +}); +builder.Configuration.AddConfiguration(config); +Console.WriteLine("🌍 Miljö: " + builder.Environment.EnvironmentName); +Console.WriteLine("🔗 Connection string: " + builder.Configuration.GetConnectionString("DefaultConnection")); + // Add services to the container. builder.Services.AddControllersWithViews() @@ -32,12 +48,15 @@ builder.Services.AddRazorPages(); builder.Services.AddHttpClient(); // Configure your DbContext with MySQLs +Console.WriteLine("🔗 Connection string: " + builder.Configuration.GetConnectionString("DefaultConnection")); builder.Services.AddDbContext(options => options.UseMySql( builder.Configuration.GetConnectionString("DefaultConnection"), - new MySqlServerVersion(new Version(8, 0, 36)) - )); + new MySqlServerVersion(new Version(8, 0, 36)), + mySqlOptions => mySqlOptions.EnableRetryOnFailure() + ) +); builder.Services.AddIdentity(options => @@ -82,10 +101,11 @@ builder.Services.Configure(options => options.SupportedCultures = supportedCultures; options.SupportedUICultures = supportedCultures; }); -builder.Configuration - .SetBasePath(Directory.GetCurrentDirectory()) - .AddJsonFile("appsettings.json", optional: false, reloadOnChange: true) - .AddEnvironmentVariables(); + +//builder.Configuration +// .SetBasePath(Directory.GetCurrentDirectory()) +// .AddJsonFile($"appsettings.{builder.Environment.EnvironmentName}.json", optional: true, reloadOnChange: true) +// .AddEnvironmentVariables(); builder.Services.AddSingleton(sp => { var config = sp.GetRequiredService(); @@ -124,17 +144,37 @@ app.MapRazorPages(); using (var scope = app.Services.CreateScope()) { var services = scope.ServiceProvider; - await IdentityDataInitializer.SeedData(services); -} -using (var scope = app.Services.CreateScope()) -{ - var services = scope.ServiceProvider; - await IdentityDataInitializer.SeedData(services); var context = services.GetRequiredService(); - await TestDataSeeder.SeedBudget(context); + // VĂ€nta tills databasen Ă€r redo + int retries = 10; + while (retries > 0) + { + try + { + context.Database.OpenConnection(); // bara testa öppna anslutningen + context.Database.CloseConnection(); + break; // lyckades! + } + catch + { + retries--; + Console.WriteLine("⏳ VĂ€ntar pĂ„ databas..."); + Thread.Sleep(3000); + } + } + + // Kör alla EF-migrationer automatiskt + context.Database.Migrate(); + + // Skapa standardroller och admin + await IdentityDataInitializer.SeedData(services); + + // (valfritt) LĂ€gg in exempelbudgetdata + // await TestDataSeeder.SeedBudget(context); } + app.Run(); diff --git a/Aberwyn/Properties/launchSettings.json b/Aberwyn/Properties/launchSettings.json index 9ab0a23..66d0fc0 100644 --- a/Aberwyn/Properties/launchSettings.json +++ b/Aberwyn/Properties/launchSettings.json @@ -8,28 +8,35 @@ } }, "profiles": { - "Aberwyn": { + "Aberwyn (Dev)": { "commandName": "Project", "launchBrowser": true, "environmentVariables": { "ASPNETCORE_ENVIRONMENT": "Development" }, - "applicationUrl": "https://localhost:7290;http://localhost:5290", - "dotnetRunMessages": true + "applicationUrl": "https://localhost:7290;http://localhost:5290" }, - "IIS Express": { - "commandName": "IISExpress", + "Aberwyn (Prod)": { + "commandName": "Project", "launchBrowser": true, "environmentVariables": { - "ASPNETCORE_ENVIRONMENT": "Development" - } + "ASPNETCORE_ENVIRONMENT": "Production" + }, + "applicationUrl": "https://localhost:7290;http://localhost:5290" }, - "Docker": { - "commandName": "Docker", - "launchBrowser": true, - "launchUrl": "{Scheme}://{ServiceHost}:{ServicePort}", - "publishAllPorts": true, - "useSSL": true + "IIS Express": { + "commandName": "IISExpress", + "launchBrowser": true, + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" } + }, + "Docker": { + "commandName": "Docker", + "launchBrowser": true, + "launchUrl": "{Scheme}://{ServiceHost}:{ServicePort}", + "publishAllPorts": true, + "useSSL": true } +} } \ No newline at end of file diff --git a/Aberwyn/Views/Admin/Index.cshtml b/Aberwyn/Views/Admin/Index.cshtml index 3c7bc5c..c370eed 100644 --- a/Aberwyn/Views/Admin/Index.cshtml +++ b/Aberwyn/Views/Admin/Index.cshtml @@ -92,6 +92,9 @@
+
+ +
+ + - +

đŸ—‚ïž Min idĂ©-board

-
-
-

{{ col.title }}

+
+
+

{{ col.Title }}

-
- {{ task.title }} + task="task"> + {{ task.Title }}
Prioritet: - @@ -88,136 +93,18 @@
-
- - + - +
- diff --git a/Aberwyn/Views/Shared/_LoginPartial.cshtml b/Aberwyn/Views/Shared/_LoginPartial.cshtml index 8c35549..1f1c8f2 100644 --- a/Aberwyn/Views/Shared/_LoginPartial.cshtml +++ b/Aberwyn/Views/Shared/_LoginPartial.cshtml @@ -1,4 +1,4 @@ -@using Microsoft.AspNetCore.Identity +ï»ż@using Microsoft.AspNetCore.Identity @using Aberwyn.Models @inject SignInManager SignInManager @inject UserManager UserManager @@ -32,7 +32,7 @@ else
- + @@ -54,7 +54,7 @@ else }); }); - // Förhindra att klick i dropdownen stänger den + // Förhindra att klick i dropdownen stĂ€nger den document.querySelectorAll('.auth-dropdown').forEach(dropdown => { dropdown.addEventListener('click', e => e.stopPropagation()); }); diff --git a/Aberwyn/appsettings.Development.json b/Aberwyn/appsettings.Development.json index 8343ee2..c537901 100644 --- a/Aberwyn/appsettings.Development.json +++ b/Aberwyn/appsettings.Development.json @@ -6,7 +6,7 @@ } }, "ConnectionStrings": { - "DefaultConnection": "server=dev-db;database=AberwynDev;user=xxx;password=xxx;", + "DefaultConnection": "Server=mysql;Database=aberwyn_dev;User=aberwyn;Password=3edc4RFV;", "ProdConnection": "Server=192.168.1.108;Database=Nevyn;Uid=root;Pwd=3edc4RFV;" } diff --git a/Aberwyn/appsettings.Production.json b/Aberwyn/appsettings.Production.json new file mode 100644 index 0000000..200eef8 --- /dev/null +++ b/Aberwyn/appsettings.Production.json @@ -0,0 +1,5 @@ +{ + "ConnectionStrings": { + "DefaultConnection": "Server=mysql;Database=aberwyn_prod;User=aberwyn;Password=3edc4RFV;" + } +} \ No newline at end of file diff --git a/Aberwyn/appsettings.json b/Aberwyn/appsettings.json index fd05d1c..6e172d0 100644 --- a/Aberwyn/appsettings.json +++ b/Aberwyn/appsettings.json @@ -7,7 +7,7 @@ }, "AllowedHosts": "*", "ConnectionStrings": { - "DefaultConnection": "Server=localhost;Port=3306;Database=aberwyn;User=aberwyn;Password=devpass;" + "DefaultConnection": "Server=mysql;Database=aberwyn_dev;User=aberwyn;Password=3edc4RFV;" }, "VapidKeys": { "Subject": "mailto:e@zcz.se", diff --git a/Aberwyn/connection-log.txt b/Aberwyn/connection-log.txt index 1c45e8b..d54cef6 100644 --- a/Aberwyn/connection-log.txt +++ b/Aberwyn/connection-log.txt @@ -1 +1 @@ -Connection string: Server=localhost;Port=3306;Database=aberwyn;User=aberwyn;Password=devpass; \ No newline at end of file +Connection string: Server=127.0.0.1;Port=3306;Database=aberwyn_dev;User=root;Password=rootpass; \ No newline at end of file diff --git a/Aberwyn/wwwroot/js/todo.js b/Aberwyn/wwwroot/js/todo.js new file mode 100644 index 0000000..eb19436 --- /dev/null +++ b/Aberwyn/wwwroot/js/todo.js @@ -0,0 +1,120 @@ +ï»żvar app = angular.module("todoApp", []); + +app.controller("TodoController", function ($scope, $http) { + $scope.Columns = [ + { Id: "ideas", Title: "💡 IdĂ©er" }, + { Id: "doing", Title: "🔧 PĂ„gĂ„ende" }, + { Id: "done", Title: "✅ Klart" } + ]; + + $scope.Tasks = []; + $scope.NewTask = { + Title: '', + Priority: 2 + }; + + $scope.LoadTasks = function () { + $http.get("/Admin/GetTodoTasks").then(res => { + $scope.Tasks = res.data; + }); + }; + + $scope.AddTask = function () { + const title = $scope.NewTask.Title; + const priority = $scope.NewTask.Priority; + + if (typeof title !== 'string' || !title.trim()) { + return; + } + + const task = { + Title: title.trim(), + Status: "ideas", + Priority: priority + }; + + $http.post("/Admin/AddTodoTask", task, { + headers: { 'Content-Type': 'application/json' } + }).then(res => { + $scope.Tasks.push(res.data); + $scope.NewTask.Title = ''; + $scope.NewTask.Priority = 2; + }, err => { + console.error("Fel vid POST:", err); + }); + }; + + $scope.MoveTask = function (droppedTask, newStatus) { + const task = $scope.Tasks.find(t => t.Id === droppedTask.Id); + if (!task || task.Status === newStatus) return; + + task.Status = newStatus; + + $http.post("/Admin/UpdateTodoTask", task) + .catch(err => console.error("Fel vid uppdatering:", err)); + }; + + + + + $scope.UpdatePriority = function (task) { + $http.post("/Admin/UpdateTodoTask", task); + }; + + $scope.PriorityClass = function (priority) { + return { + 1: 'priority-low', + 2: 'priority-medium', + 3: 'priority-high' + }[priority]; + }; + + $scope.FilteredTasks = function (status) { + if (!$scope.Tasks || !$scope.Tasks.length) return []; + return $scope.Tasks.filter(t => (t.Status || '').toLowerCase() === status.toLowerCase()); + }; + + $scope.LoadTasks(); +}); +app.directive("droppableColumn", function () { + return { + restrict: "A", + scope: { + columnId: "@", + onDrop: "&" + }, + link: function (scope, element) { + element.on("dragover", function (e) { + e.preventDefault(); + element.css("background-color", "#e0f2fe"); + }); + element.on("dragleave", function () { + element.css("background-color", ""); + }); + element.on("drop", function (e) { + e.preventDefault(); + const data = e.dataTransfer.getData("text/plain"); + const task = JSON.parse(data); + scope.onDrop({ task: task, columnId: scope.columnId }); + element.css("background-color", ""); + scope.$apply(); + }); + } + }; +}); + +app.directive("draggableTask", function () { + return { + restrict: "A", + scope: { + task: "=", + onTaskDrop: "&" + }, + link: function (scope, element) { + element.attr("draggable", true); + element.on("dragstart", function (e) { + e.dataTransfer.setData("text/plain", JSON.stringify(scope.task)); + }); + } + }; +});