diff options
author | Docile-Alligator <25734209+Docile-Alligator@users.noreply.github.com> | 2023-10-16 03:52:16 +0000 |
---|---|---|
committer | Docile-Alligator <25734209+Docile-Alligator@users.noreply.github.com> | 2023-10-16 03:52:16 +0000 |
commit | a8d511295513a07b9a91478a60755f55127191cd (patch) | |
tree | 1d0358b1e37f1d36547db23eb8432418a732b04c /app/src/main | |
parent | 448f36008f481703e50b81cd2fc85fc482f185fe (diff) | |
download | infinity-for-reddit-a8d511295513a07b9a91478a60755f55127191cd.tar infinity-for-reddit-a8d511295513a07b9a91478a60755f55127191cd.tar.gz infinity-for-reddit-a8d511295513a07b9a91478a60755f55127191cd.tar.bz2 infinity-for-reddit-a8d511295513a07b9a91478a60755f55127191cd.tar.lz infinity-for-reddit-a8d511295513a07b9a91478a60755f55127191cd.tar.xz infinity-for-reddit-a8d511295513a07b9a91478a60755f55127191cd.tar.zst infinity-for-reddit-a8d511295513a07b9a91478a60755f55127191cd.zip |
Continue adding comment filter.
Diffstat (limited to 'app/src/main')
-rw-r--r-- | app/src/main/java/ml/docilealligator/infinityforreddit/RedditDataRoomDatabase.java | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/RedditDataRoomDatabase.java b/app/src/main/java/ml/docilealligator/infinityforreddit/RedditDataRoomDatabase.java index c9eeba48..6c559df3 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/RedditDataRoomDatabase.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/RedditDataRoomDatabase.java @@ -14,6 +14,7 @@ import androidx.sqlite.db.SupportSQLiteDatabase; import ml.docilealligator.infinityforreddit.account.Account; import ml.docilealligator.infinityforreddit.account.AccountDao; import ml.docilealligator.infinityforreddit.commentfilter.CommentFilter; +import ml.docilealligator.infinityforreddit.commentfilter.CommentFilterUsage; import ml.docilealligator.infinityforreddit.customtheme.CustomTheme; import ml.docilealligator.infinityforreddit.customtheme.CustomThemeDao; import ml.docilealligator.infinityforreddit.multireddit.AnonymousMultiredditSubreddit; @@ -39,7 +40,8 @@ import ml.docilealligator.infinityforreddit.user.UserData; @Database(entities = {Account.class, SubredditData.class, SubscribedSubredditData.class, UserData.class, SubscribedUserData.class, MultiReddit.class, CustomTheme.class, RecentSearchQuery.class, - ReadPost.class, PostFilter.class, PostFilterUsage.class, AnonymousMultiredditSubreddit.class, CommentFilter.class}, version = 25) + ReadPost.class, PostFilter.class, PostFilterUsage.class, AnonymousMultiredditSubreddit.class, + CommentFilter.class, CommentFilterUsage.class}, version = 25) public abstract class RedditDataRoomDatabase extends RoomDatabase { public static RedditDataRoomDatabase create(final Context context) { @@ -398,6 +400,8 @@ public abstract class RedditDataRoomDatabase extends RoomDatabase { public void migrate(@NonNull SupportSQLiteDatabase database) { database.execSQL("CREATE TABLE comment_filter " + "(name TEXT NOT NULL PRIMARY KEY, max_vote INTEGER NOT NULL, min_vote INTEGER NOT NULL, exclude_strings TEXT)"); + database.execSQL("CREATE TABLE comment_filter_usage (name TEXT NOT NULL, usage INTEGER NOT NULL, " + + "name_of_usage TEXT NOT NULL, PRIMARY KEY(name, usage, name_of_usage), FOREIGN KEY(name) REFERENCES comment_filter(name) ON DELETE CASCADE)"); } }; } |