|
Lightweight 0.20251202.0
|
#include <SqlMigration.hpp>
Public Member Functions | |
| Migration (MigrationTimestamp timestamp, std::string_view title, std::function< void(SqlMigrationQueryBuilder &)> const &up, std::function< void(SqlMigrationQueryBuilder &)> const &down={}) | |
| void | Up (SqlMigrationQueryBuilder &builder) const override |
| void | Down (SqlMigrationQueryBuilder &builder) const override |
| bool | HasDownImplementation () const noexcept override |
Public Member Functions inherited from Lightweight::SqlMigration::MigrationBase | |
| MigrationBase (MigrationBase const &)=default | |
| MigrationBase (MigrationBase &&)=delete | |
| MigrationBase & | operator= (MigrationBase const &)=default |
| MigrationBase & | operator= (MigrationBase &&)=delete |
| MigrationBase (MigrationTimestamp timestamp, std::string_view title) | |
| 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.
This class is a convenience class that can be used to create a migration.
Definition at line 317 of file SqlMigration.hpp.
|
inline |
Create a new migration.
| timestamp | Timestamp of the migration. |
| title | Title of the migration. |
| up | Function to apply the migration. |
| down | Function to revert the migration (optional). |
Definition at line 326 of file SqlMigration.hpp.
|
inlineoverridevirtual |
Apply the migration.
| builder | Query builder to use for building the migration plan. |
Implements Lightweight::SqlMigration::MigrationBase.
Definition at line 339 of file SqlMigration.hpp.
|
inlineoverridevirtual |
Revert the migration.
| builder | Query builder to use for building the migration plan. |
Reimplemented from Lightweight::SqlMigration::MigrationBase.
Definition at line 347 of file SqlMigration.hpp.
|
inlineoverridevirtualnoexcept |
Check if this migration has a Down() implementation.
Reimplemented from Lightweight::SqlMigration::MigrationBase.
Definition at line 356 of file SqlMigration.hpp.