From 2c1aee51f375885b3ee575425814ca8cbe6129ff Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Thu, 17 Dec 2015 18:08:53 +1300 Subject: Implement changeset for version 3.0 --- database/db.changelog-3.0.xml | 180 +++++++++++++++++++++++++++++- database/db.changelog-3.1.xml | 6 +- database/db.changelog-3.2.xml | 6 +- database/db.changelog-master.xml | 6 +- src/org/traccar/database/DataManager.java | 25 ++--- 5 files changed, 199 insertions(+), 24 deletions(-) diff --git a/database/db.changelog-3.0.xml b/database/db.changelog-3.0.xml index b05ec6a03..bbc52dfeb 100644 --- a/database/db.changelog-3.0.xml +++ b/database/db.changelog-3.0.xml @@ -5,11 +5,183 @@ xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog/1.9 http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-1.9.xsd"> - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/database/db.changelog-3.1.xml b/database/db.changelog-3.1.xml index b05ec6a03..b8c706806 100644 --- a/database/db.changelog-3.1.xml +++ b/database/db.changelog-3.1.xml @@ -3,13 +3,15 @@ xmlns="http://www.liquibase.org/xml/ns/dbchangelog/1.9" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog/1.9 - http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-1.9.xsd"> + http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-1.9.xsd"> + + - + diff --git a/database/db.changelog-3.2.xml b/database/db.changelog-3.2.xml index b05ec6a03..a072c0703 100644 --- a/database/db.changelog-3.2.xml +++ b/database/db.changelog-3.2.xml @@ -3,13 +3,15 @@ xmlns="http://www.liquibase.org/xml/ns/dbchangelog/1.9" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog/1.9 - http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-1.9.xsd"> + http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-1.9.xsd"> + + - + diff --git a/database/db.changelog-master.xml b/database/db.changelog-master.xml index 3dab44a15..151cb5d19 100644 --- a/database/db.changelog-master.xml +++ b/database/db.changelog-master.xml @@ -5,7 +5,7 @@ xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.1.xsd"> - - - + + diff --git a/src/org/traccar/database/DataManager.java b/src/org/traccar/database/DataManager.java index caf6d9db3..f905b4ded 100644 --- a/src/org/traccar/database/DataManager.java +++ b/src/org/traccar/database/DataManager.java @@ -19,6 +19,8 @@ import com.mchange.v2.c3p0.ComboPooledDataSource; import java.io.File; import java.net.URL; import java.net.URLClassLoader; +import java.nio.file.Path; +import java.nio.file.Paths; import java.sql.Connection; import java.sql.Driver; import java.sql.DriverManager; @@ -160,22 +162,19 @@ public class DataManager implements IdentityManager { if (config.getString("web.type", "new").equals("new") || config.getString("web.type", "new").equals("api")) { - /*try { - ResourceAccessor resourceAccessor = new FileSystemResourceAccessor(); + /*ResourceAccessor resourceAccessor = new FileSystemResourceAccessor(); - Database database = DatabaseFactory.getInstance().openDatabase( - config.getString("database.url"), - config.getString("database.user"), - config.getString("database.password"), - null, resourceAccessor); + Database database = DatabaseFactory.getInstance().openDatabase( + config.getString("database.url"), + config.getString("database.user"), + config.getString("database.password"), + null, resourceAccessor); - Liquibase liquibase = new Liquibase( - config.getString("database.changelog"), new FileSystemResourceAccessor(), database); + Liquibase liquibase = new Liquibase( + config.getString("database.changelog"), resourceAccessor, database); + + liquibase.update(new Contexts());*/ - liquibase.update(new Contexts()); - } catch (Exception e) { - Log.warning(e); - }*/ boolean exist = false; -- cgit v1.2.3