Renvoit du rôle au frontend avec Get Login (UPDATE-DATABASE)
This commit is contained in:
@@ -12,7 +12,7 @@ using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
namespace GrossesMitainesAPI.Migrations
|
||||
{
|
||||
[DbContext(typeof(InventoryContext))]
|
||||
[Migration("20221030195130_Initial-Db")]
|
||||
[Migration("20221101172005_Initial.Db")]
|
||||
partial class InitialDb
|
||||
{
|
||||
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
||||
@@ -43,6 +43,16 @@ namespace GrossesMitainesAPI.Migrations
|
||||
b.Property<bool>("EmailConfirmed")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<string>("FirstName")
|
||||
.IsRequired()
|
||||
.HasMaxLength(30)
|
||||
.HasColumnType("nvarchar(30)");
|
||||
|
||||
b.Property<string>("LastName")
|
||||
.IsRequired()
|
||||
.HasMaxLength(30)
|
||||
.HasColumnType("nvarchar(30)");
|
||||
|
||||
b.Property<bool>("LockoutEnabled")
|
||||
.HasColumnType("bit");
|
||||
|
||||
@@ -91,23 +101,143 @@ namespace GrossesMitainesAPI.Migrations
|
||||
b.HasData(
|
||||
new
|
||||
{
|
||||
Id = "809dc5fd-c62f-4d93-abe4-275a55aabd33",
|
||||
Id = "ecf7503a-591c-454e-a824-048e10bd0474",
|
||||
AccessFailedCount = 0,
|
||||
ConcurrencyStamp = "f2e55d24-1ab5-441c-87e0-808f32045ab4",
|
||||
ConcurrencyStamp = "6259a59c-35df-4662-84e5-a783e653a643",
|
||||
Email = "admin@admin.com",
|
||||
EmailConfirmed = false,
|
||||
FirstName = "Roger",
|
||||
LastName = "Admin",
|
||||
LockoutEnabled = false,
|
||||
NormalizedEmail = "admin@admin.com",
|
||||
NormalizedUserName = "admin",
|
||||
PasswordHash = "AQAAAAEAACcQAAAAEKJtYKQ3fXHUA67KkZbzgDtxdg1UlFk3kFeNj3QSm3OfgsSoMtFExAq16W5arTVmRA==",
|
||||
NormalizedEmail = "ADMIN@ADMIN.COM",
|
||||
NormalizedUserName = "ADMIN",
|
||||
PasswordHash = "AQAAAAEAACcQAAAAELHpALZdYcW7KzDcU2ovqwdWsfSx68md+LnjvL5ZgJ2OWuTFwJM3gPzQ1yP3RHCn9g==",
|
||||
PhoneNumberConfirmed = false,
|
||||
SecurityStamp = "56fc4076-5e9d-4bd1-91e7-b53abcc41fda",
|
||||
SecurityStamp = "c43f4d48-f1bb-4a24-8cd3-78422556cf85",
|
||||
TwoFactorEnabled = false,
|
||||
UserName = "Admin"
|
||||
});
|
||||
});
|
||||
|
||||
modelBuilder.Entity("GrossesMitainesAPI.Models.Product", b =>
|
||||
modelBuilder.Entity("GrossesMitainesAPI.Models.AddressModel", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"), 1L, 1);
|
||||
|
||||
b.Property<string>("Appartment")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("City")
|
||||
.IsRequired()
|
||||
.HasMaxLength(50)
|
||||
.HasColumnType("nvarchar(50)");
|
||||
|
||||
b.Property<int>("CivicNumber")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<string>("Country")
|
||||
.IsRequired()
|
||||
.HasMaxLength(30)
|
||||
.HasColumnType("nvarchar(30)");
|
||||
|
||||
b.Property<string>("InventoryUserId")
|
||||
.HasColumnType("nvarchar(450)");
|
||||
|
||||
b.Property<string>("PostalCode")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("Province")
|
||||
.IsRequired()
|
||||
.HasMaxLength(3)
|
||||
.HasColumnType("nvarchar(3)");
|
||||
|
||||
b.Property<string>("Street")
|
||||
.IsRequired()
|
||||
.HasMaxLength(50)
|
||||
.HasColumnType("nvarchar(50)");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("InventoryUserId");
|
||||
|
||||
b.ToTable("Addresses");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("GrossesMitainesAPI.Models.InvoiceModel", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"), 1L, 1);
|
||||
|
||||
b.Property<bool>("Canceled")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<string>("EmailAddress")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("FirstName")
|
||||
.IsRequired()
|
||||
.HasMaxLength(30)
|
||||
.HasColumnType("nvarchar(30)");
|
||||
|
||||
b.Property<string>("LastName")
|
||||
.IsRequired()
|
||||
.HasMaxLength(30)
|
||||
.HasColumnType("nvarchar(30)");
|
||||
|
||||
b.Property<string>("LinkedAccountId")
|
||||
.HasColumnType("nvarchar(450)");
|
||||
|
||||
b.Property<string>("PhoneNumber")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<int>("ShippingAddressId")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("LinkedAccountId");
|
||||
|
||||
b.HasIndex("ShippingAddressId");
|
||||
|
||||
b.ToTable("Invoices");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("GrossesMitainesAPI.Models.InvoiceModel+ProductInvoice", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"), 1L, 1);
|
||||
|
||||
b.Property<int?>("InvoiceModelId")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("ProductId")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("Quantity")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("InvoiceModelId");
|
||||
|
||||
b.HasIndex("ProductId");
|
||||
|
||||
b.ToTable("ProductInvoice");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("GrossesMitainesAPI.Models.ProductModel", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
@@ -425,6 +555,22 @@ namespace GrossesMitainesAPI.Migrations
|
||||
.HasFilter("[NormalizedName] IS NOT NULL");
|
||||
|
||||
b.ToTable("AspNetRoles", (string)null);
|
||||
|
||||
b.HasData(
|
||||
new
|
||||
{
|
||||
Id = "c9e08b20-d8a5-473f-9f52-572eb23c12af",
|
||||
ConcurrencyStamp = "56321382-1bb3-4dfe-87bf-6919c0791765",
|
||||
Name = "Administrateur",
|
||||
NormalizedName = "ADMINISTRATEUR"
|
||||
},
|
||||
new
|
||||
{
|
||||
Id = "1b7b9c55-c746-493a-a24f-3d5ca937298e",
|
||||
ConcurrencyStamp = "0e3b1bc2-f632-4f63-9bea-ac995e2e95a7",
|
||||
Name = "Client",
|
||||
NormalizedName = "CLIENT"
|
||||
});
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<string>", b =>
|
||||
@@ -512,6 +658,18 @@ namespace GrossesMitainesAPI.Migrations
|
||||
b.HasIndex("RoleId");
|
||||
|
||||
b.ToTable("AspNetUserRoles", (string)null);
|
||||
|
||||
b.HasData(
|
||||
new
|
||||
{
|
||||
UserId = "ecf7503a-591c-454e-a824-048e10bd0474",
|
||||
RoleId = "c9e08b20-d8a5-473f-9f52-572eb23c12af"
|
||||
},
|
||||
new
|
||||
{
|
||||
UserId = "ecf7503a-591c-454e-a824-048e10bd0474",
|
||||
RoleId = "1b7b9c55-c746-493a-a24f-3d5ca937298e"
|
||||
});
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<string>", b =>
|
||||
@@ -533,6 +691,45 @@ namespace GrossesMitainesAPI.Migrations
|
||||
b.ToTable("AspNetUserTokens", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("GrossesMitainesAPI.Models.AddressModel", b =>
|
||||
{
|
||||
b.HasOne("GrossesMitainesAPI.Data.InventoryUser", null)
|
||||
.WithMany("Adresses")
|
||||
.HasForeignKey("InventoryUserId");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("GrossesMitainesAPI.Models.InvoiceModel", b =>
|
||||
{
|
||||
b.HasOne("GrossesMitainesAPI.Data.InventoryUser", "LinkedAccount")
|
||||
.WithMany()
|
||||
.HasForeignKey("LinkedAccountId");
|
||||
|
||||
b.HasOne("GrossesMitainesAPI.Models.AddressModel", "ShippingAddress")
|
||||
.WithMany()
|
||||
.HasForeignKey("ShippingAddressId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("LinkedAccount");
|
||||
|
||||
b.Navigation("ShippingAddress");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("GrossesMitainesAPI.Models.InvoiceModel+ProductInvoice", b =>
|
||||
{
|
||||
b.HasOne("GrossesMitainesAPI.Models.InvoiceModel", null)
|
||||
.WithMany("Products")
|
||||
.HasForeignKey("InvoiceModelId");
|
||||
|
||||
b.HasOne("GrossesMitainesAPI.Models.ProductModel", "Product")
|
||||
.WithMany()
|
||||
.HasForeignKey("ProductId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Product");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<string>", b =>
|
||||
{
|
||||
b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole", null)
|
||||
@@ -583,6 +780,16 @@ namespace GrossesMitainesAPI.Migrations
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
});
|
||||
|
||||
modelBuilder.Entity("GrossesMitainesAPI.Data.InventoryUser", b =>
|
||||
{
|
||||
b.Navigation("Adresses");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("GrossesMitainesAPI.Models.InvoiceModel", b =>
|
||||
{
|
||||
b.Navigation("Products");
|
||||
});
|
||||
#pragma warning restore 612, 618
|
||||
}
|
||||
}
|
@@ -28,6 +28,8 @@ namespace GrossesMitainesAPI.Migrations
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<string>(type: "nvarchar(450)", nullable: false),
|
||||
FirstName = table.Column<string>(type: "nvarchar(30)", maxLength: 30, nullable: false),
|
||||
LastName = table.Column<string>(type: "nvarchar(30)", maxLength: 30, nullable: false),
|
||||
UserName = table.Column<string>(type: "nvarchar(256)", maxLength: 256, nullable: true),
|
||||
NormalizedUserName = table.Column<string>(type: "nvarchar(256)", maxLength: 256, nullable: true),
|
||||
Email = table.Column<string>(type: "nvarchar(256)", maxLength: 256, nullable: true),
|
||||
@@ -93,6 +95,31 @@ namespace GrossesMitainesAPI.Migrations
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "Addresses",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<int>(type: "int", nullable: false)
|
||||
.Annotation("SqlServer:Identity", "1, 1"),
|
||||
CivicNumber = table.Column<int>(type: "int", nullable: false),
|
||||
Appartment = table.Column<string>(type: "nvarchar(max)", nullable: true),
|
||||
Street = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: false),
|
||||
City = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: false),
|
||||
Province = table.Column<string>(type: "nvarchar(3)", maxLength: 3, nullable: false),
|
||||
Country = table.Column<string>(type: "nvarchar(30)", maxLength: 30, nullable: false),
|
||||
PostalCode = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
||||
InventoryUserId = table.Column<string>(type: "nvarchar(450)", nullable: true)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_Addresses", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_Addresses_AspNetUsers_InventoryUserId",
|
||||
column: x => x.InventoryUserId,
|
||||
principalTable: "AspNetUsers",
|
||||
principalColumn: "Id");
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "AspNetUserClaims",
|
||||
columns: table => new
|
||||
@@ -178,10 +205,75 @@ namespace GrossesMitainesAPI.Migrations
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "Invoices",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<int>(type: "int", nullable: false)
|
||||
.Annotation("SqlServer:Identity", "1, 1"),
|
||||
FirstName = table.Column<string>(type: "nvarchar(30)", maxLength: 30, nullable: false),
|
||||
LastName = table.Column<string>(type: "nvarchar(30)", maxLength: 30, nullable: false),
|
||||
PhoneNumber = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
||||
EmailAddress = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
||||
LinkedAccountId = table.Column<string>(type: "nvarchar(450)", nullable: true),
|
||||
ShippingAddressId = table.Column<int>(type: "int", nullable: false),
|
||||
Canceled = table.Column<bool>(type: "bit", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_Invoices", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_Invoices_Addresses_ShippingAddressId",
|
||||
column: x => x.ShippingAddressId,
|
||||
principalTable: "Addresses",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
table.ForeignKey(
|
||||
name: "FK_Invoices_AspNetUsers_LinkedAccountId",
|
||||
column: x => x.LinkedAccountId,
|
||||
principalTable: "AspNetUsers",
|
||||
principalColumn: "Id");
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "ProductInvoice",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<int>(type: "int", nullable: false)
|
||||
.Annotation("SqlServer:Identity", "1, 1"),
|
||||
ProductId = table.Column<int>(type: "int", nullable: false),
|
||||
Quantity = table.Column<int>(type: "int", nullable: false),
|
||||
InvoiceModelId = table.Column<int>(type: "int", nullable: true)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_ProductInvoice", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_ProductInvoice_Invoices_InvoiceModelId",
|
||||
column: x => x.InvoiceModelId,
|
||||
principalTable: "Invoices",
|
||||
principalColumn: "Id");
|
||||
table.ForeignKey(
|
||||
name: "FK_ProductInvoice_Products_ProductId",
|
||||
column: x => x.ProductId,
|
||||
principalTable: "Products",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
});
|
||||
|
||||
migrationBuilder.InsertData(
|
||||
table: "AspNetRoles",
|
||||
columns: new[] { "Id", "ConcurrencyStamp", "Name", "NormalizedName" },
|
||||
values: new object[,]
|
||||
{
|
||||
{ "1b7b9c55-c746-493a-a24f-3d5ca937298e", "0e3b1bc2-f632-4f63-9bea-ac995e2e95a7", "Client", "CLIENT" },
|
||||
{ "c9e08b20-d8a5-473f-9f52-572eb23c12af", "56321382-1bb3-4dfe-87bf-6919c0791765", "Administrateur", "ADMINISTRATEUR" }
|
||||
});
|
||||
|
||||
migrationBuilder.InsertData(
|
||||
table: "AspNetUsers",
|
||||
columns: new[] { "Id", "AccessFailedCount", "ConcurrencyStamp", "Email", "EmailConfirmed", "LockoutEnabled", "LockoutEnd", "NormalizedEmail", "NormalizedUserName", "PasswordHash", "PhoneNumber", "PhoneNumberConfirmed", "SecurityStamp", "TwoFactorEnabled", "UserName" },
|
||||
values: new object[] { "809dc5fd-c62f-4d93-abe4-275a55aabd33", 0, "f2e55d24-1ab5-441c-87e0-808f32045ab4", "admin@admin.com", false, false, null, "admin@admin.com", "admin", "AQAAAAEAACcQAAAAEKJtYKQ3fXHUA67KkZbzgDtxdg1UlFk3kFeNj3QSm3OfgsSoMtFExAq16W5arTVmRA==", null, false, "56fc4076-5e9d-4bd1-91e7-b53abcc41fda", false, "Admin" });
|
||||
columns: new[] { "Id", "AccessFailedCount", "ConcurrencyStamp", "Email", "EmailConfirmed", "FirstName", "LastName", "LockoutEnabled", "LockoutEnd", "NormalizedEmail", "NormalizedUserName", "PasswordHash", "PhoneNumber", "PhoneNumberConfirmed", "SecurityStamp", "TwoFactorEnabled", "UserName" },
|
||||
values: new object[] { "ecf7503a-591c-454e-a824-048e10bd0474", 0, "6259a59c-35df-4662-84e5-a783e653a643", "admin@admin.com", false, "Roger", "Admin", false, null, "ADMIN@ADMIN.COM", "ADMIN", "AQAAAAEAACcQAAAAELHpALZdYcW7KzDcU2ovqwdWsfSx68md+LnjvL5ZgJ2OWuTFwJM3gPzQ1yP3RHCn9g==", null, false, "c43f4d48-f1bb-4a24-8cd3-78422556cf85", false, "Admin" });
|
||||
|
||||
migrationBuilder.InsertData(
|
||||
table: "Products",
|
||||
@@ -207,6 +299,21 @@ namespace GrossesMitainesAPI.Migrations
|
||||
{ 17, "Vêtements d'extérieur", "Pour avoir l'air thug en hiver.", 0L, "mitaines2", null, null, 9.45m, 8.99m, 16L, 0L, 0, "Mitaines pas de doigts" }
|
||||
});
|
||||
|
||||
migrationBuilder.InsertData(
|
||||
table: "AspNetUserRoles",
|
||||
columns: new[] { "RoleId", "UserId" },
|
||||
values: new object[] { "1b7b9c55-c746-493a-a24f-3d5ca937298e", "ecf7503a-591c-454e-a824-048e10bd0474" });
|
||||
|
||||
migrationBuilder.InsertData(
|
||||
table: "AspNetUserRoles",
|
||||
columns: new[] { "RoleId", "UserId" },
|
||||
values: new object[] { "c9e08b20-d8a5-473f-9f52-572eb23c12af", "ecf7503a-591c-454e-a824-048e10bd0474" });
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_Addresses_InventoryUserId",
|
||||
table: "Addresses",
|
||||
column: "InventoryUserId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_AspNetRoleClaims_RoleId",
|
||||
table: "AspNetRoleClaims",
|
||||
@@ -245,6 +352,26 @@ namespace GrossesMitainesAPI.Migrations
|
||||
column: "NormalizedUserName",
|
||||
unique: true,
|
||||
filter: "[NormalizedUserName] IS NOT NULL");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_Invoices_LinkedAccountId",
|
||||
table: "Invoices",
|
||||
column: "LinkedAccountId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_Invoices_ShippingAddressId",
|
||||
table: "Invoices",
|
||||
column: "ShippingAddressId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_ProductInvoice_InvoiceModelId",
|
||||
table: "ProductInvoice",
|
||||
column: "InvoiceModelId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_ProductInvoice_ProductId",
|
||||
table: "ProductInvoice",
|
||||
column: "ProductId");
|
||||
}
|
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
@@ -265,11 +392,20 @@ namespace GrossesMitainesAPI.Migrations
|
||||
name: "AspNetUserTokens");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "Products");
|
||||
name: "ProductInvoice");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "AspNetRoles");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "Invoices");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "Products");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "Addresses");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "AspNetUsers");
|
||||
}
|
@@ -41,6 +41,16 @@ namespace GrossesMitainesAPI.Migrations
|
||||
b.Property<bool>("EmailConfirmed")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<string>("FirstName")
|
||||
.IsRequired()
|
||||
.HasMaxLength(30)
|
||||
.HasColumnType("nvarchar(30)");
|
||||
|
||||
b.Property<string>("LastName")
|
||||
.IsRequired()
|
||||
.HasMaxLength(30)
|
||||
.HasColumnType("nvarchar(30)");
|
||||
|
||||
b.Property<bool>("LockoutEnabled")
|
||||
.HasColumnType("bit");
|
||||
|
||||
@@ -89,23 +99,143 @@ namespace GrossesMitainesAPI.Migrations
|
||||
b.HasData(
|
||||
new
|
||||
{
|
||||
Id = "809dc5fd-c62f-4d93-abe4-275a55aabd33",
|
||||
Id = "ecf7503a-591c-454e-a824-048e10bd0474",
|
||||
AccessFailedCount = 0,
|
||||
ConcurrencyStamp = "f2e55d24-1ab5-441c-87e0-808f32045ab4",
|
||||
ConcurrencyStamp = "6259a59c-35df-4662-84e5-a783e653a643",
|
||||
Email = "admin@admin.com",
|
||||
EmailConfirmed = false,
|
||||
FirstName = "Roger",
|
||||
LastName = "Admin",
|
||||
LockoutEnabled = false,
|
||||
NormalizedEmail = "admin@admin.com",
|
||||
NormalizedUserName = "admin",
|
||||
PasswordHash = "AQAAAAEAACcQAAAAEKJtYKQ3fXHUA67KkZbzgDtxdg1UlFk3kFeNj3QSm3OfgsSoMtFExAq16W5arTVmRA==",
|
||||
NormalizedEmail = "ADMIN@ADMIN.COM",
|
||||
NormalizedUserName = "ADMIN",
|
||||
PasswordHash = "AQAAAAEAACcQAAAAELHpALZdYcW7KzDcU2ovqwdWsfSx68md+LnjvL5ZgJ2OWuTFwJM3gPzQ1yP3RHCn9g==",
|
||||
PhoneNumberConfirmed = false,
|
||||
SecurityStamp = "56fc4076-5e9d-4bd1-91e7-b53abcc41fda",
|
||||
SecurityStamp = "c43f4d48-f1bb-4a24-8cd3-78422556cf85",
|
||||
TwoFactorEnabled = false,
|
||||
UserName = "Admin"
|
||||
});
|
||||
});
|
||||
|
||||
modelBuilder.Entity("GrossesMitainesAPI.Models.Product", b =>
|
||||
modelBuilder.Entity("GrossesMitainesAPI.Models.AddressModel", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"), 1L, 1);
|
||||
|
||||
b.Property<string>("Appartment")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("City")
|
||||
.IsRequired()
|
||||
.HasMaxLength(50)
|
||||
.HasColumnType("nvarchar(50)");
|
||||
|
||||
b.Property<int>("CivicNumber")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<string>("Country")
|
||||
.IsRequired()
|
||||
.HasMaxLength(30)
|
||||
.HasColumnType("nvarchar(30)");
|
||||
|
||||
b.Property<string>("InventoryUserId")
|
||||
.HasColumnType("nvarchar(450)");
|
||||
|
||||
b.Property<string>("PostalCode")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("Province")
|
||||
.IsRequired()
|
||||
.HasMaxLength(3)
|
||||
.HasColumnType("nvarchar(3)");
|
||||
|
||||
b.Property<string>("Street")
|
||||
.IsRequired()
|
||||
.HasMaxLength(50)
|
||||
.HasColumnType("nvarchar(50)");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("InventoryUserId");
|
||||
|
||||
b.ToTable("Addresses");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("GrossesMitainesAPI.Models.InvoiceModel", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"), 1L, 1);
|
||||
|
||||
b.Property<bool>("Canceled")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<string>("EmailAddress")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("FirstName")
|
||||
.IsRequired()
|
||||
.HasMaxLength(30)
|
||||
.HasColumnType("nvarchar(30)");
|
||||
|
||||
b.Property<string>("LastName")
|
||||
.IsRequired()
|
||||
.HasMaxLength(30)
|
||||
.HasColumnType("nvarchar(30)");
|
||||
|
||||
b.Property<string>("LinkedAccountId")
|
||||
.HasColumnType("nvarchar(450)");
|
||||
|
||||
b.Property<string>("PhoneNumber")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<int>("ShippingAddressId")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("LinkedAccountId");
|
||||
|
||||
b.HasIndex("ShippingAddressId");
|
||||
|
||||
b.ToTable("Invoices");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("GrossesMitainesAPI.Models.InvoiceModel+ProductInvoice", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"), 1L, 1);
|
||||
|
||||
b.Property<int?>("InvoiceModelId")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("ProductId")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("Quantity")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("InvoiceModelId");
|
||||
|
||||
b.HasIndex("ProductId");
|
||||
|
||||
b.ToTable("ProductInvoice");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("GrossesMitainesAPI.Models.ProductModel", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
@@ -423,6 +553,22 @@ namespace GrossesMitainesAPI.Migrations
|
||||
.HasFilter("[NormalizedName] IS NOT NULL");
|
||||
|
||||
b.ToTable("AspNetRoles", (string)null);
|
||||
|
||||
b.HasData(
|
||||
new
|
||||
{
|
||||
Id = "c9e08b20-d8a5-473f-9f52-572eb23c12af",
|
||||
ConcurrencyStamp = "56321382-1bb3-4dfe-87bf-6919c0791765",
|
||||
Name = "Administrateur",
|
||||
NormalizedName = "ADMINISTRATEUR"
|
||||
},
|
||||
new
|
||||
{
|
||||
Id = "1b7b9c55-c746-493a-a24f-3d5ca937298e",
|
||||
ConcurrencyStamp = "0e3b1bc2-f632-4f63-9bea-ac995e2e95a7",
|
||||
Name = "Client",
|
||||
NormalizedName = "CLIENT"
|
||||
});
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<string>", b =>
|
||||
@@ -510,6 +656,18 @@ namespace GrossesMitainesAPI.Migrations
|
||||
b.HasIndex("RoleId");
|
||||
|
||||
b.ToTable("AspNetUserRoles", (string)null);
|
||||
|
||||
b.HasData(
|
||||
new
|
||||
{
|
||||
UserId = "ecf7503a-591c-454e-a824-048e10bd0474",
|
||||
RoleId = "c9e08b20-d8a5-473f-9f52-572eb23c12af"
|
||||
},
|
||||
new
|
||||
{
|
||||
UserId = "ecf7503a-591c-454e-a824-048e10bd0474",
|
||||
RoleId = "1b7b9c55-c746-493a-a24f-3d5ca937298e"
|
||||
});
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<string>", b =>
|
||||
@@ -531,6 +689,45 @@ namespace GrossesMitainesAPI.Migrations
|
||||
b.ToTable("AspNetUserTokens", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("GrossesMitainesAPI.Models.AddressModel", b =>
|
||||
{
|
||||
b.HasOne("GrossesMitainesAPI.Data.InventoryUser", null)
|
||||
.WithMany("Adresses")
|
||||
.HasForeignKey("InventoryUserId");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("GrossesMitainesAPI.Models.InvoiceModel", b =>
|
||||
{
|
||||
b.HasOne("GrossesMitainesAPI.Data.InventoryUser", "LinkedAccount")
|
||||
.WithMany()
|
||||
.HasForeignKey("LinkedAccountId");
|
||||
|
||||
b.HasOne("GrossesMitainesAPI.Models.AddressModel", "ShippingAddress")
|
||||
.WithMany()
|
||||
.HasForeignKey("ShippingAddressId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("LinkedAccount");
|
||||
|
||||
b.Navigation("ShippingAddress");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("GrossesMitainesAPI.Models.InvoiceModel+ProductInvoice", b =>
|
||||
{
|
||||
b.HasOne("GrossesMitainesAPI.Models.InvoiceModel", null)
|
||||
.WithMany("Products")
|
||||
.HasForeignKey("InvoiceModelId");
|
||||
|
||||
b.HasOne("GrossesMitainesAPI.Models.ProductModel", "Product")
|
||||
.WithMany()
|
||||
.HasForeignKey("ProductId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Product");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<string>", b =>
|
||||
{
|
||||
b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole", null)
|
||||
@@ -581,6 +778,16 @@ namespace GrossesMitainesAPI.Migrations
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
});
|
||||
|
||||
modelBuilder.Entity("GrossesMitainesAPI.Data.InventoryUser", b =>
|
||||
{
|
||||
b.Navigation("Adresses");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("GrossesMitainesAPI.Models.InvoiceModel", b =>
|
||||
{
|
||||
b.Navigation("Products");
|
||||
});
|
||||
#pragma warning restore 612, 618
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user