|
Lightweight 0.20251202.0
|
#include <SqlMigration.hpp>
Public Member Functions | |
| MigrationBase (MigrationBase const &)=default | |
| MigrationBase (MigrationBase &&)=delete | |
| MigrationBase & | operator= (MigrationBase const &)=default |
| MigrationBase & | operator= (MigrationBase &&)=delete |
| MigrationBase (MigrationTimestamp timestamp, std::string_view title) | |
| virtual void | Up (SqlMigrationQueryBuilder &plan) const =0 |
| virtual void | Down (SqlMigrationQueryBuilder &) const |
| virtual bool | HasDownImplementation () const noexcept |
| MigrationTimestamp | GetTimestamp () const noexcept |
| std::string_view | GetTitle () const noexcept |
| LIGHTWEIGHT_API std::string | ComputeChecksum (SqlQueryFormatter const &formatter) const |
Represents a single unique SQL migration.
Definition at line 243 of file SqlMigration.hpp.
|
inline |
Definition at line 250 of file SqlMigration.hpp.
|
pure virtual |
Apply the migration.
| plan | Query builder to use for building the migration plan. |
Implemented in Lightweight::SqlMigration::Migration.
|
inlinevirtual |
Revert the migration.
| plan | Query builder to use for building the migration plan. |
Reimplemented in Lightweight::SqlMigration::Migration.
Definition at line 267 of file SqlMigration.hpp.
|
inlinevirtualnoexcept |
Check if this migration has a Down() implementation for rollback.
This method determines whether the migration can be safely reverted. The default implementation returns false. Derived classes that implement Down() should override this to return true.
Reimplemented in Lightweight::SqlMigration::Migration.
Definition at line 276 of file SqlMigration.hpp.
|
inlinenoexcept |
Get the timestamp of the migration.
Definition at line 284 of file SqlMigration.hpp.
|
inlinenoexcept |
Get the title of the migration.
Definition at line 292 of file SqlMigration.hpp.
| LIGHTWEIGHT_API std::string Lightweight::SqlMigration::MigrationBase::ComputeChecksum | ( | SqlQueryFormatter const & | formatter | ) | const |
Compute SHA-256 checksum of migration's Up() SQL statements.
The checksum is computed from the SQL statements that would be executed by this migration. This allows detecting if a migration has been modified after it was applied.
| formatter | The SQL query formatter to use for generating SQL. |