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
passwordHashingIPasswordHashingconfigurationIConfigurationloggerILogger<DatabaseController>dbGastroSkyDatabaseContext
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
migrationstringSpecific migration to move the db schema to. A value of
nullor empty will migrate the DB schema up to the latest migration possible.passwordstringMigration password