Skip to content

Commit

Permalink
Added new migration with customer and admin user
Browse files Browse the repository at this point in the history
  • Loading branch information
lgaljer20 committed Jan 9, 2024
1 parent e323e3b commit 8e0c90c
Show file tree
Hide file tree
Showing 4 changed files with 389 additions and 3 deletions.
293 changes: 293 additions & 0 deletions SmartCharger.Data/Migrations/20240109151419_newUsers.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

40 changes: 40 additions & 0 deletions SmartCharger.Data/Migrations/20240109151419_newUsers.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

#pragma warning disable CA1814 // Prefer jagged arrays over multidimensional

namespace SmartCharger.Data.Migrations
{
/// <inheritdoc />
public partial class newUsers : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.InsertData(
table: "Users",
columns: new[] { "Id", "Active", "CreationTime", "Email", "FirstName", "LastName", "Password", "RoleId", "Salt" },
values: new object[,]
{
{ 1, true, new DateTime(2024, 1, 9, 15, 14, 19, 692, DateTimeKind.Utc).AddTicks(8005), "[email protected]", "Admin", "Admin", "$2b$10$hmyMVezD9FUJdULq3sFnI.oWajZxHcuWusLmIdCUTcg5XI9Zy4R3a", 1, "$2b$10$f1wBguLF9ane/U9yySuKau" },
{ 2, true, new DateTime(2024, 1, 9, 15, 14, 19, 692, DateTimeKind.Utc).AddTicks(8012), "[email protected]", "Customer", "Customer", "$2b$10$Zeaai0Ju24WY/x.cpZpFiOCZAyjdphShUUqCIeoPpPEn.LPBDB1uy", 2, "$2b$10$Zeaai0Ju24WY/x.cpZpFiO" }
});
}

/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DeleteData(
table: "Users",
keyColumn: "Id",
keyValue: 1);

migrationBuilder.DeleteData(
table: "Users",
keyColumn: "Id",
keyValue: 2);
}
}
}
26 changes: 26 additions & 0 deletions SmartCharger.Data/Migrations/SmartChargerContextModelSnapshot.cs
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,32 @@ protected override void BuildModel(ModelBuilder modelBuilder)
b.HasIndex("RoleId");
b.ToTable("Users");
b.HasData(
new
{
Id = 1,
Active = true,
CreationTime = new DateTime(2024, 1, 9, 15, 14, 19, 692, DateTimeKind.Utc).AddTicks(8005),
Email = "[email protected]",
FirstName = "Admin",
LastName = "Admin",
Password = "$2b$10$hmyMVezD9FUJdULq3sFnI.oWajZxHcuWusLmIdCUTcg5XI9Zy4R3a",
RoleId = 1,
Salt = "$2b$10$f1wBguLF9ane/U9yySuKau"
},
new
{
Id = 2,
Active = true,
CreationTime = new DateTime(2024, 1, 9, 15, 14, 19, 692, DateTimeKind.Utc).AddTicks(8012),
Email = "[email protected]",
FirstName = "Customer",
LastName = "Customer",
Password = "$2b$10$Zeaai0Ju24WY/x.cpZpFiOCZAyjdphShUUqCIeoPpPEn.LPBDB1uy",
RoleId = 2,
Salt = "$2b$10$Zeaai0Ju24WY/x.cpZpFiO"
});
});

modelBuilder.Entity("SmartCharger.Data.Entities.Card", b =>
Expand Down
Loading

0 comments on commit 8e0c90c

Please sign in to comment.