Skip to content

Commit

Permalink
Attempt to fix EF Core issue
Browse files Browse the repository at this point in the history
  • Loading branch information
AmielCyber committed Sep 15, 2023
1 parent 44011c5 commit a323c26
Show file tree
Hide file tree
Showing 7 changed files with 30 additions and 50 deletions.
2 changes: 1 addition & 1 deletion PetSearch.API/PetSearch.API.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<PackageReference Include="ErrorOr" Version="1.2.1" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="7.0.10" />
<PackageReference Include="Microsoft.AspNetCore.OpenApi" Version="7.0.10" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="7.0.10">
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="7.0.5">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
Expand Down
3 changes: 1 addition & 2 deletions PetSearch.API/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,11 @@
});
// Set up database connection.
// Set up for EF service
MySqlServerVersion serverVersion = new MySqlServerVersion(new Version(8, 0, 31));
builder.Services.AddDbContext<PetSearchContext>(options =>
{
string connectionString = builder.Configuration.GetConnectionString("DefaultConnection") ??
throw new InvalidOperationException("Connection string 'Default Connection not found!");
options.UseMySql(connectionString, serverVersion);
options.UseMySQL(connectionString);
});
builder.Services.AddCors(options =>
{
Expand Down
42 changes: 0 additions & 42 deletions PetSearch.Data/Migrations/20230712061518_InitalTokenDatabase.cs

This file was deleted.

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

22 changes: 22 additions & 0 deletions PetSearch.Data/Migrations/20230915001440_InitialMigration.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace PetSearch.Data.Migrations
{
/// <inheritdoc />
public partial class InitialMigration : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{

}

/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{

}
}
}
2 changes: 1 addition & 1 deletion PetSearch.Data/Migrations/PetSearchContextModelSnapshot.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ protected override void BuildModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("ProductVersion", "7.0.9")
.HasAnnotation("ProductVersion", "7.0.5")
.HasAnnotation("Relational:MaxIdentifierLength", 64);

modelBuilder.Entity("PetSearch.Data.Entity.Token", b =>
Expand Down
3 changes: 2 additions & 1 deletion PetSearch.Data/PetSearch.Data.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@
<Nullable>enable</Nullable>
</PropertyGroup>


<ItemGroup>
<PackageReference Include="Pomelo.EntityFrameworkCore.MySql" Version="7.0.0" />
<PackageReference Include="MySql.EntityFrameworkCore" Version="7.0.5" />
</ItemGroup>

</Project>

0 comments on commit a323c26

Please sign in to comment.