瀏覽代碼

orm::SchemaMigration: add 'getSchemaVersion' method

lganzzzo 2 年之前
父節點
當前提交
657f8070bf
共有 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();
+
 };
 
 }}