Przeglądaj źródła

Merge pull request #540 from oatpp/orm_migration_better_api

orm::SchemaMigration: add 'getSchemaVersion' method
Leonid Stryzhevskyi 2 lat temu
rodzic
commit
ebf0074ef4

+ 4 - 0
src/oatpp/orm/SchemaMigration.cpp

@@ -88,4 +88,8 @@ void SchemaMigration::migrate() {
 
 }
 
+v_int64 SchemaMigration::getSchemaVersion() {
+  return m_executor->getSchemaVersion(m_suffix);
+}
+
 }}

+ 6 - 0
src/oatpp/orm/SchemaMigration.hpp

@@ -81,6 +81,12 @@ public:
    */
   void migrate();
 
+  /**
+   * Get current database schema version.
+   * @return - schema version.
+   */
+  v_int64 getSchemaVersion();
+
 };
 
 }}