Added User with ability to login and register. By default, user is not an admin. DTO expects an integer and will convert to Boolean.
This commit is contained in:
parent
2b521924d0
commit
5da41ea6f3
12 changed files with 239 additions and 10 deletions
36
API/Data/Migrations/20201213205325_AddUser.cs
Normal file
36
API/Data/Migrations/20201213205325_AddUser.cs
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
namespace API.Data.Migrations
|
||||
{
|
||||
public partial class AddUser : Migration
|
||||
{
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.CreateTable(
|
||||
name: "Users",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<int>(type: "INTEGER", nullable: false)
|
||||
.Annotation("Sqlite:Autoincrement", true),
|
||||
UserName = table.Column<string>(type: "TEXT", nullable: true),
|
||||
PasswordHash = table.Column<byte[]>(type: "BLOB", nullable: true),
|
||||
PasswordSalt = table.Column<byte[]>(type: "BLOB", nullable: true),
|
||||
Created = table.Column<DateTime>(type: "TEXT", nullable: false),
|
||||
LastActive = table.Column<DateTime>(type: "TEXT", nullable: false),
|
||||
IsAdmin = table.Column<bool>(type: "INTEGER", nullable: false),
|
||||
RowVersion = table.Column<uint>(type: "INTEGER", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_Users", x => x.Id);
|
||||
});
|
||||
}
|
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropTable(
|
||||
name: "Users");
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue