summaryrefslogtreecommitdiff
path: root/Migrations/20221118214838_AddTokenExpiryTimeToUser.cs
blob: 065483a7b34f70679c45564f429de673dc9eeac0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
using System;
using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace BackendPIA.Migrations
{
    /// <inheritdoc />
    public partial class AddTokenExpiryTimeToUser : Migration
    {
        /// <inheritdoc />
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DeleteData(
                table: "AspNetUserRoles",
                keyColumns: new[] { "RoleId", "UserId" },
                keyValues: new object[] { "24edc3d6-bf9c-41a1-9371-224e4419ccb0", "d42006bc-7f69-4aa4-b247-eb9e2abfe0ec" });

            migrationBuilder.DeleteData(
                table: "AspNetRoles",
                keyColumn: "Id",
                keyValue: "24edc3d6-bf9c-41a1-9371-224e4419ccb0");

            migrationBuilder.DeleteData(
                table: "AspNetUsers",
                keyColumn: "Id",
                keyValue: "d42006bc-7f69-4aa4-b247-eb9e2abfe0ec");

            migrationBuilder.AddColumn<DateTime>(
                name: "SessionTokenExpiryTime",
                table: "AspNetUsers",
                type: "timestamp with time zone",
                nullable: true);

            migrationBuilder.InsertData(
                table: "AspNetRoles",
                columns: new[] { "Id", "ConcurrencyStamp", "Name", "NormalizedName" },
                values: new object[] { "d42006bc-7f69-4aa4-b247-eb9e2abfe0ec", "d42006bc-7f69-4aa4-b247-eb9e2abfe0ec", "Administrator", "ADMINISTRATOR" });

            migrationBuilder.InsertData(
                table: "AspNetUsers",
                columns: new[] { "Id", "AccessFailedCount", "ConcurrencyStamp", "Email", "EmailConfirmed", "LockoutEnabled", "LockoutEnd", "NormalizedEmail", "NormalizedUserName", "PasswordHash", "PhoneNumber", "PhoneNumberConfirmed", "SecurityStamp", "SessionToken", "SessionTokenExpiryTime", "TwoFactorEnabled", "UserName" },
                values: new object[] { "24edc3d6-bf9c-41a1-9371-224e4419ccb0", 0, "bd624bcb-3f06-4bce-b924-2666f82e5f23", "admin@example.com", false, false, null, "ADMIN@EXAMPLE.COM", "ADMIN", "AQAAAAIAAYagAAAAEL19rXYOEkR3ftL+T5E5vlsLGPu3HSnJuTSLNp/nyffvQvaXlNJFqU1UO3VKB+K6yg==", null, false, "282566ca-8a3b-4310-8e61-8380d16fa07e", null, null, false, "admin" });

            migrationBuilder.InsertData(
                table: "AspNetUserRoles",
                columns: new[] { "RoleId", "UserId" },
                values: new object[] { "d42006bc-7f69-4aa4-b247-eb9e2abfe0ec", "24edc3d6-bf9c-41a1-9371-224e4419ccb0" });
        }

        /// <inheritdoc />
        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DeleteData(
                table: "AspNetUserRoles",
                keyColumns: new[] { "RoleId", "UserId" },
                keyValues: new object[] { "d42006bc-7f69-4aa4-b247-eb9e2abfe0ec", "24edc3d6-bf9c-41a1-9371-224e4419ccb0" });

            migrationBuilder.DeleteData(
                table: "AspNetRoles",
                keyColumn: "Id",
                keyValue: "d42006bc-7f69-4aa4-b247-eb9e2abfe0ec");

            migrationBuilder.DeleteData(
                table: "AspNetUsers",
                keyColumn: "Id",
                keyValue: "24edc3d6-bf9c-41a1-9371-224e4419ccb0");

            migrationBuilder.DropColumn(
                name: "SessionTokenExpiryTime",
                table: "AspNetUsers");

            migrationBuilder.InsertData(
                table: "AspNetRoles",
                columns: new[] { "Id", "ConcurrencyStamp", "Name", "NormalizedName" },
                values: new object[] { "24edc3d6-bf9c-41a1-9371-224e4419ccb0", "24edc3d6-bf9c-41a1-9371-224e4419ccb0", "Administrator", "ADMINISTRATOR" });

            migrationBuilder.InsertData(
                table: "AspNetUsers",
                columns: new[] { "Id", "AccessFailedCount", "ConcurrencyStamp", "Email", "EmailConfirmed", "LockoutEnabled", "LockoutEnd", "NormalizedEmail", "NormalizedUserName", "PasswordHash", "PhoneNumber", "PhoneNumberConfirmed", "SecurityStamp", "SessionToken", "TwoFactorEnabled", "UserName" },
                values: new object[] { "d42006bc-7f69-4aa4-b247-eb9e2abfe0ec", 0, "8bbb8fce-308b-4822-97e1-5741fc955a90", "admin@example.com", false, false, null, "ADMIN@EXAMPLE.COM", "ADMIN", "AQAAAAIAAYagAAAAEENVY01/0BOrBai8zaioq9GOr+ftYIZhUBtulPtda1tTREUCOeVst9cnrB7Ogz4Bsg==", null, false, "5a1e1053-690e-4610-ab66-7a86fe2e04c8", null, false, "admin" });

            migrationBuilder.InsertData(
                table: "AspNetUserRoles",
                columns: new[] { "RoleId", "UserId" },
                values: new object[] { "24edc3d6-bf9c-41a1-9371-224e4419ccb0", "d42006bc-7f69-4aa4-b247-eb9e2abfe0ec" });
        }
    }
}