aboutsummaryrefslogtreecommitdiff
path: root/evolution/drop-index/model.hxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2013-04-04 09:47:33 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2013-04-10 18:46:46 +0200
commit31b400b73be9aa98c0fd448423677db212667c43 (patch)
tree3f8d522d700ab6234da43211e27c136e740ab002 /evolution/drop-index/model.hxx
parent516523183fad016a26c7400d784eb9c0343b7964 (diff)
Generate add/drop index migration statements
Diffstat (limited to 'evolution/drop-index/model.hxx')
-rw-r--r--evolution/drop-index/model.hxx34
1 files changed, 34 insertions, 0 deletions
diff --git a/evolution/drop-index/model.hxx b/evolution/drop-index/model.hxx
new file mode 100644
index 0000000..f3e5e2e
--- /dev/null
+++ b/evolution/drop-index/model.hxx
@@ -0,0 +1,34 @@
+// file : evolution/drop-index/model.hxx
+// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC
+// license : GNU GPL v2; see accompanying LICENSE file
+
+#ifndef MODEL_VERSION
+# error model.hxx included directly
+#endif
+
+#include <odb/core.hxx>
+
+#pragma db model version(1, MODEL_VERSION)
+
+#define MODEL_NAMESPACE_IMPL(V) v##V
+#define MODEL_NAMESPACE(V) MODEL_NAMESPACE_IMPL(V)
+
+namespace MODEL_NAMESPACE(MODEL_VERSION)
+{
+ #pragma db object
+ struct object
+ {
+ object (unsigned long id = 0): id_ (id) {}
+
+ #pragma db id
+ unsigned long id_;
+
+#if MODEL_VERSION == 2
+ #pragma db unique
+#endif
+ unsigned long num;
+ };
+}
+
+#undef MODEL_NAMESPACE
+#undef MODEL_NAMESPACE_IMPL