1
0
Fork 0
mirror of https://github.com/ACINQ/eclair.git synced 2025-03-14 03:48:13 +01:00

db hotfix, set version to 0.2-android-alpha7

Table `channel_updates` is missing a primary key and keeps growing
everytime eclair wallet is restarted. As a temporary quick fix, we just
delete duplicates on startup.
This commit is contained in:
pm47 2017-10-24 18:35:50 +02:00
parent 4786066bb7
commit 435c1e424c
4 changed files with 5 additions and 3 deletions

View file

@ -5,7 +5,7 @@
<parent>
<groupId>fr.acinq.eclair</groupId>
<artifactId>eclair_2.11</artifactId>
<version>0.2-android-alpha6</version>
<version>0.2-android-alpha7</version>
</parent>
<artifactId>eclair-core_2.11</artifactId>

View file

@ -19,7 +19,9 @@ class SqliteNetworkDb(sqlite: Connection) extends NetworkDb {
statement.execute("PRAGMA foreign_keys = ON")
statement.executeUpdate("CREATE TABLE IF NOT EXISTS nodes (node_id BLOB NOT NULL PRIMARY KEY, data BLOB NOT NULL)")
statement.executeUpdate("CREATE TABLE IF NOT EXISTS channels (short_channel_id INTEGER NOT NULL PRIMARY KEY, data BLOB NOT NULL)")
// TODO: hack! remove duplicates (table channel_updates is missing a PRIMARY KEY, will be fixed later)
statement.executeUpdate("CREATE TABLE IF NOT EXISTS channel_updates (short_channel_id INTEGER NOT NULL, node_flag INTEGER NOT NULL, data BLOB NOT NULL, FOREIGN KEY(short_channel_id) REFERENCES channels(short_channel_id))")
statement.executeUpdate("DELETE FROM channel_updates WHERE rowid NOT IN (SELECT MIN(rowid) FROM channel_updates GROUP BY short_channel_id, node_flag)")
statement.executeUpdate("CREATE INDEX IF NOT EXISTS channel_updates_idx ON channel_updates(short_channel_id)")
}

View file

@ -5,7 +5,7 @@
<parent>
<groupId>fr.acinq.eclair</groupId>
<artifactId>eclair_2.11</artifactId>
<version>0.2-android-alpha6</version>
<version>0.2-android-alpha7</version>
</parent>
<artifactId>eclair-node_2.11</artifactId>

View file

@ -4,7 +4,7 @@
<groupId>fr.acinq.eclair</groupId>
<artifactId>eclair_2.11</artifactId>
<version>0.2-android-alpha6</version>
<version>0.2-android-alpha7</version>
<packaging>pom</packaging>
<modules>