From bd2a6bff2bd79e59ebb8744cda37ed20dccc71c7 Mon Sep 17 00:00:00 2001 From: olorin99 Date: Thu, 30 Jul 2026 15:07:36 +1000 Subject: [PATCH] Increase padding between boost and vote buttons. Add an option to show split values for votes. --- lib/l10n/app_en.arb | 2 + lib/src/controller/database/database.dart | 6 +- .../controller/database/database.steps.dart | 396 +++- .../database/schemas/drift_schema_v4.json | 2041 +++++++++++++++++ lib/src/controller/profile.dart | 7 + lib/src/screens/settings/display_screen.dart | 9 + .../widgets/content_item/action_buttons.dart | 34 +- 7 files changed, 2479 insertions(+), 16 deletions(-) create mode 100644 lib/src/controller/database/schemas/drift_schema_v4.json diff --git a/lib/l10n/app_en.arb b/lib/l10n/app_en.arb index 55633f45..47fee0c9 100644 --- a/lib/l10n/app_en.arb +++ b/lib/l10n/app_en.arb @@ -295,6 +295,8 @@ "settings_enableTrueBlack": "Enable true black", "settings_enableTrueBlack_help": "Might save power on AMOLED displays", "settings_compactMode": "Compact mode", + "settings_splitVotes": "Show separate upvotes/downvote values", + "settings_splitVotes_help": "Show separate values for upvotes and downvotes, otherwise show the sum of the votes.", "settings_hideActionButtons": "Hide action buttons", "settings_hideActionButtons_help": "Hides the action buttons (vote, boost, reply, etc.) below each post and comment. The controls are still accessible in the overflow menu. It is recommended to enable swipe gestures in unison with this setting.", "settings_hideFeedUIOnScroll": "Hide feed UI on scroll", diff --git a/lib/src/controller/database/database.dart b/lib/src/controller/database/database.dart index f5771fa5..ac6e71f8 100644 --- a/lib/src/controller/database/database.dart +++ b/lib/src/controller/database/database.dart @@ -296,6 +296,7 @@ class Profiles extends Table { TextColumn get colorScheme => textEnum().nullable()(); BoolColumn get enableTrueBlack => boolean().nullable()(); TextColumn get postMode => textEnum().nullable()(); + BoolColumn get splitVotes => boolean().nullable()(); BoolColumn get hideActionButtons => boolean().nullable()(); BoolColumn get hideFeedUIOnScroll => boolean().nullable()(); RealColumn get globalTextScale => real().nullable()(); @@ -463,7 +464,7 @@ class InterstellarDatabase extends _$InterstellarDatabase { : super(executor ?? _openConnection()); @override - int get schemaVersion => 3; + int get schemaVersion => 4; @override MigrationStrategy get migration { @@ -509,6 +510,9 @@ class InterstellarDatabase extends _$InterstellarDatabase { schema.miscCache.unifiedpushDistributorAck, ); }, + from3To4: (m, schema) async { + m.addColumn(schema.profiles, schema.profiles.splitVotes); + }, ), ); } diff --git a/lib/src/controller/database/database.steps.dart b/lib/src/controller/database/database.steps.dart index d7874ef3..626972ca 100644 --- a/lib/src/controller/database/database.steps.dart +++ b/lib/src/controller/database/database.steps.dart @@ -1821,9 +1821,393 @@ i1.GeneratedColumn _column_104(String aliasedName) => 'NOT NULL DEFAULT 0 CHECK (unifiedpush_distributor_ack IN (0, 1))', defaultValue: const i1.CustomExpression('0'), ); + +final class Schema4 extends i0.VersionedSchema { + Schema4({required super.database}) : super(version: 4); + @override + late final List entities = [ + accounts, + feeds, + feedInputs, + servers, + feedSourceCache, + readPostCache, + filterLists, + profiles, + stars, + miscCache, + drafts, + tags, + userTags, + accountUnifiedpushToken, + ]; + late final Shape13 accounts = Shape13( + source: i0.VersionedTable( + entityName: 'accounts', + withoutRowId: false, + isStrict: false, + tableConstraints: ['PRIMARY KEY(handle)'], + columns: [ + _column_0, + _column_1, + _column_2, + _column_3, + _column_97, + _column_98, + ], + attachedDatabase: database, + ), + alias: null, + ); + late final Shape14 feeds = Shape14( + source: i0.VersionedTable( + entityName: 'feeds', + withoutRowId: false, + isStrict: false, + tableConstraints: ['PRIMARY KEY(name)'], + columns: [_column_4, _column_99, _column_100], + attachedDatabase: database, + ), + alias: null, + ); + late final Shape2 feedInputs = Shape2( + source: i0.VersionedTable( + entityName: 'feed_inputs', + withoutRowId: false, + isStrict: false, + tableConstraints: ['PRIMARY KEY(name)'], + columns: [_column_5, _column_4, _column_6], + attachedDatabase: database, + ), + alias: null, + ); + late final Shape3 servers = Shape3( + source: i0.VersionedTable( + entityName: 'servers', + withoutRowId: false, + isStrict: false, + tableConstraints: ['PRIMARY KEY(name)'], + columns: [_column_4, _column_7, _column_8], + attachedDatabase: database, + ), + alias: null, + ); + late final Shape4 feedSourceCache = Shape4( + source: i0.VersionedTable( + entityName: 'feed_source_cache', + withoutRowId: false, + isStrict: false, + tableConstraints: ['PRIMARY KEY(name, server)'], + columns: [_column_9, _column_10, _column_11, _column_6], + attachedDatabase: database, + ), + alias: null, + ); + late final Shape5 readPostCache = Shape5( + source: i0.VersionedTable( + entityName: 'read_post_cache', + withoutRowId: false, + isStrict: false, + tableConstraints: ['PRIMARY KEY(account, post_type, post_id)'], + columns: [_column_12, _column_13, _column_14], + attachedDatabase: database, + ), + alias: null, + ); + late final Shape6 filterLists = Shape6( + source: i0.VersionedTable( + entityName: 'filter_lists', + withoutRowId: false, + isStrict: false, + tableConstraints: ['PRIMARY KEY(name)'], + columns: [_column_4, _column_15, _column_16, _column_17, _column_18], + attachedDatabase: database, + ), + alias: null, + ); + late final Shape17 profiles = Shape17( + source: i0.VersionedTable( + entityName: 'profiles', + withoutRowId: false, + isStrict: false, + tableConstraints: ['PRIMARY KEY(name)'], + columns: [ + _column_4, + _column_19, + _column_20, + _column_21, + _column_22, + _column_23, + _column_24, + _column_25, + _column_26, + _column_27, + _column_28, + _column_29, + _column_30, + _column_31, + _column_32, + _column_33, + _column_101, + _column_34, + _column_35, + _column_36, + _column_37, + _column_102, + _column_105, + _column_39, + _column_40, + _column_41, + _column_42, + _column_43, + _column_44, + _column_45, + _column_47, + _column_48, + _column_49, + _column_50, + _column_51, + _column_52, + _column_53, + _column_54, + _column_55, + _column_56, + _column_57, + _column_58, + _column_59, + _column_60, + _column_61, + _column_62, + _column_63, + _column_64, + _column_65, + _column_66, + _column_67, + _column_68, + _column_69, + _column_70, + _column_71, + _column_72, + _column_73, + _column_74, + ], + attachedDatabase: database, + ), + alias: null, + ); + late final Shape8 stars = Shape8( + source: i0.VersionedTable( + entityName: 'stars', + withoutRowId: false, + isStrict: false, + tableConstraints: [], + columns: [_column_75, _column_4], + attachedDatabase: database, + ), + alias: null, + ); + late final Shape16 miscCache = Shape16( + source: i0.VersionedTable( + entityName: 'misc_cache', + withoutRowId: false, + isStrict: false, + tableConstraints: ['PRIMARY KEY(id)'], + columns: [ + _column_76, + _column_77, + _column_78, + _column_79, + _column_80, + _column_81, + _column_82, + _column_83, + _column_84, + _column_85, + _column_86, + _column_87, + _column_88, + _column_103, + _column_104, + ], + attachedDatabase: database, + ), + alias: null, + ); + late final Shape10 drafts = Shape10( + source: i0.VersionedTable( + entityName: 'drafts', + withoutRowId: false, + isStrict: false, + tableConstraints: [], + columns: [_column_75, _column_89, _column_90, _column_91], + attachedDatabase: database, + ), + alias: null, + ); + late final Shape11 tags = Shape11( + source: i0.VersionedTable( + entityName: 'tags', + withoutRowId: false, + isStrict: false, + tableConstraints: [], + columns: [_column_75, _column_92, _column_93, _column_94], + attachedDatabase: database, + ), + alias: null, + ); + late final Shape12 userTags = Shape12( + source: i0.VersionedTable( + entityName: 'user_tags', + withoutRowId: false, + isStrict: false, + tableConstraints: ['PRIMARY KEY(user, tag_id)'], + columns: [_column_95, _column_96], + attachedDatabase: database, + ), + alias: null, + ); + final i1.Index accountUnifiedpushToken = i1.Index( + 'account_unifiedpushToken', + 'CREATE INDEX account_unifiedpushToken ON accounts (unifiedpush_token)', + ); +} + +class Shape17 extends i0.VersionedTable { + Shape17({required super.source, required super.alias}) : super.aliased(); + i1.GeneratedColumn get name => + columnsByName['name']! as i1.GeneratedColumn; + i1.GeneratedColumn get autoSwitchAccount => + columnsByName['auto_switch_account']! as i1.GeneratedColumn; + i1.GeneratedColumn get defaultCreateLanguage => + columnsByName['default_create_language']! as i1.GeneratedColumn; + i1.GeneratedColumn get disableTabSwiping => + columnsByName['disable_tab_swiping']! as i1.GeneratedColumn; + i1.GeneratedColumn get askBeforeUnsubscribing => + columnsByName['ask_before_unsubscribing']! as i1.GeneratedColumn; + i1.GeneratedColumn get askBeforeDeleting => + columnsByName['ask_before_deleting']! as i1.GeneratedColumn; + i1.GeneratedColumn get autoPlayVideos => + columnsByName['auto_play_videos']! as i1.GeneratedColumn; + i1.GeneratedColumn get hapticFeedback => + columnsByName['haptic_feedback']! as i1.GeneratedColumn; + i1.GeneratedColumn get autoTranslate => + columnsByName['auto_translate']! as i1.GeneratedColumn; + i1.GeneratedColumn get markThreadsReadOnScroll => + columnsByName['mark_threads_read_on_scroll']! as i1.GeneratedColumn; + i1.GeneratedColumn get markMicroblogsReadOnScroll => + columnsByName['mark_microblogs_read_on_scroll']! + as i1.GeneratedColumn; + i1.GeneratedColumn get animationSpeed => + columnsByName['animation_speed']! as i1.GeneratedColumn; + i1.GeneratedColumn get inlineReplies => + columnsByName['inline_replies']! as i1.GeneratedColumn; + i1.GeneratedColumn get showCrossPostComments => + columnsByName['show_cross_post_comments']! as i1.GeneratedColumn; + i1.GeneratedColumn get markCrossPostsAsRead => + columnsByName['mark_cross_posts_as_read']! as i1.GeneratedColumn; + i1.GeneratedColumn get defaultImageStore => + columnsByName['default_image_store']! as i1.GeneratedColumn; + i1.GeneratedColumn get defaultLinkAction => + columnsByName['default_link_action']! as i1.GeneratedColumn; + i1.GeneratedColumn get appLanguage => + columnsByName['app_language']! as i1.GeneratedColumn; + i1.GeneratedColumn get themeMode => + columnsByName['theme_mode']! as i1.GeneratedColumn; + i1.GeneratedColumn get colorScheme => + columnsByName['color_scheme']! as i1.GeneratedColumn; + i1.GeneratedColumn get enableTrueBlack => + columnsByName['enable_true_black']! as i1.GeneratedColumn; + i1.GeneratedColumn get postMode => + columnsByName['post_mode']! as i1.GeneratedColumn; + i1.GeneratedColumn get splitVotes => + columnsByName['split_votes']! as i1.GeneratedColumn; + i1.GeneratedColumn get hideActionButtons => + columnsByName['hide_action_buttons']! as i1.GeneratedColumn; + i1.GeneratedColumn get hideFeedUIOnScroll => + columnsByName['hide_feed_u_i_on_scroll']! as i1.GeneratedColumn; + i1.GeneratedColumn get globalTextScale => + columnsByName['global_text_scale']! as i1.GeneratedColumn; + i1.GeneratedColumn get alwaysShowInstance => + columnsByName['always_show_instance']! as i1.GeneratedColumn; + i1.GeneratedColumn get coverMediaMarkedSensitive => + columnsByName['cover_media_marked_sensitive']! as i1.GeneratedColumn; + i1.GeneratedColumn get fullImageSizeThreads => + columnsByName['full_image_size_threads']! as i1.GeneratedColumn; + i1.GeneratedColumn get fullImageSizeMicroblogs => + columnsByName['full_image_size_microblogs']! as i1.GeneratedColumn; + i1.GeneratedColumn get postComponentOrder => + columnsByName['post_component_order']! as i1.GeneratedColumn; + i1.GeneratedColumn get dividerThickness => + columnsByName['divider_thickness']! as i1.GeneratedColumn; + i1.GeneratedColumn get hideEmojiReactions => + columnsByName['hide_emoji_reactions']! as i1.GeneratedColumn; + i1.GeneratedColumn get feedViewOrder => + columnsByName['feed_view_order']! as i1.GeneratedColumn; + i1.GeneratedColumn get feedSourceOrder => + columnsByName['feed_source_order']! as i1.GeneratedColumn; + i1.GeneratedColumn get feedSortOrder => + columnsByName['feed_sort_order']! as i1.GeneratedColumn; + i1.GeneratedColumn get feedDefaultThreadsSort => + columnsByName['feed_default_threads_sort']! as i1.GeneratedColumn; + i1.GeneratedColumn get feedDefaultMicroblogSort => + columnsByName['feed_default_microblog_sort']! + as i1.GeneratedColumn; + i1.GeneratedColumn get feedDefaultCombinedSort => + columnsByName['feed_default_combined_sort']! + as i1.GeneratedColumn; + i1.GeneratedColumn get feedDefaultExploreSort => + columnsByName['feed_default_explore_sort']! as i1.GeneratedColumn; + i1.GeneratedColumn get feedDefaultCommentSort => + columnsByName['feed_default_comment_sort']! as i1.GeneratedColumn; + i1.GeneratedColumn get feedDefaultHideReadPosts => + columnsByName['feed_default_hide_read_posts']! as i1.GeneratedColumn; + i1.GeneratedColumn get feedActionBackToTop => + columnsByName['feed_action_back_to_top']! as i1.GeneratedColumn; + i1.GeneratedColumn get feedActionCreateNew => + columnsByName['feed_action_create_new']! as i1.GeneratedColumn; + i1.GeneratedColumn get feedActionExpandFab => + columnsByName['feed_action_expand_fab']! as i1.GeneratedColumn; + i1.GeneratedColumn get feedActionRefresh => + columnsByName['feed_action_refresh']! as i1.GeneratedColumn; + i1.GeneratedColumn get feedActionSetFilter => + columnsByName['feed_action_set_filter']! as i1.GeneratedColumn; + i1.GeneratedColumn get feedActionSetSort => + columnsByName['feed_action_set_sort']! as i1.GeneratedColumn; + i1.GeneratedColumn get feedActionSetView => + columnsByName['feed_action_set_view']! as i1.GeneratedColumn; + i1.GeneratedColumn get feedActionHideReadPosts => + columnsByName['feed_action_hide_read_posts']! + as i1.GeneratedColumn; + i1.GeneratedColumn get enableSwipeActions => + columnsByName['enable_swipe_actions']! as i1.GeneratedColumn; + i1.GeneratedColumn get swipeActionLeftShort => + columnsByName['swipe_action_left_short']! as i1.GeneratedColumn; + i1.GeneratedColumn get swipeActionLeftLong => + columnsByName['swipe_action_left_long']! as i1.GeneratedColumn; + i1.GeneratedColumn get swipeActionRightShort => + columnsByName['swipe_action_right_short']! as i1.GeneratedColumn; + i1.GeneratedColumn get swipeActionRightLong => + columnsByName['swipe_action_right_long']! as i1.GeneratedColumn; + i1.GeneratedColumn get swipeActionThreshold => + columnsByName['swipe_action_threshold']! as i1.GeneratedColumn; + i1.GeneratedColumn get filterLists => + columnsByName['filter_lists']! as i1.GeneratedColumn; + i1.GeneratedColumn get showErrors => + columnsByName['show_errors']! as i1.GeneratedColumn; +} + +i1.GeneratedColumn _column_105(String aliasedName) => + i1.GeneratedColumn( + 'split_votes', + aliasedName, + true, + type: i1.DriftSqlType.int, + $customConstraints: 'NULL CHECK (split_votes IN (0, 1))', + ); i0.MigrationStepWithVersion migrationSteps({ required Future Function(i1.Migrator m, Schema2 schema) from1To2, required Future Function(i1.Migrator m, Schema3 schema) from2To3, + required Future Function(i1.Migrator m, Schema4 schema) from3To4, }) { return (currentVersion, database) async { switch (currentVersion) { @@ -1837,6 +2221,11 @@ i0.MigrationStepWithVersion migrationSteps({ final migrator = i1.Migrator(database, schema); await from2To3(migrator, schema); return 3; + case 3: + final schema = Schema4(database: database); + final migrator = i1.Migrator(database, schema); + await from3To4(migrator, schema); + return 4; default: throw ArgumentError.value('Unknown migration from $currentVersion'); } @@ -1846,6 +2235,11 @@ i0.MigrationStepWithVersion migrationSteps({ i1.OnUpgrade stepByStep({ required Future Function(i1.Migrator m, Schema2 schema) from1To2, required Future Function(i1.Migrator m, Schema3 schema) from2To3, + required Future Function(i1.Migrator m, Schema4 schema) from3To4, }) => i0.VersionedSchema.stepByStepHelper( - step: migrationSteps(from1To2: from1To2, from2To3: from2To3), + step: migrationSteps( + from1To2: from1To2, + from2To3: from2To3, + from3To4: from3To4, + ), ); diff --git a/lib/src/controller/database/schemas/drift_schema_v4.json b/lib/src/controller/database/schemas/drift_schema_v4.json new file mode 100644 index 00000000..d8c6001d --- /dev/null +++ b/lib/src/controller/database/schemas/drift_schema_v4.json @@ -0,0 +1,2041 @@ +{ + "_meta": { + "description": "This file contains a serialized version of schema entities for drift.", + "version": "1.3.0" + }, + "options": { + "store_date_time_values_as_text": true + }, + "entities": [ + { + "id": 0, + "references": [], + "type": "table", + "data": { + "name": "accounts", + "was_declared_in_moor": false, + "columns": [ + { + "name": "handle", + "getter_name": "handle", + "moor_type": "string", + "nullable": false, + "customConstraints": null, + "default_dart": null, + "default_client_dart": "() => defaultAccount", + "dsl_features": [ + { + "allowed-lengths": { + "min": 1, + "max": null + } + } + ] + }, + { + "name": "oauth", + "getter_name": "oauth", + "moor_type": "string", + "nullable": true, + "customConstraints": null, + "default_dart": null, + "default_client_dart": null, + "dsl_features": [], + "type_converter": { + "dart_expr": "const CredentialsConverter()", + "dart_type_name": "Credentials" + } + }, + { + "name": "jwt", + "getter_name": "jwt", + "moor_type": "string", + "nullable": true, + "customConstraints": null, + "default_dart": null, + "default_client_dart": null, + "dsl_features": [] + }, + { + "name": "is_push_registered", + "getter_name": "isPushRegistered", + "moor_type": "bool", + "nullable": false, + "customConstraints": null, + "defaultConstraints": "CHECK (\"is_push_registered\" IN (0, 1))", + "dialectAwareDefaultConstraints": { + "sqlite": "CHECK (\"is_push_registered\" IN (0, 1))" + }, + "default_dart": "const CustomExpression('0')", + "default_client_dart": null, + "dsl_features": [] + }, + { + "name": "unifiedpush_key", + "getter_name": "unifiedpushKey", + "moor_type": "string", + "nullable": true, + "customConstraints": null, + "default_dart": null, + "default_client_dart": null, + "dsl_features": [] + }, + { + "name": "unifiedpush_token", + "getter_name": "unifiedpushToken", + "moor_type": "string", + "nullable": true, + "customConstraints": null, + "default_dart": null, + "default_client_dart": null, + "dsl_features": [] + } + ], + "is_virtual": false, + "without_rowid": false, + "constraints": [], + "explicit_pk": [ + "handle" + ] + } + }, + { + "id": 1, + "references": [], + "type": "table", + "data": { + "name": "feeds", + "was_declared_in_moor": false, + "columns": [ + { + "name": "name", + "getter_name": "name", + "moor_type": "string", + "nullable": false, + "customConstraints": null, + "default_dart": null, + "default_client_dart": null, + "dsl_features": [ + { + "allowed-lengths": { + "min": 1, + "max": null + } + } + ] + }, + { + "name": "server", + "getter_name": "server", + "moor_type": "bool", + "nullable": false, + "customConstraints": null, + "defaultConstraints": "CHECK (\"server\" IN (0, 1))", + "dialectAwareDefaultConstraints": { + "sqlite": "CHECK (\"server\" IN (0, 1))" + }, + "default_dart": "const CustomExpression('0')", + "default_client_dart": null, + "dsl_features": [] + }, + { + "name": "owner", + "getter_name": "owner", + "moor_type": "string", + "nullable": true, + "customConstraints": null, + "default_dart": null, + "default_client_dart": null, + "dsl_features": [] + } + ], + "is_virtual": false, + "without_rowid": false, + "constraints": [], + "explicit_pk": [ + "name" + ] + } + }, + { + "id": 2, + "references": [ + 1 + ], + "type": "table", + "data": { + "name": "feed_inputs", + "was_declared_in_moor": false, + "columns": [ + { + "name": "feed", + "getter_name": "feed", + "moor_type": "string", + "nullable": false, + "customConstraints": null, + "defaultConstraints": "REFERENCES feeds (name) ON UPDATE CASCADE ON DELETE CASCADE", + "dialectAwareDefaultConstraints": { + "sqlite": "REFERENCES feeds (name) ON UPDATE CASCADE ON DELETE CASCADE" + }, + "default_dart": null, + "default_client_dart": null, + "dsl_features": [ + { + "foreign_key": { + "to": { + "table": "feeds", + "column": "name" + }, + "initially_deferred": false, + "on_update": "cascade", + "on_delete": "cascade" + } + } + ] + }, + { + "name": "name", + "getter_name": "name", + "moor_type": "string", + "nullable": false, + "customConstraints": null, + "default_dart": null, + "default_client_dart": null, + "dsl_features": [ + { + "allowed-lengths": { + "min": 1, + "max": null + } + } + ] + }, + { + "name": "source", + "getter_name": "source", + "moor_type": "string", + "nullable": false, + "customConstraints": null, + "default_dart": null, + "default_client_dart": null, + "dsl_features": [], + "type_converter": { + "dart_expr": "const EnumNameConverter(FeedSource.values)", + "dart_type_name": "FeedSource" + } + } + ], + "is_virtual": false, + "without_rowid": false, + "constraints": [], + "explicit_pk": [ + "name" + ] + } + }, + { + "id": 3, + "references": [], + "type": "table", + "data": { + "name": "servers", + "was_declared_in_moor": false, + "columns": [ + { + "name": "name", + "getter_name": "name", + "moor_type": "string", + "nullable": false, + "customConstraints": null, + "default_dart": null, + "default_client_dart": null, + "dsl_features": [ + { + "allowed-lengths": { + "min": 1, + "max": null + } + } + ] + }, + { + "name": "software", + "getter_name": "software", + "moor_type": "string", + "nullable": false, + "customConstraints": null, + "default_dart": null, + "default_client_dart": null, + "dsl_features": [], + "type_converter": { + "dart_expr": "const EnumNameConverter(ServerSoftware.values)", + "dart_type_name": "ServerSoftware" + } + }, + { + "name": "oauth_identifier", + "getter_name": "oauthIdentifier", + "moor_type": "string", + "nullable": true, + "customConstraints": null, + "default_dart": null, + "default_client_dart": null, + "dsl_features": [] + } + ], + "is_virtual": false, + "without_rowid": false, + "constraints": [], + "explicit_pk": [ + "name" + ] + } + }, + { + "id": 4, + "references": [ + 2, + 3 + ], + "type": "table", + "data": { + "name": "feed_source_cache", + "was_declared_in_moor": false, + "columns": [ + { + "name": "name", + "getter_name": "name", + "moor_type": "string", + "nullable": false, + "customConstraints": null, + "defaultConstraints": "REFERENCES feed_inputs (name) ON UPDATE CASCADE ON DELETE CASCADE", + "dialectAwareDefaultConstraints": { + "sqlite": "REFERENCES feed_inputs (name) ON UPDATE CASCADE ON DELETE CASCADE" + }, + "default_dart": null, + "default_client_dart": null, + "dsl_features": [ + { + "foreign_key": { + "to": { + "table": "feed_inputs", + "column": "name" + }, + "initially_deferred": false, + "on_update": "cascade", + "on_delete": "cascade" + } + } + ] + }, + { + "name": "server", + "getter_name": "server", + "moor_type": "string", + "nullable": false, + "customConstraints": null, + "defaultConstraints": "REFERENCES servers (name)", + "dialectAwareDefaultConstraints": { + "sqlite": "REFERENCES servers (name)" + }, + "default_dart": null, + "default_client_dart": null, + "dsl_features": [ + { + "foreign_key": { + "to": { + "table": "servers", + "column": "name" + }, + "initially_deferred": false, + "on_update": null, + "on_delete": null + } + } + ] + }, + { + "name": "source_id", + "getter_name": "sourceId", + "moor_type": "int", + "nullable": true, + "customConstraints": null, + "default_dart": null, + "default_client_dart": null, + "dsl_features": [] + }, + { + "name": "source", + "getter_name": "source", + "moor_type": "string", + "nullable": false, + "customConstraints": null, + "default_dart": null, + "default_client_dart": null, + "dsl_features": [], + "type_converter": { + "dart_expr": "const EnumNameConverter(FeedSource.values)", + "dart_type_name": "FeedSource" + } + } + ], + "is_virtual": false, + "without_rowid": false, + "constraints": [], + "explicit_pk": [ + "name", + "server" + ] + } + }, + { + "id": 5, + "references": [ + 0 + ], + "type": "table", + "data": { + "name": "read_post_cache", + "was_declared_in_moor": false, + "columns": [ + { + "name": "account", + "getter_name": "account", + "moor_type": "string", + "nullable": false, + "customConstraints": null, + "defaultConstraints": "REFERENCES accounts (handle) ON DELETE CASCADE", + "dialectAwareDefaultConstraints": { + "sqlite": "REFERENCES accounts (handle) ON DELETE CASCADE" + }, + "default_dart": null, + "default_client_dart": null, + "dsl_features": [ + { + "foreign_key": { + "to": { + "table": "accounts", + "column": "handle" + }, + "initially_deferred": false, + "on_update": null, + "on_delete": "cascade" + } + } + ] + }, + { + "name": "post_type", + "getter_name": "postType", + "moor_type": "string", + "nullable": false, + "customConstraints": null, + "default_dart": null, + "default_client_dart": null, + "dsl_features": [], + "type_converter": { + "dart_expr": "const EnumNameConverter(PostType.values)", + "dart_type_name": "PostType" + } + }, + { + "name": "post_id", + "getter_name": "postId", + "moor_type": "int", + "nullable": false, + "customConstraints": null, + "default_dart": null, + "default_client_dart": null, + "dsl_features": [] + } + ], + "is_virtual": false, + "without_rowid": false, + "constraints": [], + "explicit_pk": [ + "account", + "post_type", + "post_id" + ] + } + }, + { + "id": 6, + "references": [], + "type": "table", + "data": { + "name": "filter_lists", + "was_declared_in_moor": false, + "columns": [ + { + "name": "name", + "getter_name": "name", + "moor_type": "string", + "nullable": false, + "customConstraints": null, + "default_dart": null, + "default_client_dart": null, + "dsl_features": [ + { + "allowed-lengths": { + "min": 1, + "max": null + } + } + ] + }, + { + "name": "phrases", + "getter_name": "phrases", + "moor_type": "string", + "nullable": false, + "customConstraints": null, + "default_dart": null, + "default_client_dart": null, + "dsl_features": [], + "type_converter": { + "dart_expr": "const FilterListConverter()", + "dart_type_name": "Set" + } + }, + { + "name": "match_mode", + "getter_name": "matchMode", + "moor_type": "string", + "nullable": false, + "customConstraints": null, + "default_dart": null, + "default_client_dart": null, + "dsl_features": [], + "type_converter": { + "dart_expr": "const EnumNameConverter(FilterListMatchMode.values)", + "dart_type_name": "FilterListMatchMode" + } + }, + { + "name": "case_sensitive", + "getter_name": "caseSensitive", + "moor_type": "bool", + "nullable": false, + "customConstraints": null, + "defaultConstraints": "CHECK (\"case_sensitive\" IN (0, 1))", + "dialectAwareDefaultConstraints": { + "sqlite": "CHECK (\"case_sensitive\" IN (0, 1))" + }, + "default_dart": null, + "default_client_dart": null, + "dsl_features": [] + }, + { + "name": "show_with_warning", + "getter_name": "showWithWarning", + "moor_type": "bool", + "nullable": false, + "customConstraints": null, + "defaultConstraints": "CHECK (\"show_with_warning\" IN (0, 1))", + "dialectAwareDefaultConstraints": { + "sqlite": "CHECK (\"show_with_warning\" IN (0, 1))" + }, + "default_dart": null, + "default_client_dart": null, + "dsl_features": [] + } + ], + "is_virtual": false, + "without_rowid": false, + "constraints": [], + "explicit_pk": [ + "name" + ] + } + }, + { + "id": 7, + "references": [ + 0 + ], + "type": "table", + "data": { + "name": "profiles", + "was_declared_in_moor": false, + "columns": [ + { + "name": "name", + "getter_name": "name", + "moor_type": "string", + "nullable": false, + "customConstraints": null, + "default_dart": null, + "default_client_dart": "() => 'Default'", + "dsl_features": [ + { + "allowed-lengths": { + "min": 1, + "max": null + } + } + ] + }, + { + "name": "auto_switch_account", + "getter_name": "autoSwitchAccount", + "moor_type": "string", + "nullable": true, + "customConstraints": null, + "defaultConstraints": "REFERENCES accounts (handle) ON DELETE SET NULL", + "dialectAwareDefaultConstraints": { + "sqlite": "REFERENCES accounts (handle) ON DELETE SET NULL" + }, + "default_dart": null, + "default_client_dart": null, + "dsl_features": [ + { + "foreign_key": { + "to": { + "table": "accounts", + "column": "handle" + }, + "initially_deferred": false, + "on_update": null, + "on_delete": "setNull" + } + } + ] + }, + { + "name": "default_create_language", + "getter_name": "defaultCreateLanguage", + "moor_type": "string", + "nullable": true, + "customConstraints": null, + "default_dart": null, + "default_client_dart": null, + "dsl_features": [] + }, + { + "name": "disable_tab_swiping", + "getter_name": "disableTabSwiping", + "moor_type": "bool", + "nullable": true, + "customConstraints": null, + "defaultConstraints": "CHECK (\"disable_tab_swiping\" IN (0, 1))", + "dialectAwareDefaultConstraints": { + "sqlite": "CHECK (\"disable_tab_swiping\" IN (0, 1))" + }, + "default_dart": null, + "default_client_dart": null, + "dsl_features": [] + }, + { + "name": "ask_before_unsubscribing", + "getter_name": "askBeforeUnsubscribing", + "moor_type": "bool", + "nullable": true, + "customConstraints": null, + "defaultConstraints": "CHECK (\"ask_before_unsubscribing\" IN (0, 1))", + "dialectAwareDefaultConstraints": { + "sqlite": "CHECK (\"ask_before_unsubscribing\" IN (0, 1))" + }, + "default_dart": null, + "default_client_dart": null, + "dsl_features": [] + }, + { + "name": "ask_before_deleting", + "getter_name": "askBeforeDeleting", + "moor_type": "bool", + "nullable": true, + "customConstraints": null, + "defaultConstraints": "CHECK (\"ask_before_deleting\" IN (0, 1))", + "dialectAwareDefaultConstraints": { + "sqlite": "CHECK (\"ask_before_deleting\" IN (0, 1))" + }, + "default_dart": null, + "default_client_dart": null, + "dsl_features": [] + }, + { + "name": "auto_play_videos", + "getter_name": "autoPlayVideos", + "moor_type": "bool", + "nullable": true, + "customConstraints": null, + "defaultConstraints": "CHECK (\"auto_play_videos\" IN (0, 1))", + "dialectAwareDefaultConstraints": { + "sqlite": "CHECK (\"auto_play_videos\" IN (0, 1))" + }, + "default_dart": null, + "default_client_dart": null, + "dsl_features": [] + }, + { + "name": "haptic_feedback", + "getter_name": "hapticFeedback", + "moor_type": "bool", + "nullable": true, + "customConstraints": null, + "defaultConstraints": "CHECK (\"haptic_feedback\" IN (0, 1))", + "dialectAwareDefaultConstraints": { + "sqlite": "CHECK (\"haptic_feedback\" IN (0, 1))" + }, + "default_dart": null, + "default_client_dart": null, + "dsl_features": [] + }, + { + "name": "auto_translate", + "getter_name": "autoTranslate", + "moor_type": "bool", + "nullable": true, + "customConstraints": null, + "defaultConstraints": "CHECK (\"auto_translate\" IN (0, 1))", + "dialectAwareDefaultConstraints": { + "sqlite": "CHECK (\"auto_translate\" IN (0, 1))" + }, + "default_dart": null, + "default_client_dart": null, + "dsl_features": [] + }, + { + "name": "mark_threads_read_on_scroll", + "getter_name": "markThreadsReadOnScroll", + "moor_type": "bool", + "nullable": true, + "customConstraints": null, + "defaultConstraints": "CHECK (\"mark_threads_read_on_scroll\" IN (0, 1))", + "dialectAwareDefaultConstraints": { + "sqlite": "CHECK (\"mark_threads_read_on_scroll\" IN (0, 1))" + }, + "default_dart": null, + "default_client_dart": null, + "dsl_features": [] + }, + { + "name": "mark_microblogs_read_on_scroll", + "getter_name": "markMicroblogsReadOnScroll", + "moor_type": "bool", + "nullable": true, + "customConstraints": null, + "defaultConstraints": "CHECK (\"mark_microblogs_read_on_scroll\" IN (0, 1))", + "dialectAwareDefaultConstraints": { + "sqlite": "CHECK (\"mark_microblogs_read_on_scroll\" IN (0, 1))" + }, + "default_dart": null, + "default_client_dart": null, + "dsl_features": [] + }, + { + "name": "animation_speed", + "getter_name": "animationSpeed", + "moor_type": "double", + "nullable": true, + "customConstraints": null, + "default_dart": null, + "default_client_dart": null, + "dsl_features": [] + }, + { + "name": "inline_replies", + "getter_name": "inlineReplies", + "moor_type": "bool", + "nullable": true, + "customConstraints": null, + "defaultConstraints": "CHECK (\"inline_replies\" IN (0, 1))", + "dialectAwareDefaultConstraints": { + "sqlite": "CHECK (\"inline_replies\" IN (0, 1))" + }, + "default_dart": null, + "default_client_dart": null, + "dsl_features": [] + }, + { + "name": "show_cross_post_comments", + "getter_name": "showCrossPostComments", + "moor_type": "bool", + "nullable": true, + "customConstraints": null, + "defaultConstraints": "CHECK (\"show_cross_post_comments\" IN (0, 1))", + "dialectAwareDefaultConstraints": { + "sqlite": "CHECK (\"show_cross_post_comments\" IN (0, 1))" + }, + "default_dart": null, + "default_client_dart": null, + "dsl_features": [] + }, + { + "name": "mark_cross_posts_as_read", + "getter_name": "markCrossPostsAsRead", + "moor_type": "bool", + "nullable": true, + "customConstraints": null, + "defaultConstraints": "CHECK (\"mark_cross_posts_as_read\" IN (0, 1))", + "dialectAwareDefaultConstraints": { + "sqlite": "CHECK (\"mark_cross_posts_as_read\" IN (0, 1))" + }, + "default_dart": null, + "default_client_dart": null, + "dsl_features": [] + }, + { + "name": "default_image_store", + "getter_name": "defaultImageStore", + "moor_type": "string", + "nullable": true, + "customConstraints": null, + "default_dart": null, + "default_client_dart": null, + "dsl_features": [], + "type_converter": { + "dart_expr": "const EnumNameConverter(ImageStore.values)", + "dart_type_name": "ImageStore" + } + }, + { + "name": "default_link_action", + "getter_name": "defaultLinkAction", + "moor_type": "string", + "nullable": true, + "customConstraints": null, + "default_dart": null, + "default_client_dart": null, + "dsl_features": [], + "type_converter": { + "dart_expr": "const EnumNameConverter(LinkAction.values)", + "dart_type_name": "LinkAction" + } + }, + { + "name": "app_language", + "getter_name": "appLanguage", + "moor_type": "string", + "nullable": true, + "customConstraints": null, + "default_dart": null, + "default_client_dart": null, + "dsl_features": [] + }, + { + "name": "theme_mode", + "getter_name": "themeMode", + "moor_type": "string", + "nullable": true, + "customConstraints": null, + "default_dart": null, + "default_client_dart": null, + "dsl_features": [], + "type_converter": { + "dart_expr": "const EnumNameConverter(ThemeMode.values)", + "dart_type_name": "ThemeMode" + } + }, + { + "name": "color_scheme", + "getter_name": "colorScheme", + "moor_type": "string", + "nullable": true, + "customConstraints": null, + "default_dart": null, + "default_client_dart": null, + "dsl_features": [], + "type_converter": { + "dart_expr": "const EnumNameConverter(FlexScheme.values)", + "dart_type_name": "FlexScheme" + } + }, + { + "name": "enable_true_black", + "getter_name": "enableTrueBlack", + "moor_type": "bool", + "nullable": true, + "customConstraints": null, + "defaultConstraints": "CHECK (\"enable_true_black\" IN (0, 1))", + "dialectAwareDefaultConstraints": { + "sqlite": "CHECK (\"enable_true_black\" IN (0, 1))" + }, + "default_dart": null, + "default_client_dart": null, + "dsl_features": [] + }, + { + "name": "post_mode", + "getter_name": "postMode", + "moor_type": "string", + "nullable": true, + "customConstraints": null, + "default_dart": null, + "default_client_dart": null, + "dsl_features": [], + "type_converter": { + "dart_expr": "const EnumNameConverter(PostMode.values)", + "dart_type_name": "PostMode" + } + }, + { + "name": "split_votes", + "getter_name": "splitVotes", + "moor_type": "bool", + "nullable": true, + "customConstraints": null, + "defaultConstraints": "CHECK (\"split_votes\" IN (0, 1))", + "dialectAwareDefaultConstraints": { + "sqlite": "CHECK (\"split_votes\" IN (0, 1))" + }, + "default_dart": null, + "default_client_dart": null, + "dsl_features": [] + }, + { + "name": "hide_action_buttons", + "getter_name": "hideActionButtons", + "moor_type": "bool", + "nullable": true, + "customConstraints": null, + "defaultConstraints": "CHECK (\"hide_action_buttons\" IN (0, 1))", + "dialectAwareDefaultConstraints": { + "sqlite": "CHECK (\"hide_action_buttons\" IN (0, 1))" + }, + "default_dart": null, + "default_client_dart": null, + "dsl_features": [] + }, + { + "name": "hide_feed_u_i_on_scroll", + "getter_name": "hideFeedUIOnScroll", + "moor_type": "bool", + "nullable": true, + "customConstraints": null, + "defaultConstraints": "CHECK (\"hide_feed_u_i_on_scroll\" IN (0, 1))", + "dialectAwareDefaultConstraints": { + "sqlite": "CHECK (\"hide_feed_u_i_on_scroll\" IN (0, 1))" + }, + "default_dart": null, + "default_client_dart": null, + "dsl_features": [] + }, + { + "name": "global_text_scale", + "getter_name": "globalTextScale", + "moor_type": "double", + "nullable": true, + "customConstraints": null, + "default_dart": null, + "default_client_dart": null, + "dsl_features": [] + }, + { + "name": "always_show_instance", + "getter_name": "alwaysShowInstance", + "moor_type": "bool", + "nullable": true, + "customConstraints": null, + "defaultConstraints": "CHECK (\"always_show_instance\" IN (0, 1))", + "dialectAwareDefaultConstraints": { + "sqlite": "CHECK (\"always_show_instance\" IN (0, 1))" + }, + "default_dart": null, + "default_client_dart": null, + "dsl_features": [] + }, + { + "name": "cover_media_marked_sensitive", + "getter_name": "coverMediaMarkedSensitive", + "moor_type": "bool", + "nullable": true, + "customConstraints": null, + "defaultConstraints": "CHECK (\"cover_media_marked_sensitive\" IN (0, 1))", + "dialectAwareDefaultConstraints": { + "sqlite": "CHECK (\"cover_media_marked_sensitive\" IN (0, 1))" + }, + "default_dart": null, + "default_client_dart": null, + "dsl_features": [] + }, + { + "name": "full_image_size_threads", + "getter_name": "fullImageSizeThreads", + "moor_type": "bool", + "nullable": true, + "customConstraints": null, + "defaultConstraints": "CHECK (\"full_image_size_threads\" IN (0, 1))", + "dialectAwareDefaultConstraints": { + "sqlite": "CHECK (\"full_image_size_threads\" IN (0, 1))" + }, + "default_dart": null, + "default_client_dart": null, + "dsl_features": [] + }, + { + "name": "full_image_size_microblogs", + "getter_name": "fullImageSizeMicroblogs", + "moor_type": "bool", + "nullable": true, + "customConstraints": null, + "defaultConstraints": "CHECK (\"full_image_size_microblogs\" IN (0, 1))", + "dialectAwareDefaultConstraints": { + "sqlite": "CHECK (\"full_image_size_microblogs\" IN (0, 1))" + }, + "default_dart": null, + "default_client_dart": null, + "dsl_features": [] + }, + { + "name": "post_component_order", + "getter_name": "postComponentOrder", + "moor_type": "string", + "nullable": true, + "customConstraints": null, + "default_dart": null, + "default_client_dart": null, + "dsl_features": [], + "type_converter": { + "dart_expr": "const PostComponentConverter()", + "dart_type_name": "List" + } + }, + { + "name": "divider_thickness", + "getter_name": "dividerThickness", + "moor_type": "double", + "nullable": true, + "customConstraints": null, + "default_dart": null, + "default_client_dart": null, + "dsl_features": [] + }, + { + "name": "hide_emoji_reactions", + "getter_name": "hideEmojiReactions", + "moor_type": "bool", + "nullable": true, + "customConstraints": null, + "defaultConstraints": "CHECK (\"hide_emoji_reactions\" IN (0, 1))", + "dialectAwareDefaultConstraints": { + "sqlite": "CHECK (\"hide_emoji_reactions\" IN (0, 1))" + }, + "default_dart": null, + "default_client_dart": null, + "dsl_features": [] + }, + { + "name": "feed_view_order", + "getter_name": "feedViewOrder", + "moor_type": "string", + "nullable": true, + "customConstraints": null, + "default_dart": null, + "default_client_dart": null, + "dsl_features": [], + "type_converter": { + "dart_expr": "const FeedViewListConverter()", + "dart_type_name": "List" + } + }, + { + "name": "feed_source_order", + "getter_name": "feedSourceOrder", + "moor_type": "string", + "nullable": true, + "customConstraints": null, + "default_dart": null, + "default_client_dart": null, + "dsl_features": [], + "type_converter": { + "dart_expr": "const FeedSourceListConverter()", + "dart_type_name": "List" + } + }, + { + "name": "feed_sort_order", + "getter_name": "feedSortOrder", + "moor_type": "string", + "nullable": true, + "customConstraints": null, + "default_dart": null, + "default_client_dart": null, + "dsl_features": [], + "type_converter": { + "dart_expr": "const FeedSortListConverter()", + "dart_type_name": "List" + } + }, + { + "name": "feed_default_threads_sort", + "getter_name": "feedDefaultThreadsSort", + "moor_type": "string", + "nullable": true, + "customConstraints": null, + "default_dart": null, + "default_client_dart": null, + "dsl_features": [], + "type_converter": { + "dart_expr": "const EnumNameConverter(FeedSort.values)", + "dart_type_name": "FeedSort" + } + }, + { + "name": "feed_default_microblog_sort", + "getter_name": "feedDefaultMicroblogSort", + "moor_type": "string", + "nullable": true, + "customConstraints": null, + "default_dart": null, + "default_client_dart": null, + "dsl_features": [], + "type_converter": { + "dart_expr": "const EnumNameConverter(FeedSort.values)", + "dart_type_name": "FeedSort" + } + }, + { + "name": "feed_default_combined_sort", + "getter_name": "feedDefaultCombinedSort", + "moor_type": "string", + "nullable": true, + "customConstraints": null, + "default_dart": null, + "default_client_dart": null, + "dsl_features": [], + "type_converter": { + "dart_expr": "const EnumNameConverter(FeedSort.values)", + "dart_type_name": "FeedSort" + } + }, + { + "name": "feed_default_explore_sort", + "getter_name": "feedDefaultExploreSort", + "moor_type": "string", + "nullable": true, + "customConstraints": null, + "default_dart": null, + "default_client_dart": null, + "dsl_features": [], + "type_converter": { + "dart_expr": "const EnumNameConverter(FeedSort.values)", + "dart_type_name": "FeedSort" + } + }, + { + "name": "feed_default_comment_sort", + "getter_name": "feedDefaultCommentSort", + "moor_type": "string", + "nullable": true, + "customConstraints": null, + "default_dart": null, + "default_client_dart": null, + "dsl_features": [], + "type_converter": { + "dart_expr": "const EnumNameConverter(CommentSort.values)", + "dart_type_name": "CommentSort" + } + }, + { + "name": "feed_default_hide_read_posts", + "getter_name": "feedDefaultHideReadPosts", + "moor_type": "bool", + "nullable": true, + "customConstraints": null, + "defaultConstraints": "CHECK (\"feed_default_hide_read_posts\" IN (0, 1))", + "dialectAwareDefaultConstraints": { + "sqlite": "CHECK (\"feed_default_hide_read_posts\" IN (0, 1))" + }, + "default_dart": null, + "default_client_dart": null, + "dsl_features": [] + }, + { + "name": "feed_action_back_to_top", + "getter_name": "feedActionBackToTop", + "moor_type": "string", + "nullable": true, + "customConstraints": null, + "default_dart": null, + "default_client_dart": null, + "dsl_features": [], + "type_converter": { + "dart_expr": "const EnumNameConverter(ActionLocation.values)", + "dart_type_name": "ActionLocation" + } + }, + { + "name": "feed_action_create_new", + "getter_name": "feedActionCreateNew", + "moor_type": "string", + "nullable": true, + "customConstraints": null, + "default_dart": null, + "default_client_dart": null, + "dsl_features": [], + "type_converter": { + "dart_expr": "const EnumNameConverter(ActionLocation.values)", + "dart_type_name": "ActionLocation" + } + }, + { + "name": "feed_action_expand_fab", + "getter_name": "feedActionExpandFab", + "moor_type": "string", + "nullable": true, + "customConstraints": null, + "default_dart": null, + "default_client_dart": null, + "dsl_features": [], + "type_converter": { + "dart_expr": "const EnumNameConverter(ActionLocation.values)", + "dart_type_name": "ActionLocation" + } + }, + { + "name": "feed_action_refresh", + "getter_name": "feedActionRefresh", + "moor_type": "string", + "nullable": true, + "customConstraints": null, + "default_dart": null, + "default_client_dart": null, + "dsl_features": [], + "type_converter": { + "dart_expr": "const EnumNameConverter(ActionLocation.values)", + "dart_type_name": "ActionLocation" + } + }, + { + "name": "feed_action_set_filter", + "getter_name": "feedActionSetFilter", + "moor_type": "string", + "nullable": true, + "customConstraints": null, + "default_dart": null, + "default_client_dart": null, + "dsl_features": [], + "type_converter": { + "dart_expr": "const EnumNameConverter(ActionLocationWithTabs.values)", + "dart_type_name": "ActionLocationWithTabs" + } + }, + { + "name": "feed_action_set_sort", + "getter_name": "feedActionSetSort", + "moor_type": "string", + "nullable": true, + "customConstraints": null, + "default_dart": null, + "default_client_dart": null, + "dsl_features": [], + "type_converter": { + "dart_expr": "const EnumNameConverter(ActionLocationWithTabs.values)", + "dart_type_name": "ActionLocationWithTabs" + } + }, + { + "name": "feed_action_set_view", + "getter_name": "feedActionSetView", + "moor_type": "string", + "nullable": true, + "customConstraints": null, + "default_dart": null, + "default_client_dart": null, + "dsl_features": [], + "type_converter": { + "dart_expr": "const EnumNameConverter(ActionLocationWithTabs.values)", + "dart_type_name": "ActionLocationWithTabs" + } + }, + { + "name": "feed_action_hide_read_posts", + "getter_name": "feedActionHideReadPosts", + "moor_type": "string", + "nullable": true, + "customConstraints": null, + "default_dart": null, + "default_client_dart": null, + "dsl_features": [], + "type_converter": { + "dart_expr": "const EnumNameConverter(ActionLocation.values)", + "dart_type_name": "ActionLocation" + } + }, + { + "name": "enable_swipe_actions", + "getter_name": "enableSwipeActions", + "moor_type": "bool", + "nullable": true, + "customConstraints": null, + "defaultConstraints": "CHECK (\"enable_swipe_actions\" IN (0, 1))", + "dialectAwareDefaultConstraints": { + "sqlite": "CHECK (\"enable_swipe_actions\" IN (0, 1))" + }, + "default_dart": null, + "default_client_dart": null, + "dsl_features": [] + }, + { + "name": "swipe_action_left_short", + "getter_name": "swipeActionLeftShort", + "moor_type": "string", + "nullable": true, + "customConstraints": null, + "default_dart": null, + "default_client_dart": null, + "dsl_features": [], + "type_converter": { + "dart_expr": "const EnumNameConverter(SwipeAction.values)", + "dart_type_name": "SwipeAction" + } + }, + { + "name": "swipe_action_left_long", + "getter_name": "swipeActionLeftLong", + "moor_type": "string", + "nullable": true, + "customConstraints": null, + "default_dart": null, + "default_client_dart": null, + "dsl_features": [], + "type_converter": { + "dart_expr": "const EnumNameConverter(SwipeAction.values)", + "dart_type_name": "SwipeAction" + } + }, + { + "name": "swipe_action_right_short", + "getter_name": "swipeActionRightShort", + "moor_type": "string", + "nullable": true, + "customConstraints": null, + "default_dart": null, + "default_client_dart": null, + "dsl_features": [], + "type_converter": { + "dart_expr": "const EnumNameConverter(SwipeAction.values)", + "dart_type_name": "SwipeAction" + } + }, + { + "name": "swipe_action_right_long", + "getter_name": "swipeActionRightLong", + "moor_type": "string", + "nullable": true, + "customConstraints": null, + "default_dart": null, + "default_client_dart": null, + "dsl_features": [], + "type_converter": { + "dart_expr": "const EnumNameConverter(SwipeAction.values)", + "dart_type_name": "SwipeAction" + } + }, + { + "name": "swipe_action_threshold", + "getter_name": "swipeActionThreshold", + "moor_type": "double", + "nullable": true, + "customConstraints": null, + "default_dart": null, + "default_client_dart": null, + "dsl_features": [] + }, + { + "name": "filter_lists", + "getter_name": "filterLists", + "moor_type": "string", + "nullable": true, + "customConstraints": null, + "default_dart": null, + "default_client_dart": null, + "dsl_features": [], + "type_converter": { + "dart_expr": "const FilterListActivationConverter()", + "dart_type_name": "Map" + } + }, + { + "name": "show_errors", + "getter_name": "showErrors", + "moor_type": "bool", + "nullable": true, + "customConstraints": null, + "defaultConstraints": "CHECK (\"show_errors\" IN (0, 1))", + "dialectAwareDefaultConstraints": { + "sqlite": "CHECK (\"show_errors\" IN (0, 1))" + }, + "default_dart": null, + "default_client_dart": null, + "dsl_features": [] + } + ], + "is_virtual": false, + "without_rowid": false, + "constraints": [], + "explicit_pk": [ + "name" + ] + } + }, + { + "id": 8, + "references": [], + "type": "table", + "data": { + "name": "stars", + "was_declared_in_moor": false, + "columns": [ + { + "name": "id", + "getter_name": "id", + "moor_type": "int", + "nullable": false, + "customConstraints": null, + "defaultConstraints": "PRIMARY KEY AUTOINCREMENT", + "dialectAwareDefaultConstraints": { + "sqlite": "PRIMARY KEY AUTOINCREMENT" + }, + "default_dart": null, + "default_client_dart": null, + "dsl_features": [ + "auto-increment" + ] + }, + { + "name": "name", + "getter_name": "name", + "moor_type": "string", + "nullable": false, + "customConstraints": null, + "default_dart": null, + "default_client_dart": null, + "dsl_features": [ + { + "allowed-lengths": { + "min": 1, + "max": null + } + } + ] + } + ], + "is_virtual": false, + "without_rowid": false, + "constraints": [] + } + }, + { + "id": 9, + "references": [ + 7, + 0 + ], + "type": "table", + "data": { + "name": "misc_cache", + "was_declared_in_moor": false, + "columns": [ + { + "name": "id", + "getter_name": "id", + "moor_type": "int", + "nullable": false, + "customConstraints": null, + "default_dart": null, + "default_client_dart": null, + "dsl_features": [ + { + "check": { + "dart_expression": { + "elements": [ + { + "lexeme": "id", + "tag": "id" + }, + ".equals(1)" + ] + } + } + } + ] + }, + { + "name": "main_profile", + "getter_name": "mainProfile", + "moor_type": "string", + "nullable": false, + "customConstraints": null, + "defaultConstraints": "REFERENCES profiles (name) ON DELETE SET DEFAULT", + "dialectAwareDefaultConstraints": { + "sqlite": "REFERENCES profiles (name) ON DELETE SET DEFAULT" + }, + "default_dart": null, + "default_client_dart": "() => 'Default'", + "dsl_features": [ + { + "foreign_key": { + "to": { + "table": "profiles", + "column": "name" + }, + "initially_deferred": false, + "on_update": null, + "on_delete": "setDefault" + } + } + ] + }, + { + "name": "selected_profile", + "getter_name": "selectedProfile", + "moor_type": "string", + "nullable": false, + "customConstraints": null, + "defaultConstraints": "REFERENCES profiles (name) ON DELETE SET DEFAULT", + "dialectAwareDefaultConstraints": { + "sqlite": "REFERENCES profiles (name) ON DELETE SET DEFAULT" + }, + "default_dart": null, + "default_client_dart": "() => 'Default'", + "dsl_features": [ + { + "foreign_key": { + "to": { + "table": "profiles", + "column": "name" + }, + "initially_deferred": false, + "on_update": null, + "on_delete": "setDefault" + } + } + ] + }, + { + "name": "auto_select_profile", + "getter_name": "autoSelectProfile", + "moor_type": "string", + "nullable": true, + "customConstraints": null, + "defaultConstraints": "REFERENCES profiles (name) ON DELETE SET NULL", + "dialectAwareDefaultConstraints": { + "sqlite": "REFERENCES profiles (name) ON DELETE SET NULL" + }, + "default_dart": null, + "default_client_dart": null, + "dsl_features": [ + { + "foreign_key": { + "to": { + "table": "profiles", + "column": "name" + }, + "initially_deferred": false, + "on_update": null, + "on_delete": "setNull" + } + } + ] + }, + { + "name": "selected_account", + "getter_name": "selectedAccount", + "moor_type": "string", + "nullable": false, + "customConstraints": null, + "defaultConstraints": "REFERENCES accounts (handle) ON DELETE SET DEFAULT", + "dialectAwareDefaultConstraints": { + "sqlite": "REFERENCES accounts (handle) ON DELETE SET DEFAULT" + }, + "default_dart": null, + "default_client_dart": "() => defaultAccount", + "dsl_features": [ + { + "foreign_key": { + "to": { + "table": "accounts", + "column": "handle" + }, + "initially_deferred": false, + "on_update": null, + "on_delete": "setDefault" + } + } + ] + }, + { + "name": "web_push_keys", + "getter_name": "webPushKeys", + "moor_type": "string", + "nullable": true, + "customConstraints": null, + "default_dart": null, + "default_client_dart": null, + "dsl_features": [] + }, + { + "name": "downloads_dir", + "getter_name": "downloadsDir", + "moor_type": "string", + "nullable": true, + "customConstraints": null, + "default_dart": null, + "default_client_dart": null, + "dsl_features": [] + }, + { + "name": "expand_nav_drawer", + "getter_name": "expandNavDrawer", + "moor_type": "bool", + "nullable": false, + "customConstraints": null, + "defaultConstraints": "CHECK (\"expand_nav_drawer\" IN (0, 1))", + "dialectAwareDefaultConstraints": { + "sqlite": "CHECK (\"expand_nav_drawer\" IN (0, 1))" + }, + "default_dart": "const CustomExpression('1')", + "default_client_dart": null, + "dsl_features": [] + }, + { + "name": "expand_nav_stars", + "getter_name": "expandNavStars", + "moor_type": "bool", + "nullable": false, + "customConstraints": null, + "defaultConstraints": "CHECK (\"expand_nav_stars\" IN (0, 1))", + "dialectAwareDefaultConstraints": { + "sqlite": "CHECK (\"expand_nav_stars\" IN (0, 1))" + }, + "default_dart": "const CustomExpression('1')", + "default_client_dart": null, + "dsl_features": [] + }, + { + "name": "expand_nav_feeds", + "getter_name": "expandNavFeeds", + "moor_type": "bool", + "nullable": false, + "customConstraints": null, + "defaultConstraints": "CHECK (\"expand_nav_feeds\" IN (0, 1))", + "dialectAwareDefaultConstraints": { + "sqlite": "CHECK (\"expand_nav_feeds\" IN (0, 1))" + }, + "default_dart": "const CustomExpression('1')", + "default_client_dart": null, + "dsl_features": [] + }, + { + "name": "expand_nav_subscriptions", + "getter_name": "expandNavSubscriptions", + "moor_type": "bool", + "nullable": false, + "customConstraints": null, + "defaultConstraints": "CHECK (\"expand_nav_subscriptions\" IN (0, 1))", + "dialectAwareDefaultConstraints": { + "sqlite": "CHECK (\"expand_nav_subscriptions\" IN (0, 1))" + }, + "default_dart": "const CustomExpression('1')", + "default_client_dart": null, + "dsl_features": [] + }, + { + "name": "expand_nav_follows", + "getter_name": "expandNavFollows", + "moor_type": "bool", + "nullable": false, + "customConstraints": null, + "defaultConstraints": "CHECK (\"expand_nav_follows\" IN (0, 1))", + "dialectAwareDefaultConstraints": { + "sqlite": "CHECK (\"expand_nav_follows\" IN (0, 1))" + }, + "default_dart": "const CustomExpression('1')", + "default_client_dart": null, + "dsl_features": [] + }, + { + "name": "expand_nav_domains", + "getter_name": "expandNavDomains", + "moor_type": "bool", + "nullable": false, + "customConstraints": null, + "defaultConstraints": "CHECK (\"expand_nav_domains\" IN (0, 1))", + "dialectAwareDefaultConstraints": { + "sqlite": "CHECK (\"expand_nav_domains\" IN (0, 1))" + }, + "default_dart": "const CustomExpression('1')", + "default_client_dart": null, + "dsl_features": [] + }, + { + "name": "unifiedpush_distributor_name", + "getter_name": "unifiedpushDistributorName", + "moor_type": "string", + "nullable": true, + "customConstraints": null, + "default_dart": null, + "default_client_dart": null, + "dsl_features": [] + }, + { + "name": "unifiedpush_distributor_ack", + "getter_name": "unifiedpushDistributorAck", + "moor_type": "bool", + "nullable": false, + "customConstraints": null, + "defaultConstraints": "CHECK (\"unifiedpush_distributor_ack\" IN (0, 1))", + "dialectAwareDefaultConstraints": { + "sqlite": "CHECK (\"unifiedpush_distributor_ack\" IN (0, 1))" + }, + "default_dart": "const CustomExpression('0')", + "default_client_dart": null, + "dsl_features": [] + } + ], + "is_virtual": false, + "without_rowid": false, + "constraints": [], + "explicit_pk": [ + "id" + ] + } + }, + { + "id": 10, + "references": [], + "type": "table", + "data": { + "name": "drafts", + "was_declared_in_moor": false, + "columns": [ + { + "name": "id", + "getter_name": "id", + "moor_type": "int", + "nullable": false, + "customConstraints": null, + "defaultConstraints": "PRIMARY KEY AUTOINCREMENT", + "dialectAwareDefaultConstraints": { + "sqlite": "PRIMARY KEY AUTOINCREMENT" + }, + "default_dart": null, + "default_client_dart": null, + "dsl_features": [ + "auto-increment" + ] + }, + { + "name": "body", + "getter_name": "body", + "moor_type": "string", + "nullable": false, + "customConstraints": null, + "default_dart": null, + "default_client_dart": null, + "dsl_features": [] + }, + { + "name": "resource_id", + "getter_name": "resourceId", + "moor_type": "string", + "nullable": true, + "customConstraints": null, + "default_dart": null, + "default_client_dart": null, + "dsl_features": [] + }, + { + "name": "at", + "getter_name": "at", + "moor_type": "dateTime", + "nullable": false, + "customConstraints": null, + "default_dart": "const CustomExpression('CURRENT_TIMESTAMP')", + "default_client_dart": null, + "dsl_features": [] + } + ], + "is_virtual": false, + "without_rowid": false, + "constraints": [] + } + }, + { + "id": 11, + "references": [], + "type": "table", + "data": { + "name": "tags", + "was_declared_in_moor": false, + "columns": [ + { + "name": "id", + "getter_name": "id", + "moor_type": "int", + "nullable": false, + "customConstraints": null, + "defaultConstraints": "PRIMARY KEY AUTOINCREMENT", + "dialectAwareDefaultConstraints": { + "sqlite": "PRIMARY KEY AUTOINCREMENT" + }, + "default_dart": null, + "default_client_dart": null, + "dsl_features": [ + "auto-increment" + ] + }, + { + "name": "tag", + "getter_name": "tag", + "moor_type": "string", + "nullable": false, + "customConstraints": null, + "defaultConstraints": "UNIQUE", + "dialectAwareDefaultConstraints": { + "sqlite": "UNIQUE" + }, + "default_dart": null, + "default_client_dart": null, + "dsl_features": [ + { + "allowed-lengths": { + "min": 1, + "max": null + } + }, + "unique" + ] + }, + { + "name": "background_color", + "getter_name": "backgroundColor", + "moor_type": "int", + "nullable": false, + "customConstraints": null, + "default_dart": null, + "default_client_dart": "() => const Color.from(alpha: 1,red: 1,green: 1,blue: 1).value32bit", + "dsl_features": [], + "type_converter": { + "dart_expr": "const ColorConverter()", + "dart_type_name": "Color" + } + }, + { + "name": "text_color", + "getter_name": "textColor", + "moor_type": "int", + "nullable": false, + "customConstraints": null, + "default_dart": null, + "default_client_dart": "() => const Color.from(alpha: 1,red: 0,green: 0,blue: 0).value32bit", + "dsl_features": [], + "type_converter": { + "dart_expr": "const ColorConverter()", + "dart_type_name": "Color" + } + } + ], + "is_virtual": false, + "without_rowid": false, + "constraints": [] + } + }, + { + "id": 12, + "references": [ + 11 + ], + "type": "table", + "data": { + "name": "user_tags", + "was_declared_in_moor": false, + "columns": [ + { + "name": "user", + "getter_name": "user", + "moor_type": "string", + "nullable": false, + "customConstraints": null, + "default_dart": null, + "default_client_dart": null, + "dsl_features": [] + }, + { + "name": "tag_id", + "getter_name": "tagId", + "moor_type": "int", + "nullable": false, + "customConstraints": null, + "defaultConstraints": "REFERENCES tags (id) ON DELETE CASCADE", + "dialectAwareDefaultConstraints": { + "sqlite": "REFERENCES tags (id) ON DELETE CASCADE" + }, + "default_dart": null, + "default_client_dart": null, + "dsl_features": [ + { + "foreign_key": { + "to": { + "table": "tags", + "column": "id" + }, + "initially_deferred": false, + "on_update": null, + "on_delete": "cascade" + } + } + ] + } + ], + "is_virtual": false, + "without_rowid": false, + "constraints": [], + "explicit_pk": [ + "user", + "tag_id" + ] + } + }, + { + "id": 13, + "references": [ + 0 + ], + "type": "index", + "data": { + "on": 0, + "name": "account_unifiedpushToken", + "sql": null, + "unique": false, + "columns": [ + { + "column": "unifiedpush_token", + "order_by": null + } + ] + } + } + ], + "fixed_sql": [ + { + "name": "accounts", + "sql": [ + { + "dialect": "sqlite", + "sql": "CREATE TABLE IF NOT EXISTS \"accounts\" (\"handle\" TEXT NOT NULL, \"oauth\" TEXT NULL, \"jwt\" TEXT NULL, \"is_push_registered\" INTEGER NOT NULL DEFAULT 0 CHECK (\"is_push_registered\" IN (0, 1)), \"unifiedpush_key\" TEXT NULL, \"unifiedpush_token\" TEXT NULL, PRIMARY KEY (\"handle\"));" + } + ] + }, + { + "name": "feeds", + "sql": [ + { + "dialect": "sqlite", + "sql": "CREATE TABLE IF NOT EXISTS \"feeds\" (\"name\" TEXT NOT NULL, \"server\" INTEGER NOT NULL DEFAULT 0 CHECK (\"server\" IN (0, 1)), \"owner\" TEXT NULL, PRIMARY KEY (\"name\"));" + } + ] + }, + { + "name": "feed_inputs", + "sql": [ + { + "dialect": "sqlite", + "sql": "CREATE TABLE IF NOT EXISTS \"feed_inputs\" (\"feed\" TEXT NOT NULL REFERENCES feeds (name) ON UPDATE CASCADE ON DELETE CASCADE, \"name\" TEXT NOT NULL, \"source\" TEXT NOT NULL, PRIMARY KEY (\"name\"));" + } + ] + }, + { + "name": "servers", + "sql": [ + { + "dialect": "sqlite", + "sql": "CREATE TABLE IF NOT EXISTS \"servers\" (\"name\" TEXT NOT NULL, \"software\" TEXT NOT NULL, \"oauth_identifier\" TEXT NULL, PRIMARY KEY (\"name\"));" + } + ] + }, + { + "name": "feed_source_cache", + "sql": [ + { + "dialect": "sqlite", + "sql": "CREATE TABLE IF NOT EXISTS \"feed_source_cache\" (\"name\" TEXT NOT NULL REFERENCES feed_inputs (name) ON UPDATE CASCADE ON DELETE CASCADE, \"server\" TEXT NOT NULL REFERENCES servers (name), \"source_id\" INTEGER NULL, \"source\" TEXT NOT NULL, PRIMARY KEY (\"name\", \"server\"));" + } + ] + }, + { + "name": "read_post_cache", + "sql": [ + { + "dialect": "sqlite", + "sql": "CREATE TABLE IF NOT EXISTS \"read_post_cache\" (\"account\" TEXT NOT NULL REFERENCES accounts (handle) ON DELETE CASCADE, \"post_type\" TEXT NOT NULL, \"post_id\" INTEGER NOT NULL, PRIMARY KEY (\"account\", \"post_type\", \"post_id\"));" + } + ] + }, + { + "name": "filter_lists", + "sql": [ + { + "dialect": "sqlite", + "sql": "CREATE TABLE IF NOT EXISTS \"filter_lists\" (\"name\" TEXT NOT NULL, \"phrases\" TEXT NOT NULL, \"match_mode\" TEXT NOT NULL, \"case_sensitive\" INTEGER NOT NULL CHECK (\"case_sensitive\" IN (0, 1)), \"show_with_warning\" INTEGER NOT NULL CHECK (\"show_with_warning\" IN (0, 1)), PRIMARY KEY (\"name\"));" + } + ] + }, + { + "name": "profiles", + "sql": [ + { + "dialect": "sqlite", + "sql": "CREATE TABLE IF NOT EXISTS \"profiles\" (\"name\" TEXT NOT NULL, \"auto_switch_account\" TEXT NULL REFERENCES accounts (handle) ON DELETE SET NULL, \"default_create_language\" TEXT NULL, \"disable_tab_swiping\" INTEGER NULL CHECK (\"disable_tab_swiping\" IN (0, 1)), \"ask_before_unsubscribing\" INTEGER NULL CHECK (\"ask_before_unsubscribing\" IN (0, 1)), \"ask_before_deleting\" INTEGER NULL CHECK (\"ask_before_deleting\" IN (0, 1)), \"auto_play_videos\" INTEGER NULL CHECK (\"auto_play_videos\" IN (0, 1)), \"haptic_feedback\" INTEGER NULL CHECK (\"haptic_feedback\" IN (0, 1)), \"auto_translate\" INTEGER NULL CHECK (\"auto_translate\" IN (0, 1)), \"mark_threads_read_on_scroll\" INTEGER NULL CHECK (\"mark_threads_read_on_scroll\" IN (0, 1)), \"mark_microblogs_read_on_scroll\" INTEGER NULL CHECK (\"mark_microblogs_read_on_scroll\" IN (0, 1)), \"animation_speed\" REAL NULL, \"inline_replies\" INTEGER NULL CHECK (\"inline_replies\" IN (0, 1)), \"show_cross_post_comments\" INTEGER NULL CHECK (\"show_cross_post_comments\" IN (0, 1)), \"mark_cross_posts_as_read\" INTEGER NULL CHECK (\"mark_cross_posts_as_read\" IN (0, 1)), \"default_image_store\" TEXT NULL, \"default_link_action\" TEXT NULL, \"app_language\" TEXT NULL, \"theme_mode\" TEXT NULL, \"color_scheme\" TEXT NULL, \"enable_true_black\" INTEGER NULL CHECK (\"enable_true_black\" IN (0, 1)), \"post_mode\" TEXT NULL, \"split_votes\" INTEGER NULL CHECK (\"split_votes\" IN (0, 1)), \"hide_action_buttons\" INTEGER NULL CHECK (\"hide_action_buttons\" IN (0, 1)), \"hide_feed_u_i_on_scroll\" INTEGER NULL CHECK (\"hide_feed_u_i_on_scroll\" IN (0, 1)), \"global_text_scale\" REAL NULL, \"always_show_instance\" INTEGER NULL CHECK (\"always_show_instance\" IN (0, 1)), \"cover_media_marked_sensitive\" INTEGER NULL CHECK (\"cover_media_marked_sensitive\" IN (0, 1)), \"full_image_size_threads\" INTEGER NULL CHECK (\"full_image_size_threads\" IN (0, 1)), \"full_image_size_microblogs\" INTEGER NULL CHECK (\"full_image_size_microblogs\" IN (0, 1)), \"post_component_order\" TEXT NULL, \"divider_thickness\" REAL NULL, \"hide_emoji_reactions\" INTEGER NULL CHECK (\"hide_emoji_reactions\" IN (0, 1)), \"feed_view_order\" TEXT NULL, \"feed_source_order\" TEXT NULL, \"feed_sort_order\" TEXT NULL, \"feed_default_threads_sort\" TEXT NULL, \"feed_default_microblog_sort\" TEXT NULL, \"feed_default_combined_sort\" TEXT NULL, \"feed_default_explore_sort\" TEXT NULL, \"feed_default_comment_sort\" TEXT NULL, \"feed_default_hide_read_posts\" INTEGER NULL CHECK (\"feed_default_hide_read_posts\" IN (0, 1)), \"feed_action_back_to_top\" TEXT NULL, \"feed_action_create_new\" TEXT NULL, \"feed_action_expand_fab\" TEXT NULL, \"feed_action_refresh\" TEXT NULL, \"feed_action_set_filter\" TEXT NULL, \"feed_action_set_sort\" TEXT NULL, \"feed_action_set_view\" TEXT NULL, \"feed_action_hide_read_posts\" TEXT NULL, \"enable_swipe_actions\" INTEGER NULL CHECK (\"enable_swipe_actions\" IN (0, 1)), \"swipe_action_left_short\" TEXT NULL, \"swipe_action_left_long\" TEXT NULL, \"swipe_action_right_short\" TEXT NULL, \"swipe_action_right_long\" TEXT NULL, \"swipe_action_threshold\" REAL NULL, \"filter_lists\" TEXT NULL, \"show_errors\" INTEGER NULL CHECK (\"show_errors\" IN (0, 1)), PRIMARY KEY (\"name\"));" + } + ] + }, + { + "name": "stars", + "sql": [ + { + "dialect": "sqlite", + "sql": "CREATE TABLE IF NOT EXISTS \"stars\" (\"id\" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, \"name\" TEXT NOT NULL);" + } + ] + }, + { + "name": "misc_cache", + "sql": [ + { + "dialect": "sqlite", + "sql": "CREATE TABLE IF NOT EXISTS \"misc_cache\" (\"id\" INTEGER NOT NULL CHECK(\"id\" = 1), \"main_profile\" TEXT NOT NULL REFERENCES profiles (name) ON DELETE SET DEFAULT, \"selected_profile\" TEXT NOT NULL REFERENCES profiles (name) ON DELETE SET DEFAULT, \"auto_select_profile\" TEXT NULL REFERENCES profiles (name) ON DELETE SET NULL, \"selected_account\" TEXT NOT NULL REFERENCES accounts (handle) ON DELETE SET DEFAULT, \"web_push_keys\" TEXT NULL, \"downloads_dir\" TEXT NULL, \"expand_nav_drawer\" INTEGER NOT NULL DEFAULT 1 CHECK (\"expand_nav_drawer\" IN (0, 1)), \"expand_nav_stars\" INTEGER NOT NULL DEFAULT 1 CHECK (\"expand_nav_stars\" IN (0, 1)), \"expand_nav_feeds\" INTEGER NOT NULL DEFAULT 1 CHECK (\"expand_nav_feeds\" IN (0, 1)), \"expand_nav_subscriptions\" INTEGER NOT NULL DEFAULT 1 CHECK (\"expand_nav_subscriptions\" IN (0, 1)), \"expand_nav_follows\" INTEGER NOT NULL DEFAULT 1 CHECK (\"expand_nav_follows\" IN (0, 1)), \"expand_nav_domains\" INTEGER NOT NULL DEFAULT 1 CHECK (\"expand_nav_domains\" IN (0, 1)), \"unifiedpush_distributor_name\" TEXT NULL, \"unifiedpush_distributor_ack\" INTEGER NOT NULL DEFAULT 0 CHECK (\"unifiedpush_distributor_ack\" IN (0, 1)), PRIMARY KEY (\"id\"));" + } + ] + }, + { + "name": "drafts", + "sql": [ + { + "dialect": "sqlite", + "sql": "CREATE TABLE IF NOT EXISTS \"drafts\" (\"id\" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, \"body\" TEXT NOT NULL, \"resource_id\" TEXT NULL, \"at\" TEXT NOT NULL DEFAULT (CURRENT_TIMESTAMP));" + } + ] + }, + { + "name": "tags", + "sql": [ + { + "dialect": "sqlite", + "sql": "CREATE TABLE IF NOT EXISTS \"tags\" (\"id\" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, \"tag\" TEXT NOT NULL UNIQUE, \"background_color\" INTEGER NOT NULL, \"text_color\" INTEGER NOT NULL);" + } + ] + }, + { + "name": "user_tags", + "sql": [ + { + "dialect": "sqlite", + "sql": "CREATE TABLE IF NOT EXISTS \"user_tags\" (\"user\" TEXT NOT NULL, \"tag_id\" INTEGER NOT NULL REFERENCES tags (id) ON DELETE CASCADE, PRIMARY KEY (\"user\", \"tag_id\"));" + } + ] + }, + { + "name": "account_unifiedpushToken", + "sql": [ + { + "dialect": "sqlite", + "sql": "CREATE INDEX account_unifiedpushToken ON accounts (unifiedpush_token)" + } + ] + } + ] +} \ No newline at end of file diff --git a/lib/src/controller/profile.dart b/lib/src/controller/profile.dart index 941e112b..701ee045 100644 --- a/lib/src/controller/profile.dart +++ b/lib/src/controller/profile.dart @@ -47,6 +47,7 @@ abstract class ProfileRequired with _$ProfileRequired { required FlexScheme colorScheme, required bool enableTrueBlack, required PostMode postMode, + required bool splitVotes, required bool hideActionButtons, required bool hideFeedUIOnScroll, required double globalTextScale, @@ -130,6 +131,7 @@ abstract class ProfileRequired with _$ProfileRequired { colorScheme: profile?.colorScheme ?? defaultProfile.colorScheme, enableTrueBlack: profile?.enableTrueBlack ?? defaultProfile.enableTrueBlack, postMode: profile?.postMode ?? defaultProfile.postMode, + splitVotes: profile?.splitVotes ?? defaultProfile.splitVotes, hideActionButtons: profile?.hideActionButtons ?? defaultProfile.hideActionButtons, hideFeedUIOnScroll: @@ -227,6 +229,7 @@ abstract class ProfileRequired with _$ProfileRequired { colorScheme: FlexScheme.custom, enableTrueBlack: false, postMode: PostMode.card, + splitVotes: false, hideActionButtons: false, hideFeedUIOnScroll: false, globalTextScale: 1, @@ -309,6 +312,7 @@ abstract class ProfileOptional required FlexScheme? colorScheme, required bool? enableTrueBlack, required PostMode? postMode, + required bool? splitVotes, required bool? hideActionButtons, required bool? hideFeedUIOnScroll, required double? globalTextScale, @@ -381,6 +385,7 @@ abstract class ProfileOptional colorScheme: Value(colorScheme), enableTrueBlack: Value(enableTrueBlack), postMode: Value(postMode), + splitVotes: Value(splitVotes), hideActionButtons: Value(hideActionButtons), hideFeedUIOnScroll: Value(hideFeedUIOnScroll), globalTextScale: Value(globalTextScale), @@ -446,6 +451,7 @@ abstract class ProfileOptional colorScheme: null, enableTrueBlack: null, postMode: null, + splitVotes: null, hideActionButtons: null, hideFeedUIOnScroll: null, globalTextScale: null, @@ -514,6 +520,7 @@ abstract class ProfileOptional colorScheme: other.colorScheme ?? colorScheme, enableTrueBlack: other.enableTrueBlack ?? enableTrueBlack, postMode: other.postMode ?? postMode, + splitVotes: other.splitVotes ?? splitVotes, hideActionButtons: other.hideActionButtons ?? hideActionButtons, hideFeedUIOnScroll: other.hideFeedUIOnScroll ?? hideFeedUIOnScroll, globalTextScale: other.globalTextScale ?? globalTextScale, diff --git a/lib/src/screens/settings/display_screen.dart b/lib/src/screens/settings/display_screen.dart index 058bfd8e..146c6737 100644 --- a/lib/src/screens/settings/display_screen.dart +++ b/lib/src/screens/settings/display_screen.dart @@ -107,6 +107,15 @@ class DisplaySettingsScreen extends StatelessWidget { title: Text(l(context).settings_postLayoutOrder), onTap: () => context.router.push(const PostLayoutSettingsRoute()), ), + ListTileSwitch( + leading: const Icon(Symbols.arrow_upward_rounded), + title: Text(l(context).settings_splitVotes), + subtitle: Text(l(context).settings_splitVotes_help), + value: ac.profile.splitVotes, + onChanged: (newValue) => ac.updateProfile( + ac.selectedProfileValue.copyWith(splitVotes: newValue), + ), + ), ListTileSwitch( leading: const Icon(Symbols.view_day_rounded), title: Text(l(context).settings_hideActionButtons), diff --git a/lib/src/widgets/content_item/action_buttons.dart b/lib/src/widgets/content_item/action_buttons.dart index a8f2e158..53f9007a 100644 --- a/lib/src/widgets/content_item/action_buttons.dart +++ b/lib/src/widgets/content_item/action_buttons.dart @@ -92,16 +92,19 @@ class ActionButtons extends StatelessWidget { onSelect: (emoji) => onEmojiReact!(emoji), ), if (boosts != null) - Row( - mainAxisSize: MainAxisSize.min, - children: [ - IconButton( - onPressed: onBoost, - color: isBoosted ? Colors.purple.shade400 : null, - icon: const Icon(Symbols.rocket_launch_rounded), - ), - Text(intFormat(boosts!)), - ], + Padding( + padding: const EdgeInsets.fromLTRB(0, 0, 16, 0), + child: Row( + mainAxisSize: MainAxisSize.min, + children: [ + IconButton( + onPressed: onBoost, + color: isBoosted ? Colors.purple.shade400 : null, + icon: const Icon(Symbols.rocket_launch_rounded), + ), + Text(intFormat(boosts!)), + ], + ), ), if (upVotes != null) IconButton( @@ -109,19 +112,22 @@ class ActionButtons extends StatelessWidget { color: isUpvoted ? Colors.green.shade400 : null, icon: const Icon(Symbols.arrow_upward_rounded), ), - Text(intFormat((upVotes ?? 0) - (downVotes ?? 0))), + if (!ac.profile.splitVotes) + Text(intFormat((upVotes ?? 0) - (downVotes ?? 0))), + if (ac.profile.splitVotes) Text(intFormat(upVotes ?? 0)), if (downVotes != null) IconButton( onPressed: onDownVote, color: isDownvoted ? Colors.red.shade400 : null, icon: const Icon(Symbols.arrow_downward_rounded), ), + if (ac.profile.splitVotes) Text(intFormat(downVotes ?? 0)), ], ); - return LayoutBuilder( - builder: (context, constraints) => - Row(children: [comments, const Spacer(), ?bookmarks, voting]), + return Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [comments, const Spacer(), ?bookmarks, voting], ); } }