Skip to content

Commit

Permalink
Merge pull request #3262 from tidusjar/develop
Browse files Browse the repository at this point in the history
Fixed issues with the RequestId Migration #3244 #3253 #3249
  • Loading branch information
tidusjar authored Nov 13, 2019
2 parents 4b15763 + 58cc49d commit 318bd0c
Show file tree
Hide file tree
Showing 5 changed files with 346 additions and 3 deletions.
9 changes: 8 additions & 1 deletion src/Ombi.Store/Context/Sqlite/ExternalSqliteContext.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System;
using Microsoft.Data.Sqlite;
using Microsoft.EntityFrameworkCore;

namespace Ombi.Store.Context.Sqlite
Expand All @@ -13,7 +14,13 @@ public ExternalSqliteContext(DbContextOptions<ExternalSqliteContext> options) :
_created = true;
Upgrade();
Database.SetCommandTimeout(60);
Database.Migrate();
try
{
Database.Migrate();
}
catch (SqliteException e) when (e.Message.Equals("duplicate column name: RequestId"))
{
}
}


Expand Down
2 changes: 1 addition & 1 deletion src/Ombi.Store/Migration.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
dotnet ef migrations add Inital --context OmbiContext --startup-project ../Ombi/Ombi.csproj
dotnet ef migrations add Inital --context OmbiSqliteContext --startup-project ../Ombi/Ombi.csproj

If running migrations for any db provider other than Sqlite, then ensure the database.json is pointing at the correct DB type

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;

namespace Ombi.Store.Migrations.ExternalSqlite
{
public partial class RequestIdPatch : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{

migrationBuilder.AddColumn<int>(
name: "RequestId",
table: "PlexServerContent",
nullable: true);
}

protected override void Down(MigrationBuilder migrationBuilder)
{

}
}
}
2 changes: 1 addition & 1 deletion src/Ombi/ClientApp/app/login/login.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ export class LoginComponent implements OnDestroy, OnInit {
this.pinTimer = setInterval(() => {
this.notify.info("Authenticating", "Loading... Please Wait");
this.getPinResult(x.pinId);
}, 3000);
}, 4000);
});
});
}
Expand Down

0 comments on commit 318bd0c

Please sign in to comment.