Backend/README.md

36 lines
1.0 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# Backend
# ApiService
Строка подключения в appsettings.json:
username:postgres
password:postgres
host:localhost
port:5432
database:prod
Если нет миграций в проекте то в папке HackathonPreparing.ApiService нужно писать:
dotnet ef migrations add UserContextMigration --context UserContext
dotnet ef database update --context UserContext
dotnet ef migrations add WeatherForecastContextMigration --context WeatherForecastContext
dotnet ef database update --context WeatherForecastContext
И так для каждого DbContext в проекте
Если в папке HackathonPreparing.ApiService есть папка Migrations и там есть миграции то можно просто сделать запрос post: /api/db/migrate.
Все запросы к маршрутам /api/db/... доступны только в dev моде
/api/swagger - путь к свагеру
из свагера в dev моде можно запустить миграции в /api/db/migrate