node: Migrate IPv6 addresses in database

The format for IPv6 addresses was changed in
df8e4e6c88 to require '[' and ']'.

IPv6 addresses that were stored in the database in the past must be
migrated.
This commit is contained in:
Lorenz Leutgeb 2026-03-16 23:07:53 +01:00
parent 9e8f09a144
commit 0736977170
No known key found for this signature in database
2 changed files with 2 additions and 0 deletions

View File

@ -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)]

View File

@ -0,0 +1 @@
update addresses set value = concat('[', rtrim(ltrim(rtrim(value, replace(value, ':', '')), '['), ']:'), ']:', replace(value, rtrim(value, replace(value, ':', '')), '')) where type = "ipv6";