소스 검색

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