13 protected override void Up(MigrationBuilder migrationBuilder)
15 ArgumentNullException.ThrowIfNull(migrationBuilder);
17 migrationBuilder.CreateTable(
18 name:
"OAuthConnections",
21 Id = table.Column<
long>(nullable:
false)
22 .Annotation(
"Sqlite:Autoincrement",
true),
23 Provider = table.Column<
int>(nullable:
false),
24 ExternalUserId = table.Column<
string>(nullable:
false, maxLength: 100),
25 UserId = table.Column<
long>(nullable:
true),
29 table.PrimaryKey(
"PK_OAuthConnections", x => x.Id);
31 name:
"FK_OAuthConnections_Users_UserId",
32 column: x => x.UserId,
33 principalTable:
"Users",
34 principalColumn:
"Id",
35 onDelete: ReferentialAction.Cascade);
38 migrationBuilder.CreateIndex(
39 name:
"IX_OAuthConnections_UserId",
40 table:
"OAuthConnections",
43 migrationBuilder.CreateIndex(
44 name:
"IX_OAuthConnections_Provider_ExternalUserId",
45 table:
"OAuthConnections",
46 columns:
new[] {
"Provider",
"ExternalUserId" },