Table of Contents

Class DatabaseController

Namespace
GastroSky.Controllers.V1
Assembly
GastroSky.dll

Database administration endpoints. Should only be accessed by admins!

[ApiController]
[Authorize("ADMIN_ONLY")]
[Route("api/v1/database")]
[Produces("application/json", new string[] { })]
public class DatabaseController : GastroSkyControllerBase
Inheritance
DatabaseController
Inherited Members

Constructors

DatabaseController(IPasswordHashing, IConfiguration, ILogger<DatabaseController>, GastroSkyDatabaseContext)

Database administration endpoints. Should only be accessed by admins!

public DatabaseController(IPasswordHashing passwordHashing, IConfiguration configuration, ILogger<DatabaseController> logger, GastroSkyDatabaseContext db)

Parameters

passwordHashing IPasswordHashing
configuration IConfiguration
logger ILogger<DatabaseController>
db GastroSkyDatabaseContext

Methods

Migrate(string?, string?)

Database schema migration endpoint. Careful with this!

[HttpPost]
[AllowAnonymous]
[Route("migrations/migrate")]
[ProducesResponseType(201)]
[ProducesResponseType(403)]
[ProducesResponseType(400)]
[ProducesResponseType(404)]
[ProducesResponseType(500)]
public Task<IActionResult> Migrate(string? migration = null, string? password = null)

Parameters

migration string

Specific migration to move the db schema to. A value of null or empty will migrate the DB schema up to the latest migration possible.

password string

Migration password

Returns

Task<IActionResult>

IActionResult