You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -114,20 +114,12 @@ class PgAuditDb(implicit ds: DataSource) extends AuditDb with Logging {
114
114
statement.executeUpdate("CREATE INDEX transactions_published_channel_id_idx ON audit.transactions_published(channel_id)")
115
115
}
116
116
117
-
defmigration1213(statement: Statement):Unit= {
118
-
statement.executeUpdate("ALTER TABLE audit.received RENAME TO received_old")
119
-
statement.executeUpdate("CREATE TABLE audit.received (virtual_amount_msat BIGINT NOT NULL, real_amount_msat BIGINT NOT NULL, payment_hash TEXT NOT NULL, from_channel_id TEXT NOT NULL, timestamp TIMESTAMP WITH TIME ZONE NOT NULL)")
120
-
statement.executeUpdate("INSERT INTO audit.received SELECT amount_msat, amount_msat, payment_hash, from_channel_id, timestamp FROM audit.received_old")
statement.executeUpdate("CREATE INDEX received_timestamp_idx ON audit.received(timestamp)")
123
-
}
124
-
125
117
getVersion(statement, DB_NAME) match {
126
118
caseNone=>
127
119
statement.executeUpdate("CREATE SCHEMA audit")
128
120
129
121
statement.executeUpdate("CREATE TABLE audit.sent (amount_msat BIGINT NOT NULL, fees_msat BIGINT NOT NULL, recipient_amount_msat BIGINT NOT NULL, payment_id TEXT NOT NULL, parent_payment_id TEXT NOT NULL, payment_hash TEXT NOT NULL, payment_preimage TEXT NOT NULL, recipient_node_id TEXT NOT NULL, to_channel_id TEXT NOT NULL, timestamp TIMESTAMP WITH TIME ZONE NOT NULL)")
130
-
statement.executeUpdate("CREATE TABLE audit.received (virtual_amount_msat BIGINT NOT NULL, real_amount_msat BIGINT NOT NULL, payment_hash TEXT NOT NULL, from_channel_id TEXT NOT NULL, timestamp TIMESTAMP WITH TIME ZONE NOT NULL)")
122
+
statement.executeUpdate("CREATE TABLE audit.received (amount_msat BIGINT NOT NULL, payment_hash TEXT NOT NULL, from_channel_id TEXT NOT NULL, timestamp TIMESTAMP WITH TIME ZONE NOT NULL)")
131
123
statement.executeUpdate("CREATE TABLE audit.relayed (payment_hash TEXT NOT NULL, amount_msat BIGINT NOT NULL, channel_id TEXT NOT NULL, direction TEXT NOT NULL, relay_type TEXT NOT NULL, timestamp TIMESTAMP WITH TIME ZONE NOT NULL)")
132
124
statement.executeUpdate("CREATE TABLE audit.relayed_trampoline (payment_hash TEXT NOT NULL, amount_msat BIGINT NOT NULL, next_node_id TEXT NOT NULL, timestamp TIMESTAMP WITH TIME ZONE NOT NULL)")
133
125
statement.executeUpdate("CREATE TABLE audit.channel_events (channel_id TEXT NOT NULL, node_id TEXT NOT NULL, capacity_sat BIGINT NOT NULL, is_funder BOOLEAN NOT NULL, is_private BOOLEAN NOT NULL, event TEXT NOT NULL, timestamp TIMESTAMP WITH TIME ZONE NOT NULL)")
@@ -157,7 +149,7 @@ class PgAuditDb(implicit ds: DataSource) extends AuditDb with Logging {
157
149
statement.executeUpdate("CREATE INDEX transactions_published_channel_id_idx ON audit.transactions_published(channel_id)")
158
150
statement.executeUpdate("CREATE INDEX transactions_published_timestamp_idx ON audit.transactions_published(timestamp)")
159
151
statement.executeUpdate("CREATE INDEX transactions_confirmed_timestamp_idx ON audit.transactions_confirmed(timestamp)")
160
-
caseSome(v@(4|5|6|7|8|9|10|11|12)) =>
152
+
caseSome(v@(4|5|6|7|8|9|10|11)) =>
161
153
logger.warn(s"migrating db $DB_NAME, found version=$v current=$CURRENT_VERSION")
162
154
if (v <5) {
163
155
migration45(statement)
@@ -183,9 +175,6 @@ class PgAuditDb(implicit ds: DataSource) extends AuditDb with Logging {
183
175
if (v <12) {
184
176
migration1112(statement)
185
177
}
186
-
if (v <13) {
187
-
migration1213(statement)
188
-
}
189
178
caseSome(CURRENT_VERSION) => () // table is up-to-date, nothing to do
190
179
caseSome(unknownVersion) =>thrownewRuntimeException(s"Unknown version of DB $DB_NAME found, version=$unknownVersion")
191
180
}
@@ -231,13 +220,12 @@ class PgAuditDb(implicit ds: DataSource) extends AuditDb with Logging {
0 commit comments