aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2022-08-24 22:26:36 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2022-08-24 22:32:53 +0300
commit70e05d5ff638554a9fd7648b1ff8f413e8af0253 (patch)
treefb0f6070a0ef6a251d31b2df905337f0f93f1d8d
parent5a2ea3e63ef2d34c5819a1c2046308e254c13dbc (diff)
Drop all database migrations to be backward compatible with 0.14.0 and above (two minor versions behind)
-rw-r--r--bdep/database.cxx12
-rw-r--r--bdep/project.hxx2
-rw-r--r--bdep/project.xml9
3 files changed, 7 insertions, 16 deletions
diff --git a/bdep/database.cxx b/bdep/database.cxx
index 7fd375c..202e1d7 100644
--- a/bdep/database.cxx
+++ b/bdep/database.cxx
@@ -22,19 +22,15 @@ namespace bdep
// Register the data migration functions.
//
+#if 0
template <odb::schema_version v>
using migration_entry = odb::data_migration_entry<v, DB_SCHEMA_VERSION_BASE>;
- static const migration_entry<2>
- migrate_v2 ([] (odb::database& db)
+ static const migration_entry<3>
+ migrate_v3 ([] (odb::database& db)
{
- for (const shared_ptr<configuration>& c:
- pointer_result (db.query<configuration> ()))
- {
- c->type = "target";
- db.update (c);
- }
});
+#endif
database
open (const dir_path& d, tracer& tr, bool create)
diff --git a/bdep/project.hxx b/bdep/project.hxx
index a26dffd..c0fd1d8 100644
--- a/bdep/project.hxx
+++ b/bdep/project.hxx
@@ -17,7 +17,7 @@
// Used by the data migration entries.
//
-#define DB_SCHEMA_VERSION_BASE 1
+#define DB_SCHEMA_VERSION_BASE 2
#pragma db model version(DB_SCHEMA_VERSION_BASE, 2, closed)
diff --git a/bdep/project.xml b/bdep/project.xml
index 805d741..44902f2 100644
--- a/bdep/project.xml
+++ b/bdep/project.xml
@@ -1,14 +1,9 @@
<changelog xmlns="http://www.codesynthesis.com/xmlns/odb/changelog" database="sqlite" version="1">
- <changeset version="2">
- <alter-table name="configuration">
- <add-column name="type" type="TEXT" null="true"/>
- </alter-table>
- </changeset>
-
- <model version="1">
+ <model version="2">
<table name="configuration" kind="object">
<column name="id" type="INTEGER" null="true"/>
<column name="name" type="TEXT" null="true"/>
+ <column name="type" type="TEXT" null="true"/>
<column name="path" type="TEXT" null="true"/>
<column name="relative_path" type="TEXT" null="true"/>
<column name="default" type="INTEGER" null="true"/>