Radish alpha
h
rad:z3gqcJUoA1n9HaHKufZs5FCSGazv5
Radicle Heartwood Protocol & Stack
Radicle
Git
node: Migrate IPv6 addresses in database
Merged lorenz opened 1 month ago

The format for IPv6 addresses was changed in df8e4e6c88a8bfb6c1ec6b07dcda64093b477cbe to require ‘[’ and ‘]’.

IPv6 addresses that were stored in the database in the past must be migrated.

2 files changed +2 -0 9e8f09a1 07369771
modified crates/radicle/src/node/db.rs
@@ -37,6 +37,7 @@ const MIGRATIONS: &[&str] = &[
    include_str!("db/migrations/4.sql"),
    include_str!("db/migrations/5.sql"),
    include_str!("db/migrations/6.sql"),
+
    include_str!("db/migrations/7.sql"),
];

#[derive(Error, Debug)]
added crates/radicle/src/node/db/migrations/7.sql
@@ -0,0 +1 @@
+
update addresses set value = concat('[', rtrim(ltrim(rtrim(value, replace(value, ':', '')), '['), ']:'), ']:', replace(value, rtrim(value, replace(value, ':', '')), '')) where type = "ipv6";

\ No newline at end of file