Commit ca700d8d authored by Torsten Grote's avatar Torsten Grote

[bramble] address review comments

parent 969150bf
...@@ -3,7 +3,7 @@ package org.briarproject.bramble.db; ...@@ -3,7 +3,7 @@ package org.briarproject.bramble.db;
class DatabaseTypes { class DatabaseTypes {
private final String hashType, secretType, binaryType; private final String hashType, secretType, binaryType;
private final String counterType, stringType; private final String counterType, stringType;
public DatabaseTypes(String hashType, String secretType, String binaryType, public DatabaseTypes(String hashType, String secretType, String binaryType,
String counterType, String stringType) { String counterType, String stringType) {
...@@ -17,11 +17,11 @@ class DatabaseTypes { ...@@ -17,11 +17,11 @@ class DatabaseTypes {
/** /**
* Replaces database type placeholders in a statement with the actual types. * Replaces database type placeholders in a statement with the actual types.
* These placeholders are currently supported: * These placeholders are currently supported:
* <li> _HASH * <li> _HASH
* <li> _SECRET * <li> _SECRET
* <li> _BINARY * <li> _BINARY
* <li> _COUNTER * <li> _COUNTER
* <li> _STRING * <li> _STRING
*/ */
String replaceTypes(String s) { String replaceTypes(String s) {
s = s.replaceAll("_HASH", hashType); s = s.replaceAll("_HASH", hashType);
......
...@@ -39,7 +39,7 @@ class Migration40_41 implements Migration<Connection> { ...@@ -39,7 +39,7 @@ class Migration40_41 implements Migration<Connection> {
try { try {
s = txn.createStatement(); s = txn.createStatement();
s.execute("ALTER TABLE contacts" s.execute("ALTER TABLE contacts"
+ dbTypes.replaceTypes(" ADD alias VARCHAR")); + dbTypes.replaceTypes(" ADD alias _STRING"));
} catch (SQLException e) { } catch (SQLException e) {
tryToClose(s); tryToClose(s);
throw new DbException(e); throw new DbException(e);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment