From f9ec517624ab2a2c4124a4cdb623c19db445a9df Mon Sep 17 00:00:00 2001 From: GianniKoch Date: Sun, 3 Sep 2023 23:13:33 +0200 Subject: [PATCH 1/3] Added example migration & environment variables to README.md --- README.md | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 97984013..9cc68955 100644 --- a/README.md +++ b/README.md @@ -1 +1,25 @@ -# POI \ No newline at end of file +# POI + +## Setup + +### Migrations +Create a new migration to update the database schema with your new changes: + +```bash +dotnet ef migrations add "[New Migration Name]" --project POI.Persistence.EFCore.Npgsql --verbose -- "[Connection String]" +``` + +Apply all generated migrations on your database: + +```bash +dotnet ef database update --project POI.Persistence.EFCore.Npgsql --verbose -- "[Connection String]" +``` + +### Environment Variables + +| Variable | Description | Example | +|--------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------| +| `ConnectionStrings:PostgreSQL` | Connection string for **PostgreSQL** database ([tutorial](https://www.commandprompt.com/education/how-to-create-a-postgresql-database-in-docker/)) | `Host=localhost;Port=5432;Database=poi_test_db;Username=postgres;Password=password` | +| `Discord:Prefix` | Prefix for bot chat commands | `poi` | +| `Discord:Token` | Token for your Discord bot ([tutorial](https://www.writebots.com/discord-bot-token/)) | `xxxx.xxxx.xxxx` | +| `Paths:DataFolderPath` | Path to folder where data files like image assets and logs can be stored | `C:\your-path\POI\Data` | \ No newline at end of file From e8e50d1b68e743f2dfefcc424f59e3c31bcac865 Mon Sep 17 00:00:00 2001 From: GianniKoch Date: Sun, 3 Sep 2023 23:17:09 +0200 Subject: [PATCH 2/3] Added location of the generate migrations. --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 9cc68955..430f2a06 100644 --- a/README.md +++ b/README.md @@ -15,6 +15,8 @@ Apply all generated migrations on your database: dotnet ef database update --project POI.Persistence.EFCore.Npgsql --verbose -- "[Connection String]" ``` +Find all migrations in the `POI.Persistence.EFCore.Npgsql/Migrations` folder. + ### Environment Variables | Variable | Description | Example | From 24af81daa70cbad57759066737e7e5fb10efd480 Mon Sep 17 00:00:00 2001 From: Gianni Koch Date: Wed, 6 Mar 2024 17:49:02 +0100 Subject: [PATCH 3/3] Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 430f2a06..e72f7672 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ Create a new migration to update the database schema with your new changes: ```bash -dotnet ef migrations add "[New Migration Name]" --project POI.Persistence.EFCore.Npgsql --verbose -- "[Connection String]" +dotnet ef migrations add "[New Migration Name]" --project POI.Persistence.EFCore.Npgsql --verbose ``` Apply all generated migrations on your database: @@ -24,4 +24,4 @@ Find all migrations in the `POI.Persistence.EFCore.Npgsql/Migrations` folder. | `ConnectionStrings:PostgreSQL` | Connection string for **PostgreSQL** database ([tutorial](https://www.commandprompt.com/education/how-to-create-a-postgresql-database-in-docker/)) | `Host=localhost;Port=5432;Database=poi_test_db;Username=postgres;Password=password` | | `Discord:Prefix` | Prefix for bot chat commands | `poi` | | `Discord:Token` | Token for your Discord bot ([tutorial](https://www.writebots.com/discord-bot-token/)) | `xxxx.xxxx.xxxx` | -| `Paths:DataFolderPath` | Path to folder where data files like image assets and logs can be stored | `C:\your-path\POI\Data` | \ No newline at end of file +| `Paths:DataFolderPath` | Path to folder where data files like image assets and logs can be stored | `C:\your-path\POI\Data` |