14 protected override void Up(MigrationBuilder migrationBuilder)
16 ArgumentNullException.ThrowIfNull(migrationBuilder);
18 migrationBuilder.CreateTable(
19 name:
"OAuthConnections",
22 Id = table.Column<
long>(nullable:
false)
23 .Annotation(
"Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
24 Provider = table.Column<
int>(nullable:
false),
25 ExternalUserId = table.Column<
string>(nullable:
false, maxLength: 100),
26 UserId = table.Column<
long>(nullable:
true),
30 table.PrimaryKey(
"PK_OAuthConnections", x => x.Id);
32 name:
"FK_OAuthConnections_Users_UserId",
33 column: x => x.UserId,
34 principalTable:
"Users",
35 principalColumn:
"Id",
36 onDelete: ReferentialAction.Cascade);
39 migrationBuilder.CreateIndex(
40 name:
"IX_OAuthConnections_UserId",
41 table:
"OAuthConnections",
44 migrationBuilder.CreateIndex(
45 name:
"IX_OAuthConnections_Provider_ExternalUserId",
46 table:
"OAuthConnections",
47 columns:
new[] {
"Provider",
"ExternalUserId" },