Rename "Trending" to "TrendingTags" or similar where necessary (#3906)
The "trending" functionality will expand to include trending links and posts. But at the moment the "Trending" references in the code are exclusively to hashtags. Rename "Trending" to "TrendingTags" or similar everywhere necessary in order to prepare for this. This includes a database migration, as the identifier for the "Trending tags" tab in the account preferences was changed from "Trending" to "TrendingTags". The migration updates the stored value if necessary.
This commit is contained in:
parent
dc9e9f2aeb
commit
b6102a755a
14 changed files with 1077 additions and 57 deletions
|
|
@ -42,12 +42,12 @@ import java.io.File;
|
|||
TimelineAccountEntity.class,
|
||||
ConversationEntity.class
|
||||
},
|
||||
version = 52,
|
||||
version = 53,
|
||||
autoMigrations = {
|
||||
@AutoMigration(from = 48, to = 49),
|
||||
@AutoMigration(from = 49, to = 50, spec = AppDatabase.MIGRATION_49_50.class),
|
||||
@AutoMigration(from = 50, to = 51),
|
||||
@AutoMigration(from = 51, to = 52)
|
||||
@AutoMigration(from = 51, to = 52),
|
||||
}
|
||||
)
|
||||
public abstract class AppDatabase extends RoomDatabase {
|
||||
|
|
@ -674,4 +674,15 @@ public abstract class AppDatabase extends RoomDatabase {
|
|||
|
||||
@DeleteColumn(tableName = "AccountEntity", columnName = "activeNotifications")
|
||||
static class MIGRATION_49_50 implements AutoMigrationSpec { }
|
||||
|
||||
/**
|
||||
* TabData.TRENDING was renamed to TabData.TRENDING_TAGS, and the text
|
||||
* representation was changed from "Trending" to "TrendingTags".
|
||||
*/
|
||||
public static final Migration MIGRATION_52_53 = new Migration(52, 53) {
|
||||
@Override
|
||||
public void migrate(@NonNull SupportSQLiteDatabase database) {
|
||||
database.execSQL("UPDATE `AccountEntity` SET `tabpreferences` = REPLACE(tabpreferences, 'Trending:', 'TrendingTags:')");
|
||||
}
|
||||
};
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue