init
This commit is contained in:
132
SecureBank.Database/Migrations/20240114165546_Migration1.Designer.cs
generated
Normal file
132
SecureBank.Database/Migrations/20240114165546_Migration1.Designer.cs
generated
Normal file
@@ -0,0 +1,132 @@
|
||||
// <auto-generated />
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
using SecureBank.Database;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace SecureBank.Database.Migrations
|
||||
{
|
||||
[DbContext(typeof(DatabaseContext))]
|
||||
[Migration("20240114165546_Migration1")]
|
||||
partial class Migration1
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
||||
{
|
||||
#pragma warning disable 612, 618
|
||||
modelBuilder.HasAnnotation("ProductVersion", "8.0.1");
|
||||
|
||||
modelBuilder.Entity("SecureBank.Database.Account", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<string>("Email")
|
||||
.IsRequired()
|
||||
.HasMaxLength(300)
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("FirstName")
|
||||
.IsRequired()
|
||||
.HasMaxLength(100)
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("LastName")
|
||||
.IsRequired()
|
||||
.HasMaxLength(100)
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<byte>("LoginFailedCount")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<string>("PhoneNumber")
|
||||
.IsRequired()
|
||||
.HasMaxLength(20)
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<bool>("TemporaryPassword")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("Accounts");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("SecureBank.Database.AccountPassword", b =>
|
||||
{
|
||||
b.Property<long>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<int>("AccountId")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<string>("LeftSalt")
|
||||
.IsRequired()
|
||||
.HasMaxLength(20)
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<byte[]>("Password")
|
||||
.IsRequired()
|
||||
.HasMaxLength(1000)
|
||||
.HasColumnType("BLOB");
|
||||
|
||||
b.Property<string>("RightSalt")
|
||||
.IsRequired()
|
||||
.HasMaxLength(20)
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("AccountId");
|
||||
|
||||
b.ToTable("AccountPasswords");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("SecureBank.Database.AccountPasswordIndex", b =>
|
||||
{
|
||||
b.Property<long>("AccountPasswordId")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<byte>("Index")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.HasIndex("AccountPasswordId");
|
||||
|
||||
b.ToTable("AccountPasswordIndexes");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("SecureBank.Database.AccountPassword", b =>
|
||||
{
|
||||
b.HasOne("SecureBank.Database.Account", "Account")
|
||||
.WithMany("AccountPasswords")
|
||||
.HasForeignKey("AccountId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Account");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("SecureBank.Database.AccountPasswordIndex", b =>
|
||||
{
|
||||
b.HasOne("SecureBank.Database.AccountPassword", "AccountPassword")
|
||||
.WithMany()
|
||||
.HasForeignKey("AccountPasswordId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("AccountPassword");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("SecureBank.Database.Account", b =>
|
||||
{
|
||||
b.Navigation("AccountPasswords");
|
||||
});
|
||||
#pragma warning restore 612, 618
|
||||
}
|
||||
}
|
||||
}
|
||||
94
SecureBank.Database/Migrations/20240114165546_Migration1.cs
Normal file
94
SecureBank.Database/Migrations/20240114165546_Migration1.cs
Normal file
@@ -0,0 +1,94 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace SecureBank.Database.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class Migration1 : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.CreateTable(
|
||||
name: "Accounts",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<int>(type: "INTEGER", nullable: false)
|
||||
.Annotation("Sqlite:Autoincrement", true),
|
||||
FirstName = table.Column<string>(type: "TEXT", maxLength: 100, nullable: false),
|
||||
LastName = table.Column<string>(type: "TEXT", maxLength: 100, nullable: false),
|
||||
Email = table.Column<string>(type: "TEXT", maxLength: 300, nullable: false),
|
||||
PhoneNumber = table.Column<string>(type: "TEXT", maxLength: 20, nullable: false),
|
||||
LoginFailedCount = table.Column<byte>(type: "INTEGER", nullable: false),
|
||||
TemporaryPassword = table.Column<bool>(type: "INTEGER", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_Accounts", x => x.Id);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "AccountPasswords",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<long>(type: "INTEGER", nullable: false)
|
||||
.Annotation("Sqlite:Autoincrement", true),
|
||||
AccountId = table.Column<int>(type: "INTEGER", nullable: false),
|
||||
Password = table.Column<byte[]>(type: "BLOB", maxLength: 1000, nullable: false),
|
||||
LeftSalt = table.Column<string>(type: "TEXT", maxLength: 20, nullable: false),
|
||||
RightSalt = table.Column<string>(type: "TEXT", maxLength: 20, nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_AccountPasswords", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_AccountPasswords_Accounts_AccountId",
|
||||
column: x => x.AccountId,
|
||||
principalTable: "Accounts",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "AccountPasswordIndexes",
|
||||
columns: table => new
|
||||
{
|
||||
AccountPasswordId = table.Column<long>(type: "INTEGER", nullable: false),
|
||||
Index = table.Column<byte>(type: "INTEGER", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.ForeignKey(
|
||||
name: "FK_AccountPasswordIndexes_AccountPasswords_AccountPasswordId",
|
||||
column: x => x.AccountPasswordId,
|
||||
principalTable: "AccountPasswords",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_AccountPasswordIndexes_AccountPasswordId",
|
||||
table: "AccountPasswordIndexes",
|
||||
column: "AccountPasswordId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_AccountPasswords_AccountId",
|
||||
table: "AccountPasswords",
|
||||
column: "AccountId");
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropTable(
|
||||
name: "AccountPasswordIndexes");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "AccountPasswords");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "Accounts");
|
||||
}
|
||||
}
|
||||
}
|
||||
138
SecureBank.Database/Migrations/20240114170227_Migration2.Designer.cs
generated
Normal file
138
SecureBank.Database/Migrations/20240114170227_Migration2.Designer.cs
generated
Normal file
@@ -0,0 +1,138 @@
|
||||
// <auto-generated />
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
using SecureBank.Database;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace SecureBank.Database.Migrations
|
||||
{
|
||||
[DbContext(typeof(DatabaseContext))]
|
||||
[Migration("20240114170227_Migration2")]
|
||||
partial class Migration2
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
||||
{
|
||||
#pragma warning disable 612, 618
|
||||
modelBuilder.HasAnnotation("ProductVersion", "8.0.1");
|
||||
|
||||
modelBuilder.Entity("SecureBank.Database.Account", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<string>("Email")
|
||||
.IsRequired()
|
||||
.HasMaxLength(300)
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("FirstName")
|
||||
.IsRequired()
|
||||
.HasMaxLength(100)
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("LastName")
|
||||
.IsRequired()
|
||||
.HasMaxLength(100)
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<byte>("LoginFailedCount")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<string>("PhoneNumber")
|
||||
.IsRequired()
|
||||
.HasMaxLength(20)
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<bool>("TemporaryPassword")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("Accounts");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("SecureBank.Database.AccountPassword", b =>
|
||||
{
|
||||
b.Property<long>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<int>("AccountId")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<string>("LeftSalt")
|
||||
.IsRequired()
|
||||
.HasMaxLength(20)
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<byte[]>("Password")
|
||||
.IsRequired()
|
||||
.HasMaxLength(1000)
|
||||
.HasColumnType("BLOB");
|
||||
|
||||
b.Property<string>("RightSalt")
|
||||
.IsRequired()
|
||||
.HasMaxLength(20)
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("AccountId");
|
||||
|
||||
b.ToTable("AccountPasswords");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("SecureBank.Database.AccountPasswordIndex", b =>
|
||||
{
|
||||
b.Property<long>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<long>("AccountPasswordId")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<byte>("Index")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("AccountPasswordId");
|
||||
|
||||
b.ToTable("AccountPasswordIndexes");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("SecureBank.Database.AccountPassword", b =>
|
||||
{
|
||||
b.HasOne("SecureBank.Database.Account", "Account")
|
||||
.WithMany("AccountPasswords")
|
||||
.HasForeignKey("AccountId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Account");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("SecureBank.Database.AccountPasswordIndex", b =>
|
||||
{
|
||||
b.HasOne("SecureBank.Database.AccountPassword", "AccountPassword")
|
||||
.WithMany()
|
||||
.HasForeignKey("AccountPasswordId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("AccountPassword");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("SecureBank.Database.Account", b =>
|
||||
{
|
||||
b.Navigation("AccountPasswords");
|
||||
});
|
||||
#pragma warning restore 612, 618
|
||||
}
|
||||
}
|
||||
}
|
||||
39
SecureBank.Database/Migrations/20240114170227_Migration2.cs
Normal file
39
SecureBank.Database/Migrations/20240114170227_Migration2.cs
Normal file
@@ -0,0 +1,39 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace SecureBank.Database.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class Migration2 : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AddColumn<long>(
|
||||
name: "Id",
|
||||
table: "AccountPasswordIndexes",
|
||||
type: "INTEGER",
|
||||
nullable: false,
|
||||
defaultValue: 0L)
|
||||
.Annotation("Sqlite:Autoincrement", true);
|
||||
|
||||
migrationBuilder.AddPrimaryKey(
|
||||
name: "PK_AccountPasswordIndexes",
|
||||
table: "AccountPasswordIndexes",
|
||||
column: "Id");
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropPrimaryKey(
|
||||
name: "PK_AccountPasswordIndexes",
|
||||
table: "AccountPasswordIndexes");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "Id",
|
||||
table: "AccountPasswordIndexes");
|
||||
}
|
||||
}
|
||||
}
|
||||
169
SecureBank.Database/Migrations/20240115084527_Migration3.Designer.cs
generated
Normal file
169
SecureBank.Database/Migrations/20240115084527_Migration3.Designer.cs
generated
Normal file
@@ -0,0 +1,169 @@
|
||||
// <auto-generated />
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
using SecureBank.Database;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace SecureBank.Database.Migrations
|
||||
{
|
||||
[DbContext(typeof(DatabaseContext))]
|
||||
[Migration("20240115084527_Migration3")]
|
||||
partial class Migration3
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
||||
{
|
||||
#pragma warning disable 612, 618
|
||||
modelBuilder.HasAnnotation("ProductVersion", "8.0.1");
|
||||
|
||||
modelBuilder.Entity("SecureBank.Database.Account", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<string>("Email")
|
||||
.IsRequired()
|
||||
.HasMaxLength(300)
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("FirstName")
|
||||
.IsRequired()
|
||||
.HasMaxLength(100)
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("LastName")
|
||||
.IsRequired()
|
||||
.HasMaxLength(100)
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<byte>("LoginFailedCount")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<string>("PhoneNumber")
|
||||
.IsRequired()
|
||||
.HasMaxLength(20)
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<bool>("TemporaryPassword")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("Accounts");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("SecureBank.Database.AccountLoginRequest", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<long>("AccountPasswordId")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<DateTime>("ValidTo")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("AccountPasswordId");
|
||||
|
||||
b.ToTable("AccountLoginRequests");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("SecureBank.Database.AccountPassword", b =>
|
||||
{
|
||||
b.Property<long>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<int>("AccountId")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<string>("LeftSalt")
|
||||
.IsRequired()
|
||||
.HasMaxLength(20)
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<byte[]>("Password")
|
||||
.IsRequired()
|
||||
.HasMaxLength(1000)
|
||||
.HasColumnType("BLOB");
|
||||
|
||||
b.Property<string>("RightSalt")
|
||||
.IsRequired()
|
||||
.HasMaxLength(20)
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("AccountId");
|
||||
|
||||
b.ToTable("AccountPasswords");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("SecureBank.Database.AccountPasswordIndex", b =>
|
||||
{
|
||||
b.Property<long>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<long>("AccountPasswordId")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<byte>("Index")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("AccountPasswordId");
|
||||
|
||||
b.ToTable("AccountPasswordIndexes");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("SecureBank.Database.AccountLoginRequest", b =>
|
||||
{
|
||||
b.HasOne("SecureBank.Database.AccountPassword", "AccountPassword")
|
||||
.WithMany()
|
||||
.HasForeignKey("AccountPasswordId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("AccountPassword");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("SecureBank.Database.AccountPassword", b =>
|
||||
{
|
||||
b.HasOne("SecureBank.Database.Account", "Account")
|
||||
.WithMany("AccountPasswords")
|
||||
.HasForeignKey("AccountId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Account");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("SecureBank.Database.AccountPasswordIndex", b =>
|
||||
{
|
||||
b.HasOne("SecureBank.Database.AccountPassword", "AccountPassword")
|
||||
.WithMany()
|
||||
.HasForeignKey("AccountPasswordId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("AccountPassword");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("SecureBank.Database.Account", b =>
|
||||
{
|
||||
b.Navigation("AccountPasswords");
|
||||
});
|
||||
#pragma warning restore 612, 618
|
||||
}
|
||||
}
|
||||
}
|
||||
46
SecureBank.Database/Migrations/20240115084527_Migration3.cs
Normal file
46
SecureBank.Database/Migrations/20240115084527_Migration3.cs
Normal file
@@ -0,0 +1,46 @@
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace SecureBank.Database.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class Migration3 : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.CreateTable(
|
||||
name: "AccountLoginRequests",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<Guid>(type: "TEXT", nullable: false),
|
||||
AccountPasswordId = table.Column<long>(type: "INTEGER", nullable: false),
|
||||
ValidTo = table.Column<DateTime>(type: "TEXT", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_AccountLoginRequests", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_AccountLoginRequests_AccountPasswords_AccountPasswordId",
|
||||
column: x => x.AccountPasswordId,
|
||||
principalTable: "AccountPasswords",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_AccountLoginRequests_AccountPasswordId",
|
||||
table: "AccountLoginRequests",
|
||||
column: "AccountPasswordId");
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropTable(
|
||||
name: "AccountLoginRequests");
|
||||
}
|
||||
}
|
||||
}
|
||||
173
SecureBank.Database/Migrations/20240115132220_Migration4.Designer.cs
generated
Normal file
173
SecureBank.Database/Migrations/20240115132220_Migration4.Designer.cs
generated
Normal file
@@ -0,0 +1,173 @@
|
||||
// <auto-generated />
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
using SecureBank.Database;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace SecureBank.Database.Migrations
|
||||
{
|
||||
[DbContext(typeof(DatabaseContext))]
|
||||
[Migration("20240115132220_Migration4")]
|
||||
partial class Migration4
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
||||
{
|
||||
#pragma warning disable 612, 618
|
||||
modelBuilder.HasAnnotation("ProductVersion", "8.0.1");
|
||||
|
||||
modelBuilder.Entity("SecureBank.Database.Account", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<string>("Email")
|
||||
.IsRequired()
|
||||
.HasMaxLength(300)
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("FirstName")
|
||||
.IsRequired()
|
||||
.HasMaxLength(100)
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("LastName")
|
||||
.IsRequired()
|
||||
.HasMaxLength(100)
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("LockReason")
|
||||
.HasMaxLength(1000)
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<byte>("LoginFailedCount")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<string>("PhoneNumber")
|
||||
.IsRequired()
|
||||
.HasMaxLength(20)
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<bool>("TemporaryPassword")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("Accounts");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("SecureBank.Database.AccountLoginRequest", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<long>("AccountPasswordId")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<DateTime>("ValidTo")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("AccountPasswordId");
|
||||
|
||||
b.ToTable("AccountLoginRequests");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("SecureBank.Database.AccountPassword", b =>
|
||||
{
|
||||
b.Property<long>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<int>("AccountId")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<string>("LeftSalt")
|
||||
.IsRequired()
|
||||
.HasMaxLength(20)
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<byte[]>("Password")
|
||||
.IsRequired()
|
||||
.HasMaxLength(1000)
|
||||
.HasColumnType("BLOB");
|
||||
|
||||
b.Property<string>("RightSalt")
|
||||
.IsRequired()
|
||||
.HasMaxLength(20)
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("AccountId");
|
||||
|
||||
b.ToTable("AccountPasswords");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("SecureBank.Database.AccountPasswordIndex", b =>
|
||||
{
|
||||
b.Property<long>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<long>("AccountPasswordId")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<byte>("Index")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("AccountPasswordId");
|
||||
|
||||
b.ToTable("AccountPasswordIndexes");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("SecureBank.Database.AccountLoginRequest", b =>
|
||||
{
|
||||
b.HasOne("SecureBank.Database.AccountPassword", "AccountPassword")
|
||||
.WithMany()
|
||||
.HasForeignKey("AccountPasswordId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("AccountPassword");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("SecureBank.Database.AccountPassword", b =>
|
||||
{
|
||||
b.HasOne("SecureBank.Database.Account", "Account")
|
||||
.WithMany("AccountPasswords")
|
||||
.HasForeignKey("AccountId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Account");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("SecureBank.Database.AccountPasswordIndex", b =>
|
||||
{
|
||||
b.HasOne("SecureBank.Database.AccountPassword", "AccountPassword")
|
||||
.WithMany()
|
||||
.HasForeignKey("AccountPasswordId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("AccountPassword");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("SecureBank.Database.Account", b =>
|
||||
{
|
||||
b.Navigation("AccountPasswords");
|
||||
});
|
||||
#pragma warning restore 612, 618
|
||||
}
|
||||
}
|
||||
}
|
||||
29
SecureBank.Database/Migrations/20240115132220_Migration4.cs
Normal file
29
SecureBank.Database/Migrations/20240115132220_Migration4.cs
Normal file
@@ -0,0 +1,29 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace SecureBank.Database.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class Migration4 : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "LockReason",
|
||||
table: "Accounts",
|
||||
type: "TEXT",
|
||||
maxLength: 1000,
|
||||
nullable: true);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropColumn(
|
||||
name: "LockReason",
|
||||
table: "Accounts");
|
||||
}
|
||||
}
|
||||
}
|
||||
170
SecureBank.Database/Migrations/DatabaseContextModelSnapshot.cs
Normal file
170
SecureBank.Database/Migrations/DatabaseContextModelSnapshot.cs
Normal file
@@ -0,0 +1,170 @@
|
||||
// <auto-generated />
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
using SecureBank.Database;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace SecureBank.Database.Migrations
|
||||
{
|
||||
[DbContext(typeof(DatabaseContext))]
|
||||
partial class DatabaseContextModelSnapshot : ModelSnapshot
|
||||
{
|
||||
protected override void BuildModel(ModelBuilder modelBuilder)
|
||||
{
|
||||
#pragma warning disable 612, 618
|
||||
modelBuilder.HasAnnotation("ProductVersion", "8.0.1");
|
||||
|
||||
modelBuilder.Entity("SecureBank.Database.Account", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<string>("Email")
|
||||
.IsRequired()
|
||||
.HasMaxLength(300)
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("FirstName")
|
||||
.IsRequired()
|
||||
.HasMaxLength(100)
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("LastName")
|
||||
.IsRequired()
|
||||
.HasMaxLength(100)
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("LockReason")
|
||||
.HasMaxLength(1000)
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<byte>("LoginFailedCount")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<string>("PhoneNumber")
|
||||
.IsRequired()
|
||||
.HasMaxLength(20)
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<bool>("TemporaryPassword")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("Accounts");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("SecureBank.Database.AccountLoginRequest", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<long>("AccountPasswordId")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<DateTime>("ValidTo")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("AccountPasswordId");
|
||||
|
||||
b.ToTable("AccountLoginRequests");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("SecureBank.Database.AccountPassword", b =>
|
||||
{
|
||||
b.Property<long>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<int>("AccountId")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<string>("LeftSalt")
|
||||
.IsRequired()
|
||||
.HasMaxLength(20)
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<byte[]>("Password")
|
||||
.IsRequired()
|
||||
.HasMaxLength(1000)
|
||||
.HasColumnType("BLOB");
|
||||
|
||||
b.Property<string>("RightSalt")
|
||||
.IsRequired()
|
||||
.HasMaxLength(20)
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("AccountId");
|
||||
|
||||
b.ToTable("AccountPasswords");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("SecureBank.Database.AccountPasswordIndex", b =>
|
||||
{
|
||||
b.Property<long>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<long>("AccountPasswordId")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<byte>("Index")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("AccountPasswordId");
|
||||
|
||||
b.ToTable("AccountPasswordIndexes");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("SecureBank.Database.AccountLoginRequest", b =>
|
||||
{
|
||||
b.HasOne("SecureBank.Database.AccountPassword", "AccountPassword")
|
||||
.WithMany()
|
||||
.HasForeignKey("AccountPasswordId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("AccountPassword");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("SecureBank.Database.AccountPassword", b =>
|
||||
{
|
||||
b.HasOne("SecureBank.Database.Account", "Account")
|
||||
.WithMany("AccountPasswords")
|
||||
.HasForeignKey("AccountId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Account");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("SecureBank.Database.AccountPasswordIndex", b =>
|
||||
{
|
||||
b.HasOne("SecureBank.Database.AccountPassword", "AccountPassword")
|
||||
.WithMany()
|
||||
.HasForeignKey("AccountPasswordId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("AccountPassword");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("SecureBank.Database.Account", b =>
|
||||
{
|
||||
b.Navigation("AccountPasswords");
|
||||
});
|
||||
#pragma warning restore 612, 618
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user