52 lines
1.4 KiB
C#
52 lines
1.4 KiB
C#
|
using System;
|
|||
|
using Microsoft.EntityFrameworkCore.Migrations;
|
|||
|
|
|||
|
#nullable disable
|
|||
|
|
|||
|
namespace API.Migrations
|
|||
|
{
|
|||
|
/// <inheritdoc />
|
|||
|
public partial class AddRefreshTokenToUser : Migration
|
|||
|
{
|
|||
|
/// <inheritdoc />
|
|||
|
protected override void Up(MigrationBuilder migrationBuilder)
|
|||
|
{
|
|||
|
migrationBuilder.DropColumn(
|
|||
|
name: "Password",
|
|||
|
table: "Users");
|
|||
|
|
|||
|
migrationBuilder.AddColumn<string>(
|
|||
|
name: "RefreshToken",
|
|||
|
table: "Users",
|
|||
|
type: "TEXT",
|
|||
|
nullable: false,
|
|||
|
defaultValue: "");
|
|||
|
|
|||
|
migrationBuilder.AddColumn<DateTime>(
|
|||
|
name: "RefreshTokenExpiresAt",
|
|||
|
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: "RefreshToken",
|
|||
|
table: "Users");
|
|||
|
|
|||
|
migrationBuilder.DropColumn(
|
|||
|
name: "RefreshTokenExpiresAt",
|
|||
|
table: "Users");
|
|||
|
|
|||
|
migrationBuilder.AddColumn<string>(
|
|||
|
name: "Password",
|
|||
|
table: "Users",
|
|||
|
type: "TEXT",
|
|||
|
nullable: true);
|
|||
|
}
|
|||
|
}
|
|||
|
}
|