tgstation-server 6.16.0
The /tg/station 13 server suite
Loading...
Searching...
No Matches
20250302232622_SLAddOidcConnections.cs
Go to the documentation of this file.
1using System;
2
3using Microsoft.EntityFrameworkCore.Migrations;
4
6{
8 public partial class SLAddOidcConnections : Migration
9 {
11 protected override void Up(MigrationBuilder migrationBuilder)
12 {
13 ArgumentNullException.ThrowIfNull(migrationBuilder);
14
15 migrationBuilder.CreateTable(
16 name: "OidcConnections",
17 columns: table => new
18 {
19 Id = table.Column<long>(type: "INTEGER", nullable: false)
20 .Annotation("Sqlite:Autoincrement", true),
21 UserId = table.Column<long>(type: "INTEGER", nullable: false),
22 SchemeKey = table.Column<string>(type: "TEXT", maxLength: 100, nullable: false),
23 ExternalUserId = table.Column<string>(type: "TEXT", maxLength: 100, nullable: false),
24 },
25 constraints: table =>
26 {
27 table.PrimaryKey("PK_OidcConnections", x => x.Id);
28 table.ForeignKey(
29 name: "FK_OidcConnections_Users_UserId",
30 column: x => x.UserId,
31 principalTable: "Users",
32 principalColumn: "Id",
33 onDelete: ReferentialAction.Cascade);
34 });
35
36 migrationBuilder.CreateIndex(
37 name: "IX_OidcConnections_SchemeKey_ExternalUserId",
38 table: "OidcConnections",
39 columns: new[] { "SchemeKey", "ExternalUserId" },
40 unique: true);
41
42 migrationBuilder.CreateIndex(
43 name: "IX_OidcConnections_UserId",
44 table: "OidcConnections",
45 column: "UserId");
46 }
47
49 protected override void Down(MigrationBuilder migrationBuilder)
50 {
51 ArgumentNullException.ThrowIfNull(migrationBuilder);
52
53 migrationBuilder.DropTable(
54 name: "OidcConnections");
55 }
56 }
57}