2022-02-27 23:37:22 +01:00
|
|
|
#ifndef DBMIGRATOR_H
|
|
|
|
#define DBMIGRATOR_H
|
|
|
|
#include <QStringList>
|
|
|
|
#include <QSqlDatabase>
|
|
|
|
#include <QObject>
|
2022-07-28 13:27:37 +02:00
|
|
|
#include "databasefactory.h"
|
2022-02-27 23:37:22 +01:00
|
|
|
class DBMigrator : public QObject
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
private:
|
2022-07-28 13:27:37 +02:00
|
|
|
DatabaseFactory *dbFactory;
|
2022-02-27 23:37:22 +01:00
|
|
|
|
|
|
|
public:
|
2022-07-28 13:27:37 +02:00
|
|
|
DBMigrator(DatabaseFactory &dbFactory);
|
2022-02-27 23:37:22 +01:00
|
|
|
~DBMigrator();
|
|
|
|
uint32_t currentRevision();
|
|
|
|
void performMigrations();
|
|
|
|
QStringList getMigrationFilenames();
|
|
|
|
bool migrationNeeded();
|
|
|
|
signals:
|
|
|
|
void migrationDone(uint32_t);
|
|
|
|
void done();
|
2022-07-28 13:27:37 +02:00
|
|
|
void error(QString e);
|
|
|
|
public slots:
|
|
|
|
void start();
|
2022-02-27 23:37:22 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // DBMIGRATOR_H
|