сделал readme на русском

This commit is contained in:
Vitaliy 2024-06-19 23:36:21 +03:00
parent 28eb54070a
commit 0f710abf3c

View File

@ -3,16 +3,16 @@
# ApiService
Database connection in appsettings.json:
username:postgres
password:postgres
host:localhost
port:5432
database:prod
Строка подключения в appsettings.json:
username:postgres
password:postgres
host:localhost
port:5432
database:prod
if no migrations
Если нет миграций в проекте то в папке HackathonPreparing.ApiService нужно писать:
dotnet ef migrations add UserContextMigration --context UserContext
dotnet ef database update --context UserContext
@ -20,11 +20,16 @@ dotnet ef database update --context UserContext
dotnet ef migrations add WeatherForecastContextMigration --context WeatherForecastContext
dotnet ef database update --context WeatherForecastContext
and etc for each dbcontext in project
И так для каждого DbContext в проекте
if you have Migrations folder in ApiService project just call (in dev mode app) post: /api/db/migrate
/api/swagger - path to swagger
Если в папке HackathonPreparing.ApiService есть папка Migrations и там есть миграции то можно просто сделать запрос post: /api/db/migrate.
Все запросы к маршрутам /api/db/... доступны только в dev моде
/api/swagger - путь к свагеру
из свагера в dev моде можно запустить миграции в /api/db/migrate