refactoring backend structure

This commit is contained in:
Michele 2021-02-15 23:35:55 +00:00
parent dcc59f7b69
commit 0e1c16ab91
36 changed files with 786 additions and 454 deletions

View file

@ -1,53 +0,0 @@
// // <auto-generated />
// using System;
// using Microsoft.EntityFrameworkCore;
// using Microsoft.EntityFrameworkCore.Infrastructure;
// using Microsoft.EntityFrameworkCore.Metadata;
// using Microsoft.EntityFrameworkCore.Migrations;
// using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
// using Sledgemapper.Helpers;
// namespace Sledgemapper.Migrations.SqlServerMigrations
// {
// [DbContext(typeof(DataContext))]
// [Migration("20200102103423_InitialCreate")]
// partial class InitialCreate
// {
// protected override void BuildTargetModel(ModelBuilder modelBuilder)
// {
// #pragma warning disable 612, 618
// modelBuilder
// .HasAnnotation("ProductVersion", "3.1.0")
// .HasAnnotation("Relational:MaxIdentifierLength", 128)
// .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
// modelBuilder.Entity("Sledgemapper.Entities.User", b =>
// {
// b.Property<int>("Id")
// .ValueGeneratedOnAdd()
// .HasColumnType("int")
// .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
// b.Property<string>("FirstName")
// .HasColumnType("nvarchar(max)");
// b.Property<string>("LastName")
// .HasColumnType("nvarchar(max)");
// b.Property<byte[]>("PasswordHash")
// .HasColumnType("varbinary(max)");
// b.Property<byte[]>("PasswordSalt")
// .HasColumnType("varbinary(max)");
// b.Property<string>("Username")
// .HasColumnType("nvarchar(max)");
// b.HasKey("Id");
// b.ToTable("Users");
// });
// #pragma warning restore 612, 618
// }
// }
// }

View file

@ -1,33 +0,0 @@
// using Microsoft.EntityFrameworkCore.Migrations;
// namespace Sledgemapper.Migrations.SqlServerMigrations
// {
// public partial class InitialCreate : Migration
// {
// protected override void Up(MigrationBuilder migrationBuilder)
// {
// migrationBuilder.CreateTable(
// name: "Users",
// columns: table => new
// {
// Id = table.Column<int>(nullable: false)
// .Annotation("SqlServer:Identity", "1, 1"),
// FirstName = table.Column<string>(nullable: true),
// LastName = table.Column<string>(nullable: true),
// Username = table.Column<string>(nullable: true),
// PasswordHash = table.Column<byte[]>(nullable: true),
// PasswordSalt = table.Column<byte[]>(nullable: true)
// },
// constraints: table =>
// {
// table.PrimaryKey("PK_Users", x => x.Id);
// });
// }
// protected override void Down(MigrationBuilder migrationBuilder)
// {
// migrationBuilder.DropTable(
// name: "Users");
// }
// }
// }

View file

@ -1,51 +0,0 @@
// // <auto-generated />
// using System;
// using Microsoft.EntityFrameworkCore;
// using Microsoft.EntityFrameworkCore.Infrastructure;
// using Microsoft.EntityFrameworkCore.Metadata;
// using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
// using Sledgemapper.Helpers;
// namespace Sledgemapper.Migrations.SqlServerMigrations
// {
// [DbContext(typeof(DataContext))]
// partial class DataContextModelSnapshot : ModelSnapshot
// {
// protected override void BuildModel(ModelBuilder modelBuilder)
// {
// #pragma warning disable 612, 618
// modelBuilder
// .HasAnnotation("ProductVersion", "3.1.0")
// .HasAnnotation("Relational:MaxIdentifierLength", 128)
// .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
// modelBuilder.Entity("Sledgemapper.Entities.User", b =>
// {
// b.Property<int>("Id")
// .ValueGeneratedOnAdd()
// .HasColumnType("int")
// .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
// b.Property<string>("FirstName")
// .HasColumnType("nvarchar(max)");
// b.Property<string>("LastName")
// .HasColumnType("nvarchar(max)");
// b.Property<byte[]>("PasswordHash")
// .HasColumnType("varbinary(max)");
// b.Property<byte[]>("PasswordSalt")
// .HasColumnType("varbinary(max)");
// b.Property<string>("Username")
// .HasColumnType("nvarchar(max)");
// b.HasKey("Id");
// b.ToTable("Users");
// });
// #pragma warning restore 612, 618
// }
// }
// }

View file

@ -1,52 +0,0 @@
// <auto-generated />
using System;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using Sledgemapper.Helpers;
namespace Sledgemapper.Migrations.SqliteMigrations
{
[DbContext(typeof(SqliteDataContext))]
[Migration("20200102102942_InitialCreate")]
partial class InitialCreate
{
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("ProductVersion", "3.1.0");
modelBuilder.Entity("Sledgemapper.Entities.User", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER");
b.Property<string>("FirstName")
.HasColumnType("TEXT");
b.Property<string>("LastName")
.HasColumnType("TEXT");
b.Property<string>("Initials")
.HasColumnType("TEXT");
b.Property<byte[]>("PasswordHash")
.HasColumnType("BLOB");
b.Property<byte[]>("PasswordSalt")
.HasColumnType("BLOB");
b.Property<string>("Username")
.HasColumnType("TEXT");
b.HasKey("Id");
b.ToTable("Users");
});
#pragma warning restore 612, 618
}
}
}

View file

@ -1,34 +0,0 @@
using Microsoft.EntityFrameworkCore.Migrations;
namespace Sledgemapper.Migrations.SqliteMigrations
{
public partial class InitialCreate : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "Users",
columns: table => new
{
Id = table.Column<int>(nullable: false)
.Annotation("Sqlite:Autoincrement", true),
FirstName = table.Column<string>(nullable: true),
LastName = table.Column<string>(nullable: true),
Username = table.Column<string>(nullable: true),
Initials = table.Column<string>(nullable: true),
PasswordHash = table.Column<byte[]>(nullable: true),
PasswordSalt = table.Column<byte[]>(nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_Users", x => x.Id);
});
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "Users");
}
}
}

View file

@ -1,50 +0,0 @@
// <auto-generated />
using System;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using Sledgemapper.Helpers;
namespace Sledgemapper.Migrations.SqliteMigrations
{
[DbContext(typeof(SqliteDataContext))]
partial class SqliteDataContextModelSnapshot : ModelSnapshot
{
protected override void BuildModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("ProductVersion", "3.1.0");
modelBuilder.Entity("Sledgemapper.Entities.User", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER");
b.Property<string>("FirstName")
.HasColumnType("TEXT");
b.Property<string>("LastName")
.HasColumnType("TEXT");
b.Property<string>("Initials")
.HasColumnType("TEXT");
b.Property<byte[]>("PasswordHash")
.HasColumnType("BLOB");
b.Property<byte[]>("PasswordSalt")
.HasColumnType("BLOB");
b.Property<string>("Username")
.HasColumnType("TEXT");
b.HasKey("Id");
b.ToTable("Users");
});
#pragma warning restore 612, 618
}
}
}