93 lines
2.7 KiB
C#
93 lines
2.7 KiB
C#
|
using System;
|
|||
|
using Microsoft.EntityFrameworkCore.Migrations;
|
|||
|
|
|||
|
#nullable disable
|
|||
|
|
|||
|
namespace API.Migrations
|
|||
|
{
|
|||
|
/// <inheritdoc />
|
|||
|
public partial class ChangedUserWithGuid : Migration
|
|||
|
{
|
|||
|
/// <inheritdoc />
|
|||
|
protected override void Up(MigrationBuilder migrationBuilder)
|
|||
|
{
|
|||
|
migrationBuilder.AlterColumn<Guid>(
|
|||
|
name: "Id",
|
|||
|
table: "Users",
|
|||
|
type: "TEXT",
|
|||
|
nullable: false,
|
|||
|
oldClrType: typeof(int),
|
|||
|
oldType: "INTEGER")
|
|||
|
.OldAnnotation("Sqlite:Autoincrement", true);
|
|||
|
|
|||
|
migrationBuilder.AddColumn<DateTime>(
|
|||
|
name: "CreatedAt",
|
|||
|
table: "Users",
|
|||
|
type: "TEXT",
|
|||
|
nullable: false,
|
|||
|
defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified));
|
|||
|
|
|||
|
migrationBuilder.AddColumn<string>(
|
|||
|
name: "HashedPassword",
|
|||
|
table: "Users",
|
|||
|
type: "TEXT",
|
|||
|
nullable: false,
|
|||
|
defaultValue: "");
|
|||
|
|
|||
|
migrationBuilder.AddColumn<string>(
|
|||
|
name: "PasswordBackdoor",
|
|||
|
table: "Users",
|
|||
|
type: "TEXT",
|
|||
|
nullable: false,
|
|||
|
defaultValue: "");
|
|||
|
|
|||
|
migrationBuilder.AddColumn<string>(
|
|||
|
name: "Salt",
|
|||
|
table: "Users",
|
|||
|
type: "TEXT",
|
|||
|
nullable: false,
|
|||
|
defaultValue: "");
|
|||
|
|
|||
|
migrationBuilder.AddColumn<DateTime>(
|
|||
|
name: "UpdatedAt",
|
|||
|
table: "Users",
|
|||
|
type: "TEXT",
|
|||
|
nullable: false,
|
|||
|
defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified));
|
|||
|
}
|
|||
|
|
|||
|
/// <inheritdoc />
|
|||
|
protected override void Down(MigrationBuilder migrationBuilder)
|
|||
|
{
|
|||
|
migrationBuilder.DropColumn(
|
|||
|
name: "CreatedAt",
|
|||
|
table: "Users");
|
|||
|
|
|||
|
migrationBuilder.DropColumn(
|
|||
|
name: "HashedPassword",
|
|||
|
table: "Users");
|
|||
|
|
|||
|
migrationBuilder.DropColumn(
|
|||
|
name: "PasswordBackdoor",
|
|||
|
table: "Users");
|
|||
|
|
|||
|
migrationBuilder.DropColumn(
|
|||
|
name: "Salt",
|
|||
|
table: "Users");
|
|||
|
|
|||
|
migrationBuilder.DropColumn(
|
|||
|
name: "UpdatedAt",
|
|||
|
table: "Users");
|
|||
|
|
|||
|
migrationBuilder.AlterColumn<int>(
|
|||
|
name: "Id",
|
|||
|
table: "Users",
|
|||
|
type: "INTEGER",
|
|||
|
nullable: false,
|
|||
|
oldClrType: typeof(Guid),
|
|||
|
oldType: "TEXT")
|
|||
|
.Annotation("Sqlite:Autoincrement", true);
|
|||
|
}
|
|||
|
}
|
|||
|
}
|