using System;
using Microsoft.EntityFrameworkCore.Migrations;
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
#nullable disable
namespace W542.GandalfReborn.Data.Migrations
{
///
public partial class addTokens : Migration
{
///
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "AuthCode",
schema: "gr",
columns: table => new
{
Id = table.Column(type: "bigint", nullable: false)
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
Expiration = table.Column(type: "timestamp with time zone", nullable: false),
IsRevoked = table.Column(type: "boolean", nullable: false),
Code = table.Column(type: "text", nullable: false),
Challenge = table.Column(type: "text", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_AuthCode", x => x.Id);
});
migrationBuilder.CreateTable(
name: "TokenMetadata",
schema: "gr",
columns: table => new
{
Id = table.Column(type: "bigint", nullable: false)
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
Expiration = table.Column(type: "timestamp with time zone", nullable: false),
IsRevoked = table.Column(type: "boolean", nullable: false),
TokenType = table.Column(type: "text", nullable: false),
UsedBy = table.Column(type: "bigint", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_TokenMetadata", x => x.Id);
});
}
///
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "AuthCode",
schema: "gr");
migrationBuilder.DropTable(
name: "TokenMetadata",
schema: "gr");
}
}
}