From 86bec71c3ea22fa24fabb50931cad50a7104b857 Mon Sep 17 00:00:00 2001
From: pytas0811 <105399564+pytas0811@users.noreply.github.com>
Date: Mon, 18 Sep 2023 01:35:49 +0700
Subject: [PATCH 01/53] Update new database
---
src/Domain/Entities/Customer.cs | 28 +-
src/Domain/Entities/LaundryStore.cs | 31 +-
src/Domain/Entities/Order.cs | 37 +-
src/Domain/Entities/OrderHistory.cs | 25 +-
src/Domain/Entities/PaymentMethod.cs | 2 +-
src/Domain/Entities/Staff.cs | 24 +-
.../Entities/{StaffTrip.cs => Staff_Trip.cs} | 29 +-
src/Domain/Entities/Transaction.cs | 20 +-
src/Domain/Entities/Validation/Validate.cs | 36 +-
.../Identity/ApplicationUser.cs | 3 +-
src/Infrastructure/Infrastructure.csproj | 4 +
.../Persistence/ApplicationDbContext.cs | 8 +-
.../00000000000000_InitialCreate.Designer.cs | 539 ---------
.../00000000000000_InitialCreate.cs | 380 ------
.../20230914161433_InitMigration.Designer.cs | 540 ---------
.../20230914161433_InitMigration.cs | 22 -
.../20230914220515_InitialDatabase.cs | 413 -------
...0230914221506_InitialDatabase2.Designer.cs | 1072 -----------------
.../20230914221506_InitialDatabase2.cs | 48 -
...20230917182804_OptimizeEntity.Designer.cs} | 169 ++-
.../20230917182804_OptimizeEntity.cs | 782 ++++++++++++
.../ApplicationDbContextModelSnapshot.cs | 315 ++---
src/WebUI/appsettings.json | 2 +-
23 files changed, 1148 insertions(+), 3381 deletions(-)
rename src/Domain/Entities/{StaffTrip.cs => Staff_Trip.cs} (60%)
delete mode 100644 src/Infrastructure/Persistence/Migrations/00000000000000_InitialCreate.Designer.cs
delete mode 100644 src/Infrastructure/Persistence/Migrations/00000000000000_InitialCreate.cs
delete mode 100644 src/Infrastructure/Persistence/Migrations/20230914161433_InitMigration.Designer.cs
delete mode 100644 src/Infrastructure/Persistence/Migrations/20230914161433_InitMigration.cs
delete mode 100644 src/Infrastructure/Persistence/Migrations/20230914220515_InitialDatabase.cs
delete mode 100644 src/Infrastructure/Persistence/Migrations/20230914221506_InitialDatabase2.Designer.cs
delete mode 100644 src/Infrastructure/Persistence/Migrations/20230914221506_InitialDatabase2.cs
rename src/Infrastructure/Persistence/Migrations/{20230914220515_InitialDatabase.Designer.cs => 20230917182804_OptimizeEntity.Designer.cs} (91%)
create mode 100644 src/Infrastructure/Persistence/Migrations/20230917182804_OptimizeEntity.cs
diff --git a/src/Domain/Entities/Customer.cs b/src/Domain/Entities/Customer.cs
index c7c988e..2e2ef54 100644
--- a/src/Domain/Entities/Customer.cs
+++ b/src/Domain/Entities/Customer.cs
@@ -1,5 +1,4 @@
using System.ComponentModel.DataAnnotations.Schema;
-using System.Text.RegularExpressions;
using SWD_Laundry_Backend.Domain.Entities.Validation;
using SWD_Laundry_Backend.Domain.IdentityModel;
@@ -9,25 +8,28 @@ namespace SWD_Laundry_Backend.Domain.Entities;
public class Customer : BaseAuditableEntity
{
- public string Address { get; set; }
+ public string Name { get; set; }
+ //public string Address { get; set; }
+
+ #region Relationship
+
+ [ForeignKey("Building")]
+ public int BuildingID { get; set; }
- ///
- /// Relationship
- ///
- ///
[ForeignKey("Wallet")]
public int WalletID { get; set; }
[ForeignKey("ApplicationUser")]
public string ApplicationUserID { get; set; }
+ public Building Building { get; set; }
public Wallet Wallet { get; set; }
public ApplicationUser ApplicationUser { get; set; }
- ///
- /// Special attributes
- ///
- ///
+ #endregion Relationship
+
+ #region Special Attribute
+
private string _email;
private string _phone;
@@ -39,7 +41,7 @@ public string Email
{
_email = new Validate().IsValidEmail(value)
? value
- : throw new ArgumentException("Not valid mail.");
+ : throw new ArgumentException("Invalid email.");
}
}
@@ -50,7 +52,9 @@ public string Phone
{
_phone = new Validate().IsValidPhone(value)
? value
- : throw new ArgumentException("Not valid phone.");
+ : throw new ArgumentException("Invalid phone (must be 9-10 numbers and start with 09 or 01).");
}
}
+
+ #endregion Special Attribute
}
\ No newline at end of file
diff --git a/src/Domain/Entities/LaundryStore.cs b/src/Domain/Entities/LaundryStore.cs
index b87c98e..33163d5 100644
--- a/src/Domain/Entities/LaundryStore.cs
+++ b/src/Domain/Entities/LaundryStore.cs
@@ -1,9 +1,4 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-using SWD_Laundry_Backend.Domain.Entities.Validation;
+using SWD_Laundry_Backend.Domain.Entities.Validation;
using SWD_Laundry_Backend.Domain.IdentityModel;
namespace SWD_Laundry_Backend.Domain.Entities;
@@ -11,12 +6,14 @@ namespace SWD_Laundry_Backend.Domain.Entities;
public class LaundryStore : BaseAuditableEntity
{
+ public string Name { get; set; }
public string Address { get; set; }
+ public DateTime StartTime { get; set; }
+ public DateTime EndTime { get; set; }
+ public bool Status { get; set; }
+
+ #region Relationship
- ///
- /// Relationship
- ///
- ///
public string ApplicationUserID { get; set; }
public int WalletID { get; set; }
@@ -24,10 +21,10 @@ public class LaundryStore : BaseAuditableEntity
public ApplicationUser ApplicationUser { get; set; }
public Wallet Wallet { get; set; }
- ///
- /// Special attributes
- ///
- ///
+ #endregion Relationship
+
+ #region Special Attribute
+
private string _email;
private string _phone;
@@ -39,7 +36,7 @@ public string Email
{
_email = new Validate().IsValidEmail(value)
? value
- : throw new ArgumentException("Not valid mail.");
+ : throw new ArgumentException("Invalid email.");
}
}
@@ -50,7 +47,9 @@ public string Phone
{
_phone = new Validate().IsValidPhone(value)
? value
- : throw new ArgumentException("Not valid phone.");
+ : throw new ArgumentException("Invalid phone (must be 9-10 numbers and start with 09 or 01).");
}
}
+
+ #endregion Special Attribute
}
\ No newline at end of file
diff --git a/src/Domain/Entities/Order.cs b/src/Domain/Entities/Order.cs
index 9e7e1cb..71869b5 100644
--- a/src/Domain/Entities/Order.cs
+++ b/src/Domain/Entities/Order.cs
@@ -12,24 +12,41 @@ namespace SWD_Laundry_Backend.Domain.Entities;
public class Order : BaseAuditableEntity
{
+
public DateTime OrderDate { get; set; }
- public DateTime ShipDate { get; set; }
- public decimal Amount { get; set; }
+ public DateTime ExpectedFinishDate { get; set; }
+ public string Address { get; set; } // Address = Customer's building location
+ public short Amount { get; set; }
+ public bool IsWhiteClothes { get; set; }
+ public double TotalPrice { get; set; }
+
+ #region Relationship
- ///
- /// Relationship
- ///
- ///
[ForeignKey("PaymentMethod")]
public int PaymentMethodID { get; set; }
- [ForeignKey("Building")]
- public int BuildingID { get; set; }
-
[ForeignKey("ApplicationUser")]
public string ApplicationUserID { get; set; }
public ApplicationUser ApplicationUser { get; set; }
public PaymentMethod PaymentMethod { get; set; }
- public Building Building { get; set; }
+
+ #endregion Relationship
+
+ #region Special Attribute
+
+ private string _orderType;
+
+ public string OrderType
+ {
+ get => _orderType;
+ set
+ {
+ _orderType = new Validate().IsValidOrderType(value)
+ ? value
+ : throw new Exception("Invalid order type {ONEWAY, TWOWAY}");
+ }
+ }
+
+ #endregion Special Attribute
}
\ No newline at end of file
diff --git a/src/Domain/Entities/OrderHistory.cs b/src/Domain/Entities/OrderHistory.cs
index a698815..a5a820a 100644
--- a/src/Domain/Entities/OrderHistory.cs
+++ b/src/Domain/Entities/OrderHistory.cs
@@ -1,9 +1,4 @@
-using System;
-using System.Collections.Generic;
-using System.ComponentModel.DataAnnotations.Schema;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
+using System.ComponentModel.DataAnnotations.Schema;
using SWD_Laundry_Backend.Domain.Entities.Validation;
namespace SWD_Laundry_Backend.Domain.Entities;
@@ -11,19 +6,17 @@ namespace SWD_Laundry_Backend.Domain.Entities;
public class OrderHistory : BaseAuditableEntity
{
- ///
- /// Relationship
- ///
- ///
+ #region Relationship
+
[ForeignKey("Order")]
public int OrderID { get; set; }
public Order Order { get; set; }
- ///
- /// Special attributes
- ///
- ///
+ #endregion Relationship
+
+ #region Special attributes
+
private string _orderstatus;
public string Status
@@ -33,7 +26,9 @@ public string Status
{
_orderstatus = new Validate().IsValidTripStatus(value)
? value
- : throw new ArgumentException("Not valid order status.");
+ : throw new ArgumentException("Invalid order status {FINISHED, PROCESSING, CANCELLED}.");
}
}
+
+ #endregion Special attributes
}
\ No newline at end of file
diff --git a/src/Domain/Entities/PaymentMethod.cs b/src/Domain/Entities/PaymentMethod.cs
index 5c5e901..065a6ac 100644
--- a/src/Domain/Entities/PaymentMethod.cs
+++ b/src/Domain/Entities/PaymentMethod.cs
@@ -19,7 +19,7 @@ public string PaymentType
{
_type = new Validate().IsValidPayment(value)
? value
- : throw new ArgumentException("Not valid payment type.");
+ : throw new ArgumentException("Invalid payment type{CASH , PAYPAL}.");
}
}
}
\ No newline at end of file
diff --git a/src/Domain/Entities/Staff.cs b/src/Domain/Entities/Staff.cs
index ea738ed..f20bc7b 100644
--- a/src/Domain/Entities/Staff.cs
+++ b/src/Domain/Entities/Staff.cs
@@ -9,12 +9,10 @@ public class Staff : BaseAuditableEntity
{
public DateTime Dob { get; set; }
public string Address { get; set; }
- public decimal Salary { get; set; }
+ public double Salary { get; set; }
+
+ #region Relationship
- ///
- /// Relationship
- ///
- ///
[ForeignKey("Wallet")]
public int WalletID { get; set; }
@@ -24,10 +22,10 @@ public class Staff : BaseAuditableEntity
public ApplicationUser ApplicationUser { get; set; }
public Wallet Wallet { get; set; }
- ///
- /// Special attributes
- ///
- ///
+ #endregion Relationship
+
+ #region Special Attribute
+
private string _email;
private string _phone;
@@ -40,7 +38,7 @@ public string Role
{
_role = new Validate().IsValidStaffRole(value)
? value
- : throw new ArgumentException("Not valid staff role.");
+ : throw new ArgumentException("Invalid staff role {COLLECTOR, RECEIVER}.");
}
}
@@ -51,7 +49,7 @@ public string Email
{
_email = new Validate().IsValidEmail(value)
? value
- : throw new ArgumentException("Not valid mail.");
+ : throw new ArgumentException("Invalid email.");
}
}
@@ -62,7 +60,9 @@ public string Phone
{
_phone = new Validate().IsValidPhone(value)
? value
- : throw new ArgumentException("Not valid phone.");
+ : throw new ArgumentException("Invalid phone (must be 9-10 numbers and start with 09 or 01).");
}
}
+
+ #endregion Special Attribute
}
\ No newline at end of file
diff --git a/src/Domain/Entities/StaffTrip.cs b/src/Domain/Entities/Staff_Trip.cs
similarity index 60%
rename from src/Domain/Entities/StaffTrip.cs
rename to src/Domain/Entities/Staff_Trip.cs
index bd7baf3..c4f5c27 100644
--- a/src/Domain/Entities/StaffTrip.cs
+++ b/src/Domain/Entities/Staff_Trip.cs
@@ -1,37 +1,32 @@
using System.ComponentModel.DataAnnotations.Schema;
+using Microsoft.EntityFrameworkCore.Storage.ValueConversion.Internal;
using SWD_Laundry_Backend.Domain.Entities.Validation;
namespace SWD_Laundry_Backend.Domain.Entities;
#nullable disable
-public class StaffTrip : BaseAuditableEntity
+public class Staff_Trip : BaseAuditableEntity
{
- //public DateOnly TripDate { get; set; }
+ public string Address { get; set; }
public DateTime StartTime { get; set; }
+
public DateTime EndTime { get; set; }
public decimal TripCollect { get; set; } = 0;
-
- ///
- /// Relationship
- ///
- ///
- [ForeignKey("Building")]
- public int BuildingID { get; set; }
+ #region Relationship
[ForeignKey("Staff")]
public int StaffID { get; set; }
- public Building Building { get; set; }
-
public Staff Staff { get; set; }
- ///
- /// Special attributes
- ///
- ///
+ #endregion Relationship
+
+ #region Special Attribute
+
private string _tripstatus;
+
public string TripStatus
{
get { return _tripstatus; }
@@ -39,7 +34,9 @@ public string TripStatus
{
_tripstatus = new Validate().IsValidTripStatus(value)
? value
- : throw new ArgumentException("Not valid trip status.");
+ : throw new ArgumentException("Invalid trip status {FINISHED, PROCESSING, CANCELLED}.");
}
}
+
+ #endregion Special Attribute
}
\ No newline at end of file
diff --git a/src/Domain/Entities/Transaction.cs b/src/Domain/Entities/Transaction.cs
index 9a1dd76..6a3e82d 100644
--- a/src/Domain/Entities/Transaction.cs
+++ b/src/Domain/Entities/Transaction.cs
@@ -9,18 +9,16 @@ public class Transaction : BaseAuditableEntity
public decimal Amount { get; set; }
public string Description { get; set; }
- ///
- /// Relationship
- ///
- ///
+ #region Relationship
+
public int WalletID { get; set; }
public List Wallet { get; set; }
- ///
- /// Special attribute
- ///
- ///
+ #endregion Relationship
+
+ #region Special Attribute
+
private string _transactiontype;
private string _status;
@@ -31,7 +29,7 @@ public string TransactionType
set
{
if (!new Validate().IsValidTransactionType(value))
- throw new ArgumentException("Not valid transaction type.");
+ throw new ArgumentException("Invalid transaction type {DEPOSIT, WITHDRAWAL, DEBT, PAID}.");
_transactiontype = value;
}
}
@@ -42,8 +40,10 @@ public string Status
set
{
if (!new Validate().IsValidTransactionStatus(value))
- throw new ArgumentException("Not valid transaction status.");
+ throw new ArgumentException("Invalid transaction status {FINISHED, PROCESSING, CANCELLED}.");
_status = value;
}
}
+
+ #endregion Special Attribute
}
\ No newline at end of file
diff --git a/src/Domain/Entities/Validation/Validate.cs b/src/Domain/Entities/Validation/Validate.cs
index ed593fa..32b1227 100644
--- a/src/Domain/Entities/Validation/Validate.cs
+++ b/src/Domain/Entities/Validation/Validate.cs
@@ -17,7 +17,7 @@ public bool IsValidTransactionType(string type)
public bool IsValidTransactionStatus(string status)
{
- return TransactionStatus.Contains(status);
+ return Status.Contains(status);
}
public bool IsValidPhone(string phone)
@@ -34,37 +34,45 @@ public bool IsValidEmail(string email)
public bool IsValidTripStatus(string status)
{
- return TripStatus.Contains(status);
+ return Status.Contains(status);
}
public bool IsValidPayment(string payment)
{
return Payment.Contains(payment);
}
+
+ public bool IsValidOrderType(string value)
+ {
+ return OrderType.Contains(value);
+ }
+
//=======================================================
- public string[] Payment = new string[]
+ private readonly string[] OrderType = new string[]
+ {
+ "ONEWAY","TWOWAY"
+ };
+
+ private readonly string[] Payment = new string[]
{
- "Cash","Paypal"
+ "CASH","PAYPAL"
};
- public string[] TripStatus = new string[]
+ private readonly string[] Status = new string[]
{
- "Finished","Processing","Cancelled"
+ "FINISHED","PROCESSING","CANCELLED"
};
- public string[] StaffRole = new string[]
+ private readonly string[] StaffRole = new string[]
{
- "Collector","Receiver"
+ "COLLECTOR","RECEIVER"
};
- public string[] AllowedTransactionType = new string[]
+ private readonly string[] AllowedTransactionType = new string[]
{
- "Deposit","Withdrawal", "Debt", "Paid"
+ "DEPOSIT","WITHDRAWAL", "DEBT", "PAID"
};
- public string[] TransactionStatus = new string[]
- {
- "Success","Processing","Fail"
- };
+
}
\ No newline at end of file
diff --git a/src/Infrastructure/Identity/ApplicationUser.cs b/src/Infrastructure/Identity/ApplicationUser.cs
index 6072d61..a65ac7b 100644
--- a/src/Infrastructure/Identity/ApplicationUser.cs
+++ b/src/Infrastructure/Identity/ApplicationUser.cs
@@ -4,5 +4,4 @@ namespace SWD_Laundry_Backend.Infrastructure.Identity;
public class ApplicationUser : IdentityUser
{
- public string? Name { get; set; }
-}
+}
\ No newline at end of file
diff --git a/src/Infrastructure/Infrastructure.csproj b/src/Infrastructure/Infrastructure.csproj
index e6dfee7..5503c3a 100644
--- a/src/Infrastructure/Infrastructure.csproj
+++ b/src/Infrastructure/Infrastructure.csproj
@@ -22,4 +22,8 @@
+
+
+
+
diff --git a/src/Infrastructure/Persistence/ApplicationDbContext.cs b/src/Infrastructure/Persistence/ApplicationDbContext.cs
index 2b1328e..157d6b2 100644
--- a/src/Infrastructure/Persistence/ApplicationDbContext.cs
+++ b/src/Infrastructure/Persistence/ApplicationDbContext.cs
@@ -6,8 +6,9 @@
using Microsoft.Extensions.Options;
using SWD_Laundry_Backend.Application.Common.Interfaces;
using SWD_Laundry_Backend.Domain.Entities;
-using SWD_Laundry_Backend.Domain.IdentityModel;
-//using SWD_Laundry_Backend.Infrastructure.Identity;
+
+//using SWD_Laundry_Backend.Domain.IdentityModel;
+using SWD_Laundry_Backend.Infrastructure.Identity;
using SWD_Laundry_Backend.Infrastructure.Persistence.Interceptors;
namespace SWD_Laundry_Backend.Infrastructure.Persistence;
@@ -40,8 +41,9 @@ public ApplicationDbContext(
public DbSet Orders => Set();
public DbSet OrderHistory => Set();
public DbSet PaymentMethods => Set();
+ public DbSet Staff_Trips => Set();
public DbSet Staffs => Set();
- public DbSet Stasts => Set();
+
public DbSet Transactions => Set();
public DbSet Wallets => Set();
diff --git a/src/Infrastructure/Persistence/Migrations/00000000000000_InitialCreate.Designer.cs b/src/Infrastructure/Persistence/Migrations/00000000000000_InitialCreate.Designer.cs
deleted file mode 100644
index 1850070..0000000
--- a/src/Infrastructure/Persistence/Migrations/00000000000000_InitialCreate.Designer.cs
+++ /dev/null
@@ -1,539 +0,0 @@
-//
-using System;
-using SWD_Laundry_Backend.Infrastructure.Persistence;
-using Microsoft.EntityFrameworkCore;
-using Microsoft.EntityFrameworkCore.Infrastructure;
-using Microsoft.EntityFrameworkCore.Metadata;
-using Microsoft.EntityFrameworkCore.Migrations;
-using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
-
-#nullable disable
-
-namespace SWD_Laundry_Backend.Infrastructure.Persistence.Migrations
-{
- [DbContext(typeof(ApplicationDbContext))]
- [Migration("00000000000000_InitialCreate")]
- partial class InitialCreate
- {
- protected override void BuildTargetModel(ModelBuilder modelBuilder)
- {
-#pragma warning disable 612, 618
- modelBuilder
- .HasAnnotation("ProductVersion", "6.0.0")
- .HasAnnotation("Relational:MaxIdentifierLength", 128);
-
- SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder, 1L, 1);
-
- modelBuilder.Entity("SWD_Laundry_Backend.Domain.Entities.TodoItem", b =>
- {
- b.Property("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("int");
-
- SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1);
-
- b.Property("Created")
- .HasColumnType("datetime2");
-
- b.Property("CreatedBy")
- .HasColumnType("nvarchar(max)");
-
- b.Property("Done")
- .HasColumnType("bit");
-
- b.Property("LastModified")
- .HasColumnType("datetime2");
-
- b.Property("LastModifiedBy")
- .HasColumnType("nvarchar(max)");
-
- b.Property("ListId")
- .HasColumnType("int");
-
- b.Property("Note")
- .HasColumnType("nvarchar(max)");
-
- b.Property("Priority")
- .HasColumnType("int");
-
- b.Property("Reminder")
- .HasColumnType("datetime2");
-
- b.Property("Title")
- .IsRequired()
- .HasMaxLength(200)
- .HasColumnType("nvarchar(200)");
-
- b.HasKey("Id");
-
- b.HasIndex("ListId");
-
- b.ToTable("TodoItems");
- });
-
- modelBuilder.Entity("SWD_Laundry_Backend.Domain.Entities.TodoList", b =>
- {
- b.Property("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("int");
-
- SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1);
-
- b.Property("Created")
- .HasColumnType("datetime2");
-
- b.Property("CreatedBy")
- .HasColumnType("nvarchar(max)");
-
- b.Property("LastModified")
- .HasColumnType("datetime2");
-
- b.Property("LastModifiedBy")
- .HasColumnType("nvarchar(max)");
-
- b.Property("Title")
- .IsRequired()
- .HasMaxLength(200)
- .HasColumnType("nvarchar(200)");
-
- b.HasKey("Id");
-
- b.ToTable("TodoLists");
- });
-
- modelBuilder.Entity("SWD_Laundry_Backend.Infrastructure.Identity.ApplicationUser", b =>
- {
- b.Property("Id")
- .HasColumnType("nvarchar(450)");
-
- b.Property("AccessFailedCount")
- .HasColumnType("int");
-
- b.Property("ConcurrencyStamp")
- .IsConcurrencyToken()
- .HasColumnType("nvarchar(max)");
-
- b.Property("Email")
- .HasMaxLength(256)
- .HasColumnType("nvarchar(256)");
-
- b.Property("EmailConfirmed")
- .HasColumnType("bit");
-
- b.Property("LockoutEnabled")
- .HasColumnType("bit");
-
- b.Property("LockoutEnd")
- .HasColumnType("datetimeoffset");
-
- b.Property("NormalizedEmail")
- .HasMaxLength(256)
- .HasColumnType("nvarchar(256)");
-
- b.Property("NormalizedUserName")
- .HasMaxLength(256)
- .HasColumnType("nvarchar(256)");
-
- b.Property("PasswordHash")
- .HasColumnType("nvarchar(max)");
-
- b.Property("PhoneNumber")
- .HasColumnType("nvarchar(max)");
-
- b.Property("PhoneNumberConfirmed")
- .HasColumnType("bit");
-
- b.Property("SecurityStamp")
- .HasColumnType("nvarchar(max)");
-
- b.Property("TwoFactorEnabled")
- .HasColumnType("bit");
-
- b.Property("UserName")
- .HasMaxLength(256)
- .HasColumnType("nvarchar(256)");
-
- b.HasKey("Id");
-
- b.HasIndex("NormalizedEmail")
- .HasDatabaseName("EmailIndex");
-
- b.HasIndex("NormalizedUserName")
- .IsUnique()
- .HasDatabaseName("UserNameIndex")
- .HasFilter("[NormalizedUserName] IS NOT NULL");
-
- b.ToTable("AspNetUsers", (string)null);
- });
-
- modelBuilder.Entity("Duende.IdentityServer.EntityFramework.Entities.DeviceFlowCodes", b =>
- {
- b.Property("UserCode")
- .HasMaxLength(200)
- .HasColumnType("nvarchar(200)");
-
- b.Property("ClientId")
- .IsRequired()
- .HasMaxLength(200)
- .HasColumnType("nvarchar(200)");
-
- b.Property("CreationTime")
- .HasColumnType("datetime2");
-
- b.Property("Data")
- .IsRequired()
- .HasMaxLength(50000)
- .HasColumnType("nvarchar(max)");
-
- b.Property("Description")
- .HasMaxLength(200)
- .HasColumnType("nvarchar(200)");
-
- b.Property("DeviceCode")
- .IsRequired()
- .HasMaxLength(200)
- .HasColumnType("nvarchar(200)");
-
- b.Property("Expiration")
- .IsRequired()
- .HasColumnType("datetime2");
-
- b.Property("SessionId")
- .HasMaxLength(100)
- .HasColumnType("nvarchar(100)");
-
- b.Property("SubjectId")
- .HasMaxLength(200)
- .HasColumnType("nvarchar(200)");
-
- b.HasKey("UserCode");
-
- b.HasIndex("DeviceCode")
- .IsUnique();
-
- b.HasIndex("Expiration");
-
- b.ToTable("DeviceCodes", (string)null);
- });
-
- modelBuilder.Entity("Duende.IdentityServer.EntityFramework.Entities.Key", b =>
- {
- b.Property("Id")
- .HasColumnType("nvarchar(450)");
-
- b.Property("Algorithm")
- .IsRequired()
- .HasMaxLength(100)
- .HasColumnType("nvarchar(100)");
-
- b.Property("Created")
- .HasColumnType("datetime2");
-
- b.Property("Data")
- .IsRequired()
- .HasColumnType("nvarchar(max)");
-
- b.Property("DataProtected")
- .HasColumnType("bit");
-
- b.Property("IsX509Certificate")
- .HasColumnType("bit");
-
- b.Property("Use")
- .HasColumnType("nvarchar(450)");
-
- b.Property("Version")
- .HasColumnType("int");
-
- b.HasKey("Id");
-
- b.HasIndex("Use");
-
- b.ToTable("Keys");
- });
-
- modelBuilder.Entity("Duende.IdentityServer.EntityFramework.Entities.PersistedGrant", b =>
- {
- b.Property("Key")
- .HasMaxLength(200)
- .HasColumnType("nvarchar(200)");
-
- b.Property("ClientId")
- .IsRequired()
- .HasMaxLength(200)
- .HasColumnType("nvarchar(200)");
-
- b.Property("ConsumedTime")
- .HasColumnType("datetime2");
-
- b.Property("CreationTime")
- .HasColumnType("datetime2");
-
- b.Property("Data")
- .IsRequired()
- .HasMaxLength(50000)
- .HasColumnType("nvarchar(max)");
-
- b.Property("Description")
- .HasMaxLength(200)
- .HasColumnType("nvarchar(200)");
-
- b.Property("Expiration")
- .HasColumnType("datetime2");
-
- b.Property("SessionId")
- .HasMaxLength(100)
- .HasColumnType("nvarchar(100)");
-
- b.Property("SubjectId")
- .HasMaxLength(200)
- .HasColumnType("nvarchar(200)");
-
- b.Property("Type")
- .IsRequired()
- .HasMaxLength(50)
- .HasColumnType("nvarchar(50)");
-
- b.HasKey("Key");
-
- b.HasIndex("ConsumedTime");
-
- b.HasIndex("Expiration");
-
- b.HasIndex("SubjectId", "ClientId", "Type");
-
- b.HasIndex("SubjectId", "SessionId", "Type");
-
- b.ToTable("PersistedGrants", (string)null);
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRole", b =>
- {
- b.Property("Id")
- .HasColumnType("nvarchar(450)");
-
- b.Property("ConcurrencyStamp")
- .IsConcurrencyToken()
- .HasColumnType("nvarchar(max)");
-
- b.Property("Name")
- .HasMaxLength(256)
- .HasColumnType("nvarchar(256)");
-
- b.Property("NormalizedName")
- .HasMaxLength(256)
- .HasColumnType("nvarchar(256)");
-
- b.HasKey("Id");
-
- b.HasIndex("NormalizedName")
- .IsUnique()
- .HasDatabaseName("RoleNameIndex")
- .HasFilter("[NormalizedName] IS NOT NULL");
-
- b.ToTable("AspNetRoles", (string)null);
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b =>
- {
- b.Property("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("int");
-
- SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1);
-
- b.Property("ClaimType")
- .HasColumnType("nvarchar(max)");
-
- b.Property("ClaimValue")
- .HasColumnType("nvarchar(max)");
-
- b.Property("RoleId")
- .IsRequired()
- .HasColumnType("nvarchar(450)");
-
- b.HasKey("Id");
-
- b.HasIndex("RoleId");
-
- b.ToTable("AspNetRoleClaims", (string)null);
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b =>
- {
- b.Property("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("int");
-
- SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1);
-
- b.Property("ClaimType")
- .HasColumnType("nvarchar(max)");
-
- b.Property("ClaimValue")
- .HasColumnType("nvarchar(max)");
-
- b.Property("UserId")
- .IsRequired()
- .HasColumnType("nvarchar(450)");
-
- b.HasKey("Id");
-
- b.HasIndex("UserId");
-
- b.ToTable("AspNetUserClaims", (string)null);
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b =>
- {
- b.Property("LoginProvider")
- .HasMaxLength(128)
- .HasColumnType("nvarchar(128)");
-
- b.Property("ProviderKey")
- .HasMaxLength(128)
- .HasColumnType("nvarchar(128)");
-
- b.Property("ProviderDisplayName")
- .HasColumnType("nvarchar(max)");
-
- b.Property("UserId")
- .IsRequired()
- .HasColumnType("nvarchar(450)");
-
- b.HasKey("LoginProvider", "ProviderKey");
-
- b.HasIndex("UserId");
-
- b.ToTable("AspNetUserLogins", (string)null);
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b =>
- {
- b.Property("UserId")
- .HasColumnType("nvarchar(450)");
-
- b.Property("RoleId")
- .HasColumnType("nvarchar(450)");
-
- b.HasKey("UserId", "RoleId");
-
- b.HasIndex("RoleId");
-
- b.ToTable("AspNetUserRoles", (string)null);
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b =>
- {
- b.Property("UserId")
- .HasColumnType("nvarchar(450)");
-
- b.Property("LoginProvider")
- .HasMaxLength(128)
- .HasColumnType("nvarchar(128)");
-
- b.Property("Name")
- .HasMaxLength(128)
- .HasColumnType("nvarchar(128)");
-
- b.Property("Value")
- .HasColumnType("nvarchar(max)");
-
- b.HasKey("UserId", "LoginProvider", "Name");
-
- b.ToTable("AspNetUserTokens", (string)null);
- });
-
- modelBuilder.Entity("SWD_Laundry_Backend.Domain.Entities.TodoItem", b =>
- {
- b.HasOne("SWD_Laundry_Backend.Domain.Entities.TodoList", "List")
- .WithMany("Items")
- .HasForeignKey("ListId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("List");
- });
-
- modelBuilder.Entity("SWD_Laundry_Backend.Domain.Entities.TodoList", b =>
- {
- b.OwnsOne("SWD_Laundry_Backend.Domain.ValueObjects.Colour", "Colour", b1 =>
- {
- b1.Property("TodoListId")
- .HasColumnType("int");
-
- b1.Property("Code")
- .IsRequired()
- .HasColumnType("nvarchar(max)");
-
- b1.HasKey("TodoListId");
-
- b1.ToTable("TodoLists");
-
- b1.WithOwner()
- .HasForeignKey("TodoListId");
- });
-
- b.Navigation("Colour")
- .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("SWD_Laundry_Backend.Infrastructure.Identity.ApplicationUser", null)
- .WithMany()
- .HasForeignKey("UserId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b =>
- {
- b.HasOne("SWD_Laundry_Backend.Infrastructure.Identity.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("SWD_Laundry_Backend.Infrastructure.Identity.ApplicationUser", null)
- .WithMany()
- .HasForeignKey("UserId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b =>
- {
- b.HasOne("SWD_Laundry_Backend.Infrastructure.Identity.ApplicationUser", null)
- .WithMany()
- .HasForeignKey("UserId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
- });
-
- modelBuilder.Entity("SWD_Laundry_Backend.Domain.Entities.TodoList", b =>
- {
- b.Navigation("Items");
- });
-#pragma warning restore 612, 618
- }
- }
-}
diff --git a/src/Infrastructure/Persistence/Migrations/00000000000000_InitialCreate.cs b/src/Infrastructure/Persistence/Migrations/00000000000000_InitialCreate.cs
deleted file mode 100644
index 68facc0..0000000
--- a/src/Infrastructure/Persistence/Migrations/00000000000000_InitialCreate.cs
+++ /dev/null
@@ -1,380 +0,0 @@
-using System;
-using Microsoft.EntityFrameworkCore.Migrations;
-
-#nullable disable
-
-namespace SWD_Laundry_Backend.Infrastructure.Persistence.Migrations
-{
- public partial class InitialCreate : Migration
- {
- protected override void Up(MigrationBuilder migrationBuilder)
- {
- migrationBuilder.CreateTable(
- name: "AspNetRoles",
- columns: table => new
- {
- Id = table.Column(type: "nvarchar(450)", nullable: false),
- Name = table.Column(type: "nvarchar(256)", maxLength: 256, nullable: true),
- NormalizedName = table.Column(type: "nvarchar(256)", maxLength: 256, nullable: true),
- ConcurrencyStamp = table.Column(type: "nvarchar(max)", nullable: true)
- },
- constraints: table =>
- {
- table.PrimaryKey("PK_AspNetRoles", x => x.Id);
- });
-
- migrationBuilder.CreateTable(
- name: "AspNetUsers",
- columns: table => new
- {
- Id = table.Column(type: "nvarchar(450)", nullable: false),
- UserName = table.Column(type: "nvarchar(256)", maxLength: 256, nullable: true),
- NormalizedUserName = table.Column(type: "nvarchar(256)", maxLength: 256, nullable: true),
- Email = table.Column(type: "nvarchar(256)", maxLength: 256, nullable: true),
- NormalizedEmail = table.Column(type: "nvarchar(256)", maxLength: 256, nullable: true),
- EmailConfirmed = table.Column(type: "bit", nullable: false),
- PasswordHash = table.Column(type: "nvarchar(max)", nullable: true),
- SecurityStamp = table.Column(type: "nvarchar(max)", nullable: true),
- ConcurrencyStamp = table.Column(type: "nvarchar(max)", nullable: true),
- PhoneNumber = table.Column(type: "nvarchar(max)", nullable: true),
- PhoneNumberConfirmed = table.Column(type: "bit", nullable: false),
- TwoFactorEnabled = table.Column(type: "bit", nullable: false),
- LockoutEnd = table.Column(type: "datetimeoffset", nullable: true),
- LockoutEnabled = table.Column(type: "bit", nullable: false),
- AccessFailedCount = table.Column(type: "int", nullable: false)
- },
- constraints: table =>
- {
- table.PrimaryKey("PK_AspNetUsers", x => x.Id);
- });
-
- migrationBuilder.CreateTable(
- name: "DeviceCodes",
- columns: table => new
- {
- UserCode = table.Column(type: "nvarchar(200)", maxLength: 200, nullable: false),
- DeviceCode = table.Column(type: "nvarchar(200)", maxLength: 200, nullable: false),
- SubjectId = table.Column(type: "nvarchar(200)", maxLength: 200, nullable: true),
- SessionId = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: true),
- ClientId = table.Column(type: "nvarchar(200)", maxLength: 200, nullable: false),
- Description = table.Column(type: "nvarchar(200)", maxLength: 200, nullable: true),
- CreationTime = table.Column(type: "datetime2", nullable: false),
- Expiration = table.Column(type: "datetime2", nullable: false),
- Data = table.Column(type: "nvarchar(max)", maxLength: 50000, nullable: false)
- },
- constraints: table =>
- {
- table.PrimaryKey("PK_DeviceCodes", x => x.UserCode);
- });
-
- migrationBuilder.CreateTable(
- name: "Keys",
- columns: table => new
- {
- Id = table.Column(type: "nvarchar(450)", nullable: false),
- Version = table.Column(type: "int", nullable: false),
- Created = table.Column(type: "datetime2", nullable: false),
- Use = table.Column(type: "nvarchar(450)", nullable: true),
- Algorithm = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: false),
- IsX509Certificate = table.Column(type: "bit", nullable: false),
- DataProtected = table.Column(type: "bit", nullable: false),
- Data = table.Column(type: "nvarchar(max)", nullable: false)
- },
- constraints: table =>
- {
- table.PrimaryKey("PK_Keys", x => x.Id);
- });
-
- migrationBuilder.CreateTable(
- name: "PersistedGrants",
- columns: table => new
- {
- Key = table.Column(type: "nvarchar(200)", maxLength: 200, nullable: false),
- Type = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: false),
- SubjectId = table.Column(type: "nvarchar(200)", maxLength: 200, nullable: true),
- SessionId = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: true),
- ClientId = table.Column(type: "nvarchar(200)", maxLength: 200, nullable: false),
- Description = table.Column(type: "nvarchar(200)", maxLength: 200, nullable: true),
- CreationTime = table.Column(type: "datetime2", nullable: false),
- Expiration = table.Column(type: "datetime2", nullable: true),
- ConsumedTime = table.Column(type: "datetime2", nullable: true),
- Data = table.Column(type: "nvarchar(max)", maxLength: 50000, nullable: false)
- },
- constraints: table =>
- {
- table.PrimaryKey("PK_PersistedGrants", x => x.Key);
- });
-
- migrationBuilder.CreateTable(
- name: "TodoLists",
- columns: table => new
- {
- Id = table.Column(type: "int", nullable: false)
- .Annotation("SqlServer:Identity", "1, 1"),
- Title = table.Column(type: "nvarchar(200)", maxLength: 200, nullable: false),
- Colour_Code = table.Column(type: "nvarchar(max)", nullable: false),
- Created = table.Column(type: "datetime2", nullable: false),
- CreatedBy = table.Column(type: "nvarchar(max)", nullable: true),
- LastModified = table.Column(type: "datetime2", nullable: true),
- LastModifiedBy = table.Column(type: "nvarchar(max)", nullable: true)
- },
- constraints: table =>
- {
- table.PrimaryKey("PK_TodoLists", x => x.Id);
- });
-
- migrationBuilder.CreateTable(
- name: "AspNetRoleClaims",
- columns: table => new
- {
- Id = table.Column(type: "int", nullable: false)
- .Annotation("SqlServer:Identity", "1, 1"),
- RoleId = table.Column(type: "nvarchar(450)", nullable: false),
- ClaimType = table.Column(type: "nvarchar(max)", nullable: true),
- ClaimValue = table.Column(type: "nvarchar(max)", nullable: true)
- },
- 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);
- });
-
- migrationBuilder.CreateTable(
- name: "AspNetUserClaims",
- columns: table => new
- {
- Id = table.Column(type: "int", nullable: false)
- .Annotation("SqlServer:Identity", "1, 1"),
- UserId = table.Column(type: "nvarchar(450)", nullable: false),
- ClaimType = table.Column(type: "nvarchar(max)", nullable: true),
- ClaimValue = table.Column(type: "nvarchar(max)", nullable: true)
- },
- 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);
- });
-
- migrationBuilder.CreateTable(
- name: "AspNetUserLogins",
- columns: table => new
- {
- LoginProvider = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: false),
- ProviderKey = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: false),
- ProviderDisplayName = table.Column(type: "nvarchar(max)", nullable: true),
- UserId = table.Column(type: "nvarchar(450)", nullable: false)
- },
- 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);
- });
-
- migrationBuilder.CreateTable(
- name: "AspNetUserRoles",
- columns: table => new
- {
- UserId = table.Column(type: "nvarchar(450)", nullable: false),
- RoleId = table.Column(type: "nvarchar(450)", nullable: false)
- },
- 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);
- });
-
- migrationBuilder.CreateTable(
- name: "AspNetUserTokens",
- columns: table => new
- {
- UserId = table.Column(type: "nvarchar(450)", nullable: false),
- LoginProvider = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: false),
- Name = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: false),
- Value = table.Column(type: "nvarchar(max)", nullable: true)
- },
- 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);
- });
-
- migrationBuilder.CreateTable(
- name: "TodoItems",
- columns: table => new
- {
- Id = table.Column(type: "int", nullable: false)
- .Annotation("SqlServer:Identity", "1, 1"),
- ListId = table.Column(type: "int", nullable: false),
- Title = table.Column(type: "nvarchar(200)", maxLength: 200, nullable: false),
- Note = table.Column(type: "nvarchar(max)", nullable: true),
- Priority = table.Column(type: "int", nullable: false),
- Reminder = table.Column(type: "datetime2", nullable: true),
- Done = table.Column(type: "bit", nullable: false),
- Created = table.Column(type: "datetime2", nullable: false),
- CreatedBy = table.Column(type: "nvarchar(max)", nullable: true),
- LastModified = table.Column(type: "datetime2", nullable: true),
- LastModifiedBy = table.Column(type: "nvarchar(max)", nullable: true)
- },
- constraints: table =>
- {
- table.PrimaryKey("PK_TodoItems", x => x.Id);
- table.ForeignKey(
- name: "FK_TodoItems_TodoLists_ListId",
- column: x => x.ListId,
- principalTable: "TodoLists",
- principalColumn: "Id",
- onDelete: ReferentialAction.Cascade);
- });
-
- migrationBuilder.CreateIndex(
- name: "IX_AspNetRoleClaims_RoleId",
- table: "AspNetRoleClaims",
- column: "RoleId");
-
- migrationBuilder.CreateIndex(
- name: "RoleNameIndex",
- table: "AspNetRoles",
- column: "NormalizedName",
- unique: true,
- filter: "[NormalizedName] IS NOT NULL");
-
- 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,
- filter: "[NormalizedUserName] IS NOT NULL");
-
- migrationBuilder.CreateIndex(
- name: "IX_DeviceCodes_DeviceCode",
- table: "DeviceCodes",
- column: "DeviceCode",
- unique: true);
-
- migrationBuilder.CreateIndex(
- name: "IX_DeviceCodes_Expiration",
- table: "DeviceCodes",
- column: "Expiration");
-
- migrationBuilder.CreateIndex(
- name: "IX_Keys_Use",
- table: "Keys",
- column: "Use");
-
- migrationBuilder.CreateIndex(
- name: "IX_PersistedGrants_ConsumedTime",
- table: "PersistedGrants",
- column: "ConsumedTime");
-
- migrationBuilder.CreateIndex(
- name: "IX_PersistedGrants_Expiration",
- table: "PersistedGrants",
- column: "Expiration");
-
- migrationBuilder.CreateIndex(
- name: "IX_PersistedGrants_SubjectId_ClientId_Type",
- table: "PersistedGrants",
- columns: new[] { "SubjectId", "ClientId", "Type" });
-
- migrationBuilder.CreateIndex(
- name: "IX_PersistedGrants_SubjectId_SessionId_Type",
- table: "PersistedGrants",
- columns: new[] { "SubjectId", "SessionId", "Type" });
-
- migrationBuilder.CreateIndex(
- name: "IX_TodoItems_ListId",
- table: "TodoItems",
- column: "ListId");
- }
-
- 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: "DeviceCodes");
-
- migrationBuilder.DropTable(
- name: "Keys");
-
- migrationBuilder.DropTable(
- name: "PersistedGrants");
-
- migrationBuilder.DropTable(
- name: "TodoItems");
-
- migrationBuilder.DropTable(
- name: "AspNetRoles");
-
- migrationBuilder.DropTable(
- name: "AspNetUsers");
-
- migrationBuilder.DropTable(
- name: "TodoLists");
- }
- }
-}
diff --git a/src/Infrastructure/Persistence/Migrations/20230914161433_InitMigration.Designer.cs b/src/Infrastructure/Persistence/Migrations/20230914161433_InitMigration.Designer.cs
deleted file mode 100644
index bfcc2c5..0000000
--- a/src/Infrastructure/Persistence/Migrations/20230914161433_InitMigration.Designer.cs
+++ /dev/null
@@ -1,540 +0,0 @@
-//
-using System;
-using Microsoft.EntityFrameworkCore;
-using Microsoft.EntityFrameworkCore.Infrastructure;
-using Microsoft.EntityFrameworkCore.Metadata;
-using Microsoft.EntityFrameworkCore.Migrations;
-using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
-using SWD_Laundry_Backend.Infrastructure.Persistence;
-
-#nullable disable
-
-namespace SWD_Laundry_Backend.Infrastructure.Persistence.Migrations
-{
- [DbContext(typeof(ApplicationDbContext))]
- [Migration("20230914161433_InitMigration")]
- partial class InitMigration
- {
- ///
- protected override void BuildTargetModel(ModelBuilder modelBuilder)
- {
-#pragma warning disable 612, 618
- modelBuilder
- .HasAnnotation("ProductVersion", "7.0.7")
- .HasAnnotation("Relational:MaxIdentifierLength", 128);
-
- SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder);
-
- modelBuilder.Entity("Duende.IdentityServer.EntityFramework.Entities.DeviceFlowCodes", b =>
- {
- b.Property("UserCode")
- .HasMaxLength(200)
- .HasColumnType("nvarchar(200)");
-
- b.Property("ClientId")
- .IsRequired()
- .HasMaxLength(200)
- .HasColumnType("nvarchar(200)");
-
- b.Property("CreationTime")
- .HasColumnType("datetime2");
-
- b.Property("Data")
- .IsRequired()
- .HasMaxLength(50000)
- .HasColumnType("nvarchar(max)");
-
- b.Property("Description")
- .HasMaxLength(200)
- .HasColumnType("nvarchar(200)");
-
- b.Property("DeviceCode")
- .IsRequired()
- .HasMaxLength(200)
- .HasColumnType("nvarchar(200)");
-
- b.Property("Expiration")
- .IsRequired()
- .HasColumnType("datetime2");
-
- b.Property("SessionId")
- .HasMaxLength(100)
- .HasColumnType("nvarchar(100)");
-
- b.Property("SubjectId")
- .HasMaxLength(200)
- .HasColumnType("nvarchar(200)");
-
- b.HasKey("UserCode");
-
- b.HasIndex("DeviceCode")
- .IsUnique();
-
- b.HasIndex("Expiration");
-
- b.ToTable("DeviceCodes", (string)null);
- });
-
- modelBuilder.Entity("Duende.IdentityServer.EntityFramework.Entities.Key", b =>
- {
- b.Property("Id")
- .HasColumnType("nvarchar(450)");
-
- b.Property("Algorithm")
- .IsRequired()
- .HasMaxLength(100)
- .HasColumnType("nvarchar(100)");
-
- b.Property("Created")
- .HasColumnType("datetime2");
-
- b.Property("Data")
- .IsRequired()
- .HasColumnType("nvarchar(max)");
-
- b.Property("DataProtected")
- .HasColumnType("bit");
-
- b.Property("IsX509Certificate")
- .HasColumnType("bit");
-
- b.Property("Use")
- .HasColumnType("nvarchar(450)");
-
- b.Property("Version")
- .HasColumnType("int");
-
- b.HasKey("Id");
-
- b.HasIndex("Use");
-
- b.ToTable("Keys", (string)null);
- });
-
- modelBuilder.Entity("Duende.IdentityServer.EntityFramework.Entities.PersistedGrant", b =>
- {
- b.Property("Key")
- .HasMaxLength(200)
- .HasColumnType("nvarchar(200)");
-
- b.Property("ClientId")
- .IsRequired()
- .HasMaxLength(200)
- .HasColumnType("nvarchar(200)");
-
- b.Property("ConsumedTime")
- .HasColumnType("datetime2");
-
- b.Property("CreationTime")
- .HasColumnType("datetime2");
-
- b.Property("Data")
- .IsRequired()
- .HasMaxLength(50000)
- .HasColumnType("nvarchar(max)");
-
- b.Property("Description")
- .HasMaxLength(200)
- .HasColumnType("nvarchar(200)");
-
- b.Property("Expiration")
- .HasColumnType("datetime2");
-
- b.Property("SessionId")
- .HasMaxLength(100)
- .HasColumnType("nvarchar(100)");
-
- b.Property("SubjectId")
- .HasMaxLength(200)
- .HasColumnType("nvarchar(200)");
-
- b.Property("Type")
- .IsRequired()
- .HasMaxLength(50)
- .HasColumnType("nvarchar(50)");
-
- b.HasKey("Key");
-
- b.HasIndex("ConsumedTime");
-
- b.HasIndex("Expiration");
-
- b.HasIndex("SubjectId", "ClientId", "Type");
-
- b.HasIndex("SubjectId", "SessionId", "Type");
-
- b.ToTable("PersistedGrants", (string)null);
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRole", b =>
- {
- b.Property("Id")
- .HasColumnType("nvarchar(450)");
-
- b.Property("ConcurrencyStamp")
- .IsConcurrencyToken()
- .HasColumnType("nvarchar(max)");
-
- b.Property("Name")
- .HasMaxLength(256)
- .HasColumnType("nvarchar(256)");
-
- b.Property("NormalizedName")
- .HasMaxLength(256)
- .HasColumnType("nvarchar(256)");
-
- b.HasKey("Id");
-
- b.HasIndex("NormalizedName")
- .IsUnique()
- .HasDatabaseName("RoleNameIndex")
- .HasFilter("[NormalizedName] IS NOT NULL");
-
- b.ToTable("AspNetRoles", (string)null);
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b =>
- {
- b.Property("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("int");
-
- SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"));
-
- b.Property("ClaimType")
- .HasColumnType("nvarchar(max)");
-
- b.Property("ClaimValue")
- .HasColumnType("nvarchar(max)");
-
- b.Property("RoleId")
- .IsRequired()
- .HasColumnType("nvarchar(450)");
-
- b.HasKey("Id");
-
- b.HasIndex("RoleId");
-
- b.ToTable("AspNetRoleClaims", (string)null);
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b =>
- {
- b.Property("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("int");
-
- SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"));
-
- b.Property("ClaimType")
- .HasColumnType("nvarchar(max)");
-
- b.Property("ClaimValue")
- .HasColumnType("nvarchar(max)");
-
- b.Property("UserId")
- .IsRequired()
- .HasColumnType("nvarchar(450)");
-
- b.HasKey("Id");
-
- b.HasIndex("UserId");
-
- b.ToTable("AspNetUserClaims", (string)null);
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b =>
- {
- b.Property("LoginProvider")
- .HasMaxLength(128)
- .HasColumnType("nvarchar(128)");
-
- b.Property("ProviderKey")
- .HasMaxLength(128)
- .HasColumnType("nvarchar(128)");
-
- b.Property("ProviderDisplayName")
- .HasColumnType("nvarchar(max)");
-
- b.Property("UserId")
- .IsRequired()
- .HasColumnType("nvarchar(450)");
-
- b.HasKey("LoginProvider", "ProviderKey");
-
- b.HasIndex("UserId");
-
- b.ToTable("AspNetUserLogins", (string)null);
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b =>
- {
- b.Property("UserId")
- .HasColumnType("nvarchar(450)");
-
- b.Property("RoleId")
- .HasColumnType("nvarchar(450)");
-
- b.HasKey("UserId", "RoleId");
-
- b.HasIndex("RoleId");
-
- b.ToTable("AspNetUserRoles", (string)null);
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b =>
- {
- b.Property("UserId")
- .HasColumnType("nvarchar(450)");
-
- b.Property("LoginProvider")
- .HasMaxLength(128)
- .HasColumnType("nvarchar(128)");
-
- b.Property("Name")
- .HasMaxLength(128)
- .HasColumnType("nvarchar(128)");
-
- b.Property("Value")
- .HasColumnType("nvarchar(max)");
-
- b.HasKey("UserId", "LoginProvider", "Name");
-
- b.ToTable("AspNetUserTokens", (string)null);
- });
-
- modelBuilder.Entity("SWD_Laundry_Backend.Domain.Entities.TodoItem", b =>
- {
- b.Property("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("int");
-
- SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"));
-
- b.Property