Skip to content

Commit

Permalink
refactor: ♻️ upgrade ef core to latest version (#10)
Browse files Browse the repository at this point in the history
  • Loading branch information
mehdihadeli authored Aug 21, 2024
1 parent f8e436b commit 8bf3d4b
Show file tree
Hide file tree
Showing 15 changed files with 136 additions and 57 deletions.
17 changes: 5 additions & 12 deletions .config/dotnet-tools.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,12 @@
"isRoot": true,
"tools": {
"altcover.global": {
"version": "8.8.74",
"version": "8.9.3",
"commands": [
"altcover"
],
"rollForward": false
},
"cake.tool": {
"version": "2.3.0",
"commands": [
"dotnet-cake"
],
"rollForward": false
},
"dotnet-format": {
"version": "5.1.250801",
"commands": [
Expand All @@ -24,14 +17,14 @@
"rollForward": false
},
"csharpier": {
"version": "0.28.2",
"version": "0.29.0",
"commands": [
"dotnet-csharpier"
],
"rollForward": false
},
"swashbuckle.aspnetcore.cli": {
"version": "6.6.2",
"version": "6.7.1",
"commands": [
"swagger"
],
Expand All @@ -45,7 +38,7 @@
"rollForward": false
},
"dotnet-ef": {
"version": "8.0.7",
"version": "8.0.8",
"commands": [
"dotnet-ef"
],
Expand All @@ -59,7 +52,7 @@
"rollForward": false
},
"nbgv": {
"version": "3.6.139",
"version": "3.6.141",
"commands": [
"nbgv"
],
Expand Down
4 changes: 2 additions & 2 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
// https://github.com/devcontainers/features/tree/main/src/dotnet#dotnet-cli-dotnet
"ghcr.io/devcontainers/features/dotnet:2": {
// this version should be matched with global.json .net version for working vscode IntelliSense correctly
"version": "8.0.303",
"additionalVersions": "latest, 8.0.303",
"version": "8.0.400",
"additionalVersions": "latest, 8.0.400",
"aspNetCoreRuntimeVersions": "latest"
},
// https://github.com/devcontainers/features/tree/main/src/github-cli
Expand Down
2 changes: 1 addition & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<ItemGroup>
<PackageReference Include="Nerdbank.GitVersioning" Condition="!Exists('packages.config')">
<PrivateAssets>all</PrivateAssets>
<Version>3.6.133</Version>
<Version>1.2.0</Version>
</PackageReference>
</ItemGroup>
</Project>
36 changes: 36 additions & 0 deletions Vertical.Slice.Template.sln
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,18 @@ Microsoft Visual Studio Solution File, Format Version 12.00
VisualStudioVersion = 17.0.31903.59
MinimumVisualStudioVersion = 10.0.40219.1
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{9BB0311A-FE23-4C8D-B7C0-E8CD49FA3D20}"
ProjectSection(SolutionItems) = preProject
src\Directory.Build.props = src\Directory.Build.props
src\Directory.Build.targets = src\Directory.Build.targets
src\Directory.Packages.props = src\Directory.Packages.props
src\Packages.props = src\Packages.props
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tests", "tests", "{C4B80800-5430-4D4E-B473-261157D54CD4}"
ProjectSection(SolutionItems) = preProject
tests\Directory.Build.props = tests\Directory.Build.props
tests\Directory.Packages.props = tests\Directory.Packages.props
EndProjectSection
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Vertical.Slice.Template.EndToEndTests", "tests\Vertical.Slice.Template.EndToEndTests\Vertical.Slice.Template.EndToEndTests.csproj", "{5F41BF51-E13B-48BF-8D81-874FBA9BC961}"
EndProject
Expand Down Expand Up @@ -63,6 +73,28 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Vertical.Slice.Template", "
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Vertical.Slice.Template.Api", "src\Vertical.Slice.Template.Api\Vertical.Slice.Template.Api.csproj", "{F45584B2-2831-410B-BC9D-3E13817E768F}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".devcontainer", ".devcontainer", "{268E2B03-D9F4-4D31-84BA-6D1DC250E894}"
ProjectSection(SolutionItems) = preProject
.devcontainer\devcontainer.json = .devcontainer\devcontainer.json
.devcontainer\docker-compose.yaml = .devcontainer\docker-compose.yaml
.devcontainer\Dockerfile = .devcontainer\Dockerfile
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "scripts", "scripts", "{3A68A53A-1E76-49DE-A622-569267333288}"
ProjectSection(SolutionItems) = preProject
.devcontainer\scripts\post-create.sh = .devcontainer\scripts\post-create.sh
.devcontainer\scripts\setup-fonts.sh = .devcontainer\scripts\setup-fonts.sh
.devcontainer\scripts\update.sh = .devcontainer\scripts\update.sh
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "deployments", "deployments", "{9DF99E09-AEC5-4F44-BC7E-CB16EF796431}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "docker-compose", "docker-compose", "{F3FCF437-0EF6-4149-AA20-46C787B6FCB1}"
ProjectSection(SolutionItems) = preProject
deployments\docker-compose\.env.sample = deployments\docker-compose\.env.sample
deployments\docker-compose\docker-compose.infrastructure.yaml = deployments\docker-compose\docker-compose.infrastructure.yaml
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand All @@ -88,6 +120,10 @@ Global
{05B80842-E143-46CA-A881-CF14A85D927C} = {9BB0311A-FE23-4C8D-B7C0-E8CD49FA3D20}
{31F7A4C7-66DD-4387-9981-4A64501018E7} = {9BB0311A-FE23-4C8D-B7C0-E8CD49FA3D20}
{F45584B2-2831-410B-BC9D-3E13817E768F} = {9BB0311A-FE23-4C8D-B7C0-E8CD49FA3D20}
{268E2B03-D9F4-4D31-84BA-6D1DC250E894} = {798579C1-7DEC-47A2-9C18-CA3DBE4A6573}
{3A68A53A-1E76-49DE-A622-569267333288} = {268E2B03-D9F4-4D31-84BA-6D1DC250E894}
{9DF99E09-AEC5-4F44-BC7E-CB16EF796431} = {798579C1-7DEC-47A2-9C18-CA3DBE4A6573}
{F3FCF437-0EF6-4149-AA20-46C787B6FCB1} = {9DF99E09-AEC5-4F44-BC7E-CB16EF796431}
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{5F41BF51-E13B-48BF-8D81-874FBA9BC961}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
Expand Down
13 changes: 13 additions & 0 deletions deployments/docker-compose/.env.sample
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# This needs to be configured by each developer based on their platform, we also ask people to tell git to ignore changes to the file by running `git update-index --assume-unchanged .env`
# https://docs.docker.com/compose/environment-variables/env-file/

TAG=latest
POSTGRES_USER=postgres
POSTGRES_PASSWORD=postgres
POSTGRES_PORT=5432
POSTGRES_HOST_PORT=5432
REGISTRY=ghcr.io
RABBITMQ_PORT=5672
RABBITMQ_HOST_PORT=5672
RABBITMQ_API_PORT=15672
RABBITMQ_HOST_API_PORT=15672
40 changes: 40 additions & 0 deletions deployments/docker-compose/docker-compose.infrastructure.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
version: "3.9"
name: vertical-slice-template

services:
#######################################################
# rabbitmq
#######################################################
rabbitmq:
image: rabbitmq:management
container_name: rabbitmq
restart: on-failure
ports:
- ${RABBITMQ_HOST_PORT:-5672}:${RABBITMQ_PORT:-5672}
- ${RABBITMQ_HOST_API_PORT:-15672}:${RABBITMQ_API_PORT:-15672}
# volumes:
# - rabbitmq:/var/lib/rabbitmq
networks:
- infrastructure


#######################################################
# postgres
#######################################################
postgres:
image: postgres:latest
container_name: postgres
restart: on-failure
ports:
- ${POSTGRES_HOST_PORT:-5432}:${POSTGRES_PORT:-5432}
#https://docs.docker.com/compose/environment-variables/env-file/#parameter-expansion
environment:
- POSTGRES_USER=${POSTGRES_USER:-postgres}
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD:-postgres}
networks:
- infrastructure

networks:
infrastructure:
name: infrastructure
driver: bridge
4 changes: 2 additions & 2 deletions global.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"sdk": {
"version": "8.0.303",
"version": "8.0.400",
"rollForward": "latestFeature"
}
}
}
34 changes: 16 additions & 18 deletions src/Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@
<PackageVersion Include="Ben.Demystifier" Version="0.4.1" />
<PackageVersion Include="EventStore.Client.Grpc.Streams" Version="23.3.3" />
<PackageVersion Include="Marten" Version="7.24.0" />
<PackageVersion Include="Microsoft.AspNetCore.Authentication.Google" Version="8.0.7" />
<PackageVersion Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="8.0.7" />
<PackageVersion Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="8.0.8" />
<PackageVersion Include="Microsoft.AspNetCore.Http" Version="2.2.2" />
<PackageVersion Include="Microsoft.AspNetCore.Http.Abstractions" Version="2.2.0" />
<PackageVersion Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="8.0.7" />
Expand All @@ -38,15 +37,15 @@
<PackageVersion Include="Microsoft.Extensions.Hosting" Version="8.0.0" />
<PackageVersion Include="Microsoft.Extensions.Hosting.Abstractions" Version="8.0.0" />
<PackageVersion Include="Microsoft.Extensions.Http" Version="8.0.0" />
<PackageVersion Include="Microsoft.Extensions.Http.Polly" Version="8.0.7" />
<PackageVersion Include="Microsoft.Extensions.Http.Polly" Version="8.0.8" />
<PackageVersion Include="Microsoft.Extensions.Logging" Version="8.0.0" />
<PackageVersion Include="Microsoft.Extensions.Logging.Abstractions" Version="8.0.1" />
<PackageVersion Include="Microsoft.Extensions.Options" Version="8.0.2" />
<PackageVersion Include="Microsoft.Extensions.Options.ConfigurationExtensions" Version="8.0.0" />
<PackageVersion Include="Microsoft.Extensions.Options.DataAnnotations" Version="8.0.0" />
<PackageVersion Include="Microsoft.Extensions.PlatformAbstractions" Version="1.1.0" />
<PackageVersion Include="Microsoft.Tye.Extensions.Configuration" Version="0.10.0-alpha.21420.1" />
<PackageVersion Include="Microsoft.VisualStudio.Threading.Analyzers" Version="17.10.48" />
<PackageVersion Include="Microsoft.VisualStudio.Threading.Analyzers" Version="17.11.20" />
<PackageVersion Include="Microsoft.DotNet.PlatformAbstractions" Version="3.1.6" />
<PackageVersion Include="Asp.Versioning.Http" Version="8.1.0" />
<PackageVersion Include="Asp.Versioning.Mvc" Version="8.1.0" />
Expand All @@ -57,7 +56,7 @@
<PackageVersion Include="Open.ChannelExtensions" Version="8.4.3" />
<PackageVersion Include="Serilog.Exceptions.EntityFrameworkCore" Version="8.4.0" />
<PackageVersion Include="Serilog.Sinks.Grafana.Loki" Version="8.3.0" />
<PackageVersion Include="Serilog.Sinks.OpenTelemetry" Version="4.0.0-dev-00325" />
<PackageVersion Include="Serilog.Sinks.OpenTelemetry" Version="4.1.0-dev-00336" />
<PackageVersion Include="System.Threading.RateLimiting" Version="8.0.0" />
<PackageVersion Include="System.Net.Http.Json" Version="8.0.0" />
</ItemGroup>
Expand All @@ -76,19 +75,18 @@
<PackageVersion Include="prometheus-net.AspNetCore.HealthChecks" Version="8.2.1" />
</ItemGroup>
<ItemGroup>
<PackageVersion Include="Microsoft.EntityFrameworkCore" Version="8.0.7" />
<PackageVersion Include="Microsoft.EntityFrameworkCore.Abstractions" Version="8.0.7" />
<PackageVersion Include="Microsoft.EntityFrameworkCore.Design" Version="8.0.7" />
<PackageVersion Include="Microsoft.EntityFrameworkCore.InMemory" Version="8.0.7" />
<PackageVersion Include="Microsoft.EntityFrameworkCore.Relational" Version="8.0.7" />
<PackageVersion Include="Microsoft.EntityFrameworkCore" Version="8.0.8" />
<PackageVersion Include="Microsoft.EntityFrameworkCore.Abstractions" Version="8.0.8" />
<PackageVersion Include="Microsoft.EntityFrameworkCore.Design" Version="8.0.8" />
<PackageVersion Include="Microsoft.EntityFrameworkCore.InMemory" Version="8.0.8" />
<PackageVersion Include="Microsoft.EntityFrameworkCore.Relational" Version="8.0.8" />
<PackageVersion Include="Microsoft.EntityFrameworkCore.Tools" Version="8.0.7" />
<PackageVersion Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="8.0.7" />
<PackageVersion Include="EFCore.NamingConventions" Version="8.0.3" />
<PackageVersion Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="8.0.4" />
</ItemGroup>
<ItemGroup>
<PackageVersion Include="Serilog" Version="4.0.1" />
<PackageVersion Include="Serilog.AspNetCore" Version="8.0.1" />
<PackageVersion Include="Serilog.AspNetCore" Version="8.0.2" />
<PackageVersion Include="Serilog.Enrichers.CorrelationId" Version="3.0.1" />
<PackageVersion Include="Serilog.Enrichers.Environment" Version="3.0.1" />
<PackageVersion Include="Serilog.Enrichers.Span" Version="3.1.0" />
Expand Down Expand Up @@ -126,7 +124,7 @@
</ItemGroup>
<ItemGroup>
<PackageVersion Include="AsyncFixer" Version="1.6.0" />
<PackageVersion Include="Meziantou.Analyzer" Version="2.0.162" />
<PackageVersion Include="Meziantou.Analyzer" Version="2.0.163" />
<PackageVersion Include="Roslynator.Analyzers" Version="4.12.4" />
<PackageVersion Include="Roslynator.CodeAnalysis.Analyzers" Version="4.12.4" />
<PackageVersion Include="Roslynator.Formatting.Analyzers" Version="4.12.4" />
Expand All @@ -144,9 +142,9 @@
</ItemGroup>
<ItemGroup>
<PackageVersion Include="Unchase.Swashbuckle.AspNetCore.Extensions" Version="2.7.1" />
<PackageVersion Include="Swashbuckle.AspNetCore" Version="6.6.2" />
<PackageVersion Include="Swashbuckle.AspNetCore" Version="6.7.1" />
<PackageVersion Include="Swashbuckle.AspNetCore.Annotations" Version="6.6.2" />
<PackageVersion Include="Microsoft.AspNetCore.OpenApi" Version="8.0.7" />
<PackageVersion Include="Microsoft.AspNetCore.OpenApi" Version="8.0.8" />
</ItemGroup>
<ItemGroup>
<PackageVersion Include="AutoMapper" Version="13.0.1" />
Expand All @@ -158,7 +156,7 @@
<PackageVersion Include="Ardalis.Specification.EntityFrameworkCore" Version="8.0.0" />
<PackageVersion Include="Meziantou.Extensions.Logging.InMemory" Version="1.2.0" />
<PackageVersion Include="Dapper" Version="2.1.35" />
<PackageVersion Include="DotNetEnv" Version="3.0.0" />
<PackageVersion Include="DotNetEnv" Version="3.1.1" />
<PackageVersion Include="FluentMigrator.Extensions.Postgres" Version="5.2.0" />
<PackageVersion Include="FluentMigrator.Runner.Postgres" Version="5.2.0" />
<PackageVersion Include="FluentValidation.AspNetCore" Version="11.3.0" />
Expand Down Expand Up @@ -190,7 +188,7 @@
<PackageVersion Include="NSwag.MSBuild" Version="14.1.0" />
<PackageVersion Include="CorrelationId" Version="3.0.1" />
<PackageVersion Include="LinqKit.Core" Version="1.2.5" />
<PackageVersion Include="MassTransit.Abstractions" Version="8.2.3" />
<PackageVersion Include="MassTransit.Abstractions" Version="8.2.4" />
</ItemGroup>
<ItemGroup>
<PackageVersion Include="Duende.IdentityServer" Version="7.0.5" />
Expand All @@ -208,4 +206,4 @@
<ItemGroup>
<PackageVersion Include="NSubstitute" Version="5.1.0" />
</ItemGroup>
</Project>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
using Microsoft.Extensions.Logging;
using Vertical.Slice.Template.Shared.Abstractions.Ef;

namespace Vertical.Slice.Template.Shared.Data.Migrations;
namespace Vertical.Slice.Template.Shared.Data;

public class CatalogsMigrationExecutor : IMigrationExecutor
{
Expand Down

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
@@ -1,16 +1,18 @@
using Microsoft.EntityFrameworkCore.Migrations;
using System;
using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace Vertical.Slice.Template.Shared.Data.Migrations.Catalogs
{
/// <inheritdoc />
public partial class InitialCatalogsMigration : Migration
public partial class InitialCatalogMigration : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.EnsureSchema(name: "catalog");
migrationBuilder.EnsureSchema(
name: "catalog");

migrationBuilder.CreateTable(
name: "products",
Expand All @@ -26,22 +28,22 @@ protected override void Up(MigrationBuilder migrationBuilder)
constraints: table =>
{
table.PrimaryKey("pk_products", x => x.id);
}
);
});

migrationBuilder.CreateIndex(
name: "ix_products_id",
schema: "catalog",
table: "products",
column: "id",
unique: true
);
unique: true);
}

/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(name: "products", schema: "catalog");
migrationBuilder.DropTable(
name: "products",
schema: "catalog");
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ protected override void BuildModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("ProductVersion", "7.0.5")
.HasAnnotation("ProductVersion", "8.0.8")
.HasAnnotation("Relational:MaxIdentifierLength", 63);

NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
Expand Down
Loading

0 comments on commit 8bf3d4b

Please sign in to comment.