using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Avalonia_EFCore.Migrations.SQLite
{
///
public partial class AutoMigration_20260515165835 : Migration
{
///
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "api-refresh-token",
columns: table => new
{
id = table.Column(type: "INTEGER", nullable: false)
.Annotation("Sqlite:Autoincrement", true),
userid = table.Column(name: "user-id", type: "INTEGER", nullable: false),
tokenhash = table.Column(name: "token-hash", type: "TEXT", maxLength: 128, nullable: false),
createdat = table.Column(name: "created-at", type: "TEXT", nullable: false),
expiresat = table.Column(name: "expires-at", type: "TEXT", nullable: false),
revokedat = table.Column(name: "revoked-at", type: "TEXT", nullable: true),
replacedbytokenhash = table.Column(name: "replaced-by-token-hash", type: "TEXT", maxLength: 128, nullable: true),
device = table.Column(type: "TEXT", maxLength: 200, nullable: true),
ipaddress = table.Column(name: "ip-address", type: "TEXT", maxLength: 64, nullable: true)
},
constraints: table =>
{
table.PrimaryKey("pk-api-refresh-token", x => x.id);
},
comment: "API refresh token");
migrationBuilder.CreateIndex(
name: "idx-api-refresh-token-hash",
table: "api-refresh-token",
column: "token-hash",
unique: true);
migrationBuilder.CreateIndex(
name: "idx-api-refresh-token-user-id",
table: "api-refresh-token",
column: "user-id");
}
///
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "api-refresh-token");
}
}
}