﻿using Microsoft.EntityFrameworkCore.Migrations;
using System;
using System.Collections.Generic;

namespace HealthAndFitness.Api.data.Migrations
{
    public partial class UpdatedUserAndUserToken : Migration
    {
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropColumn(
                name: "Type",
                table: "UserTokens");

            migrationBuilder.AddColumn<DateTime>(
                name: "CreatedOn",
                table: "UserTokens",
                type: "datetime2",
                nullable: false,
                defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified));

            migrationBuilder.AddColumn<bool>(
                name: "SessionToken",
                table: "UserTokens",
                type: "bit",
                nullable: false,
                defaultValue: false);

            migrationBuilder.AlterColumn<int>(
                name: "AccessFailedCount",
                table: "Users",
                type: "int",
                nullable: false,
                oldClrType: typeof(byte));
        }

        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropColumn(
                name: "CreatedOn",
                table: "UserTokens");

            migrationBuilder.DropColumn(
                name: "SessionToken",
                table: "UserTokens");

            migrationBuilder.AddColumn<string>(
                name: "Type",
                table: "UserTokens",
                maxLength: 10,
                nullable: false,
                defaultValue: "");

            migrationBuilder.AlterColumn<byte>(
                name: "AccessFailedCount",
                table: "Users",
                nullable: false,
                oldClrType: typeof(int),
                oldType: "int");
        }
    }
}