summaryrefslogtreecommitdiffhomepage
path: root/migration/20160906_0-mappings.cpp
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2016-09-09 08:51:25 +0200
committerStanislaw Halik <sthalik@misaki.pl>2016-09-09 15:00:58 +0200
commit6bc3fe31a3f354afc7be870a4a2d375ab6c746b6 (patch)
tree39b439b16cb872b3d982a6083a546456001d0f8e /migration/20160906_0-mappings.cpp
parentcc6fc6577940df89c57db08743b181291c2a4b43 (diff)
add support for migrations
They're run from the UI thread so can even be interactive.
Diffstat (limited to 'migration/20160906_0-mappings.cpp')
-rw-r--r--migration/20160906_0-mappings.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/migration/20160906_0-mappings.cpp b/migration/20160906_0-mappings.cpp
new file mode 100644
index 00000000..0ff3095a
--- /dev/null
+++ b/migration/20160906_0-mappings.cpp
@@ -0,0 +1,14 @@
+#include "migration.hpp"
+
+#include <QDebug>
+
+using namespace migrations;
+
+struct foo : migration
+{
+ const QString& unique_date() const override { qDebug() << "foo"; static QString ret(""); return ret; }
+ bool should_run() const override { qDebug() << "bar"; return false; }
+ bool run() override { return false; }
+};
+
+OPENTRACK_MIGRATION(foo);