mirror of
https://github.com/mikedilger/gossip.git
synced 2024-09-19 19:46:50 +00:00
Deal with relay URLs ending in slash (nostr-types handled part of this)
This commit is contained in:
parent
76c9791d99
commit
07d85b9457
@ -118,6 +118,7 @@ fn upgrade(db: &Connection, mut version: u16) -> Result<(), Error> {
|
|||||||
apply_sql!(db, version, 10, "schema10.sql");
|
apply_sql!(db, version, 10, "schema10.sql");
|
||||||
apply_sql!(db, version, 11, "schema11.sql");
|
apply_sql!(db, version, 11, "schema11.sql");
|
||||||
apply_sql!(db, version, 12, "schema12.sql");
|
apply_sql!(db, version, 12, "schema12.sql");
|
||||||
|
apply_sql!(db, version, 13, "schema13.sql");
|
||||||
tracing::info!("Database is at version {}", version);
|
tracing::info!("Database is at version {}", version);
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
7
src/db/schema13.sql
Normal file
7
src/db/schema13.sql
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
|
||||||
|
-- I tried to merge records with relays ending in '/' to records where they didn't, but SQLITE makes it very hard to update joins (you can't do it directly, and I think the join ON clause is too complex to use EXISTS tricks).
|
||||||
|
-- So I'm just going to delete such records. The data lost is statistical and not critical.
|
||||||
|
|
||||||
|
DELETE FROM event_seen WHERE SUBSTR(relay, LENGTH(relay), 1) == '/';
|
||||||
|
DELETE FROM person_relay WHERE SUBSTR(relay, LENGTH(relay), 1) == '/';
|
||||||
|
DELETE FROM relay WHERE SUBSTR(url, LENGTH(url), 1) == '/';
|
Loading…
Reference in New Issue
Block a user