Skip to content

Commit

Permalink
Merge pull request #71 from nixhantb/feature/nishantb/postgress/migra…
Browse files Browse the repository at this point in the history
…tions

migrate SQL DB to PostgresSQL
  • Loading branch information
nixhantb authored Oct 24, 2024
2 parents 6bf2b74 + 5b77b66 commit 4b2a15b
Show file tree
Hide file tree
Showing 15 changed files with 471 additions and 1,229 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
using JobLeet.WebApi.JobLeet.Core.Entities.Accounts.V1;
using JobLeet.WebApi.JobLeet.Core.Interfaces.Accounts.V1;
using JobLeet.WebApi.JobLeet.Infrastructure.Data.Contexts;
using Microsoft.Data.SqlClient;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Caching.Memory;
using System.Data.Common;
Expand Down Expand Up @@ -53,7 +52,7 @@ public async Task<List<RoleModel>> GetAllAsync()
}).ToListAsync();
return results;
}
catch (Exception ex) when (ex is DbUpdateException || ex is DbException || ex is SqlException)
catch (Exception ex) when (ex is DbUpdateException || ex is DbException)
{
throw new Exception("Error while fetching data from the database. Please try again later.");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
using JobLeet.WebApi.JobLeet.Core.Entities.Common.V1;
using JobLeet.WebApi.JobLeet.Core.Interfaces.Common.V1;
using JobLeet.WebApi.JobLeet.Infrastructure.Data.Contexts;
using Microsoft.Data.SqlClient;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Caching.Memory;
using System.Data.Common;
Expand Down Expand Up @@ -60,7 +59,7 @@ public async Task<List<AddressModel>> GetAllAsync()
return results;

}
catch (Exception ex) when (ex is DbUpdateException || ex is DbException || ex is SqlException)
catch (Exception ex) when (ex is DbUpdateException || ex is DbException)
{
throw new Exception("Error while fetching data from the database. Please try again later.");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
using JobLeet.WebApi.JobLeet.Core.Entities.Common.V1;
using JobLeet.WebApi.JobLeet.Core.Interfaces.Common.V1;
using JobLeet.WebApi.JobLeet.Infrastructure.Data.Contexts;
using Microsoft.Data.SqlClient;

using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Caching.Memory;
using System.Data.Common;
Expand Down Expand Up @@ -58,7 +58,7 @@ public async Task<List<EducationModel>> GetAllAsync()
return results;

}
catch (Exception ex) when (ex is DbUpdateException || ex is DbException || ex is SqlException)
catch (Exception ex) when (ex is DbUpdateException || ex is DbException)
{
throw new Exception("Error while fetching data from the database. Please try again later.");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
using JobLeet.WebApi.JobLeet.Core.Entities.Common.V1;
using JobLeet.WebApi.JobLeet.Core.Interfaces.Common.V1;
using JobLeet.WebApi.JobLeet.Infrastructure.Data.Contexts;
using Microsoft.Data.SqlClient;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Caching.Memory;
using System.Data.Common;
Expand Down Expand Up @@ -54,7 +53,7 @@ public async Task<List<ExperienceModel>> GetAllAsync()

return results;
}
catch (Exception ex) when (ex is DbUpdateException || ex is DbException || ex is SqlException)
catch (Exception ex) when (ex is DbUpdateException || ex is DbException)
{
throw new Exception("Error while fetching data from the database. Please try again later.");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
using JobLeet.WebApi.JobLeet.Core.Entities.Common.V1;
using JobLeet.WebApi.JobLeet.Core.Interfaces.Common.V1;
using JobLeet.WebApi.JobLeet.Infrastructure.Data.Contexts;
using Microsoft.Data.SqlClient;
using Microsoft.EntityFrameworkCore;
using System.Data.Common;

Expand Down Expand Up @@ -37,7 +36,7 @@ public async Task<List<PersonNameModel>> GetAllAsync()
}).ToListAsync();
return result;
}
catch (Exception ex) when (ex is DbUpdateException || ex is DbException || ex is SqlException)
catch (Exception ex) when (ex is DbUpdateException || ex is DbException)
{
throw new Exception("Error while fetching data from the database. Please try again later.");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
using JobLeet.WebApi.JobLeet.Core.Entities.Common.V1;
using JobLeet.WebApi.JobLeet.Core.Interfaces.Common.V1;
using JobLeet.WebApi.JobLeet.Infrastructure.Data.Contexts;
using Microsoft.Data.SqlClient;
using Microsoft.EntityFrameworkCore;
using System.Data.Common;
namespace JobLeet.WebApi.JobLeet.Infrastructure.Repositories.Common.V1
Expand Down Expand Up @@ -43,7 +42,7 @@ public async Task<List<PhoneModel>> GetAllAsync()
}).ToListAsync();
return result;
}
catch (Exception ex) when (ex is DbUpdateException || ex is DbException || ex is SqlException)
catch (Exception ex) when (ex is DbUpdateException || ex is DbException)
{
throw new Exception("Error while fetching data from the database. Please try again later.");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
using JobLeet.WebApi.JobLeet.Core.Entities.Jobs.V1;
using JobLeet.WebApi.JobLeet.Core.Interfaces.Jobs.V1;
using JobLeet.WebApi.JobLeet.Infrastructure.Data.Contexts;
using Microsoft.Data.SqlClient;
using Microsoft.EntityFrameworkCore;

namespace JobLeet.WebApi.JobLeet.Infrastructure.Repositories.Jobs.V1
Expand Down Expand Up @@ -281,7 +280,7 @@ public async Task<List<JobModel>> GetAllAsync()
return results;

}
catch (Exception ex) when (ex is DbUpdateException || ex is DbException || ex is SqlException)
catch (Exception ex) when (ex is DbUpdateException || ex is DbException)
{
throw new Exception("Error while fetching data from the database. Please try again later.");
}
Expand Down
19 changes: 5 additions & 14 deletions JobLeet.WebApi/JobLeet.WebApi.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,28 +8,19 @@
</PropertyGroup>

<ItemGroup>
<Compile Remove="JobLeet.Api\Middlewares\NewFolder\**" />
<Compile Remove="JobLeet.Core\Constants\**" />
<Content Remove="JobLeet.Api\Middlewares\NewFolder\**" />
<Content Remove="JobLeet.Core\Constants\**" />
<EmbeddedResource Remove="JobLeet.Api\Middlewares\NewFolder\**" />
<EmbeddedResource Remove="JobLeet.Core\Constants\**" />
<None Remove="JobLeet.Api\Middlewares\NewFolder\**" />
<None Remove="JobLeet.Core\Constants\**" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Aspire.Hosting.PostgreSQL" Version="8.2.2" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="8.0.7" />
<PackageReference Include="Microsoft.AspNetCore.OpenApi" Version="7.0.12" />
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="7.0.14" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="7.0.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="7.0.14" />
<!-- <PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="7.0.14" /> -->
<PackageReference Include="Newtonsoft.json" Version="13.0.3" />
<PackageReference Include="Pomelo.EntityFrameworkCore.MySql" Version="7.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging" Version="8.0.0" />
<!-- <PackageReference Include="Pomelo.EntityFrameworkCore.MySql" Version="7.0.0" /> -->
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="7.0.0" />
<!-- <PackageReference Include="Microsoft.Extensions.Logging" Version="8.0.0" /> -->
<PackageReference Include="NLog" Version="5.2.8" />
<PackageReference Include="RabbitMQ.Client" Version="6.8.1" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.5.0" />
Expand Down
Loading

0 comments on commit 4b2a15b

Please sign in to comment.