final1
This commit is contained in:
@@ -1,132 +0,0 @@
|
||||
// <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
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,138 +0,0 @@
|
||||
// <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
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,39 +0,0 @@
|
||||
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");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,169 +0,0 @@
|
||||
// <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
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,46 +0,0 @@
|
||||
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");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,29 +0,0 @@
|
||||
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");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -11,8 +11,8 @@ using SecureBank.Database;
|
||||
namespace SecureBank.Database.Migrations
|
||||
{
|
||||
[DbContext(typeof(DatabaseContext))]
|
||||
[Migration("20240115132220_Migration4")]
|
||||
partial class Migration4
|
||||
[Migration("20240122225115_Migration1")]
|
||||
partial class Migration1
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
||||
@@ -26,6 +26,26 @@ namespace SecureBank.Database.Migrations
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<string>("Address")
|
||||
.IsRequired()
|
||||
.HasMaxLength(500)
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<byte[]>("CardCVV")
|
||||
.IsRequired()
|
||||
.HasMaxLength(16)
|
||||
.HasColumnType("BLOB");
|
||||
|
||||
b.Property<byte[]>("CardExpirationDate")
|
||||
.IsRequired()
|
||||
.HasMaxLength(16)
|
||||
.HasColumnType("BLOB");
|
||||
|
||||
b.Property<byte[]>("CardNumber")
|
||||
.IsRequired()
|
||||
.HasMaxLength(32)
|
||||
.HasColumnType("BLOB");
|
||||
|
||||
b.Property<string>("Email")
|
||||
.IsRequired()
|
||||
.HasMaxLength(300)
|
||||
@@ -36,6 +56,19 @@ namespace SecureBank.Database.Migrations
|
||||
.HasMaxLength(100)
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("IBAN")
|
||||
.IsRequired()
|
||||
.HasMaxLength(26)
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<byte[]>("IdCardNumber")
|
||||
.IsRequired()
|
||||
.HasMaxLength(16)
|
||||
.HasColumnType("BLOB");
|
||||
|
||||
b.Property<bool>("IsAdmin")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<string>("LastName")
|
||||
.IsRequired()
|
||||
.HasMaxLength(100)
|
||||
@@ -48,6 +81,11 @@ namespace SecureBank.Database.Migrations
|
||||
b.Property<byte>("LoginFailedCount")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<byte[]>("PESEL")
|
||||
.IsRequired()
|
||||
.HasMaxLength(16)
|
||||
.HasColumnType("BLOB");
|
||||
|
||||
b.Property<string>("PhoneNumber")
|
||||
.IsRequired()
|
||||
.HasMaxLength(20)
|
||||
@@ -130,6 +168,55 @@ namespace SecureBank.Database.Migrations
|
||||
b.ToTable("AccountPasswordIndexes");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("SecureBank.Database.Transfer", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<decimal>("Amount")
|
||||
.HasPrecision(14, 2)
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<DateTime>("Date")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("ReceiverAccountNumber")
|
||||
.IsRequired()
|
||||
.HasMaxLength(26)
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("ReceiverAddress")
|
||||
.HasMaxLength(100)
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("ReceiverName")
|
||||
.HasMaxLength(100)
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("SenderAccountNumber")
|
||||
.IsRequired()
|
||||
.HasMaxLength(26)
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("SenderAddress")
|
||||
.HasMaxLength(100)
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("SenderName")
|
||||
.HasMaxLength(100)
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("Title")
|
||||
.IsRequired()
|
||||
.HasMaxLength(200)
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("Transfers");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("SecureBank.Database.AccountLoginRequest", b =>
|
||||
{
|
||||
b.HasOne("SecureBank.Database.AccountPassword", "AccountPassword")
|
||||
@@ -1,4 +1,5 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
@@ -20,14 +21,43 @@ namespace SecureBank.Database.Migrations
|
||||
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),
|
||||
Address = table.Column<string>(type: "TEXT", maxLength: 500, nullable: false),
|
||||
PESEL = table.Column<byte[]>(type: "BLOB", maxLength: 16, nullable: false),
|
||||
IdCardNumber = table.Column<byte[]>(type: "BLOB", maxLength: 16, nullable: false),
|
||||
IBAN = table.Column<string>(type: "TEXT", maxLength: 26, nullable: false),
|
||||
CardNumber = table.Column<byte[]>(type: "BLOB", maxLength: 32, nullable: false),
|
||||
CardExpirationDate = table.Column<byte[]>(type: "BLOB", maxLength: 16, nullable: false),
|
||||
CardCVV = table.Column<byte[]>(type: "BLOB", maxLength: 16, nullable: false),
|
||||
IsAdmin = table.Column<bool>(type: "INTEGER", nullable: false),
|
||||
LoginFailedCount = table.Column<byte>(type: "INTEGER", nullable: false),
|
||||
TemporaryPassword = table.Column<bool>(type: "INTEGER", nullable: false)
|
||||
TemporaryPassword = table.Column<bool>(type: "INTEGER", nullable: false),
|
||||
LockReason = table.Column<string>(type: "TEXT", maxLength: 1000, nullable: true)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_Accounts", x => x.Id);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "Transfers",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<Guid>(type: "TEXT", nullable: false),
|
||||
SenderAccountNumber = table.Column<string>(type: "TEXT", maxLength: 26, nullable: false),
|
||||
SenderName = table.Column<string>(type: "TEXT", maxLength: 100, nullable: true),
|
||||
SenderAddress = table.Column<string>(type: "TEXT", maxLength: 100, nullable: true),
|
||||
ReceiverAccountNumber = table.Column<string>(type: "TEXT", maxLength: 26, nullable: false),
|
||||
ReceiverName = table.Column<string>(type: "TEXT", maxLength: 100, nullable: true),
|
||||
ReceiverAddress = table.Column<string>(type: "TEXT", maxLength: 100, nullable: true),
|
||||
Amount = table.Column<decimal>(type: "TEXT", precision: 14, scale: 2, nullable: false),
|
||||
Title = table.Column<string>(type: "TEXT", maxLength: 200, nullable: false),
|
||||
Date = table.Column<DateTime>(type: "TEXT", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_Transfers", x => x.Id);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "AccountPasswords",
|
||||
columns: table => new
|
||||
@@ -50,15 +80,37 @@ namespace SecureBank.Database.Migrations
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
});
|
||||
|
||||
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.CreateTable(
|
||||
name: "AccountPasswordIndexes",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<long>(type: "INTEGER", nullable: false)
|
||||
.Annotation("Sqlite:Autoincrement", true),
|
||||
AccountPasswordId = table.Column<long>(type: "INTEGER", nullable: false),
|
||||
Index = table.Column<byte>(type: "INTEGER", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_AccountPasswordIndexes", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_AccountPasswordIndexes_AccountPasswords_AccountPasswordId",
|
||||
column: x => x.AccountPasswordId,
|
||||
@@ -67,6 +119,11 @@ namespace SecureBank.Database.Migrations
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_AccountLoginRequests_AccountPasswordId",
|
||||
table: "AccountLoginRequests",
|
||||
column: "AccountPasswordId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_AccountPasswordIndexes_AccountPasswordId",
|
||||
table: "AccountPasswordIndexes",
|
||||
@@ -81,9 +138,15 @@ namespace SecureBank.Database.Migrations
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropTable(
|
||||
name: "AccountLoginRequests");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "AccountPasswordIndexes");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "Transfers");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "AccountPasswords");
|
||||
|
||||
@@ -23,6 +23,26 @@ namespace SecureBank.Database.Migrations
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<string>("Address")
|
||||
.IsRequired()
|
||||
.HasMaxLength(500)
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<byte[]>("CardCVV")
|
||||
.IsRequired()
|
||||
.HasMaxLength(16)
|
||||
.HasColumnType("BLOB");
|
||||
|
||||
b.Property<byte[]>("CardExpirationDate")
|
||||
.IsRequired()
|
||||
.HasMaxLength(16)
|
||||
.HasColumnType("BLOB");
|
||||
|
||||
b.Property<byte[]>("CardNumber")
|
||||
.IsRequired()
|
||||
.HasMaxLength(32)
|
||||
.HasColumnType("BLOB");
|
||||
|
||||
b.Property<string>("Email")
|
||||
.IsRequired()
|
||||
.HasMaxLength(300)
|
||||
@@ -33,6 +53,19 @@ namespace SecureBank.Database.Migrations
|
||||
.HasMaxLength(100)
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("IBAN")
|
||||
.IsRequired()
|
||||
.HasMaxLength(26)
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<byte[]>("IdCardNumber")
|
||||
.IsRequired()
|
||||
.HasMaxLength(16)
|
||||
.HasColumnType("BLOB");
|
||||
|
||||
b.Property<bool>("IsAdmin")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<string>("LastName")
|
||||
.IsRequired()
|
||||
.HasMaxLength(100)
|
||||
@@ -45,6 +78,11 @@ namespace SecureBank.Database.Migrations
|
||||
b.Property<byte>("LoginFailedCount")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<byte[]>("PESEL")
|
||||
.IsRequired()
|
||||
.HasMaxLength(16)
|
||||
.HasColumnType("BLOB");
|
||||
|
||||
b.Property<string>("PhoneNumber")
|
||||
.IsRequired()
|
||||
.HasMaxLength(20)
|
||||
@@ -127,6 +165,55 @@ namespace SecureBank.Database.Migrations
|
||||
b.ToTable("AccountPasswordIndexes");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("SecureBank.Database.Transfer", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<decimal>("Amount")
|
||||
.HasPrecision(14, 2)
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<DateTime>("Date")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("ReceiverAccountNumber")
|
||||
.IsRequired()
|
||||
.HasMaxLength(26)
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("ReceiverAddress")
|
||||
.HasMaxLength(100)
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("ReceiverName")
|
||||
.HasMaxLength(100)
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("SenderAccountNumber")
|
||||
.IsRequired()
|
||||
.HasMaxLength(26)
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("SenderAddress")
|
||||
.HasMaxLength(100)
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("SenderName")
|
||||
.HasMaxLength(100)
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("Title")
|
||||
.IsRequired()
|
||||
.HasMaxLength(200)
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("Transfers");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("SecureBank.Database.AccountLoginRequest", b =>
|
||||
{
|
||||
b.HasOne("SecureBank.Database.AccountPassword", "AccountPassword")
|
||||
|
||||
Reference in New Issue
Block a user