Преглед на файлове

Merge pull request #540 from oatpp/orm_migration_better_api

orm::SchemaMigration: add 'getSchemaVersion' method
Leonid Stryzhevskyi преди 2 години
родител
ревизия
ebf0074ef4
променени са 2 файла, в които са добавени 10 реда и са изтрити 0 реда
  1. 4 0
      src/oatpp/orm/SchemaMigration.cpp
  2. 6 0
      src/oatpp/orm/SchemaMigration.hpp

+ 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();
+
 };
 
 }}