From 95b1d913f57d9b4f940a6a71de64eebc119b3f67 Mon Sep 17 00:00:00 2001 From: Ahmad Mohammad Al-Qadiri Date: Fri, 1 Nov 2024 13:02:01 +0100 Subject: [PATCH 1/2] Create a Database Added database to Data folder Created a frs --- GameLibrary/Database.db | Bin 0 -> 8192 bytes GameLibrary/GameLibrary.csproj | 3 ++- GameLibrary/Program.cs | 2 +- GameLibrary/appsettings.json | 2 +- docker-compose.yml | 13 ------------- 5 files changed, 4 insertions(+), 16 deletions(-) create mode 100644 GameLibrary/Database.db diff --git a/GameLibrary/Database.db b/GameLibrary/Database.db new file mode 100644 index 0000000000000000000000000000000000000000..067335c06a921684e56db7e63c1f9d39de9ca480 GIT binary patch literal 8192 zcmeI#&q~8U5C-tsA`}WmZ@GTQ7Q{?}L*yY1q^t(y{WyJ}lB7|DegBiDe47@ZxR$7u7jW1@ST{}x8BUZt}B%&!7MWC_n)UP=Epypa2CZKmiI+;2#To0db8wc>n+a literal 0 HcmV?d00001 diff --git a/GameLibrary/GameLibrary.csproj b/GameLibrary/GameLibrary.csproj index 3ca1415..61ad328 100644 --- a/GameLibrary/GameLibrary.csproj +++ b/GameLibrary/GameLibrary.csproj @@ -10,7 +10,8 @@ - + + all diff --git a/GameLibrary/Program.cs b/GameLibrary/Program.cs index e3af997..70532c3 100644 --- a/GameLibrary/Program.cs +++ b/GameLibrary/Program.cs @@ -21,7 +21,7 @@ builder.Services.AddRazorPages(); builder.Services.AddDbContext(options => - options.UseNpgsql(builder.Configuration.GetConnectionString("DefaultConnection"))); + options.UseSqlite(builder.Configuration.GetConnectionString("DefaultConnection"))); var app = builder.Build(); diff --git a/GameLibrary/appsettings.json b/GameLibrary/appsettings.json index 482e2d7..19f059f 100644 --- a/GameLibrary/appsettings.json +++ b/GameLibrary/appsettings.json @@ -1,6 +1,6 @@ { "ConnectionStrings": { - "DefaultConnection": "Host=gamelibrary.db;Port=5432;Database=gamelibrary;Username=postgres;Password=postgres;Include Error Detail=true" + "DefaultConnection": "Data Source=Database.db" }, "Logging": { "LogLevel": { diff --git a/docker-compose.yml b/docker-compose.yml index 0cff986..0c48c1b 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -15,19 +15,6 @@ services: - gamelibrary_usersecrets:/home/app/.microsoft/usersecrets:ro - gamelibrary_https:/home/app/.aspnet/https:ro - gamelibrary.db: - image: postgres:latest - container_name: gamelibrary.db - environment: - POSTGRES_DB: gamelibrary - POSTGRES_USER: postgres - POSTGRES_PASSWORD: postgres - volumes: - - gamelibrary_data:/var/lib/postgresql/data - ports: - - "5432:5432" - volumes: - gamelibrary_data: gamelibrary_usersecrets: gamelibrary_https: From 5a8404d84507b6d56d9a4c336973c34869c83020 Mon Sep 17 00:00:00 2001 From: Mathias Date: Fri, 1 Nov 2024 13:08:18 +0100 Subject: [PATCH 2/2] Tools included in EFCore --- GameLibrary/GameLibrary.csproj | 4 ---- 1 file changed, 4 deletions(-) diff --git a/GameLibrary/GameLibrary.csproj b/GameLibrary/GameLibrary.csproj index 61ad328..664b94a 100644 --- a/GameLibrary/GameLibrary.csproj +++ b/GameLibrary/GameLibrary.csproj @@ -13,10 +13,6 @@ - - all - runtime; build; native; contentfiles; analyzers; buildtransitive -