mirror of
https://github.com/alex289/CleanArchitecture.git
synced 2025-06-30 02:31:08 +00:00
53 lines
1.7 KiB
C#
53 lines
1.7 KiB
C#
using System;
|
|
using Microsoft.EntityFrameworkCore.Migrations;
|
|
|
|
#nullable disable
|
|
|
|
namespace CleanArchitecture.Infrastructure.Migrations
|
|
{
|
|
/// <inheritdoc />
|
|
public partial class AddUserRoleAndPassword : Migration
|
|
{
|
|
/// <inheritdoc />
|
|
protected override void Up(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.AddColumn<string>(
|
|
name: "Password",
|
|
table: "Users",
|
|
type: "nvarchar(128)",
|
|
maxLength: 128,
|
|
nullable: false,
|
|
defaultValue: "");
|
|
|
|
migrationBuilder.AddColumn<int>(
|
|
name: "Role",
|
|
table: "Users",
|
|
type: "int",
|
|
nullable: false,
|
|
defaultValue: 0);
|
|
|
|
migrationBuilder.InsertData(
|
|
table: "Users",
|
|
columns: new[] { "Id", "Deleted", "Email", "GivenName", "Password", "Role", "Surname" },
|
|
values: new object[] { new Guid("3fc7aacd-41cc-4ca2-b842-32edcd0782d5"), false, "admin@email.com", "User", "$2a$12$Blal/uiFIJdYsCLTMUik/egLbfg3XhbnxBC6Sb5IKz2ZYhiU/MzL2", 0, "Admin" });
|
|
}
|
|
|
|
/// <inheritdoc />
|
|
protected override void Down(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.DeleteData(
|
|
table: "Users",
|
|
keyColumn: "Id",
|
|
keyValue: new Guid("3fc7aacd-41cc-4ca2-b842-32edcd0782d5"));
|
|
|
|
migrationBuilder.DropColumn(
|
|
name: "Password",
|
|
table: "Users");
|
|
|
|
migrationBuilder.DropColumn(
|
|
name: "Role",
|
|
table: "Users");
|
|
}
|
|
}
|
|
}
|