42 lines
1.5 KiB
C#
42 lines
1.5 KiB
C#
|
|
using Microsoft.EntityFrameworkCore.Migrations;
|
|||
|
|
|
|||
|
|
#nullable disable
|
|||
|
|
|
|||
|
|
namespace GestorFacturas.API.Migrations
|
|||
|
|
{
|
|||
|
|
/// <inheritdoc />
|
|||
|
|
public partial class AgregaAutenticacion : Migration
|
|||
|
|
{
|
|||
|
|
/// <inheritdoc />
|
|||
|
|
protected override void Up(MigrationBuilder migrationBuilder)
|
|||
|
|
{
|
|||
|
|
migrationBuilder.CreateTable(
|
|||
|
|
name: "Usuarios",
|
|||
|
|
columns: table => new
|
|||
|
|
{
|
|||
|
|
Id = table.Column<int>(type: "int", nullable: false)
|
|||
|
|
.Annotation("SqlServer:Identity", "1, 1"),
|
|||
|
|
Username = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: false),
|
|||
|
|
PasswordHash = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
|||
|
|
Nombre = table.Column<string>(type: "nvarchar(max)", nullable: false)
|
|||
|
|
},
|
|||
|
|
constraints: table =>
|
|||
|
|
{
|
|||
|
|
table.PrimaryKey("PK_Usuarios", x => x.Id);
|
|||
|
|
});
|
|||
|
|
|
|||
|
|
migrationBuilder.InsertData(
|
|||
|
|
table: "Usuarios",
|
|||
|
|
columns: new[] { "Id", "Nombre", "PasswordHash", "Username" },
|
|||
|
|
values: new object[] { 1, "Administrador", "$2a$11$Z5.Cg.y.u.e.t.c.h.a.n.g.e.m.e", "admin" });
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
/// <inheritdoc />
|
|||
|
|
protected override void Down(MigrationBuilder migrationBuilder)
|
|||
|
|
{
|
|||
|
|
migrationBuilder.DropTable(
|
|||
|
|
name: "Usuarios");
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|