43 lines
1.4 KiB
C#
43 lines
1.4 KiB
C#
using System;
|
|
using Microsoft.EntityFrameworkCore.Migrations;
|
|
|
|
#nullable disable
|
|
|
|
namespace backend.Migrations
|
|
{
|
|
/// <inheritdoc />
|
|
public partial class AddPairingCodes : Migration
|
|
{
|
|
/// <inheritdoc />
|
|
protected override void Up(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.CreateTable(
|
|
name: "PairingCodes",
|
|
columns: table => new
|
|
{
|
|
Code = table.Column<string>(type: "TEXT", nullable: false),
|
|
OwnerUserId = table.Column<Guid>(type: "TEXT", nullable: false),
|
|
DeviceName = table.Column<string>(type: "TEXT", nullable: false),
|
|
ExpiresAt = table.Column<DateTimeOffset>(type: "TEXT", nullable: false),
|
|
ConsumedAt = table.Column<DateTimeOffset>(type: "TEXT", nullable: true)
|
|
},
|
|
constraints: table =>
|
|
{
|
|
table.PrimaryKey("PK_PairingCodes", x => x.Code);
|
|
});
|
|
|
|
migrationBuilder.CreateIndex(
|
|
name: "IX_PairingCodes_ExpiresAt",
|
|
table: "PairingCodes",
|
|
column: "ExpiresAt");
|
|
}
|
|
|
|
/// <inheritdoc />
|
|
protected override void Down(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.DropTable(
|
|
name: "PairingCodes");
|
|
}
|
|
}
|
|
}
|