From 68d406282058d32639c0ff3abab7402b5eddb083 Mon Sep 17 00:00:00 2001 From: Alessio Date: Wed, 2 Mar 2022 16:09:41 -0800 Subject: [PATCH] Add a data migration to remove URLs that just link to a quoted tweet --- persistence/versions.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/persistence/versions.go b/persistence/versions.go index 712cbdf..1546ebf 100644 --- a/persistence/versions.go +++ b/persistence/versions.go @@ -8,7 +8,7 @@ import ( ) -const ENGINE_DATABASE_VERSION = 10 +const ENGINE_DATABASE_VERSION = 11 type VersionMismatchError struct { @@ -65,6 +65,7 @@ var MIGRATIONS = []string{ `create table fake_user_sequence(latest_fake_id integer not null); insert into fake_user_sequence values(0x4000000000000000); alter table users add column is_id_fake boolean default 0;`, +`delete from urls where rowid in (select urls.rowid from tweets join urls on tweets.id = urls.tweet_id where urls.text like 'https://twitter.com/%/status/' || tweets.quoted_tweet_id || "%")`, } /**