ImagingTools Core SDK
CMigrationControllerComp.h
1// SPDX-License-Identifier: LGPL-2.1-or-later OR GPL-2.0-or-later OR GPL-3.0-or-later OR LicenseRef-ImtCore-Commercial
2#pragma once
3
4
5// ACF includes
6#include <ilog/TLoggerCompWrap.h>
7#include <ifile/IFileNameParam.h>
8
9// ImtCore includes
10#include <imtdb/CMigrationControllerCompBase.h>
11
12
13namespace imtdb
14{
15
16
17class CMigrationControllerComp: virtual public imtdb::CMigrationControllerCompBase
18{
19public:
20 typedef imtdb::CMigrationControllerCompBase BaseClass;
21
22 I_BEGIN_COMPONENT(CMigrationControllerComp);
23 I_ASSIGN(m_migrationFolderPathCompPtr, "MigrationFolderPath", "The property holds the folder contains SQL migraton script", false, "MigrationFolderPath");
24 I_END_COMPONENT;
25
26protected:
27 // reimplemented (imtdb::IMigrationController)
28 virtual bool DoMigration(int& resultRevision, const istd::CIntRange& subRange = istd::CIntRange()) const override;
29
30 // reimplemented (icomp::CComponentBase)
31 virtual void OnComponentCreated() override;
32
33private:
34 int GetLastMigration(const QString& migrationFolder, QString& errorMessage) const;
35
36protected:
37 I_REF(ifile::IFileNameParam, m_migrationFolderPathCompPtr);
38};
39
40
41} // namespace imtdb
42
43
Database Abstraction Layer (ORM Framework) for ImtCore applications.