|
Orbit Framework 2.0.0
A high-performance asynchronous C++20 HTTP server framework.
|
Database migration runner (PostgreSQL) More...
#include <MigrationRunner.hpp>
Public Member Functions | |
| bool | ok () const |
| std::string | summary () const |
Public Attributes | |
| std::vector< std::string > | applied |
| Files applied by this run, in order. | |
| std::string | error |
| Why the run stopped; empty on success. | |
| bool | directory_missing = false |
| The migrations directory does not exist (not an error). | |
Database migration runner (PostgreSQL)
Scans a directory for .sql files, checks which have been applied against the orbit_migrations table, and applies any pending files in name order. Each file runs in its own transaction together with its tracking row, so a failing migration leaves no trace and stops the run. A PostgreSQL advisory lock keeps concurrent runners (e.g. several app instances starting at once) from applying the same file twice.
Statements that cannot run inside a transaction (such as CREATE INDEX CONCURRENTLY) are not supported. The outcome of a migration run.
|
inline |
|
inline |
"Database is up to date", "Successfully applied N migrations.", "Migrations skipped - no directory" or the error.
| std::vector<std::string> orbit::orm::MigrationResult::applied |
Files applied by this run, in order.
| bool orbit::orm::MigrationResult::directory_missing = false |
The migrations directory does not exist (not an error).
| std::string orbit::orm::MigrationResult::error |
Why the run stopped; empty on success.