Skip to content

High performance self-hosted photo and video management solution.

fix: mobile edit handling (#25315)

Brandon Wees1b56bb84f941
diff --git a/mobile/drift_schemas/main/drift_schema_v17.json b/mobile/drift_schemas/main/drift_schema_v17.json
new file mode 100644
index 0000000000..a26b7b57ad
--- /dev/null
+++ b/mobile/drift_schemas/main/drift_schema_v17.json
@@ -0,0 +1 @@
+{"_meta":{"description":"This file contains a serialized version of schema entities for drift.","version":"1.2.0"},"options":{"store_date_time_values_as_text":true},"entities":[{"id":0,"references":[],"type":"table","data":{"name":"user_entity","was_declared_in_moor":false,"columns":[{"name":"id","getter_name":"id","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"name","getter_name":"name","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"email","getter_name":"email","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"has_profile_image","getter_name":"hasProfileImage","moor_type":"bool","nullable":false,"customConstraints":null,"defaultConstraints":"CHECK (\"has_profile_image\" IN (0, 1))","dialectAwareDefaultConstraints":{"sqlite":"CHECK (\"has_profile_image\" IN (0, 1))"},"default_dart":"const CustomExpression('0')","default_client_dart":null,"dsl_features":[]},{"name":"profile_changed_at","getter_name":"profileChangedAt","moor_type":"dateTime","nullable":false,"customConstraints":null,"default_dart":"const CustomExpression('CURRENT_TIMESTAMP')","default_client_dart":null,"dsl_features":[]},{"name":"avatar_color","getter_name":"avatarColor","moor_type":"int","nullable":false,"customConstraints":null,"default_dart":"const CustomExpression('0')","default_client_dart":null,"dsl_features":[],"type_converter":{"dart_expr":"const EnumIndexConverter<AvatarColor>(AvatarColor.values)","dart_type_name":"AvatarColor"}}],"is_virtual":false,"without_rowid":true,"constraints":[],"strict":true,"explicit_pk":["id"]}},{"id":1,"references":[0],"type":"table","data":{"name":"remote_asset_entity","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":[]},{"name":"type","getter_name":"type","moor_type":"int","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[],"type_converter":{"dart_expr":"const EnumIndexConverter<AssetType>(AssetType.values)","dart_type_name":"AssetType"}},{"name":"created_at","getter_name":"createdAt","moor_type":"dateTime","nullable":false,"customConstraints":null,"default_dart":"const CustomExpression('CURRENT_TIMESTAMP')","default_client_dart":null,"dsl_features":[]},{"name":"updated_at","getter_name":"updatedAt","moor_type":"dateTime","nullable":false,"customConstraints":null,"default_dart":"const CustomExpression('CURRENT_TIMESTAMP')","default_client_dart":null,"dsl_features":[]},{"name":"width","getter_name":"width","moor_type":"int","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"height","getter_name":"height","moor_type":"int","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"duration_in_seconds","getter_name":"durationInSeconds","moor_type":"int","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"id","getter_name":"id","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"checksum","getter_name":"checksum","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"is_favorite","getter_name":"isFavorite","moor_type":"bool","nullable":false,"customConstraints":null,"defaultConstraints":"CHECK (\"is_favorite\" IN (0, 1))","dialectAwareDefaultConstraints":{"sqlite":"CHECK (\"is_favorite\" IN (0, 1))"},"default_dart":"const CustomExpression('0')","default_client_dart":null,"dsl_features":[]},{"name":"owner_id","getter_name":"ownerId","moor_type":"string","nullable":false,"customConstraints":null,"defaultConstraints":"REFERENCES user_entity (id) ON DELETE CASCADE","dialectAwareDefaultConstraints":{"sqlite":"REFERENCES user_entity (id) ON DELETE CASCADE"},"default_dart":null,"default_client_dart":null,"dsl_features":["unknown"]},{"name":"local_date_time","getter_name":"localDateTime","moor_type":"dateTime","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"thumb_hash","getter_name":"thumbHash","moor_type":"string","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"deleted_at","getter_name":"deletedAt","moor_type":"dateTime","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"live_photo_video_id","getter_name":"livePhotoVideoId","moor_type":"string","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"visibility","getter_name":"visibility","moor_type":"int","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[],"type_converter":{"dart_expr":"const EnumIndexConverter<AssetVisibility>(AssetVisibility.values)","dart_type_name":"AssetVisibility"}},{"name":"stack_id","getter_name":"stackId","moor_type":"string","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"library_id","getter_name":"libraryId","moor_type":"string","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"is_edited","getter_name":"isEdited","moor_type":"bool","nullable":false,"customConstraints":null,"defaultConstraints":"CHECK (\"is_edited\" IN (0, 1))","dialectAwareDefaultConstraints":{"sqlite":"CHECK (\"is_edited\" IN (0, 1))"},"default_dart":"const CustomExpression('0')","default_client_dart":null,"dsl_features":[]}],"is_virtual":false,"without_rowid":true,"constraints":[],"strict":true,"explicit_pk":["id"]}},{"id":2,"references":[0],"type":"table","data":{"name":"stack_entity","was_declared_in_moor":false,"columns":[{"name":"id","getter_name":"id","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"created_at","getter_name":"createdAt","moor_type":"dateTime","nullable":false,"customConstraints":null,"default_dart":"const CustomExpression('CURRENT_TIMESTAMP')","default_client_dart":null,"dsl_features":[]},{"name":"updated_at","getter_name":"updatedAt","moor_type":"dateTime","nullable":false,"customConstraints":null,"default_dart":"const CustomExpression('CURRENT_TIMESTAMP')","default_client_dart":null,"dsl_features":[]},{"name":"owner_id","getter_name":"ownerId","moor_type":"string","nullable":false,"customConstraints":null,"defaultConstraints":"REFERENCES user_entity (id) ON DELETE CASCADE","dialectAwareDefaultConstraints":{"sqlite":"REFERENCES user_entity (id) ON DELETE CASCADE"},"default_dart":null,"default_client_dart":null,"dsl_features":["unknown"]},{"name":"primary_asset_id","getter_name":"primaryAssetId","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]}],"is_virtual":false,"without_rowid":true,"constraints":[],"strict":true,"explicit_pk":["id"]}},{"id":3,"references":[],"type":"table","data":{"name":"local_asset_entity","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":[]},{"name":"type","getter_name":"type","moor_type":"int","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[],"type_converter":{"dart_expr":"const EnumIndexConverter<AssetType>(AssetType.values)","dart_type_name":"AssetType"}},{"name":"created_at","getter_name":"createdAt","moor_type":"dateTime","nullable":false,"customConstraints":null,"default_dart":"const CustomExpression('CURRENT_TIMESTAMP')","default_client_dart":null,"dsl_features":[]},{"name":"updated_at","getter_name":"updatedAt","moor_type":"dateTime","nullable":false,"customConstraints":null,"default_dart":"const CustomExpression('CURRENT_TIMESTAMP')","default_client_dart":null,"dsl_features":[]},{"name":"width","getter_name":"width","moor_type":"int","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"height","getter_name":"height","moor_type":"int","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"duration_in_seconds","getter_name":"durationInSeconds","moor_type":"int","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"id","getter_name":"id","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"checksum","getter_name":"checksum","moor_type":"string","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"is_favorite","getter_name":"isFavorite","moor_type":"bool","nullable":false,"customConstraints":null,"defaultConstraints":"CHECK (\"is_favorite\" IN (0, 1))","dialectAwareDefaultConstraints":{"sqlite":"CHECK (\"is_favorite\" IN (0, 1))"},"default_dart":"const CustomExpression('0')","default_client_dart":null,"dsl_features":[]},{"name":"orientation","getter_name":"orientation","moor_type":"int","nullable":false,"customConstraints":null,"default_dart":"const CustomExpression('0')","default_client_dart":null,"dsl_features":[]},{"name":"i_cloud_id","getter_name":"iCloudId","moor_type":"string","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"adjustment_time","getter_name":"adjustmentTime","moor_type":"dateTime","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"latitude","getter_name":"latitude","moor_type":"double","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"longitude","getter_name":"longitude","moor_type":"double","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]}],"is_virtual":false,"without_rowid":true,"constraints":[],"strict":true,"explicit_pk":["id"]}},{"id":4,"references":[0,1],"type":"table","data":{"name":"remote_album_entity","was_declared_in_moor":false,"columns":[{"name":"id","getter_name":"id","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"name","getter_name":"name","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"description","getter_name":"description","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":"const CustomExpression('\\'\\'')","default_client_dart":null,"dsl_features":[]},{"name":"created_at","getter_name":"createdAt","moor_type":"dateTime","nullable":false,"customConstraints":null,"default_dart":"const CustomExpression('CURRENT_TIMESTAMP')","default_client_dart":null,"dsl_features":[]},{"name":"updated_at","getter_name":"updatedAt","moor_type":"dateTime","nullable":false,"customConstraints":null,"default_dart":"const CustomExpression('CURRENT_TIMESTAMP')","default_client_dart":null,"dsl_features":[]},{"name":"owner_id","getter_name":"ownerId","moor_type":"string","nullable":false,"customConstraints":null,"defaultConstraints":"REFERENCES user_entity (id) ON DELETE CASCADE","dialectAwareDefaultConstraints":{"sqlite":"REFERENCES user_entity (id) ON DELETE CASCADE"},"default_dart":null,"default_client_dart":null,"dsl_features":["unknown"]},{"name":"thumbnail_asset_id","getter_name":"thumbnailAssetId","moor_type":"string","nullable":true,"customConstraints":null,"defaultConstraints":"REFERENCES remote_asset_entity (id) ON DELETE SET NULL","dialectAwareDefaultConstraints":{"sqlite":"REFERENCES remote_asset_entity (id) ON DELETE SET NULL"},"default_dart":null,"default_client_dart":null,"dsl_features":["unknown"]},{"name":"is_activity_enabled","getter_name":"isActivityEnabled","moor_type":"bool","nullable":false,"customConstraints":null,"defaultConstraints":"CHECK (\"is_activity_enabled\" IN (0, 1))","dialectAwareDefaultConstraints":{"sqlite":"CHECK (\"is_activity_enabled\" IN (0, 1))"},"default_dart":"const CustomExpression('1')","default_client_dart":null,"dsl_features":[]},{"name":"order","getter_name":"order","moor_type":"int","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[],"type_converter":{"dart_expr":"const EnumIndexConverter<AlbumAssetOrder>(AlbumAssetOrder.values)","dart_type_name":"AlbumAssetOrder"}}],"is_virtual":false,"without_rowid":true,"constraints":[],"strict":true,"explicit_pk":["id"]}},{"id":5,"references":[4],"type":"table","data":{"name":"local_album_entity","was_declared_in_moor":false,"columns":[{"name":"id","getter_name":"id","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"name","getter_name":"name","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"updated_at","getter_name":"updatedAt","moor_type":"dateTime","nullable":false,"customConstraints":null,"default_dart":"const CustomExpression('CURRENT_TIMESTAMP')","default_client_dart":null,"dsl_features":[]},{"name":"backup_selection","getter_name":"backupSelection","moor_type":"int","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[],"type_converter":{"dart_expr":"const EnumIndexConverter<BackupSelection>(BackupSelection.values)","dart_type_name":"BackupSelection"}},{"name":"is_ios_shared_album","getter_name":"isIosSharedAlbum","moor_type":"bool","nullable":false,"customConstraints":null,"defaultConstraints":"CHECK (\"is_ios_shared_album\" IN (0, 1))","dialectAwareDefaultConstraints":{"sqlite":"CHECK (\"is_ios_shared_album\" IN (0, 1))"},"default_dart":"const CustomExpression('0')","default_client_dart":null,"dsl_features":[]},{"name":"linked_remote_album_id","getter_name":"linkedRemoteAlbumId","moor_type":"string","nullable":true,"customConstraints":null,"defaultConstraints":"REFERENCES remote_album_entity (id) ON DELETE SET NULL","dialectAwareDefaultConstraints":{"sqlite":"REFERENCES remote_album_entity (id) ON DELETE SET NULL"},"default_dart":null,"default_client_dart":null,"dsl_features":["unknown"]},{"name":"marker","getter_name":"marker_","moor_type":"bool","nullable":true,"customConstraints":null,"defaultConstraints":"CHECK (\"marker\" IN (0, 1))","dialectAwareDefaultConstraints":{"sqlite":"CHECK (\"marker\" IN (0, 1))"},"default_dart":null,"default_client_dart":null,"dsl_features":[]}],"is_virtual":false,"without_rowid":true,"constraints":[],"strict":true,"explicit_pk":["id"]}},{"id":6,"references":[3,5],"type":"table","data":{"name":"local_album_asset_entity","was_declared_in_moor":false,"columns":[{"name":"asset_id","getter_name":"assetId","moor_type":"string","nullable":false,"customConstraints":null,"defaultConstraints":"REFERENCES local_asset_entity (id) ON DELETE CASCADE","dialectAwareDefaultConstraints":{"sqlite":"REFERENCES local_asset_entity (id) ON DELETE CASCADE"},"default_dart":null,"default_client_dart":null,"dsl_features":["unknown"]},{"name":"album_id","getter_name":"albumId","moor_type":"string","nullable":false,"customConstraints":null,"defaultConstraints":"REFERENCES local_album_entity (id) ON DELETE CASCADE","dialectAwareDefaultConstraints":{"sqlite":"REFERENCES local_album_entity (id) ON DELETE CASCADE"},"default_dart":null,"default_client_dart":null,"dsl_features":["unknown"]},{"name":"marker","getter_name":"marker_","moor_type":"bool","nullable":true,"customConstraints":null,"defaultConstraints":"CHECK (\"marker\" IN (0, 1))","dialectAwareDefaultConstraints":{"sqlite":"CHECK (\"marker\" IN (0, 1))"},"default_dart":null,"default_client_dart":null,"dsl_features":[]}],"is_virtual":false,"without_rowid":true,"constraints":[],"strict":true,"explicit_pk":["asset_id","album_id"]}},{"id":7,"references":[3],"type":"index","data":{"on":3,"name":"idx_local_asset_checksum","sql":"CREATE INDEX IF NOT EXISTS idx_local_asset_checksum ON local_asset_entity (checksum)","unique":false,"columns":[]}},{"id":8,"references":[3],"type":"index","data":{"on":3,"name":"idx_local_asset_cloud_id","sql":"CREATE INDEX IF NOT EXISTS idx_local_asset_cloud_id ON local_asset_entity (i_cloud_id)","unique":false,"columns":[]}},{"id":9,"references":[1],"type":"index","data":{"on":1,"name":"idx_remote_asset_owner_checksum","sql":"CREATE INDEX IF NOT EXISTS idx_remote_asset_owner_checksum ON remote_asset_entity (owner_id, checksum)","unique":false,"columns":[]}},{"id":10,"references":[1],"type":"index","data":{"on":1,"name":"UQ_remote_assets_owner_checksum","sql":"CREATE UNIQUE INDEX IF NOT EXISTS UQ_remote_assets_owner_checksum\nON remote_asset_entity (owner_id, checksum)\nWHERE (library_id IS NULL);\n","unique":true,"columns":[]}},{"id":11,"references":[1],"type":"index","data":{"on":1,"name":"UQ_remote_assets_owner_library_checksum","sql":"CREATE UNIQUE INDEX IF NOT EXISTS UQ_remote_assets_owner_library_checksum\nON remote_asset_entity (owner_id, library_id, checksum)\nWHERE (library_id IS NOT NULL);\n","unique":true,"columns":[]}},{"id":12,"references":[1],"type":"index","data":{"on":1,"name":"idx_remote_asset_checksum","sql":"CREATE INDEX IF NOT EXISTS idx_remote_asset_checksum ON remote_asset_entity (checksum)","unique":false,"columns":[]}},{"id":13,"references":[],"type":"table","data":{"name":"auth_user_entity","was_declared_in_moor":false,"columns":[{"name":"id","getter_name":"id","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"name","getter_name":"name","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"email","getter_name":"email","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"is_admin","getter_name":"isAdmin","moor_type":"bool","nullable":false,"customConstraints":null,"defaultConstraints":"CHECK (\"is_admin\" IN (0, 1))","dialectAwareDefaultConstraints":{"sqlite":"CHECK (\"is_admin\" IN (0, 1))"},"default_dart":"const CustomExpression('0')","default_client_dart":null,"dsl_features":[]},{"name":"has_profile_image","getter_name":"hasProfileImage","moor_type":"bool","nullable":false,"customConstraints":null,"defaultConstraints":"CHECK (\"has_profile_image\" IN (0, 1))","dialectAwareDefaultConstraints":{"sqlite":"CHECK (\"has_profile_image\" IN (0, 1))"},"default_dart":"const CustomExpression('0')","default_client_dart":null,"dsl_features":[]},{"name":"profile_changed_at","getter_name":"profileChangedAt","moor_type":"dateTime","nullable":false,"customConstraints":null,"default_dart":"const CustomExpression('CURRENT_TIMESTAMP')","default_client_dart":null,"dsl_features":[]},{"name":"avatar_color","getter_name":"avatarColor","moor_type":"int","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[],"type_converter":{"dart_expr":"const EnumIndexConverter<AvatarColor>(AvatarColor.values)","dart_type_name":"AvatarColor"}},{"name":"quota_size_in_bytes","getter_name":"quotaSizeInBytes","moor_type":"int","nullable":false,"customConstraints":null,"default_dart":"const CustomExpression('0')","default_client_dart":null,"dsl_features":[]},{"name":"quota_usage_in_bytes","getter_name":"quotaUsageInBytes","moor_type":"int","nullable":false,"customConstraints":null,"default_dart":"const CustomExpression('0')","default_client_dart":null,"dsl_features":[]},{"name":"pin_code","getter_name":"pinCode","moor_type":"string","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]}],"is_virtual":false,"without_rowid":true,"constraints":[],"strict":true,"explicit_pk":["id"]}},{"id":14,"references":[0],"type":"table","data":{"name":"user_metadata_entity","was_declared_in_moor":false,"columns":[{"name":"user_id","getter_name":"userId","moor_type":"string","nullable":false,"customConstraints":null,"defaultConstraints":"REFERENCES user_entity (id) ON DELETE CASCADE","dialectAwareDefaultConstraints":{"sqlite":"REFERENCES user_entity (id) ON DELETE CASCADE"},"default_dart":null,"default_client_dart":null,"dsl_features":["unknown"]},{"name":"key","getter_name":"key","moor_type":"int","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[],"type_converter":{"dart_expr":"const EnumIndexConverter<UserMetadataKey>(UserMetadataKey.values)","dart_type_name":"UserMetadataKey"}},{"name":"value","getter_name":"value","moor_type":"blob","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[],"type_converter":{"dart_expr":"userMetadataConverter","dart_type_name":"Map<String, Object?>"}}],"is_virtual":false,"without_rowid":true,"constraints":[],"strict":true,"explicit_pk":["user_id","key"]}},{"id":15,"references":[0],"type":"table","data":{"name":"partner_entity","was_declared_in_moor":false,"columns":[{"name":"shared_by_id","getter_name":"sharedById","moor_type":"string","nullable":false,"customConstraints":null,"defaultConstraints":"REFERENCES user_entity (id) ON DELETE CASCADE","dialectAwareDefaultConstraints":{"sqlite":"REFERENCES user_entity (id) ON DELETE CASCADE"},"default_dart":null,"default_client_dart":null,"dsl_features":["unknown"]},{"name":"shared_with_id","getter_name":"sharedWithId","moor_type":"string","nullable":false,"customConstraints":null,"defaultConstraints":"REFERENCES user_entity (id) ON DELETE CASCADE","dialectAwareDefaultConstraints":{"sqlite":"REFERENCES user_entity (id) ON DELETE CASCADE"},"default_dart":null,"default_client_dart":null,"dsl_features":["unknown"]},{"name":"in_timeline","getter_name":"inTimeline","moor_type":"bool","nullable":false,"customConstraints":null,"defaultConstraints":"CHECK (\"in_timeline\" IN (0, 1))","dialectAwareDefaultConstraints":{"sqlite":"CHECK (\"in_timeline\" IN (0, 1))"},"default_dart":"const CustomExpression('0')","default_client_dart":null,"dsl_features":[]}],"is_virtual":false,"without_rowid":true,"constraints":[],"strict":true,"explicit_pk":["shared_by_id","shared_with_id"]}},{"id":16,"references":[1],"type":"table","data":{"name":"remote_exif_entity","was_declared_in_moor":false,"columns":[{"name":"asset_id","getter_name":"assetId","moor_type":"string","nullable":false,"customConstraints":null,"defaultConstraints":"REFERENCES remote_asset_entity (id) ON DELETE CASCADE","dialectAwareDefaultConstraints":{"sqlite":"REFERENCES remote_asset_entity (id) ON DELETE CASCADE"},"default_dart":null,"default_client_dart":null,"dsl_features":["unknown"]},{"name":"city","getter_name":"city","moor_type":"string","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"state","getter_name":"state","moor_type":"string","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"country","getter_name":"country","moor_type":"string","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"date_time_original","getter_name":"dateTimeOriginal","moor_type":"dateTime","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"description","getter_name":"description","moor_type":"string","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"height","getter_name":"height","moor_type":"int","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"width","getter_name":"width","moor_type":"int","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"exposure_time","getter_name":"exposureTime","moor_type":"string","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"f_number","getter_name":"fNumber","moor_type":"double","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"file_size","getter_name":"fileSize","moor_type":"int","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"focal_length","getter_name":"focalLength","moor_type":"double","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"latitude","getter_name":"latitude","moor_type":"double","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"longitude","getter_name":"longitude","moor_type":"double","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"iso","getter_name":"iso","moor_type":"int","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"make","getter_name":"make","moor_type":"string","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"model","getter_name":"model","moor_type":"string","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"lens","getter_name":"lens","moor_type":"string","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"orientation","getter_name":"orientation","moor_type":"string","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"time_zone","getter_name":"timeZone","moor_type":"string","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"rating","getter_name":"rating","moor_type":"int","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"projection_type","getter_name":"projectionType","moor_type":"string","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]}],"is_virtual":false,"without_rowid":true,"constraints":[],"strict":true,"explicit_pk":["asset_id"]}},{"id":17,"references":[1,4],"type":"table","data":{"name":"remote_album_asset_entity","was_declared_in_moor":false,"columns":[{"name":"asset_id","getter_name":"assetId","moor_type":"string","nullable":false,"customConstraints":null,"defaultConstraints":"REFERENCES remote_asset_entity (id) ON DELETE CASCADE","dialectAwareDefaultConstraints":{"sqlite":"REFERENCES remote_asset_entity (id) ON DELETE CASCADE"},"default_dart":null,"default_client_dart":null,"dsl_features":["unknown"]},{"name":"album_id","getter_name":"albumId","moor_type":"string","nullable":false,"customConstraints":null,"defaultConstraints":"REFERENCES remote_album_entity (id) ON DELETE CASCADE","dialectAwareDefaultConstraints":{"sqlite":"REFERENCES remote_album_entity (id) ON DELETE CASCADE"},"default_dart":null,"default_client_dart":null,"dsl_features":["unknown"]}],"is_virtual":false,"without_rowid":true,"constraints":[],"strict":true,"explicit_pk":["asset_id","album_id"]}},{"id":18,"references":[4,0],"type":"table","data":{"name":"remote_album_user_entity","was_declared_in_moor":false,"columns":[{"name":"album_id","getter_name":"albumId","moor_type":"string","nullable":false,"customConstraints":null,"defaultConstraints":"REFERENCES remote_album_entity (id) ON DELETE CASCADE","dialectAwareDefaultConstraints":{"sqlite":"REFERENCES remote_album_entity (id) ON DELETE CASCADE"},"default_dart":null,"default_client_dart":null,"dsl_features":["unknown"]},{"name":"user_id","getter_name":"userId","moor_type":"string","nullable":false,"customConstraints":null,"defaultConstraints":"REFERENCES user_entity (id) ON DELETE CASCADE","dialectAwareDefaultConstraints":{"sqlite":"REFERENCES user_entity (id) ON DELETE CASCADE"},"default_dart":null,"default_client_dart":null,"dsl_features":["unknown"]},{"name":"role","getter_name":"role","moor_type":"int","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[],"type_converter":{"dart_expr":"const EnumIndexConverter<AlbumUserRole>(AlbumUserRole.values)","dart_type_name":"AlbumUserRole"}}],"is_virtual":false,"without_rowid":true,"constraints":[],"strict":true,"explicit_pk":["album_id","user_id"]}},{"id":19,"references":[1],"type":"table","data":{"name":"remote_asset_cloud_id_entity","was_declared_in_moor":false,"columns":[{"name":"asset_id","getter_name":"assetId","moor_type":"string","nullable":false,"customConstraints":null,"defaultConstraints":"REFERENCES remote_asset_entity (id) ON DELETE CASCADE","dialectAwareDefaultConstraints":{"sqlite":"REFERENCES remote_asset_entity (id) ON DELETE CASCADE"},"default_dart":null,"default_client_dart":null,"dsl_features":["unknown"]},{"name":"cloud_id","getter_name":"cloudId","moor_type":"string","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"created_at","getter_name":"createdAt","moor_type":"dateTime","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"adjustment_time","getter_name":"adjustmentTime","moor_type":"dateTime","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"latitude","getter_name":"latitude","moor_type":"double","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"longitude","getter_name":"longitude","moor_type":"double","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]}],"is_virtual":false,"without_rowid":true,"constraints":[],"strict":true,"explicit_pk":["asset_id"]}},{"id":20,"references":[0],"type":"table","data":{"name":"memory_entity","was_declared_in_moor":false,"columns":[{"name":"id","getter_name":"id","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"created_at","getter_name":"createdAt","moor_type":"dateTime","nullable":false,"customConstraints":null,"default_dart":"const CustomExpression('CURRENT_TIMESTAMP')","default_client_dart":null,"dsl_features":[]},{"name":"updated_at","getter_name":"updatedAt","moor_type":"dateTime","nullable":false,"customConstraints":null,"default_dart":"const CustomExpression('CURRENT_TIMESTAMP')","default_client_dart":null,"dsl_features":[]},{"name":"deleted_at","getter_name":"deletedAt","moor_type":"dateTime","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"owner_id","getter_name":"ownerId","moor_type":"string","nullable":false,"customConstraints":null,"defaultConstraints":"REFERENCES user_entity (id) ON DELETE CASCADE","dialectAwareDefaultConstraints":{"sqlite":"REFERENCES user_entity (id) ON DELETE CASCADE"},"default_dart":null,"default_client_dart":null,"dsl_features":["unknown"]},{"name":"type","getter_name":"type","moor_type":"int","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[],"type_converter":{"dart_expr":"const EnumIndexConverter<MemoryTypeEnum>(MemoryTypeEnum.values)","dart_type_name":"MemoryTypeEnum"}},{"name":"data","getter_name":"data","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"is_saved","getter_name":"isSaved","moor_type":"bool","nullable":false,"customConstraints":null,"defaultConstraints":"CHECK (\"is_saved\" IN (0, 1))","dialectAwareDefaultConstraints":{"sqlite":"CHECK (\"is_saved\" IN (0, 1))"},"default_dart":"const CustomExpression('0')","default_client_dart":null,"dsl_features":[]},{"name":"memory_at","getter_name":"memoryAt","moor_type":"dateTime","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"seen_at","getter_name":"seenAt","moor_type":"dateTime","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"show_at","getter_name":"showAt","moor_type":"dateTime","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"hide_at","getter_name":"hideAt","moor_type":"dateTime","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]}],"is_virtual":false,"without_rowid":true,"constraints":[],"strict":true,"explicit_pk":["id"]}},{"id":21,"references":[1,20],"type":"table","data":{"name":"memory_asset_entity","was_declared_in_moor":false,"columns":[{"name":"asset_id","getter_name":"assetId","moor_type":"string","nullable":false,"customConstraints":null,"defaultConstraints":"REFERENCES remote_asset_entity (id) ON DELETE CASCADE","dialectAwareDefaultConstraints":{"sqlite":"REFERENCES remote_asset_entity (id) ON DELETE CASCADE"},"default_dart":null,"default_client_dart":null,"dsl_features":["unknown"]},{"name":"memory_id","getter_name":"memoryId","moor_type":"string","nullable":false,"customConstraints":null,"defaultConstraints":"REFERENCES memory_entity (id) ON DELETE CASCADE","dialectAwareDefaultConstraints":{"sqlite":"REFERENCES memory_entity (id) ON DELETE CASCADE"},"default_dart":null,"default_client_dart":null,"dsl_features":["unknown"]}],"is_virtual":false,"without_rowid":true,"constraints":[],"strict":true,"explicit_pk":["asset_id","memory_id"]}},{"id":22,"references":[0],"type":"table","data":{"name":"person_entity","was_declared_in_moor":false,"columns":[{"name":"id","getter_name":"id","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"created_at","getter_name":"createdAt","moor_type":"dateTime","nullable":false,"customConstraints":null,"default_dart":"const CustomExpression('CURRENT_TIMESTAMP')","default_client_dart":null,"dsl_features":[]},{"name":"updated_at","getter_name":"updatedAt","moor_type":"dateTime","nullable":false,"customConstraints":null,"default_dart":"const CustomExpression('CURRENT_TIMESTAMP')","default_client_dart":null,"dsl_features":[]},{"name":"owner_id","getter_name":"ownerId","moor_type":"string","nullable":false,"customConstraints":null,"defaultConstraints":"REFERENCES user_entity (id) ON DELETE CASCADE","dialectAwareDefaultConstraints":{"sqlite":"REFERENCES user_entity (id) ON DELETE CASCADE"},"default_dart":null,"default_client_dart":null,"dsl_features":["unknown"]},{"name":"name","getter_name":"name","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"face_asset_id","getter_name":"faceAssetId","moor_type":"string","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"is_favorite","getter_name":"isFavorite","moor_type":"bool","nullable":false,"customConstraints":null,"defaultConstraints":"CHECK (\"is_favorite\" IN (0, 1))","dialectAwareDefaultConstraints":{"sqlite":"CHECK (\"is_favorite\" IN (0, 1))"},"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"is_hidden","getter_name":"isHidden","moor_type":"bool","nullable":false,"customConstraints":null,"defaultConstraints":"CHECK (\"is_hidden\" IN (0, 1))","dialectAwareDefaultConstraints":{"sqlite":"CHECK (\"is_hidden\" IN (0, 1))"},"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"color","getter_name":"color","moor_type":"string","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"birth_date","getter_name":"birthDate","moor_type":"dateTime","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]}],"is_virtual":false,"without_rowid":true,"constraints":[],"strict":true,"explicit_pk":["id"]}},{"id":23,"references":[1,22],"type":"table","data":{"name":"asset_face_entity","was_declared_in_moor":false,"columns":[{"name":"id","getter_name":"id","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"asset_id","getter_name":"assetId","moor_type":"string","nullable":false,"customConstraints":null,"defaultConstraints":"REFERENCES remote_asset_entity (id) ON DELETE CASCADE","dialectAwareDefaultConstraints":{"sqlite":"REFERENCES remote_asset_entity (id) ON DELETE CASCADE"},"default_dart":null,"default_client_dart":null,"dsl_features":["unknown"]},{"name":"person_id","getter_name":"personId","moor_type":"string","nullable":true,"customConstraints":null,"defaultConstraints":"REFERENCES person_entity (id) ON DELETE SET NULL","dialectAwareDefaultConstraints":{"sqlite":"REFERENCES person_entity (id) ON DELETE SET NULL"},"default_dart":null,"default_client_dart":null,"dsl_features":["unknown"]},{"name":"image_width","getter_name":"imageWidth","moor_type":"int","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"image_height","getter_name":"imageHeight","moor_type":"int","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"bounding_box_x1","getter_name":"boundingBoxX1","moor_type":"int","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"bounding_box_y1","getter_name":"boundingBoxY1","moor_type":"int","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"bounding_box_x2","getter_name":"boundingBoxX2","moor_type":"int","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"bounding_box_y2","getter_name":"boundingBoxY2","moor_type":"int","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"source_type","getter_name":"sourceType","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]}],"is_virtual":false,"without_rowid":true,"constraints":[],"strict":true,"explicit_pk":["id"]}},{"id":24,"references":[],"type":"table","data":{"name":"store_entity","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":[]},{"name":"string_value","getter_name":"stringValue","moor_type":"string","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"int_value","getter_name":"intValue","moor_type":"int","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]}],"is_virtual":false,"without_rowid":true,"constraints":[],"strict":true,"explicit_pk":["id"]}},{"id":25,"references":[],"type":"table","data":{"name":"trashed_local_asset_entity","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":[]},{"name":"type","getter_name":"type","moor_type":"int","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[],"type_converter":{"dart_expr":"const EnumIndexConverter<AssetType>(AssetType.values)","dart_type_name":"AssetType"}},{"name":"created_at","getter_name":"createdAt","moor_type":"dateTime","nullable":false,"customConstraints":null,"default_dart":"const CustomExpression('CURRENT_TIMESTAMP')","default_client_dart":null,"dsl_features":[]},{"name":"updated_at","getter_name":"updatedAt","moor_type":"dateTime","nullable":false,"customConstraints":null,"default_dart":"const CustomExpression('CURRENT_TIMESTAMP')","default_client_dart":null,"dsl_features":[]},{"name":"width","getter_name":"width","moor_type":"int","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"height","getter_name":"height","moor_type":"int","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"duration_in_seconds","getter_name":"durationInSeconds","moor_type":"int","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"id","getter_name":"id","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"album_id","getter_name":"albumId","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"checksum","getter_name":"checksum","moor_type":"string","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"is_favorite","getter_name":"isFavorite","moor_type":"bool","nullable":false,"customConstraints":null,"defaultConstraints":"CHECK (\"is_favorite\" IN (0, 1))","dialectAwareDefaultConstraints":{"sqlite":"CHECK (\"is_favorite\" IN (0, 1))"},"default_dart":"const CustomExpression('0')","default_client_dart":null,"dsl_features":[]},{"name":"orientation","getter_name":"orientation","moor_type":"int","nullable":false,"customConstraints":null,"default_dart":"const CustomExpression('0')","default_client_dart":null,"dsl_features":[]},{"name":"source","getter_name":"source","moor_type":"int","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[],"type_converter":{"dart_expr":"const EnumIndexConverter<TrashOrigin>(TrashOrigin.values)","dart_type_name":"TrashOrigin"}}],"is_virtual":false,"without_rowid":true,"constraints":[],"strict":true,"explicit_pk":["id","album_id"]}},{"id":26,"references":[16],"type":"index","data":{"on":16,"name":"idx_lat_lng","sql":"CREATE INDEX IF NOT EXISTS idx_lat_lng ON remote_exif_entity (latitude, longitude)","unique":false,"columns":[]}},{"id":27,"references":[25],"type":"index","data":{"on":25,"name":"idx_trashed_local_asset_checksum","sql":"CREATE INDEX IF NOT EXISTS idx_trashed_local_asset_checksum ON trashed_local_asset_entity (checksum)","unique":false,"columns":[]}},{"id":28,"references":[25],"type":"index","data":{"on":25,"name":"idx_trashed_local_asset_album","sql":"CREATE INDEX IF NOT EXISTS idx_trashed_local_asset_album ON trashed_local_asset_entity (album_id)","unique":false,"columns":[]}}]}
\ No newline at end of file
diff --git a/mobile/lib/domain/models/asset/base_asset.model.dart b/mobile/lib/domain/models/asset/base_asset.model.dart
index 5774a13c90..310e30ea62 100644
--- a/mobile/lib/domain/models/asset/base_asset.model.dart
+++ b/mobile/lib/domain/models/asset/base_asset.model.dart
@@ -22,6 +22,7 @@ sealed class BaseAsset {
final int? durationInSeconds;
final bool isFavorite;
final String? livePhotoVideoId;
+ final bool isEdited;
const BaseAsset({
required this.name,
@@ -34,6 +35,7 @@ sealed class BaseAsset {
this.durationInSeconds,
this.isFavorite = false,
this.livePhotoVideoId,
+ required this.isEdited,
});
bool get isImage => type == AssetType.image;
@@ -71,6 +73,7 @@ sealed class BaseAsset {
height: ${height ?? "<NA>"},
durationInSeconds: ${durationInSeconds ?? "<NA>"},
isFavorite: $isFavorite,
+ isEdited: $isEdited,
}''';
}
@@ -85,7 +88,8 @@ sealed class BaseAsset {
width == other.width &&
height == other.height &&
durationInSeconds == other.durationInSeconds &&
- isFavorite == other.isFavorite;
+ isFavorite == other.isFavorite &&
+ isEdited == other.isEdited;
}
return false;
}
@@ -99,6 +103,7 @@ sealed class BaseAsset {
width.hashCode ^
height.hashCode ^
durationInSeconds.hashCode ^
- isFavorite.hashCode;
+ isFavorite.hashCode ^
+ isEdited.hashCode;
}
}
diff --git a/mobile/lib/domain/models/asset/local_asset.model.dart b/mobile/lib/domain/models/asset/local_asset.model.dart
index b7ef635f2d..887dfd3834 100644
--- a/mobile/lib/domain/models/asset/local_asset.model.dart
+++ b/mobile/lib/domain/models/asset/local_asset.model.dart
@@ -28,6 +28,7 @@ class LocalAsset extends BaseAsset {
this.adjustmentTime,
this.latitude,
this.longitude,
+ required super.isEdited,
}) : remoteAssetId = remoteId;
@override
@@ -107,6 +108,7 @@ class LocalAsset extends BaseAsset {
DateTime? adjustmentTime,
double? latitude,
double? longitude,
+ bool? isEdited,
}) {
return LocalAsset(
id: id ?? this.id,
@@ -125,6 +127,7 @@ class LocalAsset extends BaseAsset {
adjustmentTime: adjustmentTime ?? this.adjustmentTime,
latitude: latitude ?? this.latitude,
longitude: longitude ?? this.longitude,
+ isEdited: isEdited ?? this.isEdited,
);
}
}
diff --git a/mobile/lib/domain/models/asset/remote_asset.model.dart b/mobile/lib/domain/models/asset/remote_asset.model.dart
index 4974dc9118..43d49506e3 100644
--- a/mobile/lib/domain/models/asset/remote_asset.model.dart
+++ b/mobile/lib/domain/models/asset/remote_asset.model.dart
@@ -28,6 +28,7 @@ class RemoteAsset extends BaseAsset {
this.visibility = AssetVisibility.timeline,
super.livePhotoVideoId,
this.stackId,
+ required super.isEdited,
}) : localAssetId = localId;
@override
@@ -104,6 +105,7 @@ class RemoteAsset extends BaseAsset {
AssetVisibility? visibility,
String? livePhotoVideoId,
String? stackId,
+ bool? isEdited,
}) {
return RemoteAsset(
id: id ?? this.id,
@@ -122,6 +124,7 @@ class RemoteAsset extends BaseAsset {
visibility: visibility ?? this.visibility,
livePhotoVideoId: livePhotoVideoId ?? this.livePhotoVideoId,
stackId: stackId ?? this.stackId,
+ isEdited: isEdited ?? this.isEdited,
);
}
}
diff --git a/mobile/lib/domain/services/local_sync.service.dart b/mobile/lib/domain/services/local_sync.service.dart
index 8b324cf6cf..e4a129d322 100644
--- a/mobile/lib/domain/services/local_sync.service.dart
+++ b/mobile/lib/domain/services/local_sync.service.dart
@@ -436,5 +436,6 @@ extension PlatformToLocalAsset on PlatformAsset {
adjustmentTime: tryFromSecondsSinceEpoch(adjustmentTime, isUtc: true),
latitude: latitude,
longitude: longitude,
+ isEdited: false,
);
}
diff --git a/mobile/lib/domain/services/search.service.dart b/mobile/lib/domain/services/search.service.dart
index 6ccc5a97bf..a3f935c492 100644
--- a/mobile/lib/domain/services/search.service.dart
+++ b/mobile/lib/domain/services/search.service.dart
@@ -77,6 +77,7 @@ extension on AssetResponseDto {
thumbHash: thumbhash,
localId: null,
type: type.toAssetType(),
+ isEdited: isEdited,
);
}
}
diff --git a/mobile/lib/domain/services/sync_stream.service.dart b/mobile/lib/domain/services/sync_stream.service.dart
index e14321a780..d5029abac8 100644
--- a/mobile/lib/domain/services/sync_stream.service.dart
+++ b/mobile/lib/domain/services/sync_stream.service.dart
@@ -247,6 +247,42 @@ class SyncStreamService {
}
}
+ Future<void> handleWsAssetEditReadyV1Batch(List<dynamic> batchData) async {
+ if (batchData.isEmpty) return;
+
+ _logger.info('Processing batch of ${batchData.length} AssetEditReadyV1 events');
+
+ final List<SyncAssetV1> assets = [];
+
+ try {
+ for (final data in batchData) {
+ if (data is! Map<String, dynamic>) {
+ continue;
+ }
+
+ final payload = data;
+ final assetData = payload['asset'];
+
+ if (assetData == null) {
+ continue;
+ }
+
+ final asset = SyncAssetV1.fromJson(assetData);
+
+ if (asset != null) {
+ assets.add(asset);
+ }
+ }
+
+ if (assets.isNotEmpty) {
+ await _syncStreamRepository.updateAssetsV1(assets, debugLabel: 'websocket-edit');
+ _logger.info('Successfully processed ${assets.length} edited assets');
+ }
+ } catch (error, stackTrace) {
+ _logger.severe("Error processing AssetEditReadyV1 websocket batch events", error, stackTrace);
+ }
+ }
+
Future<void> _handleRemoteTrashed(Iterable<String> checksums) async {
if (checksums.isEmpty) {
return Future.value();
diff --git a/mobile/lib/domain/utils/background_sync.dart b/mobile/lib/domain/utils/background_sync.dart
index 637ae20cb8..6840bae595 100644
--- a/mobile/lib/domain/utils/background_sync.dart
+++ b/mobile/lib/domain/utils/background_sync.dart
@@ -196,6 +196,16 @@ class BackgroundSyncManager {
});
}
+ Future<void> syncWebsocketEditBatch(List<dynamic> batchData) {
+ if (_syncWebsocketTask != null) {
+ return _syncWebsocketTask!.future;
+ }
+ _syncWebsocketTask = _handleWsAssetEditReadyV1Batch(batchData);
+ return _syncWebsocketTask!.whenComplete(() {
+ _syncWebsocketTask = null;
+ });
+ }
+
Future<void> syncLinkedAlbum() {
if (_linkedAlbumSyncTask != null) {
return _linkedAlbumSyncTask!.future;
@@ -231,3 +241,8 @@ Cancelable<void> _handleWsAssetUploadReadyV1Batch(List<dynamic> batchData) => ru
computation: (ref) => ref.read(syncStreamServiceProvider).handleWsAssetUploadReadyV1Batch(batchData),
debugLabel: 'websocket-batch',
);
+
+Cancelable<void> _handleWsAssetEditReadyV1Batch(List<dynamic> batchData) => runInIsolateGentle(
+ computation: (ref) => ref.read(syncStreamServiceProvider).handleWsAssetEditReadyV1Batch(batchData),
+ debugLabel: 'websocket-edit',
+);
diff --git a/mobile/lib/infrastructure/entities/local_asset.entity.dart b/mobile/lib/infrastructure/entities/local_asset.entity.dart
index 6591f922ae..9d154a5013 100644
--- a/mobile/lib/infrastructure/entities/local_asset.entity.dart
+++ b/mobile/lib/infrastructure/entities/local_asset.entity.dart
@@ -47,5 +47,6 @@ extension LocalAssetEntityDataDomainExtension on LocalAssetEntityData {
latitude: latitude,
longitude: longitude,
cloudId: iCloudId,
+ isEdited: false,
);
}
diff --git a/mobile/lib/infrastructure/entities/merged_asset.drift b/mobile/lib/infrastructure/entities/merged_asset.drift
index 93d7f0c90d..1db22b558e 100644
--- a/mobile/lib/infrastructure/entities/merged_asset.drift
+++ b/mobile/lib/infrastructure/entities/merged_asset.drift
@@ -25,7 +25,8 @@ SELECT
NULL as i_cloud_id,
NULL as latitude,
NULL as longitude,
- NULL as adjustmentTime
+ NULL as adjustmentTime,
+ rae.is_edited
FROM
remote_asset_entity rae
LEFT JOIN
@@ -61,7 +62,8 @@ SELECT
lae.i_cloud_id,
lae.latitude,
lae.longitude,
- lae.adjustment_time
+ lae.adjustment_time,
+ 0 as is_edited
FROM
local_asset_entity lae
WHERE NOT EXISTS (
diff --git a/mobile/lib/infrastructure/entities/merged_asset.drift.dart b/mobile/lib/infrastructure/entities/merged_asset.drift.dart
index 169004b45d..f71aa8eb54 100644
--- a/mobile/lib/infrastructure/entities/merged_asset.drift.dart
+++ b/mobile/lib/infrastructure/entities/merged_asset.drift.dart
@@ -29,7 +29,7 @@ class MergedAssetDrift extends i1.ModularAccessor {
);
$arrayStartIndex += generatedlimit.amountOfVariables;
return customSelect(
- 'SELECT rae.id AS remote_id, (SELECT lae.id FROM local_asset_entity AS lae WHERE lae.checksum = rae.checksum LIMIT 1) AS local_id, rae.name, rae.type, rae.created_at AS created_at, rae.updated_at, rae.width, rae.height, rae.duration_in_seconds, rae.is_favorite, rae.thumb_hash, rae.checksum, rae.owner_id, rae.live_photo_video_id, 0 AS orientation, rae.stack_id, NULL AS i_cloud_id, NULL AS latitude, NULL AS longitude, NULL AS adjustmentTime FROM remote_asset_entity AS rae LEFT JOIN stack_entity AS se ON rae.stack_id = se.id WHERE rae.deleted_at IS NULL AND rae.visibility = 0 AND rae.owner_id IN ($expandeduserIds) AND(rae.stack_id IS NULL OR rae.id = se.primary_asset_id)UNION ALL SELECT NULL AS remote_id, lae.id AS local_id, lae.name, lae.type, lae.created_at AS created_at, lae.updated_at, lae.width, lae.height, lae.duration_in_seconds, lae.is_favorite, NULL AS thumb_hash, lae.checksum, NULL AS owner_id, NULL AS live_photo_video_id, lae.orientation, NULL AS stack_id, lae.i_cloud_id, lae.latitude, lae.longitude, lae.adjustment_time FROM local_asset_entity AS lae WHERE NOT EXISTS (SELECT 1 FROM remote_asset_entity AS rae WHERE rae.checksum = lae.checksum AND rae.owner_id IN ($expandeduserIds)) AND EXISTS (SELECT 1 FROM local_album_asset_entity AS laa INNER JOIN local_album_entity AS la ON laa.album_id = la.id WHERE laa.asset_id = lae.id AND la.backup_selection = 0) AND NOT EXISTS (SELECT 1 FROM local_album_asset_entity AS laa INNER JOIN local_album_entity AS la ON laa.album_id = la.id WHERE laa.asset_id = lae.id AND la.backup_selection = 2) ORDER BY created_at DESC ${generatedlimit.sql}',
+ 'SELECT rae.id AS remote_id, (SELECT lae.id FROM local_asset_entity AS lae WHERE lae.checksum = rae.checksum LIMIT 1) AS local_id, rae.name, rae.type, rae.created_at AS created_at, rae.updated_at, rae.width, rae.height, rae.duration_in_seconds, rae.is_favorite, rae.thumb_hash, rae.checksum, rae.owner_id, rae.live_photo_video_id, 0 AS orientation, rae.stack_id, NULL AS i_cloud_id, NULL AS latitude, NULL AS longitude, NULL AS adjustmentTime, rae.is_edited FROM remote_asset_entity AS rae LEFT JOIN stack_entity AS se ON rae.stack_id = se.id WHERE rae.deleted_at IS NULL AND rae.visibility = 0 AND rae.owner_id IN ($expandeduserIds) AND(rae.stack_id IS NULL OR rae.id = se.primary_asset_id)UNION ALL SELECT NULL AS remote_id, lae.id AS local_id, lae.name, lae.type, lae.created_at AS created_at, lae.updated_at, lae.width, lae.height, lae.duration_in_seconds, lae.is_favorite, NULL AS thumb_hash, lae.checksum, NULL AS owner_id, NULL AS live_photo_video_id, lae.orientation, NULL AS stack_id, lae.i_cloud_id, lae.latitude, lae.longitude, lae.adjustment_time, 0 AS is_edited FROM local_asset_entity AS lae WHERE NOT EXISTS (SELECT 1 FROM remote_asset_entity AS rae WHERE rae.checksum = lae.checksum AND rae.owner_id IN ($expandeduserIds)) AND EXISTS (SELECT 1 FROM local_album_asset_entity AS laa INNER JOIN local_album_entity AS la ON laa.album_id = la.id WHERE laa.asset_id = lae.id AND la.backup_selection = 0) AND NOT EXISTS (SELECT 1 FROM local_album_asset_entity AS laa INNER JOIN local_album_entity AS la ON laa.album_id = la.id WHERE laa.asset_id = lae.id AND la.backup_selection = 2) ORDER BY created_at DESC ${generatedlimit.sql}',
variables: [
for (var $ in userIds) i0.Variable<String>($),
...generatedlimit.introducedVariables,
@@ -66,6 +66,7 @@ class MergedAssetDrift extends i1.ModularAccessor {
latitude: row.readNullable<double>('latitude'),
longitude: row.readNullable<double>('longitude'),
adjustmentTime: row.readNullable<DateTime>('adjustmentTime'),
+ isEdited: row.read<bool>('is_edited'),
),
);
}
@@ -137,6 +138,7 @@ class MergedAssetResult {
final double? latitude;
final double? longitude;
final DateTime? adjustmentTime;
+ final bool isEdited;
MergedAssetResult({
this.remoteId,
this.localId,
@@ -158,6 +160,7 @@ class MergedAssetResult {
this.latitude,
this.longitude,
this.adjustmentTime,
+ required this.isEdited,
});
}
diff --git a/mobile/lib/infrastructure/entities/remote_asset.entity.dart b/mobile/lib/infrastructure/entities/remote_asset.entity.dart
index dcc885a2a9..4dc0fa568f 100644
--- a/mobile/lib/infrastructure/entities/remote_asset.entity.dart
+++ b/mobile/lib/infrastructure/entities/remote_asset.entity.dart
@@ -44,6 +44,8 @@ class RemoteAssetEntity extends Table with DriftDefaultsMixin, AssetEntityMixin
TextColumn get libraryId => text().nullable()();
+ BoolColumn get isEdited => boolean().withDefault(const Constant(false))();
+
@override
Set<Column> get primaryKey => {id};
}
@@ -66,5 +68,6 @@ extension RemoteAssetEntityDataDomainEx on RemoteAssetEntityData {
livePhotoVideoId: livePhotoVideoId,
localId: localId,
stackId: stackId,
+ isEdited: isEdited,
);
}
diff --git a/mobile/lib/infrastructure/entities/remote_asset.entity.drift.dart b/mobile/lib/infrastructure/entities/remote_asset.entity.drift.dart
index eab7f95f64..2d9e8b235e 100644
--- a/mobile/lib/infrastructure/entities/remote_asset.entity.drift.dart
+++ b/mobile/lib/infrastructure/entities/remote_asset.entity.drift.dart
@@ -31,6 +31,7 @@ typedef $$RemoteAssetEntityTableCreateCompanionBuilder =
required i2.AssetVisibility visibility,
i0.Value<String?> stackId,
i0.Value<String?> libraryId,
+ i0.Value<bool> isEdited,
});
typedef $$RemoteAssetEntityTableUpdateCompanionBuilder =
i1.RemoteAssetEntityCompanion Function({
@@ -52,6 +53,7 @@ typedef $$RemoteAssetEntityTableUpdateCompanionBuilder =
i0.Value<i2.AssetVisibility> visibility,
i0.Value<String?> stackId,
i0.Value<String?> libraryId,
+ i0.Value<bool> isEdited,
});
final class $$RemoteAssetEntityTableReferences
@@ -196,6 +198,11 @@ class $$RemoteAssetEntityTableFilterComposer
builder: (column) => i0.ColumnFilters(column),
);
+ i0.ColumnFilters<bool> get isEdited => $composableBuilder(
+ column: $table.isEdited,
+ builder: (column) => i0.ColumnFilters(column),
+ );
+
i5.$$UserEntityTableFilterComposer get ownerId {
final i5.$$UserEntityTableFilterComposer composer = $composerBuilder(
composer: this,
@@ -318,6 +325,11 @@ class $$RemoteAssetEntityTableOrderingComposer
builder: (column) => i0.ColumnOrderings(column),
);
+ i0.ColumnOrderings<bool> get isEdited => $composableBuilder(
+ column: $table.isEdited,
+ builder: (column) => i0.ColumnOrderings(column),
+ );
+
i5.$$UserEntityTableOrderingComposer get ownerId {
final i5.$$UserEntityTableOrderingComposer composer = $composerBuilder(
composer: this,
@@ -417,6 +429,9 @@ class $$RemoteAssetEntityTableAnnotationComposer
i0.GeneratedColumn<String> get libraryId =>
$composableBuilder(column: $table.libraryId, builder: (column) => column);
+ i0.GeneratedColumn<bool> get isEdited =>
+ $composableBuilder(column: $table.isEdited, builder: (column) => column);
+
i5.$$UserEntityTableAnnotationComposer get ownerId {
final i5.$$UserEntityTableAnnotationComposer composer = $composerBuilder(
composer: this,
@@ -497,6 +512,7 @@ class $$RemoteAssetEntityTableTableManager
const i0.Value.absent(),
i0.Value<String?> stackId = const i0.Value.absent(),
i0.Value<String?> libraryId = const i0.Value.absent(),
+ i0.Value<bool> isEdited = const i0.Value.absent(),
}) => i1.RemoteAssetEntityCompanion(
name: name,
type: type,
@@ -516,6 +532,7 @@ class $$RemoteAssetEntityTableTableManager
visibility: visibility,
stackId: stackId,
libraryId: libraryId,
+ isEdited: isEdited,
),
createCompanionCallback:
({
@@ -537,6 +554,7 @@ class $$RemoteAssetEntityTableTableManager
required i2.AssetVisibility visibility,
i0.Value<String?> stackId = const i0.Value.absent(),
i0.Value<String?> libraryId = const i0.Value.absent(),
+ i0.Value<bool> isEdited = const i0.Value.absent(),
}) => i1.RemoteAssetEntityCompanion.insert(
name: name,
type: type,
@@ -556,6 +574,7 @@ class $$RemoteAssetEntityTableTableManager
visibility: visibility,
stackId: stackId,
libraryId: libraryId,
+ isEdited: isEdited,
),
withReferenceMapper: (p0) => p0
.map(
@@ -844,6 +863,21 @@ class $RemoteAssetEntityTable extends i3.RemoteAssetEntity
type: i0.DriftSqlType.string,
requiredDuringInsert: false,
);
+ static const i0.VerificationMeta _isEditedMeta = const i0.VerificationMeta(
+ 'isEdited',
+ );
+ @override
+ late final i0.GeneratedColumn<bool> isEdited = i0.GeneratedColumn<bool>(
+ 'is_edited',
+ aliasedName,
+ false,
+ type: i0.DriftSqlType.bool,
+ requiredDuringInsert: false,
+ defaultConstraints: i0.GeneratedColumn.constraintIsAlways(
+ 'CHECK ("is_edited" IN (0, 1))',
+ ),
+ defaultValue: const i4.Constant(false),
+ );
@override
List<i0.GeneratedColumn> get $columns => [
name,
@@ -864,6 +898,7 @@ class $RemoteAssetEntityTable extends i3.RemoteAssetEntity
visibility,
stackId,
libraryId,
+ isEdited,
];
@override
String get aliasedName => _alias ?? actualTableName;
@@ -987,6 +1022,12 @@ class $RemoteAssetEntityTable extends i3.RemoteAssetEntity
libraryId.isAcceptableOrUnknown(data['library_id']!, _libraryIdMeta),
);
}
+ if (data.containsKey('is_edited')) {
+ context.handle(
+ _isEditedMeta,
+ isEdited.isAcceptableOrUnknown(data['is_edited']!, _isEditedMeta),
+ );
+ }
return context;
}
@@ -1075,6 +1116,10 @@ class $RemoteAssetEntityTable extends i3.RemoteAssetEntity
i0.DriftSqlType.string,
data['${effectivePrefix}library_id'],
),
+ isEdited: attachedDatabase.typeMapping.read(
+ i0.DriftSqlType.bool,
+ data['${effectivePrefix}is_edited'],
+ )!,
);
}
@@ -1115,6 +1160,7 @@ class RemoteAssetEntityData extends i0.DataClass
final i2.AssetVisibility visibility;
final String? stackId;
final String? libraryId;
+ final bool isEdited;
const RemoteAssetEntityData({
required this.name,
required this.type,
@@ -1134,6 +1180,7 @@ class RemoteAssetEntityData extends i0.DataClass
required this.visibility,
this.stackId,
this.libraryId,
+ required this.isEdited,
});
@override
Map<String, i0.Expression> toColumns(bool nullToAbsent) {
@@ -1182,6 +1229,7 @@ class RemoteAssetEntityData extends i0.DataClass
if (!nullToAbsent || libraryId != null) {
map['library_id'] = i0.Variable<String>(libraryId);
}
+ map['is_edited'] = i0.Variable<bool>(isEdited);
return map;
}
@@ -1213,6 +1261,7 @@ class RemoteAssetEntityData extends i0.DataClass
),
stackId: serializer.fromJson<String?>(json['stackId']),
libraryId: serializer.fromJson<String?>(json['libraryId']),
+ isEdited: serializer.fromJson<bool>(json['isEdited']),
);
}
@override
@@ -1241,6 +1290,7 @@ class RemoteAssetEntityData extends i0.DataClass
),
'stackId': serializer.toJson<String?>(stackId),
'libraryId': serializer.toJson<String?>(libraryId),
+ 'isEdited': serializer.toJson<bool>(isEdited),
};
}
@@ -1263,6 +1313,7 @@ class RemoteAssetEntityData extends i0.DataClass
i2.AssetVisibility? visibility,
i0.Value<String?> stackId = const i0.Value.absent(),
i0.Value<String?> libraryId = const i0.Value.absent(),
+ bool? isEdited,
}) => i1.RemoteAssetEntityData(
name: name ?? this.name,
type: type ?? this.type,
@@ -1288,6 +1339,7 @@ class RemoteAssetEntityData extends i0.DataClass
visibility: visibility ?? this.visibility,
stackId: stackId.present ? stackId.value : this.stackId,
libraryId: libraryId.present ? libraryId.value : this.libraryId,
+ isEdited: isEdited ?? this.isEdited,
);
RemoteAssetEntityData copyWithCompanion(i1.RemoteAssetEntityCompanion data) {
return RemoteAssetEntityData(
@@ -1319,6 +1371,7 @@ class RemoteAssetEntityData extends i0.DataClass
: this.visibility,
stackId: data.stackId.present ? data.stackId.value : this.stackId,
libraryId: data.libraryId.present ? data.libraryId.value : this.libraryId,
+ isEdited: data.isEdited.present ? data.isEdited.value : this.isEdited,
);
}
@@ -1342,7 +1395,8 @@ class RemoteAssetEntityData extends i0.DataClass
..write('livePhotoVideoId: $livePhotoVideoId, ')
..write('visibility: $visibility, ')
..write('stackId: $stackId, ')
- ..write('libraryId: $libraryId')
+ ..write('libraryId: $libraryId, ')
+ ..write('isEdited: $isEdited')
..write(')'))
.toString();
}
@@ -1367,6 +1421,7 @@ class RemoteAssetEntityData extends i0.DataClass
visibility,
stackId,
libraryId,
+ isEdited,
);
@override
bool operator ==(Object other) =>
@@ -1389,7 +1444,8 @@ class RemoteAssetEntityData extends i0.DataClass
other.livePhotoVideoId == this.livePhotoVideoId &&
other.visibility == this.visibility &&
other.stackId == this.stackId &&
- other.libraryId == this.libraryId);
+ other.libraryId == this.libraryId &&
+ other.isEdited == this.isEdited);
}
class RemoteAssetEntityCompanion
@@ -1412,6 +1468,7 @@ class RemoteAssetEntityCompanion
final i0.Value<i2.AssetVisibility> visibility;
final i0.Value<String?> stackId;
final i0.Value<String?> libraryId;
+ final i0.Value<bool> isEdited;
const RemoteAssetEntityCompanion({
this.name = const i0.Value.absent(),
this.type = const i0.Value.absent(),
@@ -1431,6 +1488,7 @@ class RemoteAssetEntityCompanion
this.visibility = const i0.Value.absent(),
this.stackId = const i0.Value.absent(),
this.libraryId = const i0.Value.absent(),
+ this.isEdited = const i0.Value.absent(),
});
RemoteAssetEntityCompanion.insert({
required String name,
@@ -1451,6 +1509,7 @@ class RemoteAssetEntityCompanion
required i2.AssetVisibility visibility,
this.stackId = const i0.Value.absent(),
this.libraryId = const i0.Value.absent(),
+ this.isEdited = const i0.Value.absent(),
}) : name = i0.Value(name),
type = i0.Value(type),
id = i0.Value(id),
@@ -1476,6 +1535,7 @@ class RemoteAssetEntityCompanion
i0.Expression<int>? visibility,
i0.Expression<String>? stackId,
i0.Expression<String>? libraryId,
+ i0.Expression<bool>? isEdited,
}) {
return i0.RawValuesInsertable({
if (name != null) 'name': name,
@@ -1496,6 +1556,7 @@ class RemoteAssetEntityCompanion
if (visibility != null) 'visibility': visibility,
if (stackId != null) 'stack_id': stackId,
if (libraryId != null) 'library_id': libraryId,
+ if (isEdited != null) 'is_edited': isEdited,
});
}
@@ -1518,6 +1579,7 @@ class RemoteAssetEntityCompanion
i0.Value<i2.AssetVisibility>? visibility,
i0.Value<String?>? stackId,
i0.Value<String?>? libraryId,
+ i0.Value<bool>? isEdited,
}) {
return i1.RemoteAssetEntityCompanion(
name: name ?? this.name,
@@ -1538,6 +1600,7 @@ class RemoteAssetEntityCompanion
visibility: visibility ?? this.visibility,
stackId: stackId ?? this.stackId,
libraryId: libraryId ?? this.libraryId,
+ isEdited: isEdited ?? this.isEdited,
);
}
@@ -1602,6 +1665,9 @@ class RemoteAssetEntityCompanion
if (libraryId.present) {
map['library_id'] = i0.Variable<String>(libraryId.value);
}
+ if (isEdited.present) {
+ map['is_edited'] = i0.Variable<bool>(isEdited.value);
+ }
return map;
}
@@ -1625,7 +1691,8 @@ class RemoteAssetEntityCompanion
..write('livePhotoVideoId: $livePhotoVideoId, ')
..write('visibility: $visibility, ')
..write('stackId: $stackId, ')
- ..write('libraryId: $libraryId')
+ ..write('libraryId: $libraryId, ')
+ ..write('isEdited: $isEdited')
..write(')'))
.toString();
}
diff --git a/mobile/lib/infrastructure/entities/trashed_local_asset.entity.dart b/mobile/lib/infrastructure/entities/trashed_local_asset.entity.dart
index 2eaff5d5fb..d239588529 100644
--- a/mobile/lib/infrastructure/entities/trashed_local_asset.entity.dart
+++ b/mobile/lib/infrastructure/entities/trashed_local_asset.entity.dart
@@ -45,5 +45,6 @@ extension TrashedLocalAssetEntityDataDomainExtension on TrashedLocalAssetEntityD
height: height,
width: width,
orientation: orientation,
+ isEdited: false,
);
}
diff --git a/mobile/lib/infrastructure/repositories/db.repository.dart b/mobile/lib/infrastructure/repositories/db.repository.dart
index 482f7f04b2..ad15401bed 100644
--- a/mobile/lib/infrastructure/repositories/db.repository.dart
+++ b/mobile/lib/infrastructure/repositories/db.repository.dart
@@ -97,7 +97,7 @@ class Drift extends $Drift implements IDatabaseRepository {
}
@override
- int get schemaVersion => 16;
+ int get schemaVersion => 17;
@override
MigrationStrategy get migration => MigrationStrategy(
@@ -201,6 +201,9 @@ class Drift extends $Drift implements IDatabaseRepository {
await m.createIndex(v16.idxLocalAssetCloudId);
await m.createTable(v16.remoteAssetCloudIdEntity);
},
+ from16To17: (m, v17) async {
+ await m.addColumn(v17.remoteAssetEntity, v17.remoteAssetEntity.isEdited);
+ },
),
);
diff --git a/mobile/lib/infrastructure/repositories/db.repository.steps.dart b/mobile/lib/infrastructure/repositories/db.repository.steps.dart
index 10cba0821a..fe7d1d4f0d 100644
--- a/mobile/lib/infrastructure/repositories/db.repository.steps.dart
+++ b/mobile/lib/infrastructure/repositories/db.repository.steps.dart
@@ -6911,6 +6911,503 @@ i1.GeneratedColumn<DateTime> _column_100(String aliasedName) =>
true,
type: i1.DriftSqlType.dateTime,
);
+
+final class Schema17 extends i0.VersionedSchema {
+ Schema17({required super.database}) : super(version: 17);
+ @override
+ late final List<i1.DatabaseSchemaEntity> entities = [
+ userEntity,
+ remoteAssetEntity,
+ stackEntity,
+ localAssetEntity,
+ remoteAlbumEntity,
+ localAlbumEntity,
+ localAlbumAssetEntity,
+ idxLocalAssetChecksum,
+ idxLocalAssetCloudId,
+ idxRemoteAssetOwnerChecksum,
+ uQRemoteAssetsOwnerChecksum,
+ uQRemoteAssetsOwnerLibraryChecksum,
+ idxRemoteAssetChecksum,
+ authUserEntity,
+ userMetadataEntity,
+ partnerEntity,
+ remoteExifEntity,
+ remoteAlbumAssetEntity,
+ remoteAlbumUserEntity,
+ remoteAssetCloudIdEntity,
+ memoryEntity,
+ memoryAssetEntity,
+ personEntity,
+ assetFaceEntity,
+ storeEntity,
+ trashedLocalAssetEntity,
+ idxLatLng,
+ idxTrashedLocalAssetChecksum,
+ idxTrashedLocalAssetAlbum,
+ ];
+ late final Shape20 userEntity = Shape20(
+ source: i0.VersionedTable(
+ entityName: 'user_entity',
+ withoutRowId: true,
+ isStrict: true,
+ tableConstraints: ['PRIMARY KEY(id)'],
+ columns: [
+ _column_0,
+ _column_1,
+ _column_3,
+ _column_84,
+ _column_85,
+ _column_91,
+ ],
+ attachedDatabase: database,
+ ),
+ alias: null,
+ );
+ late final Shape28 remoteAssetEntity = Shape28(
+ source: i0.VersionedTable(
+ entityName: 'remote_asset_entity',
+ withoutRowId: true,
+ isStrict: true,
+ tableConstraints: ['PRIMARY KEY(id)'],
+ columns: [
+ _column_1,
+ _column_8,
+ _column_9,
+ _column_5,
+ _column_10,
+ _column_11,
+ _column_12,
+ _column_0,
+ _column_13,
+ _column_14,
+ _column_15,
+ _column_16,
+ _column_17,
+ _column_18,
+ _column_19,
+ _column_20,
+ _column_21,
+ _column_86,
+ _column_101,
+ ],
+ attachedDatabase: database,
+ ),
+ alias: null,
+ );
+ late final Shape3 stackEntity = Shape3(
+ source: i0.VersionedTable(
+ entityName: 'stack_entity',
+ withoutRowId: true,
+ isStrict: true,
+ tableConstraints: ['PRIMARY KEY(id)'],
+ columns: [_column_0, _column_9, _column_5, _column_15, _column_75],
+ attachedDatabase: database,
+ ),
+ alias: null,
+ );
+ late final Shape26 localAssetEntity = Shape26(
+ source: i0.VersionedTable(
+ entityName: 'local_asset_entity',
+ withoutRowId: true,
+ isStrict: true,
+ tableConstraints: ['PRIMARY KEY(id)'],
+ columns: [
+ _column_1,
+ _column_8,
+ _column_9,
+ _column_5,
+ _column_10,
+ _column_11,
+ _column_12,
+ _column_0,
+ _column_22,
+ _column_14,
+ _column_23,
+ _column_98,
+ _column_96,
+ _column_46,
+ _column_47,
+ ],
+ attachedDatabase: database,
+ ),
+ alias: null,
+ );
+ late final Shape9 remoteAlbumEntity = Shape9(
+ source: i0.VersionedTable(
+ entityName: 'remote_album_entity',
+ withoutRowId: true,
+ isStrict: true,
+ tableConstraints: ['PRIMARY KEY(id)'],
+ columns: [
+ _column_0,
+ _column_1,
+ _column_56,
+ _column_9,
+ _column_5,
+ _column_15,
+ _column_57,
+ _column_58,
+ _column_59,
+ ],
+ attachedDatabase: database,
+ ),
+ alias: null,
+ );
+ late final Shape19 localAlbumEntity = Shape19(
+ source: i0.VersionedTable(
+ entityName: 'local_album_entity',
+ withoutRowId: true,
+ isStrict: true,
+ tableConstraints: ['PRIMARY KEY(id)'],
+ columns: [
+ _column_0,
+ _column_1,
+ _column_5,
+ _column_31,
+ _column_32,
+ _column_90,
+ _column_33,
+ ],
+ attachedDatabase: database,
+ ),
+ alias: null,
+ );
+ late final Shape22 localAlbumAssetEntity = Shape22(
+ source: i0.VersionedTable(
+ entityName: 'local_album_asset_entity',
+ withoutRowId: true,
+ isStrict: true,
+ tableConstraints: ['PRIMARY KEY(asset_id, album_id)'],
+ columns: [_column_34, _column_35, _column_33],
+ attachedDatabase: database,
+ ),
+ alias: null,
+ );
+ final i1.Index idxLocalAssetChecksum = i1.Index(
+ 'idx_local_asset_checksum',
+ 'CREATE INDEX IF NOT EXISTS idx_local_asset_checksum ON local_asset_entity (checksum)',
+ );
+ final i1.Index idxLocalAssetCloudId = i1.Index(
+ 'idx_local_asset_cloud_id',
+ 'CREATE INDEX IF NOT EXISTS idx_local_asset_cloud_id ON local_asset_entity (i_cloud_id)',
+ );
+ final i1.Index idxRemoteAssetOwnerChecksum = i1.Index(
+ 'idx_remote_asset_owner_checksum',
+ 'CREATE INDEX IF NOT EXISTS idx_remote_asset_owner_checksum ON remote_asset_entity (owner_id, checksum)',
+ );
+ final i1.Index uQRemoteAssetsOwnerChecksum = i1.Index(
+ 'UQ_remote_assets_owner_checksum',
+ 'CREATE UNIQUE INDEX IF NOT EXISTS UQ_remote_assets_owner_checksum ON remote_asset_entity (owner_id, checksum) WHERE(library_id IS NULL)',
+ );
+ final i1.Index uQRemoteAssetsOwnerLibraryChecksum = i1.Index(
+ 'UQ_remote_assets_owner_library_checksum',
+ 'CREATE UNIQUE INDEX IF NOT EXISTS UQ_remote_assets_owner_library_checksum ON remote_asset_entity (owner_id, library_id, checksum) WHERE(library_id IS NOT NULL)',
+ );
+ final i1.Index idxRemoteAssetChecksum = i1.Index(
+ 'idx_remote_asset_checksum',
+ 'CREATE INDEX IF NOT EXISTS idx_remote_asset_checksum ON remote_asset_entity (checksum)',
+ );
+ late final Shape21 authUserEntity = Shape21(
+ source: i0.VersionedTable(
+ entityName: 'auth_user_entity',
+ withoutRowId: true,
+ isStrict: true,
+ tableConstraints: ['PRIMARY KEY(id)'],
+ columns: [
+ _column_0,
+ _column_1,
+ _column_3,
+ _column_2,
+ _column_84,
+ _column_85,
+ _column_92,
+ _column_93,
+ _column_7,
+ _column_94,
+ ],
+ attachedDatabase: database,
+ ),
+ alias: null,
+ );
+ late final Shape4 userMetadataEntity = Shape4(
+ source: i0.VersionedTable(
+ entityName: 'user_metadata_entity',
+ withoutRowId: true,
+ isStrict: true,
+ tableConstraints: ['PRIMARY KEY(user_id, "key")'],
+ columns: [_column_25, _column_26, _column_27],
+ attachedDatabase: database,
+ ),
+ alias: null,
+ );
+ late final Shape5 partnerEntity = Shape5(
+ source: i0.VersionedTable(
+ entityName: 'partner_entity',
+ withoutRowId: true,
+ isStrict: true,
+ tableConstraints: ['PRIMARY KEY(shared_by_id, shared_with_id)'],
+ columns: [_column_28, _column_29, _column_30],
+ attachedDatabase: database,
+ ),
+ alias: null,
+ );
+ late final Shape8 remoteExifEntity = Shape8(
+ source: i0.VersionedTable(
+ entityName: 'remote_exif_entity',
+ withoutRowId: true,
+ isStrict: true,
+ tableConstraints: ['PRIMARY KEY(asset_id)'],
+ columns: [
+ _column_36,
+ _column_37,
+ _column_38,
+ _column_39,
+ _column_40,
+ _column_41,
+ _column_11,
+ _column_10,
+ _column_42,
+ _column_43,
+ _column_44,
+ _column_45,
+ _column_46,
+ _column_47,
+ _column_48,
+ _column_49,
+ _column_50,
+ _column_51,
+ _column_52,
+ _column_53,
+ _column_54,
+ _column_55,
+ ],
+ attachedDatabase: database,
+ ),
+ alias: null,
+ );
+ late final Shape7 remoteAlbumAssetEntity = Shape7(
+ source: i0.VersionedTable(
+ entityName: 'remote_album_asset_entity',
+ withoutRowId: true,
+ isStrict: true,
+ tableConstraints: ['PRIMARY KEY(asset_id, album_id)'],
+ columns: [_column_36, _column_60],
+ attachedDatabase: database,
+ ),
+ alias: null,
+ );
+ late final Shape10 remoteAlbumUserEntity = Shape10(
+ source: i0.VersionedTable(
+ entityName: 'remote_album_user_entity',
+ withoutRowId: true,
+ isStrict: true,
+ tableConstraints: ['PRIMARY KEY(album_id, user_id)'],
+ columns: [_column_60, _column_25, _column_61],
+ attachedDatabase: database,
+ ),
+ alias: null,
+ );
+ late final Shape27 remoteAssetCloudIdEntity = Shape27(
+ source: i0.VersionedTable(
+ entityName: 'remote_asset_cloud_id_entity',
+ withoutRowId: true,
+ isStrict: true,
+ tableConstraints: ['PRIMARY KEY(asset_id)'],
+ columns: [
+ _column_36,
+ _column_99,
+ _column_100,
+ _column_96,
+ _column_46,
+ _column_47,
+ ],
+ attachedDatabase: database,
+ ),
+ alias: null,
+ );
+ late final Shape11 memoryEntity = Shape11(
+ source: i0.VersionedTable(
+ entityName: 'memory_entity',
+ withoutRowId: true,
+ isStrict: true,
+ tableConstraints: ['PRIMARY KEY(id)'],
+ columns: [
+ _column_0,
+ _column_9,
+ _column_5,
+ _column_18,
+ _column_15,
+ _column_8,
+ _column_62,
+ _column_63,
+ _column_64,
+ _column_65,
+ _column_66,
+ _column_67,
+ ],
+ attachedDatabase: database,
+ ),
+ alias: null,
+ );
+ late final Shape12 memoryAssetEntity = Shape12(
+ source: i0.VersionedTable(
+ entityName: 'memory_asset_entity',
+ withoutRowId: true,
+ isStrict: true,
+ tableConstraints: ['PRIMARY KEY(asset_id, memory_id)'],
+ columns: [_column_36, _column_68],
+ attachedDatabase: database,
+ ),
+ alias: null,
+ );
+ late final Shape14 personEntity = Shape14(
+ source: i0.VersionedTable(
+ entityName: 'person_entity',
+ withoutRowId: true,
+ isStrict: true,
+ tableConstraints: ['PRIMARY KEY(id)'],
+ columns: [
+ _column_0,
+ _column_9,
+ _column_5,
+ _column_15,
+ _column_1,
+ _column_69,
+ _column_71,
+ _column_72,
+ _column_73,
+ _column_74,
+ ],
+ attachedDatabase: database,
+ ),
+ alias: null,
+ );
+ late final Shape15 assetFaceEntity = Shape15(
+ source: i0.VersionedTable(
+ entityName: 'asset_face_entity',
+ withoutRowId: true,
+ isStrict: true,
+ tableConstraints: ['PRIMARY KEY(id)'],
+ columns: [
+ _column_0,
+ _column_36,
+ _column_76,
+ _column_77,
+ _column_78,
+ _column_79,
+ _column_80,
+ _column_81,
+ _column_82,
+ _column_83,
+ ],
+ attachedDatabase: database,
+ ),
+ alias: null,
+ );
+ late final Shape18 storeEntity = Shape18(
+ source: i0.VersionedTable(
+ entityName: 'store_entity',
+ withoutRowId: true,
+ isStrict: true,
+ tableConstraints: ['PRIMARY KEY(id)'],
+ columns: [_column_87, _column_88, _column_89],
+ attachedDatabase: database,
+ ),
+ alias: null,
+ );
+ late final Shape25 trashedLocalAssetEntity = Shape25(
+ source: i0.VersionedTable(
+ entityName: 'trashed_local_asset_entity',
+ withoutRowId: true,
+ isStrict: true,
+ tableConstraints: ['PRIMARY KEY(id, album_id)'],
+ columns: [
+ _column_1,
+ _column_8,
+ _column_9,
+ _column_5,
+ _column_10,
+ _column_11,
+ _column_12,
+ _column_0,
+ _column_95,
+ _column_22,
+ _column_14,
+ _column_23,
+ _column_97,
+ ],
+ attachedDatabase: database,
+ ),
+ alias: null,
+ );
+ final i1.Index idxLatLng = i1.Index(
+ 'idx_lat_lng',
+ 'CREATE INDEX IF NOT EXISTS idx_lat_lng ON remote_exif_entity (latitude, longitude)',
+ );
+ final i1.Index idxTrashedLocalAssetChecksum = i1.Index(
+ 'idx_trashed_local_asset_checksum',
+ 'CREATE INDEX IF NOT EXISTS idx_trashed_local_asset_checksum ON trashed_local_asset_entity (checksum)',
+ );
+ final i1.Index idxTrashedLocalAssetAlbum = i1.Index(
+ 'idx_trashed_local_asset_album',
+ 'CREATE INDEX IF NOT EXISTS idx_trashed_local_asset_album ON trashed_local_asset_entity (album_id)',
+ );
+}
+
+class Shape28 extends i0.VersionedTable {
+ Shape28({required super.source, required super.alias}) : super.aliased();
+ i1.GeneratedColumn<String> get name =>
+ columnsByName['name']! as i1.GeneratedColumn<String>;
+ i1.GeneratedColumn<int> get type =>
+ columnsByName['type']! as i1.GeneratedColumn<int>;
+ i1.GeneratedColumn<DateTime> get createdAt =>
+ columnsByName['created_at']! as i1.GeneratedColumn<DateTime>;
+ i1.GeneratedColumn<DateTime> get updatedAt =>
+ columnsByName['updated_at']! as i1.GeneratedColumn<DateTime>;
+ i1.GeneratedColumn<int> get width =>
+ columnsByName['width']! as i1.GeneratedColumn<int>;
+ i1.GeneratedColumn<int> get height =>
+ columnsByName['height']! as i1.GeneratedColumn<int>;
+ i1.GeneratedColumn<int> get durationInSeconds =>
+ columnsByName['duration_in_seconds']! as i1.GeneratedColumn<int>;
+ i1.GeneratedColumn<String> get id =>
+ columnsByName['id']! as i1.GeneratedColumn<String>;
+ i1.GeneratedColumn<String> get checksum =>
+ columnsByName['checksum']! as i1.GeneratedColumn<String>;
+ i1.GeneratedColumn<bool> get isFavorite =>
+ columnsByName['is_favorite']! as i1.GeneratedColumn<bool>;
+ i1.GeneratedColumn<String> get ownerId =>
+ columnsByName['owner_id']! as i1.GeneratedColumn<String>;
+ i1.GeneratedColumn<DateTime> get localDateTime =>
+ columnsByName['local_date_time']! as i1.GeneratedColumn<DateTime>;
+ i1.GeneratedColumn<String> get thumbHash =>
+ columnsByName['thumb_hash']! as i1.GeneratedColumn<String>;
+ i1.GeneratedColumn<DateTime> get deletedAt =>
+ columnsByName['deleted_at']! as i1.GeneratedColumn<DateTime>;
+ i1.GeneratedColumn<String> get livePhotoVideoId =>
+ columnsByName['live_photo_video_id']! as i1.GeneratedColumn<String>;
+ i1.GeneratedColumn<int> get visibility =>
+ columnsByName['visibility']! as i1.GeneratedColumn<int>;
+ i1.GeneratedColumn<String> get stackId =>
+ columnsByName['stack_id']! as i1.GeneratedColumn<String>;
+ i1.GeneratedColumn<String> get libraryId =>
+ columnsByName['library_id']! as i1.GeneratedColumn<String>;
+ i1.GeneratedColumn<bool> get isEdited =>
+ columnsByName['is_edited']! as i1.GeneratedColumn<bool>;
+}
+
+i1.GeneratedColumn<bool> _column_101(String aliasedName) =>
+ i1.GeneratedColumn<bool>(
+ 'is_edited',
+ aliasedName,
+ false,
+ type: i1.DriftSqlType.bool,
+ defaultConstraints: i1.GeneratedColumn.constraintIsAlways(
+ 'CHECK ("is_edited" IN (0, 1))',
+ ),
+ defaultValue: const CustomExpression('0'),
+ );
i0.MigrationStepWithVersion migrationSteps({
required Future<void> Function(i1.Migrator m, Schema2 schema) from1To2,
required Future<void> Function(i1.Migrator m, Schema3 schema) from2To3,
@@ -6927,6 +7424,7 @@ i0.MigrationStepWithVersion migrationSteps({
required Future<void> Function(i1.Migrator m, Schema14 schema) from13To14,
required Future<void> Function(i1.Migrator m, Schema15 schema) from14To15,
required Future<void> Function(i1.Migrator m, Schema16 schema) from15To16,
+ required Future<void> Function(i1.Migrator m, Schema17 schema) from16To17,
}) {
return (currentVersion, database) async {
switch (currentVersion) {
@@ -7005,6 +7503,11 @@ i0.MigrationStepWithVersion migrationSteps({
final migrator = i1.Migrator(database, schema);
await from15To16(migrator, schema);
return 16;
+ case 16:
+ final schema = Schema17(database: database);
+ final migrator = i1.Migrator(database, schema);
+ await from16To17(migrator, schema);
+ return 17;
default:
throw ArgumentError.value('Unknown migration from $currentVersion');
}
@@ -7027,6 +7530,7 @@ i1.OnUpgrade stepByStep({
required Future<void> Function(i1.Migrator m, Schema14 schema) from13To14,
required Future<void> Function(i1.Migrator m, Schema15 schema) from14To15,
required Future<void> Function(i1.Migrator m, Schema16 schema) from15To16,
+ required Future<void> Function(i1.Migrator m, Schema17 schema) from16To17,
}) => i0.VersionedSchema.stepByStepHelper(
step: migrationSteps(
from1To2: from1To2,
@@ -7044,5 +7548,6 @@ i1.OnUpgrade stepByStep({
from13To14: from13To14,
from14To15: from14To15,
from15To16: from15To16,
+ from16To17: from16To17,
),
);
diff --git a/mobile/lib/infrastructure/repositories/sync_stream.repository.dart b/mobile/lib/infrastructure/repositories/sync_stream.repository.dart
index 95239a469c..c92ce427d5 100644
--- a/mobile/lib/infrastructure/repositories/sync_stream.repository.dart
+++ b/mobile/lib/infrastructure/repositories/sync_stream.repository.dart
@@ -200,6 +200,7 @@ class SyncStreamRepository extends DriftDatabaseRepository {
libraryId: Value(asset.libraryId),
width: Value(asset.width),
height: Value(asset.height),
+ isEdited: Value(asset.isEdited),
);
batch.insert(
diff --git a/mobile/lib/infrastructure/repositories/timeline.repository.dart b/mobile/lib/infrastructure/repositories/timeline.repository.dart
index e625b57c1a..f57ef04b07 100644
--- a/mobile/lib/infrastructure/repositories/timeline.repository.dart
+++ b/mobile/lib/infrastructure/repositories/timeline.repository.dart
@@ -70,6 +70,7 @@ class DriftTimelineRepository extends DriftDatabaseRepository {
durationInSeconds: row.durationInSeconds,
livePhotoVideoId: row.livePhotoVideoId,
stackId: row.stackId,
+ isEdited: row.isEdited,
)
: LocalAsset(
id: row.localId!,
@@ -88,6 +89,7 @@ class DriftTimelineRepository extends DriftDatabaseRepository {
latitude: row.latitude,
longitude: row.longitude,
adjustmentTime: row.adjustmentTime,
+ isEdited: row.isEdited,
),
)
.get();
diff --git a/mobile/lib/presentation/pages/drift_asset_troubleshoot.page.dart b/mobile/lib/presentation/pages/drift_asset_troubleshoot.page.dart
index 579b4c1d58..9da21c72ee 100644
--- a/mobile/lib/presentation/pages/drift_asset_troubleshoot.page.dart
+++ b/mobile/lib/presentation/pages/drift_asset_troubleshoot.page.dart
@@ -118,6 +118,7 @@ class _AssetPropertiesSectionState extends ConsumerState<_AssetPropertiesSection
),
_PropertyItem(label: 'Is Favorite', value: asset.isFavorite.toString()),
_PropertyItem(label: 'Live Photo Video ID', value: asset.livePhotoVideoId),
+ _PropertyItem(label: 'Is Edited', value: asset.isEdited.toString()),
]);
}
diff --git a/mobile/lib/presentation/pages/drift_place.page.dart b/mobile/lib/presentation/pages/drift_place.page.dart
index d042f52673..10b9ca7ae4 100644
--- a/mobile/lib/presentation/pages/drift_place.page.dart
+++ b/mobile/lib/presentation/pages/drift_place.page.dart
@@ -167,7 +167,7 @@ class _PlaceTile extends StatelessWidget {
child: SizedBox(
width: 80,
height: 80,
- child: Thumbnail.remote(remoteId: place.$2, fit: BoxFit.cover),
+ child: Thumbnail.remote(remoteId: place.$2, fit: BoxFit.cover, thumbhash: ""),
),
),
);
diff --git a/mobile/lib/presentation/widgets/album/album_selector.widget.dart b/mobile/lib/presentation/widgets/album/album_selector.widget.dart
index 101f0d31d8..4f37f88344 100644
--- a/mobile/lib/presentation/widgets/album/album_selector.widget.dart
+++ b/mobile/lib/presentation/widgets/album/album_selector.widget.dart
@@ -14,14 +14,15 @@ import 'package:immich_mobile/models/albums/album_search.model.dart';
import 'package:immich_mobile/presentation/widgets/album/album_tile.dart';
import 'package:immich_mobile/presentation/widgets/album/new_album_name_modal.widget.dart';
import 'package:immich_mobile/presentation/widgets/images/thumbnail.widget.dart';
+import 'package:immich_mobile/providers/album/album_sort_by_options.provider.dart';
+import 'package:immich_mobile/providers/app_settings.provider.dart';
import 'package:immich_mobile/providers/infrastructure/album.provider.dart';
+import 'package:immich_mobile/providers/infrastructure/asset.provider.dart';
import 'package:immich_mobile/providers/infrastructure/asset_viewer/current_asset.provider.dart';
import 'package:immich_mobile/providers/timeline/multiselect.provider.dart';
import 'package:immich_mobile/providers/user.provider.dart';
-import 'package:immich_mobile/providers/album/album_sort_by_options.provider.dart';
-import 'package:immich_mobile/providers/app_settings.provider.dart';
-import 'package:immich_mobile/services/app_settings.service.dart';
import 'package:immich_mobile/routing/router.dart';
+import 'package:immich_mobile/services/app_settings.service.dart';
import 'package:immich_mobile/utils/album_filter.utils.dart';
import 'package:immich_mobile/widgets/common/confirm_dialog.dart';
import 'package:immich_mobile/widgets/common/immich_toast.dart';
@@ -666,6 +667,8 @@ class _GridAlbumCard extends ConsumerWidget {
@override
Widget build(BuildContext context, WidgetRef ref) {
+ final albumThumbnailAsset = ref.read(assetServiceProvider).getRemoteAsset(album.thumbnailAssetId ?? "");
+
return GestureDetector(
onTap: () => onAlbumSelected(album),
child: Card(
@@ -684,12 +687,22 @@ class _GridAlbumCard extends ConsumerWidget {
borderRadius: const BorderRadius.vertical(top: Radius.circular(15)),
child: SizedBox(
width: double.infinity,
- child: album.thumbnailAssetId != null
- ? Thumbnail.remote(remoteId: album.thumbnailAssetId!)
- : Container(
- color: context.colorScheme.surfaceContainerHighest,
- child: const Icon(Icons.photo_album_rounded, size: 40, color: Colors.grey),
- ),
+ child: FutureBuilder(
+ future: albumThumbnailAsset,
+ builder: (context, snapshot) {
+ if (snapshot.hasData && snapshot.data != null) {
+ return Thumbnail.remote(
+ remoteId: album.thumbnailAssetId!,
+ thumbhash: snapshot.data!.thumbHash ?? "",
+ );
+ }
+
+ return Container(
+ color: context.colorScheme.surfaceContainerHighest,
+ child: const Icon(Icons.photo_album_rounded, size: 40, color: Colors.grey),
+ );
+ },
+ ),
),
),
),
diff --git a/mobile/lib/presentation/widgets/album/album_tile.dart b/mobile/lib/presentation/widgets/album/album_tile.dart
index 561b018ef8..1aeadf61bc 100644
--- a/mobile/lib/presentation/widgets/album/album_tile.dart
+++ b/mobile/lib/presentation/widgets/album/album_tile.dart
@@ -1,12 +1,14 @@
import 'package:flutter/material.dart';
+import 'package:hooks_riverpod/hooks_riverpod.dart';
import 'package:immich_mobile/domain/models/album/album.model.dart';
import 'package:immich_mobile/extensions/build_context_extensions.dart';
import 'package:immich_mobile/extensions/theme_extensions.dart';
import 'package:immich_mobile/extensions/translate_extensions.dart';
import 'package:immich_mobile/pages/common/large_leading_tile.dart';
import 'package:immich_mobile/presentation/widgets/images/thumbnail.widget.dart';
+import 'package:immich_mobile/providers/infrastructure/asset.provider.dart';
-class AlbumTile extends StatelessWidget {
+class AlbumTile extends ConsumerWidget {
const AlbumTile({super.key, required this.album, required this.isOwner, this.onAlbumSelected});
final RemoteAlbum album;
@@ -14,7 +16,9 @@ class AlbumTile extends StatelessWidget {
final Function(RemoteAlbum)? onAlbumSelected;
@override
- Widget build(BuildContext context) {
+ Widget build(BuildContext context, WidgetRef ref) {
+ final albumThumbnailAsset = ref.read(assetServiceProvider).getRemoteAsset(album.thumbnailAssetId ?? "");
+
return LargeLeadingTile(
title: Text(
album.name,
@@ -29,23 +33,35 @@ class AlbumTile extends StatelessWidget {
),
onTap: () => onAlbumSelected?.call(album),
leadingPadding: const EdgeInsets.only(right: 16),
- leading: album.thumbnailAssetId != null
- ? ClipRRect(
- borderRadius: const BorderRadius.all(Radius.circular(15)),
- child: SizedBox(width: 80, height: 80, child: Thumbnail.remote(remoteId: album.thumbnailAssetId!)),
- )
- : SizedBox(
- width: 80,
- height: 80,
- child: Container(
- decoration: BoxDecoration(
- color: context.colorScheme.surfaceContainer,
- borderRadius: const BorderRadius.all(Radius.circular(16)),
- border: Border.all(color: context.colorScheme.outline.withAlpha(50), width: 1),
- ),
- child: const Icon(Icons.photo_album_rounded, size: 24, color: Colors.grey),
- ),
- ),
+ leading: FutureBuilder(
+ future: albumThumbnailAsset,
+ builder: (context, snapshot) {
+ return snapshot.hasData && snapshot.data != null
+ ? ClipRRect(
+ borderRadius: const BorderRadius.all(Radius.circular(15)),
+ child: SizedBox(
+ width: 80,
+ height: 80,
+ child: Thumbnail.remote(
+ remoteId: album.thumbnailAssetId!,
+ thumbhash: snapshot.data!.thumbHash ?? "",
+ ),
+ ),
+ )
+ : SizedBox(
+ width: 80,
+ height: 80,
+ child: Container(
+ decoration: BoxDecoration(
+ color: context.colorScheme.surfaceContainer,
+ borderRadius: const BorderRadius.all(Radius.circular(16)),
+ border: Border.all(color: context.colorScheme.outline.withAlpha(50), width: 1),
+ ),
+ child: const Icon(Icons.photo_album_rounded, size: 24, color: Colors.grey),
+ ),
+ );
+ },
+ ),
);
}
}
diff --git a/mobile/lib/presentation/widgets/images/image_provider.dart b/mobile/lib/presentation/widgets/images/image_provider.dart
index e77803c206..ad7d53af13 100644
--- a/mobile/lib/presentation/widgets/images/image_provider.dart
+++ b/mobile/lib/presentation/widgets/images/image_provider.dart
@@ -112,14 +112,17 @@ ImageProvider getFullImageProvider(BaseAsset asset, {Size size = const Size(1080
provider = LocalFullImageProvider(id: id, size: size, assetType: asset.type);
} else {
final String assetId;
+ final String thumbhash;
if (asset is LocalAsset && asset.hasRemote) {
assetId = asset.remoteId!;
+ thumbhash = "";
} else if (asset is RemoteAsset) {
assetId = asset.id;
+ thumbhash = asset.thumbHash ?? "";
} else {
throw ArgumentError("Unsupported asset type: ${asset.runtimeType}");
}
- provider = RemoteFullImageProvider(assetId: assetId);
+ provider = RemoteFullImageProvider(assetId: assetId, thumbhash: thumbhash);
}
return provider;
@@ -132,8 +135,9 @@ ImageProvider? getThumbnailImageProvider(BaseAsset asset, {Size size = kThumbnai
}
final assetId = asset is RemoteAsset ? asset.id : (asset as LocalAsset).remoteId;
- return assetId != null ? RemoteThumbProvider(assetId: assetId) : null;
+ final thumbhash = asset is RemoteAsset ? asset.thumbHash ?? "" : "";
+ return assetId != null ? RemoteThumbProvider(assetId: assetId, thumbhash: thumbhash) : null;
}
bool _shouldUseLocalAsset(BaseAsset asset) =>
- asset.hasLocal && (!asset.hasRemote || !AppSetting.get(Setting.preferRemoteImage));
+ asset.hasLocal && (!asset.hasRemote || !AppSetting.get(Setting.preferRemoteImage)) && !asset.isEdited;
diff --git a/mobile/lib/presentation/widgets/images/remote_image_provider.dart b/mobile/lib/presentation/widgets/images/remote_image_provider.dart
index d9a736861f..b550e53c21 100644
--- a/mobile/lib/presentation/widgets/images/remote_image_provider.dart
+++ b/mobile/lib/presentation/widgets/images/remote_image_provider.dart
@@ -16,8 +16,9 @@ class RemoteThumbProvider extends CancellableImageProvider<RemoteThumbProvider>
with CancellableImageProviderMixin<RemoteThumbProvider> {
static final cacheManager = RemoteThumbnailCacheManager();
final String assetId;
+ final String thumbhash;
- RemoteThumbProvider({required this.assetId});
+ RemoteThumbProvider({required this.assetId, required this.thumbhash});
@override
Future<RemoteThumbProvider> obtainKey(ImageConfiguration configuration) {
@@ -38,7 +39,7 @@ class RemoteThumbProvider extends CancellableImageProvider<RemoteThumbProvider>
Stream<ImageInfo> _codec(RemoteThumbProvider key, ImageDecoderCallback decode) {
final request = this.request = RemoteImageRequest(
- uri: getThumbnailUrlForRemoteId(key.assetId),
+ uri: getThumbnailUrlForRemoteId(key.assetId, thumbhash: key.thumbhash),
headers: ApiService.getRequestHeaders(),
cacheManager: cacheManager,
);
@@ -49,22 +50,23 @@ class RemoteThumbProvider extends CancellableImageProvider<RemoteThumbProvider>
bool operator ==(Object other) {
if (identical(this, other)) return true;
if (other is RemoteThumbProvider) {
- return assetId == other.assetId;
+ return assetId == other.assetId && thumbhash == other.thumbhash;
}
return false;
}
@override
- int get hashCode => assetId.hashCode;
+ int get hashCode => assetId.hashCode ^ thumbhash.hashCode;
}
class RemoteFullImageProvider extends CancellableImageProvider<RemoteFullImageProvider>
with CancellableImageProviderMixin<RemoteFullImageProvider> {
static final cacheManager = RemoteThumbnailCacheManager();
final String assetId;
+ final String thumbhash;
- RemoteFullImageProvider({required this.assetId});
+ RemoteFullImageProvider({required this.assetId, required this.thumbhash});
@override
Future<RemoteFullImageProvider> obtainKey(ImageConfiguration configuration) {
@@ -75,7 +77,7 @@ class RemoteFullImageProvider extends CancellableImageProvider<RemoteFullImagePr
ImageStreamCompleter loadImage(RemoteFullImageProvider key, ImageDecoderCallback decode) {
return OneFramePlaceholderImageStreamCompleter(
_codec(key, decode),
- initialImage: getInitialImage(RemoteThumbProvider(assetId: key.assetId)),
+ initialImage: getInitialImage(RemoteThumbProvider(assetId: key.assetId, thumbhash: key.thumbhash)),
informationCollector: () => <DiagnosticsNode>[
DiagnosticsProperty<ImageProvider>('Image provider', this),
DiagnosticsProperty<String>('Asset Id', key.assetId),
@@ -94,7 +96,7 @@ class RemoteFullImageProvider extends CancellableImageProvider<RemoteFullImagePr
final headers = ApiService.getRequestHeaders();
final request = this.request = RemoteImageRequest(
- uri: getThumbnailUrlForRemoteId(key.assetId, type: AssetMediaSize.preview),
+ uri: getThumbnailUrlForRemoteId(key.assetId, type: AssetMediaSize.preview, thumbhash: key.thumbhash),
headers: headers,
cacheManager: cacheManager,
);
@@ -115,12 +117,12 @@ class RemoteFullImageProvider extends CancellableImageProvider<RemoteFullImagePr
bool operator ==(Object other) {
if (identical(this, other)) return true;
if (other is RemoteFullImageProvider) {
- return assetId == other.assetId;
+ return assetId == other.assetId && thumbhash == other.thumbhash;
}
return false;
}
@override
- int get hashCode => assetId.hashCode;
+ int get hashCode => assetId.hashCode ^ thumbhash.hashCode;
}
diff --git a/mobile/lib/presentation/widgets/images/thumbnail.widget.dart b/mobile/lib/presentation/widgets/images/thumbnail.widget.dart
index 92b1bb2544..f878c214a9 100644
--- a/mobile/lib/presentation/widgets/images/thumbnail.widget.dart
+++ b/mobile/lib/presentation/widgets/images/thumbnail.widget.dart
@@ -21,9 +21,14 @@ class Thumbnail extends StatefulWidget {
const Thumbnail({this.imageProvider, this.fit = BoxFit.cover, this.thumbhashProvider, super.key});
- Thumbnail.remote({required String remoteId, this.fit = BoxFit.cover, Size size = kThumbnailResolution, super.key})
- : imageProvider = RemoteThumbProvider(assetId: remoteId),
- thumbhashProvider = null;
+ Thumbnail.remote({
+ required String remoteId,
+ required String thumbhash,
+ this.fit = BoxFit.cover,
+ Size size = kThumbnailResolution,
+ super.key,
+ }) : imageProvider = RemoteThumbProvider(assetId: remoteId, thumbhash: thumbhash),
+ thumbhashProvider = null;
Thumbnail.fromAsset({
required BaseAsset? asset,
diff --git a/mobile/lib/presentation/widgets/memory/memory_lane.widget.dart b/mobile/lib/presentation/widgets/memory/memory_lane.widget.dart
index e85a6c05f8..62889b10cb 100644
--- a/mobile/lib/presentation/widgets/memory/memory_lane.widget.dart
+++ b/mobile/lib/presentation/widgets/memory/memory_lane.widget.dart
@@ -60,7 +60,11 @@ class DriftMemoryCard extends ConsumerWidget {
child: SizedBox(
width: 205,
height: 200,
- child: Thumbnail.remote(remoteId: memory.assets[0].id, fit: BoxFit.cover),
+ child: Thumbnail.remote(
+ remoteId: memory.assets[0].id,
+ thumbhash: memory.assets[0].thumbHash ?? "",
+ fit: BoxFit.cover,
+ ),
),
),
Positioned(
diff --git a/mobile/lib/providers/cast.provider.dart b/mobile/lib/providers/cast.provider.dart
index 75a2a35fb6..1cd5ded487 100644
--- a/mobile/lib/providers/cast.provider.dart
+++ b/mobile/lib/providers/cast.provider.dart
@@ -69,6 +69,7 @@ class CastNotifier extends StateNotifier<CastManagerState> {
: AssetType.other,
createdAt: asset.fileCreatedAt,
updatedAt: asset.updatedAt,
+ isEdited: false,
);
_gCastService.loadMedia(remoteAsset, reload);
diff --git a/mobile/lib/providers/websocket.provider.dart b/mobile/lib/providers/websocket.provider.dart
index 6a1083bfcc..f9473ce440 100644
--- a/mobile/lib/providers/websocket.provider.dart
+++ b/mobile/lib/providers/websocket.provider.dart
@@ -144,6 +144,7 @@ class WebsocketNotifier extends StateNotifier<WebsocketState> {
socket.on('on_asset_hidden', _handleOnAssetHidden);
} else {
socket.on('AssetUploadReadyV1', _handleSyncAssetUploadReady);
+ socket.on('AssetEditReadyV1', _handleSyncAssetEditReady);
}
socket.on('on_config_update', _handleOnConfigUpdate);
@@ -192,10 +193,12 @@ class WebsocketNotifier extends StateNotifier<WebsocketState> {
void stopListeningToBetaEvents() {
state.socket?.off('AssetUploadReadyV1');
+ state.socket?.off('AssetEditReadyV1');
}
void startListeningToBetaEvents() {
state.socket?.on('AssetUploadReadyV1', _handleSyncAssetUploadReady);
+ state.socket?.on('AssetEditReadyV1', _handleSyncAssetEditReady);
}
void listenUploadEvent() {
@@ -315,6 +318,10 @@ class WebsocketNotifier extends StateNotifier<WebsocketState> {
_batchDebouncer.run(_processBatchedAssetUploadReady);
}
+ void _handleSyncAssetEditReady(dynamic data) {
+ unawaited(_ref.read(backgroundSyncProvider).syncWebsocketEditBatch([data]));
+ }
+
void _processBatchedAssetUploadReady() {
if (_batchedAssetUploadReady.isEmpty) {
return;
diff --git a/mobile/lib/repositories/file_media.repository.dart b/mobile/lib/repositories/file_media.repository.dart
index 654be78fb4..3a3e50f370 100644
--- a/mobile/lib/repositories/file_media.repository.dart
+++ b/mobile/lib/repositories/file_media.repository.dart
@@ -25,6 +25,7 @@ class FileMediaRepository {
type: AssetType.image,
createdAt: entity.createDateTime,
updatedAt: entity.modifiedDateTime,
+ isEdited: false,
);
}
diff --git a/mobile/lib/utils/image_url_builder.dart b/mobile/lib/utils/image_url_builder.dart
index 4059f5baa2..079f0e51fa 100644
--- a/mobile/lib/utils/image_url_builder.dart
+++ b/mobile/lib/utils/image_url_builder.dart
@@ -50,8 +50,10 @@ String getThumbnailUrlForRemoteId(
final String id, {
AssetMediaSize type = AssetMediaSize.thumbnail,
bool edited = true,
+ String? thumbhash,
}) {
- return '${Store.get(StoreKey.serverEndpoint)}/assets/$id/thumbnail?size=${type.value}&edited=$edited';
+ final url = '${Store.get(StoreKey.serverEndpoint)}/assets/$id/thumbnail?size=${type.value}&edited=$edited';
+ return thumbhash != null ? '$url&c=${Uri.encodeComponent(thumbhash)}' : url;
}
String getPlaybackUrlForRemoteId(final String id) {
diff --git a/mobile/lib/utils/openapi_patching.dart b/mobile/lib/utils/openapi_patching.dart
index 02ff265104..090889ff32 100644
--- a/mobile/lib/utils/openapi_patching.dart
+++ b/mobile/lib/utils/openapi_patching.dart
@@ -49,7 +49,7 @@ dynamic upgradeDto(dynamic value, String targetType) {
}
case 'SyncAssetV1':
if (value is Map) {
- addDefault(value, 'editCount', 0);
+ addDefault(value, 'isEdited', false);
}
case 'ServerFeaturesDto':
if (value is Map) {
diff --git a/mobile/openapi/lib/model/sync_asset_v1.dart b/mobile/openapi/lib/model/sync_asset_v1.dart
index 6e9fa95df0..1d0e735396 100644
--- a/mobile/openapi/lib/model/sync_asset_v1.dart
+++ b/mobile/openapi/lib/model/sync_asset_v1.dart
@@ -16,11 +16,11 @@ class SyncAssetV1 {
required this.checksum,
required this.deletedAt,
required this.duration,
- required this.editCount,
required this.fileCreatedAt,
required this.fileModifiedAt,
required this.height,
required this.id,
+ required this.isEdited,
required this.isFavorite,
required this.libraryId,
required this.livePhotoVideoId,
@@ -40,8 +40,6 @@ class SyncAssetV1 {
String? duration;
- int editCount;
-
DateTime? fileCreatedAt;
DateTime? fileModifiedAt;
@@ -50,6 +48,8 @@ class SyncAssetV1 {
String id;
+ bool isEdited;
+
bool isFavorite;
String? libraryId;
@@ -77,11 +77,11 @@ class SyncAssetV1 {
other.checksum == checksum &&
other.deletedAt == deletedAt &&
other.duration == duration &&
- other.editCount == editCount &&
other.fileCreatedAt == fileCreatedAt &&
other.fileModifiedAt == fileModifiedAt &&
other.height == height &&
other.id == id &&
+ other.isEdited == isEdited &&
other.isFavorite == isFavorite &&
other.libraryId == libraryId &&
other.livePhotoVideoId == livePhotoVideoId &&
@@ -100,11 +100,11 @@ class SyncAssetV1 {
(checksum.hashCode) +
(deletedAt == null ? 0 : deletedAt!.hashCode) +
(duration == null ? 0 : duration!.hashCode) +
- (editCount.hashCode) +
(fileCreatedAt == null ? 0 : fileCreatedAt!.hashCode) +
(fileModifiedAt == null ? 0 : fileModifiedAt!.hashCode) +
(height == null ? 0 : height!.hashCode) +
(id.hashCode) +
+ (isEdited.hashCode) +
(isFavorite.hashCode) +
(libraryId == null ? 0 : libraryId!.hashCode) +
(livePhotoVideoId == null ? 0 : livePhotoVideoId!.hashCode) +
@@ -118,7 +118,7 @@ class SyncAssetV1 {
(width == null ? 0 : width!.hashCode);
@override
- String toString() => 'SyncAssetV1[checksum=$checksum, deletedAt=$deletedAt, duration=$duration, editCount=$editCount, fileCreatedAt=$fileCreatedAt, fileModifiedAt=$fileModifiedAt, height=$height, id=$id, isFavorite=$isFavorite, libraryId=$libraryId, livePhotoVideoId=$livePhotoVideoId, localDateTime=$localDateTime, originalFileName=$originalFileName, ownerId=$ownerId, stackId=$stackId, thumbhash=$thumbhash, type=$type, visibility=$visibility, width=$width]';
+ String toString() => 'SyncAssetV1[checksum=$checksum, deletedAt=$deletedAt, duration=$duration, fileCreatedAt=$fileCreatedAt, fileModifiedAt=$fileModifiedAt, height=$height, id=$id, isEdited=$isEdited, isFavorite=$isFavorite, libraryId=$libraryId, livePhotoVideoId=$livePhotoVideoId, localDateTime=$localDateTime, originalFileName=$originalFileName, ownerId=$ownerId, stackId=$stackId, thumbhash=$thumbhash, type=$type, visibility=$visibility, width=$width]';
Map<String, dynamic> toJson() {
final json = <String, dynamic>{};
@@ -133,7 +133,6 @@ class SyncAssetV1 {
} else {
// json[r'duration'] = null;
}
- json[r'editCount'] = this.editCount;
if (this.fileCreatedAt != null) {
json[r'fileCreatedAt'] = this.fileCreatedAt!.toUtc().toIso8601String();
} else {
@@ -150,6 +149,7 @@ class SyncAssetV1 {
// json[r'height'] = null;
}
json[r'id'] = this.id;
+ json[r'isEdited'] = this.isEdited;
json[r'isFavorite'] = this.isFavorite;
if (this.libraryId != null) {
json[r'libraryId'] = this.libraryId;
@@ -200,11 +200,11 @@ class SyncAssetV1 {
checksum: mapValueOfType<String>(json, r'checksum')!,
deletedAt: mapDateTime(json, r'deletedAt', r''),
duration: mapValueOfType<String>(json, r'duration'),
- editCount: mapValueOfType<int>(json, r'editCount')!,
fileCreatedAt: mapDateTime(json, r'fileCreatedAt', r''),
fileModifiedAt: mapDateTime(json, r'fileModifiedAt', r''),
height: mapValueOfType<int>(json, r'height'),
id: mapValueOfType<String>(json, r'id')!,
+ isEdited: mapValueOfType<bool>(json, r'isEdited')!,
isFavorite: mapValueOfType<bool>(json, r'isFavorite')!,
libraryId: mapValueOfType<String>(json, r'libraryId'),
livePhotoVideoId: mapValueOfType<String>(json, r'livePhotoVideoId'),
@@ -266,11 +266,11 @@ class SyncAssetV1 {
'checksum',
'deletedAt',
'duration',
- 'editCount',
'fileCreatedAt',
'fileModifiedAt',
'height',
'id',
+ 'isEdited',
'isFavorite',
'libraryId',
'livePhotoVideoId',
diff --git a/mobile/test/domain/repositories/sync_stream_repository_test.dart b/mobile/test/domain/repositories/sync_stream_repository_test.dart
index 5f139df401..a26683213c 100644
--- a/mobile/test/domain/repositories/sync_stream_repository_test.dart
+++ b/mobile/test/domain/repositories/sync_stream_repository_test.dart
@@ -44,7 +44,7 @@ SyncAssetV1 _createAsset({
livePhotoVideoId: null,
stackId: null,
thumbhash: null,
- editCount: 0,
+ isEdited: false,
);
}
diff --git a/mobile/test/drift/main/generated/schema.dart b/mobile/test/drift/main/generated/schema.dart
index 571d5c0284..89eef9c831 100644
--- a/mobile/test/drift/main/generated/schema.dart
+++ b/mobile/test/drift/main/generated/schema.dart
@@ -19,6 +19,7 @@ import 'schema_v13.dart' as v13;
import 'schema_v14.dart' as v14;
import 'schema_v15.dart' as v15;
import 'schema_v16.dart' as v16;
+import 'schema_v17.dart' as v17;
class GeneratedHelper implements SchemaInstantiationHelper {
@override
@@ -56,6 +57,8 @@ class GeneratedHelper implements SchemaInstantiationHelper {
return v15.DatabaseAtV15(db);
case 16:
return v16.DatabaseAtV16(db);
+ case 17:
+ return v17.DatabaseAtV17(db);
default:
throw MissingSchemaException(version, versions);
}
@@ -78,5 +81,6 @@ class GeneratedHelper implements SchemaInstantiationHelper {
14,
15,
16,
+ 17,
];
}
diff --git a/mobile/test/drift/main/generated/schema_v17.dart b/mobile/test/drift/main/generated/schema_v17.dart
new file mode 100644
index 0000000000..042c069ecd
--- /dev/null
+++ b/mobile/test/drift/main/generated/schema_v17.dart
@@ -0,0 +1,8337 @@
+// dart format width=80
+// GENERATED CODE, DO NOT EDIT BY HAND.
+// ignore_for_file: type=lint
+import 'package:drift/drift.dart';
+
+class UserEntity extends Table with TableInfo<UserEntity, UserEntityData> {
+ @override
+ final GeneratedDatabase attachedDatabase;
+ final String? _alias;
+ UserEntity(this.attachedDatabase, [this._alias]);
+ late final GeneratedColumn<String> id = GeneratedColumn<String>(
+ 'id',
+ aliasedName,
+ false,
+ type: DriftSqlType.string,
+ requiredDuringInsert: true,
+ );
+ late final GeneratedColumn<String> name = GeneratedColumn<String>(
+ 'name',
+ aliasedName,
+ false,
+ type: DriftSqlType.string,
+ requiredDuringInsert: true,
+ );
+ late final GeneratedColumn<String> email = GeneratedColumn<String>(
+ 'email',
+ aliasedName,
+ false,
+ type: DriftSqlType.string,
+ requiredDuringInsert: true,
+ );
+ late final GeneratedColumn<bool> hasProfileImage = GeneratedColumn<bool>(
+ 'has_profile_image',
+ aliasedName,
+ false,
+ type: DriftSqlType.bool,
+ requiredDuringInsert: false,
+ defaultConstraints: GeneratedColumn.constraintIsAlways(
+ 'CHECK ("has_profile_image" IN (0, 1))',
+ ),
+ defaultValue: const CustomExpression('0'),
+ );
+ late final GeneratedColumn<DateTime> profileChangedAt =
+ GeneratedColumn<DateTime>(
+ 'profile_changed_at',
+ aliasedName,
+ false,
+ type: DriftSqlType.dateTime,
+ requiredDuringInsert: false,
+ defaultValue: const CustomExpression('CURRENT_TIMESTAMP'),
+ );
+ late final GeneratedColumn<int> avatarColor = GeneratedColumn<int>(
+ 'avatar_color',
+ aliasedName,
+ false,
+ type: DriftSqlType.int,
+ requiredDuringInsert: false,
+ defaultValue: const CustomExpression('0'),
+ );
+ @override
+ List<GeneratedColumn> get $columns => [
+ id,
+ name,
+ email,
+ hasProfileImage,
+ profileChangedAt,
+ avatarColor,
+ ];
+ @override
+ String get aliasedName => _alias ?? actualTableName;
+ @override
+ String get actualTableName => $name;
+ static const String $name = 'user_entity';
+ @override
+ Set<GeneratedColumn> get $primaryKey => {id};
+ @override
+ UserEntityData map(Map<String, dynamic> data, {String? tablePrefix}) {
+ final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : '';
+ return UserEntityData(
+ id: attachedDatabase.typeMapping.read(
+ DriftSqlType.string,
+ data['${effectivePrefix}id'],
+ )!,
+ name: attachedDatabase.typeMapping.read(
+ DriftSqlType.string,
+ data['${effectivePrefix}name'],
+ )!,
+ email: attachedDatabase.typeMapping.read(
+ DriftSqlType.string,
+ data['${effectivePrefix}email'],
+ )!,
+ hasProfileImage: attachedDatabase.typeMapping.read(
+ DriftSqlType.bool,
+ data['${effectivePrefix}has_profile_image'],
+ )!,
+ profileChangedAt: attachedDatabase.typeMapping.read(
+ DriftSqlType.dateTime,
+ data['${effectivePrefix}profile_changed_at'],
+ )!,
+ avatarColor: attachedDatabase.typeMapping.read(
+ DriftSqlType.int,
+ data['${effectivePrefix}avatar_color'],
+ )!,
+ );
+ }
+
+ @override
+ UserEntity createAlias(String alias) {
+ return UserEntity(attachedDatabase, alias);
+ }
+
+ @override
+ bool get withoutRowId => true;
+ @override
+ bool get isStrict => true;
+}
+
+class UserEntityData extends DataClass implements Insertable<UserEntityData> {
+ final String id;
+ final String name;
+ final String email;
+ final bool hasProfileImage;
+ final DateTime profileChangedAt;
+ final int avatarColor;
+ const UserEntityData({
+ required this.id,
+ required this.name,
+ required this.email,
+ required this.hasProfileImage,
+ required this.profileChangedAt,
+ required this.avatarColor,
+ });
+ @override
+ Map<String, Expression> toColumns(bool nullToAbsent) {
+ final map = <String, Expression>{};
+ map['id'] = Variable<String>(id);
+ map['name'] = Variable<String>(name);
+ map['email'] = Variable<String>(email);
+ map['has_profile_image'] = Variable<bool>(hasProfileImage);
+ map['profile_changed_at'] = Variable<DateTime>(profileChangedAt);
+ map['avatar_color'] = Variable<int>(avatarColor);
+ return map;
+ }
+
+ factory UserEntityData.fromJson(
+ Map<String, dynamic> json, {
+ ValueSerializer? serializer,
+ }) {
+ serializer ??= driftRuntimeOptions.defaultSerializer;
+ return UserEntityData(
+ id: serializer.fromJson<String>(json['id']),
+ name: serializer.fromJson<String>(json['name']),
+ email: serializer.fromJson<String>(json['email']),
+ hasProfileImage: serializer.fromJson<bool>(json['hasProfileImage']),
+ profileChangedAt: serializer.fromJson<DateTime>(json['profileChangedAt']),
+ avatarColor: serializer.fromJson<int>(json['avatarColor']),
+ );
+ }
+ @override
+ Map<String, dynamic> toJson({ValueSerializer? serializer}) {
+ serializer ??= driftRuntimeOptions.defaultSerializer;
+ return <String, dynamic>{
+ 'id': serializer.toJson<String>(id),
+ 'name': serializer.toJson<String>(name),
+ 'email': serializer.toJson<String>(email),
+ 'hasProfileImage': serializer.toJson<bool>(hasProfileImage),
+ 'profileChangedAt': serializer.toJson<DateTime>(profileChangedAt),
+ 'avatarColor': serializer.toJson<int>(avatarColor),
+ };
+ }
+
+ UserEntityData copyWith({
+ String? id,
+ String? name,
+ String? email,
+ bool? hasProfileImage,
+ DateTime? profileChangedAt,
+ int? avatarColor,
+ }) => UserEntityData(
+ id: id ?? this.id,
+ name: name ?? this.name,
+ email: email ?? this.email,
+ hasProfileImage: hasProfileImage ?? this.hasProfileImage,
+ profileChangedAt: profileChangedAt ?? this.profileChangedAt,
+ avatarColor: avatarColor ?? this.avatarColor,
+ );
+ UserEntityData copyWithCompanion(UserEntityCompanion data) {
+ return UserEntityData(
+ id: data.id.present ? data.id.value : this.id,
+ name: data.name.present ? data.name.value : this.name,
+ email: data.email.present ? data.email.value : this.email,
+ hasProfileImage: data.hasProfileImage.present
+ ? data.hasProfileImage.value
+ : this.hasProfileImage,
+ profileChangedAt: data.profileChangedAt.present
+ ? data.profileChangedAt.value
+ : this.profileChangedAt,
+ avatarColor: data.avatarColor.present
+ ? data.avatarColor.value
+ : this.avatarColor,
+ );
+ }
+
+ @override
+ String toString() {
+ return (StringBuffer('UserEntityData(')
+ ..write('id: $id, ')
+ ..write('name: $name, ')
+ ..write('email: $email, ')
+ ..write('hasProfileImage: $hasProfileImage, ')
+ ..write('profileChangedAt: $profileChangedAt, ')
+ ..write('avatarColor: $avatarColor')
+ ..write(')'))
+ .toString();
+ }
+
+ @override
+ int get hashCode => Object.hash(
+ id,
+ name,
+ email,
+ hasProfileImage,
+ profileChangedAt,
+ avatarColor,
+ );
+ @override
+ bool operator ==(Object other) =>
+ identical(this, other) ||
+ (other is UserEntityData &&
+ other.id == this.id &&
+ other.name == this.name &&
+ other.email == this.email &&
+ other.hasProfileImage == this.hasProfileImage &&
+ other.profileChangedAt == this.profileChangedAt &&
+ other.avatarColor == this.avatarColor);
+}
+
+class UserEntityCompanion extends UpdateCompanion<UserEntityData> {
+ final Value<String> id;
+ final Value<String> name;
+ final Value<String> email;
+ final Value<bool> hasProfileImage;
+ final Value<DateTime> profileChangedAt;
+ final Value<int> avatarColor;
+ const UserEntityCompanion({
+ this.id = const Value.absent(),
+ this.name = const Value.absent(),
+ this.email = const Value.absent(),
+ this.hasProfileImage = const Value.absent(),
+ this.profileChangedAt = const Value.absent(),
+ this.avatarColor = const Value.absent(),
+ });
+ UserEntityCompanion.insert({
+ required String id,
+ required String name,
+ required String email,
+ this.hasProfileImage = const Value.absent(),
+ this.profileChangedAt = const Value.absent(),
+ this.avatarColor = const Value.absent(),
+ }) : id = Value(id),
+ name = Value(name),
+ email = Value(email);
+ static Insertable<UserEntityData> custom({
+ Expression<String>? id,
+ Expression<String>? name,
+ Expression<String>? email,
+ Expression<bool>? hasProfileImage,
+ Expression<DateTime>? profileChangedAt,
+ Expression<int>? avatarColor,
+ }) {
+ return RawValuesInsertable({
+ if (id != null) 'id': id,
+ if (name != null) 'name': name,
+ if (email != null) 'email': email,
+ if (hasProfileImage != null) 'has_profile_image': hasProfileImage,
+ if (profileChangedAt != null) 'profile_changed_at': profileChangedAt,
+ if (avatarColor != null) 'avatar_color': avatarColor,
+ });
+ }
+
+ UserEntityCompanion copyWith({
+ Value<String>? id,
+ Value<String>? name,
+ Value<String>? email,
+ Value<bool>? hasProfileImage,
+ Value<DateTime>? profileChangedAt,
+ Value<int>? avatarColor,
+ }) {
+ return UserEntityCompanion(
+ id: id ?? this.id,
+ name: name ?? this.name,
+ email: email ?? this.email,
+ hasProfileImage: hasProfileImage ?? this.hasProfileImage,
+ profileChangedAt: profileChangedAt ?? this.profileChangedAt,
+ avatarColor: avatarColor ?? this.avatarColor,
+ );
+ }
+
+ @override
+ Map<String, Expression> toColumns(bool nullToAbsent) {
+ final map = <String, Expression>{};
+ if (id.present) {
+ map['id'] = Variable<String>(id.value);
+ }
+ if (name.present) {
+ map['name'] = Variable<String>(name.value);
+ }
+ if (email.present) {
+ map['email'] = Variable<String>(email.value);
+ }
+ if (hasProfileImage.present) {
+ map['has_profile_image'] = Variable<bool>(hasProfileImage.value);
+ }
+ if (profileChangedAt.present) {
+ map['profile_changed_at'] = Variable<DateTime>(profileChangedAt.value);
+ }
+ if (avatarColor.present) {
+ map['avatar_color'] = Variable<int>(avatarColor.value);
+ }
+ return map;
+ }
+
+ @override
+ String toString() {
+ return (StringBuffer('UserEntityCompanion(')
+ ..write('id: $id, ')
+ ..write('name: $name, ')
+ ..write('email: $email, ')
+ ..write('hasProfileImage: $hasProfileImage, ')
+ ..write('profileChangedAt: $profileChangedAt, ')
+ ..write('avatarColor: $avatarColor')
+ ..write(')'))
+ .toString();
+ }
+}
+
+class RemoteAssetEntity extends Table
+ with TableInfo<RemoteAssetEntity, RemoteAssetEntityData> {
+ @override
+ final GeneratedDatabase attachedDatabase;
+ final String? _alias;
+ RemoteAssetEntity(this.attachedDatabase, [this._alias]);
+ late final GeneratedColumn<String> name = GeneratedColumn<String>(
+ 'name',
+ aliasedName,
+ false,
+ type: DriftSqlType.string,
+ requiredDuringInsert: true,
+ );
+ late final GeneratedColumn<int> type = GeneratedColumn<int>(
+ 'type',
+ aliasedName,
+ false,
+ type: DriftSqlType.int,
+ requiredDuringInsert: true,
+ );
+ late final GeneratedColumn<DateTime> createdAt = GeneratedColumn<DateTime>(
+ 'created_at',
+ aliasedName,
+ false,
+ type: DriftSqlType.dateTime,
+ requiredDuringInsert: false,
+ defaultValue: const CustomExpression('CURRENT_TIMESTAMP'),
+ );
+ late final GeneratedColumn<DateTime> updatedAt = GeneratedColumn<DateTime>(
+ 'updated_at',
+ aliasedName,
+ false,
+ type: DriftSqlType.dateTime,
+ requiredDuringInsert: false,
+ defaultValue: const CustomExpression('CURRENT_TIMESTAMP'),
+ );
+ late final GeneratedColumn<int> width = GeneratedColumn<int>(
+ 'width',
+ aliasedName,
+ true,
+ type: DriftSqlType.int,
+ requiredDuringInsert: false,
+ );
+ late final GeneratedColumn<int> height = GeneratedColumn<int>(
+ 'height',
+ aliasedName,
+ true,
+ type: DriftSqlType.int,
+ requiredDuringInsert: false,
+ );
+ late final GeneratedColumn<int> durationInSeconds = GeneratedColumn<int>(
+ 'duration_in_seconds',
+ aliasedName,
+ true,
+ type: DriftSqlType.int,
+ requiredDuringInsert: false,
+ );
+ late final GeneratedColumn<String> id = GeneratedColumn<String>(
+ 'id',
+ aliasedName,
+ false,
+ type: DriftSqlType.string,
+ requiredDuringInsert: true,
+ );
+ late final GeneratedColumn<String> checksum = GeneratedColumn<String>(
+ 'checksum',
+ aliasedName,
+ false,
+ type: DriftSqlType.string,
+ requiredDuringInsert: true,
+ );
+ late final GeneratedColumn<bool> isFavorite = GeneratedColumn<bool>(
+ 'is_favorite',
+ aliasedName,
+ false,
+ type: DriftSqlType.bool,
+ requiredDuringInsert: false,
+ defaultConstraints: GeneratedColumn.constraintIsAlways(
+ 'CHECK ("is_favorite" IN (0, 1))',
+ ),
+ defaultValue: const CustomExpression('0'),
+ );
+ late final GeneratedColumn<String> ownerId = GeneratedColumn<String>(
+ 'owner_id',
+ aliasedName,
+ false,
+ type: DriftSqlType.string,
+ requiredDuringInsert: true,
+ defaultConstraints: GeneratedColumn.constraintIsAlways(
+ 'REFERENCES user_entity (id) ON DELETE CASCADE',
+ ),
+ );
+ late final GeneratedColumn<DateTime> localDateTime =
+ GeneratedColumn<DateTime>(
+ 'local_date_time',
+ aliasedName,
+ true,
+ type: DriftSqlType.dateTime,
+ requiredDuringInsert: false,
+ );
+ late final GeneratedColumn<String> thumbHash = GeneratedColumn<String>(
+ 'thumb_hash',
+ aliasedName,
+ true,
+ type: DriftSqlType.string,
+ requiredDuringInsert: false,
+ );
+ late final GeneratedColumn<DateTime> deletedAt = GeneratedColumn<DateTime>(
+ 'deleted_at',
+ aliasedName,
+ true,
+ type: DriftSqlType.dateTime,
+ requiredDuringInsert: false,
+ );
+ late final GeneratedColumn<String> livePhotoVideoId = GeneratedColumn<String>(
+ 'live_photo_video_id',
+ aliasedName,
+ true,
+ type: DriftSqlType.string,
+ requiredDuringInsert: false,
+ );
+ late final GeneratedColumn<int> visibility = GeneratedColumn<int>(
+ 'visibility',
+ aliasedName,
+ false,
+ type: DriftSqlType.int,
+ requiredDuringInsert: true,
+ );
+ late final GeneratedColumn<String> stackId = GeneratedColumn<String>(
+ 'stack_id',
+ aliasedName,
+ true,
+ type: DriftSqlType.string,
+ requiredDuringInsert: false,
+ );
+ late final GeneratedColumn<String> libraryId = GeneratedColumn<String>(
+ 'library_id',
+ aliasedName,
+ true,
+ type: DriftSqlType.string,
+ requiredDuringInsert: false,
+ );
+ late final GeneratedColumn<bool> isEdited = GeneratedColumn<bool>(
+ 'is_edited',
+ aliasedName,
+ false,
+ type: DriftSqlType.bool,
+ requiredDuringInsert: false,
+ defaultConstraints: GeneratedColumn.constraintIsAlways(
+ 'CHECK ("is_edited" IN (0, 1))',
+ ),
+ defaultValue: const CustomExpression('0'),
+ );
+ @override
+ List<GeneratedColumn> get $columns => [
+ name,
+ type,
+ createdAt,
+ updatedAt,
+ width,
+ height,
+ durationInSeconds,
+ id,
+ checksum,
+ isFavorite,
+ ownerId,
+ localDateTime,
+ thumbHash,
+ deletedAt,
+ livePhotoVideoId,
+ visibility,
+ stackId,
+ libraryId,
+ isEdited,
+ ];
+ @override
+ String get aliasedName => _alias ?? actualTableName;
+ @override
+ String get actualTableName => $name;
+ static const String $name = 'remote_asset_entity';
+ @override
+ Set<GeneratedColumn> get $primaryKey => {id};
+ @override
+ RemoteAssetEntityData map(Map<String, dynamic> data, {String? tablePrefix}) {
+ final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : '';
+ return RemoteAssetEntityData(
+ name: attachedDatabase.typeMapping.read(
+ DriftSqlType.string,
+ data['${effectivePrefix}name'],
+ )!,
+ type: attachedDatabase.typeMapping.read(
+ DriftSqlType.int,
+ data['${effectivePrefix}type'],
+ )!,
+ createdAt: attachedDatabase.typeMapping.read(
+ DriftSqlType.dateTime,
+ data['${effectivePrefix}created_at'],
+ )!,
+ updatedAt: attachedDatabase.typeMapping.read(
+ DriftSqlType.dateTime,
+ data['${effectivePrefix}updated_at'],
+ )!,
+ width: attachedDatabase.typeMapping.read(
+ DriftSqlType.int,
+ data['${effectivePrefix}width'],
+ ),
+ height: attachedDatabase.typeMapping.read(
+ DriftSqlType.int,
+ data['${effectivePrefix}height'],
+ ),
+ durationInSeconds: attachedDatabase.typeMapping.read(
+ DriftSqlType.int,
+ data['${effectivePrefix}duration_in_seconds'],
+ ),
+ id: attachedDatabase.typeMapping.read(
+ DriftSqlType.string,
+ data['${effectivePrefix}id'],
+ )!,
+ checksum: attachedDatabase.typeMapping.read(
+ DriftSqlType.string,
+ data['${effectivePrefix}checksum'],
+ )!,
+ isFavorite: attachedDatabase.typeMapping.read(
+ DriftSqlType.bool,
+ data['${effectivePrefix}is_favorite'],
+ )!,
+ ownerId: attachedDatabase.typeMapping.read(
+ DriftSqlType.string,
+ data['${effectivePrefix}owner_id'],
+ )!,
+ localDateTime: attachedDatabase.typeMapping.read(
+ DriftSqlType.dateTime,
+ data['${effectivePrefix}local_date_time'],
+ ),
+ thumbHash: attachedDatabase.typeMapping.read(
+ DriftSqlType.string,
+ data['${effectivePrefix}thumb_hash'],
+ ),
+ deletedAt: attachedDatabase.typeMapping.read(
+ DriftSqlType.dateTime,
+ data['${effectivePrefix}deleted_at'],
+ ),
+ livePhotoVideoId: attachedDatabase.typeMapping.read(
+ DriftSqlType.string,
+ data['${effectivePrefix}live_photo_video_id'],
+ ),
+ visibility: attachedDatabase.typeMapping.read(
+ DriftSqlType.int,
+ data['${effectivePrefix}visibility'],
+ )!,
+ stackId: attachedDatabase.typeMapping.read(
+ DriftSqlType.string,
+ data['${effectivePrefix}stack_id'],
+ ),
+ libraryId: attachedDatabase.typeMapping.read(
+ DriftSqlType.string,
+ data['${effectivePrefix}library_id'],
+ ),
+ isEdited: attachedDatabase.typeMapping.read(
+ DriftSqlType.bool,
+ data['${effectivePrefix}is_edited'],
+ )!,
+ );
+ }
+
+ @override
+ RemoteAssetEntity createAlias(String alias) {
+ return RemoteAssetEntity(attachedDatabase, alias);
+ }
+
+ @override
+ bool get withoutRowId => true;
+ @override
+ bool get isStrict => true;
+}
+
+class RemoteAssetEntityData extends DataClass
+ implements Insertable<RemoteAssetEntityData> {
+ final String name;
+ final int type;
+ final DateTime createdAt;
+ final DateTime updatedAt;
+ final int? width;
+ final int? height;
+ final int? durationInSeconds;
+ final String id;
+ final String checksum;
+ final bool isFavorite;
+ final String ownerId;
+ final DateTime? localDateTime;
+ final String? thumbHash;
+ final DateTime? deletedAt;
+ final String? livePhotoVideoId;
+ final int visibility;
+ final String? stackId;
+ final String? libraryId;
+ final bool isEdited;
+ const RemoteAssetEntityData({
+ required this.name,
+ required this.type,
+ required this.createdAt,
+ required this.updatedAt,
+ this.width,
+ this.height,
+ this.durationInSeconds,
+ required this.id,
+ required this.checksum,
+ required this.isFavorite,
+ required this.ownerId,
+ this.localDateTime,
+ this.thumbHash,
+ this.deletedAt,
+ this.livePhotoVideoId,
+ required this.visibility,
+ this.stackId,
+ this.libraryId,
+ required this.isEdited,
+ });
+ @override
+ Map<String, Expression> toColumns(bool nullToAbsent) {
+ final map = <String, Expression>{};
+ map['name'] = Variable<String>(name);
+ map['type'] = Variable<int>(type);
+ map['created_at'] = Variable<DateTime>(createdAt);
+ map['updated_at'] = Variable<DateTime>(updatedAt);
+ if (!nullToAbsent || width != null) {
+ map['width'] = Variable<int>(width);
+ }
+ if (!nullToAbsent || height != null) {
+ map['height'] = Variable<int>(height);
+ }
+ if (!nullToAbsent || durationInSeconds != null) {
+ map['duration_in_seconds'] = Variable<int>(durationInSeconds);
+ }
+ map['id'] = Variable<String>(id);
+ map['checksum'] = Variable<String>(checksum);
+ map['is_favorite'] = Variable<bool>(isFavorite);
+ map['owner_id'] = Variable<String>(ownerId);
+ if (!nullToAbsent || localDateTime != null) {
+ map['local_date_time'] = Variable<DateTime>(localDateTime);
+ }
+ if (!nullToAbsent || thumbHash != null) {
+ map['thumb_hash'] = Variable<String>(thumbHash);
+ }
+ if (!nullToAbsent || deletedAt != null) {
+ map['deleted_at'] = Variable<DateTime>(deletedAt);
+ }
+ if (!nullToAbsent || livePhotoVideoId != null) {
+ map['live_photo_video_id'] = Variable<String>(livePhotoVideoId);
+ }
+ map['visibility'] = Variable<int>(visibility);
+ if (!nullToAbsent || stackId != null) {
+ map['stack_id'] = Variable<String>(stackId);
+ }
+ if (!nullToAbsent || libraryId != null) {
+ map['library_id'] = Variable<String>(libraryId);
+ }
+ map['is_edited'] = Variable<bool>(isEdited);
+ return map;
+ }
+
+ factory RemoteAssetEntityData.fromJson(
+ Map<String, dynamic> json, {
+ ValueSerializer? serializer,
+ }) {
+ serializer ??= driftRuntimeOptions.defaultSerializer;
+ return RemoteAssetEntityData(
+ name: serializer.fromJson<String>(json['name']),
+ type: serializer.fromJson<int>(json['type']),
+ createdAt: serializer.fromJson<DateTime>(json['createdAt']),
+ updatedAt: serializer.fromJson<DateTime>(json['updatedAt']),
+ width: serializer.fromJson<int?>(json['width']),
+ height: serializer.fromJson<int?>(json['height']),
+ durationInSeconds: serializer.fromJson<int?>(json['durationInSeconds']),
+ id: serializer.fromJson<String>(json['id']),
+ checksum: serializer.fromJson<String>(json['checksum']),
+ isFavorite: serializer.fromJson<bool>(json['isFavorite']),
+ ownerId: serializer.fromJson<String>(json['ownerId']),
+ localDateTime: serializer.fromJson<DateTime?>(json['localDateTime']),
+ thumbHash: serializer.fromJson<String?>(json['thumbHash']),
+ deletedAt: serializer.fromJson<DateTime?>(json['deletedAt']),
+ livePhotoVideoId: serializer.fromJson<String?>(json['livePhotoVideoId']),
+ visibility: serializer.fromJson<int>(json['visibility']),
+ stackId: serializer.fromJson<String?>(json['stackId']),
+ libraryId: serializer.fromJson<String?>(json['libraryId']),
+ isEdited: serializer.fromJson<bool>(json['isEdited']),
+ );
+ }
+ @override
+ Map<String, dynamic> toJson({ValueSerializer? serializer}) {
+ serializer ??= driftRuntimeOptions.defaultSerializer;
+ return <String, dynamic>{
+ 'name': serializer.toJson<String>(name),
+ 'type': serializer.toJson<int>(type),
+ 'createdAt': serializer.toJson<DateTime>(createdAt),
+ 'updatedAt': serializer.toJson<DateTime>(updatedAt),
+ 'width': serializer.toJson<int?>(width),
+ 'height': serializer.toJson<int?>(height),
+ 'durationInSeconds': serializer.toJson<int?>(durationInSeconds),
+ 'id': serializer.toJson<String>(id),
+ 'checksum': serializer.toJson<String>(checksum),
+ 'isFavorite': serializer.toJson<bool>(isFavorite),
+ 'ownerId': serializer.toJson<String>(ownerId),
+ 'localDateTime': serializer.toJson<DateTime?>(localDateTime),
+ 'thumbHash': serializer.toJson<String?>(thumbHash),
+ 'deletedAt': serializer.toJson<DateTime?>(deletedAt),
+ 'livePhotoVideoId': serializer.toJson<String?>(livePhotoVideoId),
+ 'visibility': serializer.toJson<int>(visibility),
+ 'stackId': serializer.toJson<String?>(stackId),
+ 'libraryId': serializer.toJson<String?>(libraryId),
+ 'isEdited': serializer.toJson<bool>(isEdited),
+ };
+ }
+
+ RemoteAssetEntityData copyWith({
+ String? name,
+ int? type,
+ DateTime? createdAt,
+ DateTime? updatedAt,
+ Value<int?> width = const Value.absent(),
+ Value<int?> height = const Value.absent(),
+ Value<int?> durationInSeconds = const Value.absent(),
+ String? id,
+ String? checksum,
+ bool? isFavorite,
+ String? ownerId,
+ Value<DateTime?> localDateTime = const Value.absent(),
+ Value<String?> thumbHash = const Value.absent(),
+ Value<DateTime?> deletedAt = const Value.absent(),
+ Value<String?> livePhotoVideoId = const Value.absent(),
+ int? visibility,
+ Value<String?> stackId = const Value.absent(),
+ Value<String?> libraryId = const Value.absent(),
+ bool? isEdited,
+ }) => RemoteAssetEntityData(
+ name: name ?? this.name,
+ type: type ?? this.type,
+ createdAt: createdAt ?? this.createdAt,
+ updatedAt: updatedAt ?? this.updatedAt,
+ width: width.present ? width.value : this.width,
+ height: height.present ? height.value : this.height,
+ durationInSeconds: durationInSeconds.present
+ ? durationInSeconds.value
+ : this.durationInSeconds,
+ id: id ?? this.id,
+ checksum: checksum ?? this.checksum,
+ isFavorite: isFavorite ?? this.isFavorite,
+ ownerId: ownerId ?? this.ownerId,
+ localDateTime: localDateTime.present
+ ? localDateTime.value
+ : this.localDateTime,
+ thumbHash: thumbHash.present ? thumbHash.value : this.thumbHash,
+ deletedAt: deletedAt.present ? deletedAt.value : this.deletedAt,
+ livePhotoVideoId: livePhotoVideoId.present
+ ? livePhotoVideoId.value
+ : this.livePhotoVideoId,
+ visibility: visibility ?? this.visibility,
+ stackId: stackId.present ? stackId.value : this.stackId,
+ libraryId: libraryId.present ? libraryId.value : this.libraryId,
+ isEdited: isEdited ?? this.isEdited,
+ );
+ RemoteAssetEntityData copyWithCompanion(RemoteAssetEntityCompanion data) {
+ return RemoteAssetEntityData(
+ name: data.name.present ? data.name.value : this.name,
+ type: data.type.present ? data.type.value : this.type,
+ createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt,
+ updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt,
+ width: data.width.present ? data.width.value : this.width,
+ height: data.height.present ? data.height.value : this.height,
+ durationInSeconds: data.durationInSeconds.present
+ ? data.durationInSeconds.value
+ : this.durationInSeconds,
+ id: data.id.present ? data.id.value : this.id,
+ checksum: data.checksum.present ? data.checksum.value : this.checksum,
+ isFavorite: data.isFavorite.present
+ ? data.isFavorite.value
+ : this.isFavorite,
+ ownerId: data.ownerId.present ? data.ownerId.value : this.ownerId,
+ localDateTime: data.localDateTime.present
+ ? data.localDateTime.value
+ : this.localDateTime,
+ thumbHash: data.thumbHash.present ? data.thumbHash.value : this.thumbHash,
+ deletedAt: data.deletedAt.present ? data.deletedAt.value : this.deletedAt,
+ livePhotoVideoId: data.livePhotoVideoId.present
+ ? data.livePhotoVideoId.value
+ : this.livePhotoVideoId,
+ visibility: data.visibility.present
+ ? data.visibility.value
+ : this.visibility,
+ stackId: data.stackId.present ? data.stackId.value : this.stackId,
+ libraryId: data.libraryId.present ? data.libraryId.value : this.libraryId,
+ isEdited: data.isEdited.present ? data.isEdited.value : this.isEdited,
+ );
+ }
+
+ @override
+ String toString() {
+ return (StringBuffer('RemoteAssetEntityData(')
+ ..write('name: $name, ')
+ ..write('type: $type, ')
+ ..write('createdAt: $createdAt, ')
+ ..write('updatedAt: $updatedAt, ')
+ ..write('width: $width, ')
+ ..write('height: $height, ')
+ ..write('durationInSeconds: $durationInSeconds, ')
+ ..write('id: $id, ')
+ ..write('checksum: $checksum, ')
+ ..write('isFavorite: $isFavorite, ')
+ ..write('ownerId: $ownerId, ')
+ ..write('localDateTime: $localDateTime, ')
+ ..write('thumbHash: $thumbHash, ')
+ ..write('deletedAt: $deletedAt, ')
+ ..write('livePhotoVideoId: $livePhotoVideoId, ')
+ ..write('visibility: $visibility, ')
+ ..write('stackId: $stackId, ')
+ ..write('libraryId: $libraryId, ')
+ ..write('isEdited: $isEdited')
+ ..write(')'))
+ .toString();
+ }
+
+ @override
+ int get hashCode => Object.hash(
+ name,
+ type,
+ createdAt,
+ updatedAt,
+ width,
+ height,
+ durationInSeconds,
+ id,
+ checksum,
+ isFavorite,
+ ownerId,
+ localDateTime,
+ thumbHash,
+ deletedAt,
+ livePhotoVideoId,
+ visibility,
+ stackId,
+ libraryId,
+ isEdited,
+ );
+ @override
+ bool operator ==(Object other) =>
+ identical(this, other) ||
+ (other is RemoteAssetEntityData &&
+ other.name == this.name &&
+ other.type == this.type &&
+ other.createdAt == this.createdAt &&
+ other.updatedAt == this.updatedAt &&
+ other.width == this.width &&
+ other.height == this.height &&
+ other.durationInSeconds == this.durationInSeconds &&
+ other.id == this.id &&
+ other.checksum == this.checksum &&
+ other.isFavorite == this.isFavorite &&
+ other.ownerId == this.ownerId &&
+ other.localDateTime == this.localDateTime &&
+ other.thumbHash == this.thumbHash &&
+ other.deletedAt == this.deletedAt &&
+ other.livePhotoVideoId == this.livePhotoVideoId &&
+ other.visibility == this.visibility &&
+ other.stackId == this.stackId &&
+ other.libraryId == this.libraryId &&
+ other.isEdited == this.isEdited);
+}
+
+class RemoteAssetEntityCompanion
+ extends UpdateCompanion<RemoteAssetEntityData> {
+ final Value<String> name;
+ final Value<int> type;
+ final Value<DateTime> createdAt;
+ final Value<DateTime> updatedAt;
+ final Value<int?> width;
+ final Value<int?> height;
+ final Value<int?> durationInSeconds;
+ final Value<String> id;
+ final Value<String> checksum;
+ final Value<bool> isFavorite;
+ final Value<String> ownerId;
+ final Value<DateTime?> localDateTime;
+ final Value<String?> thumbHash;
+ final Value<DateTime?> deletedAt;
+ final Value<String?> livePhotoVideoId;
+ final Value<int> visibility;
+ final Value<String?> stackId;
+ final Value<String?> libraryId;
+ final Value<bool> isEdited;
+ const RemoteAssetEntityCompanion({
+ this.name = const Value.absent(),
+ this.type = const Value.absent(),
+ this.createdAt = const Value.absent(),
+ this.updatedAt = const Value.absent(),
+ this.width = const Value.absent(),
+ this.height = const Value.absent(),
+ this.durationInSeconds = const Value.absent(),
+ this.id = const Value.absent(),
+ this.checksum = const Value.absent(),
+ this.isFavorite = const Value.absent(),
+ this.ownerId = const Value.absent(),
+ this.localDateTime = const Value.absent(),
+ this.thumbHash = const Value.absent(),
+ this.deletedAt = const Value.absent(),
+ this.livePhotoVideoId = const Value.absent(),
+ this.visibility = const Value.absent(),
+ this.stackId = const Value.absent(),
+ this.libraryId = const Value.absent(),
+ this.isEdited = const Value.absent(),
+ });
+ RemoteAssetEntityCompanion.insert({
+ required String name,
+ required int type,
+ this.createdAt = const Value.absent(),
+ this.updatedAt = const Value.absent(),
+ this.width = const Value.absent(),
+ this.height = const Value.absent(),
+ this.durationInSeconds = const Value.absent(),
+ required String id,
+ required String checksum,
+ this.isFavorite = const Value.absent(),
+ required String ownerId,
+ this.localDateTime = const Value.absent(),
+ this.thumbHash = const Value.absent(),
+ this.deletedAt = const Value.absent(),
+ this.livePhotoVideoId = const Value.absent(),
+ required int visibility,
+ this.stackId = const Value.absent(),
+ this.libraryId = const Value.absent(),
+ this.isEdited = const Value.absent(),
+ }) : name = Value(name),
+ type = Value(type),
+ id = Value(id),
+ checksum = Value(checksum),
+ ownerId = Value(ownerId),
+ visibility = Value(visibility);
+ static Insertable<RemoteAssetEntityData> custom({
+ Expression<String>? name,
+ Expression<int>? type,
+ Expression<DateTime>? createdAt,
+ Expression<DateTime>? updatedAt,
+ Expression<int>? width,
+ Expression<int>? height,
+ Expression<int>? durationInSeconds,
+ Expression<String>? id,
+ Expression<String>? checksum,
+ Expression<bool>? isFavorite,
+ Expression<String>? ownerId,
+ Expression<DateTime>? localDateTime,
+ Expression<String>? thumbHash,
+ Expression<DateTime>? deletedAt,
+ Expression<String>? livePhotoVideoId,
+ Expression<int>? visibility,
+ Expression<String>? stackId,
+ Expression<String>? libraryId,
+ Expression<bool>? isEdited,
+ }) {
+ return RawValuesInsertable({
+ if (name != null) 'name': name,
+ if (type != null) 'type': type,
+ if (createdAt != null) 'created_at': createdAt,
+ if (updatedAt != null) 'updated_at': updatedAt,
+ if (width != null) 'width': width,
+ if (height != null) 'height': height,
+ if (durationInSeconds != null) 'duration_in_seconds': durationInSeconds,
+ if (id != null) 'id': id,
+ if (checksum != null) 'checksum': checksum,
+ if (isFavorite != null) 'is_favorite': isFavorite,
+ if (ownerId != null) 'owner_id': ownerId,
+ if (localDateTime != null) 'local_date_time': localDateTime,
+ if (thumbHash != null) 'thumb_hash': thumbHash,
+ if (deletedAt != null) 'deleted_at': deletedAt,
+ if (livePhotoVideoId != null) 'live_photo_video_id': livePhotoVideoId,
+ if (visibility != null) 'visibility': visibility,
+ if (stackId != null) 'stack_id': stackId,
+ if (libraryId != null) 'library_id': libraryId,
+ if (isEdited != null) 'is_edited': isEdited,
+ });
+ }
+
+ RemoteAssetEntityCompanion copyWith({
+ Value<String>? name,
+ Value<int>? type,
+ Value<DateTime>? createdAt,
+ Value<DateTime>? updatedAt,
+ Value<int?>? width,
+ Value<int?>? height,
+ Value<int?>? durationInSeconds,
+ Value<String>? id,
+ Value<String>? checksum,
+ Value<bool>? isFavorite,
+ Value<String>? ownerId,
+ Value<DateTime?>? localDateTime,
+ Value<String?>? thumbHash,
+ Value<DateTime?>? deletedAt,
+ Value<String?>? livePhotoVideoId,
+ Value<int>? visibility,
+ Value<String?>? stackId,
+ Value<String?>? libraryId,
+ Value<bool>? isEdited,
+ }) {
+ return RemoteAssetEntityCompanion(
+ name: name ?? this.name,
+ type: type ?? this.type,
+ createdAt: createdAt ?? this.createdAt,
+ updatedAt: updatedAt ?? this.updatedAt,
+ width: width ?? this.width,
+ height: height ?? this.height,
+ durationInSeconds: durationInSeconds ?? this.durationInSeconds,
+ id: id ?? this.id,
+ checksum: checksum ?? this.checksum,
+ isFavorite: isFavorite ?? this.isFavorite,
+ ownerId: ownerId ?? this.ownerId,
+ localDateTime: localDateTime ?? this.localDateTime,
+ thumbHash: thumbHash ?? this.thumbHash,
+ deletedAt: deletedAt ?? this.deletedAt,
+ livePhotoVideoId: livePhotoVideoId ?? this.livePhotoVideoId,
+ visibility: visibility ?? this.visibility,
+ stackId: stackId ?? this.stackId,
+ libraryId: libraryId ?? this.libraryId,
+ isEdited: isEdited ?? this.isEdited,
+ );
+ }
+
+ @override
+ Map<String, Expression> toColumns(bool nullToAbsent) {
+ final map = <String, Expression>{};
+ if (name.present) {
+ map['name'] = Variable<String>(name.value);
+ }
+ if (type.present) {
+ map['type'] = Variable<int>(type.value);
+ }
+ if (createdAt.present) {
+ map['created_at'] = Variable<DateTime>(createdAt.value);
+ }
+ if (updatedAt.present) {
+ map['updated_at'] = Variable<DateTime>(updatedAt.value);
+ }
+ if (width.present) {
+ map['width'] = Variable<int>(width.value);
+ }
+ if (height.present) {
+ map['height'] = Variable<int>(height.value);
+ }
+ if (durationInSeconds.present) {
+ map['duration_in_seconds'] = Variable<int>(durationInSeconds.value);
+ }
+ if (id.present) {
+ map['id'] = Variable<String>(id.value);
+ }
+ if (checksum.present) {
+ map['checksum'] = Variable<String>(checksum.value);
+ }
+ if (isFavorite.present) {
+ map['is_favorite'] = Variable<bool>(isFavorite.value);
+ }
+ if (ownerId.present) {
+ map['owner_id'] = Variable<String>(ownerId.value);
+ }
+ if (localDateTime.present) {
+ map['local_date_time'] = Variable<DateTime>(localDateTime.value);
+ }
+ if (thumbHash.present) {
+ map['thumb_hash'] = Variable<String>(thumbHash.value);
+ }
+ if (deletedAt.present) {
+ map['deleted_at'] = Variable<DateTime>(deletedAt.value);
+ }
+ if (livePhotoVideoId.present) {
+ map['live_photo_video_id'] = Variable<String>(livePhotoVideoId.value);
+ }
+ if (visibility.present) {
+ map['visibility'] = Variable<int>(visibility.value);
+ }
+ if (stackId.present) {
+ map['stack_id'] = Variable<String>(stackId.value);
+ }
+ if (libraryId.present) {
+ map['library_id'] = Variable<String>(libraryId.value);
+ }
+ if (isEdited.present) {
+ map['is_edited'] = Variable<bool>(isEdited.value);
+ }
+ return map;
+ }
+
+ @override
+ String toString() {
+ return (StringBuffer('RemoteAssetEntityCompanion(')
+ ..write('name: $name, ')
+ ..write('type: $type, ')
+ ..write('createdAt: $createdAt, ')
+ ..write('updatedAt: $updatedAt, ')
+ ..write('width: $width, ')
+ ..write('height: $height, ')
+ ..write('durationInSeconds: $durationInSeconds, ')
+ ..write('id: $id, ')
+ ..write('checksum: $checksum, ')
+ ..write('isFavorite: $isFavorite, ')
+ ..write('ownerId: $ownerId, ')
+ ..write('localDateTime: $localDateTime, ')
+ ..write('thumbHash: $thumbHash, ')
+ ..write('deletedAt: $deletedAt, ')
+ ..write('livePhotoVideoId: $livePhotoVideoId, ')
+ ..write('visibility: $visibility, ')
+ ..write('stackId: $stackId, ')
+ ..write('libraryId: $libraryId, ')
+ ..write('isEdited: $isEdited')
+ ..write(')'))
+ .toString();
+ }
+}
+
+class StackEntity extends Table with TableInfo<StackEntity, StackEntityData> {
+ @override
+ final GeneratedDatabase attachedDatabase;
+ final String? _alias;
+ StackEntity(this.attachedDatabase, [this._alias]);
+ late final GeneratedColumn<String> id = GeneratedColumn<String>(
+ 'id',
+ aliasedName,
+ false,
+ type: DriftSqlType.string,
+ requiredDuringInsert: true,
+ );
+ late final GeneratedColumn<DateTime> createdAt = GeneratedColumn<DateTime>(
+ 'created_at',
+ aliasedName,
+ false,
+ type: DriftSqlType.dateTime,
+ requiredDuringInsert: false,
+ defaultValue: const CustomExpression('CURRENT_TIMESTAMP'),
+ );
+ late final GeneratedColumn<DateTime> updatedAt = GeneratedColumn<DateTime>(
+ 'updated_at',
+ aliasedName,
+ false,
+ type: DriftSqlType.dateTime,
+ requiredDuringInsert: false,
+ defaultValue: const CustomExpression('CURRENT_TIMESTAMP'),
+ );
+ late final GeneratedColumn<String> ownerId = GeneratedColumn<String>(
+ 'owner_id',
+ aliasedName,
+ false,
+ type: DriftSqlType.string,
+ requiredDuringInsert: true,
+ defaultConstraints: GeneratedColumn.constraintIsAlways(
+ 'REFERENCES user_entity (id) ON DELETE CASCADE',
+ ),
+ );
+ late final GeneratedColumn<String> primaryAssetId = GeneratedColumn<String>(
+ 'primary_asset_id',
+ aliasedName,
+ false,
+ type: DriftSqlType.string,
+ requiredDuringInsert: true,
+ );
+ @override
+ List<GeneratedColumn> get $columns => [
+ id,
+ createdAt,
+ updatedAt,
+ ownerId,
+ primaryAssetId,
+ ];
+ @override
+ String get aliasedName => _alias ?? actualTableName;
+ @override
+ String get actualTableName => $name;
+ static const String $name = 'stack_entity';
+ @override
+ Set<GeneratedColumn> get $primaryKey => {id};
+ @override
+ StackEntityData map(Map<String, dynamic> data, {String? tablePrefix}) {
+ final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : '';
+ return StackEntityData(
+ id: attachedDatabase.typeMapping.read(
+ DriftSqlType.string,
+ data['${effectivePrefix}id'],
+ )!,
+ createdAt: attachedDatabase.typeMapping.read(
+ DriftSqlType.dateTime,
+ data['${effectivePrefix}created_at'],
+ )!,
+ updatedAt: attachedDatabase.typeMapping.read(
+ DriftSqlType.dateTime,
+ data['${effectivePrefix}updated_at'],
+ )!,
+ ownerId: attachedDatabase.typeMapping.read(
+ DriftSqlType.string,
+ data['${effectivePrefix}owner_id'],
+ )!,
+ primaryAssetId: attachedDatabase.typeMapping.read(
+ DriftSqlType.string,
+ data['${effectivePrefix}primary_asset_id'],
+ )!,
+ );
+ }
+
+ @override
+ StackEntity createAlias(String alias) {
+ return StackEntity(attachedDatabase, alias);
+ }
+
+ @override
+ bool get withoutRowId => true;
+ @override
+ bool get isStrict => true;
+}
+
+class StackEntityData extends DataClass implements Insertable<StackEntityData> {
+ final String id;
+ final DateTime createdAt;
+ final DateTime updatedAt;
+ final String ownerId;
+ final String primaryAssetId;
+ const StackEntityData({
+ required this.id,
+ required this.createdAt,
+ required this.updatedAt,
+ required this.ownerId,
+ required this.primaryAssetId,
+ });
+ @override
+ Map<String, Expression> toColumns(bool nullToAbsent) {
+ final map = <String, Expression>{};
+ map['id'] = Variable<String>(id);
+ map['created_at'] = Variable<DateTime>(createdAt);
+ map['updated_at'] = Variable<DateTime>(updatedAt);
+ map['owner_id'] = Variable<String>(ownerId);
+ map['primary_asset_id'] = Variable<String>(primaryAssetId);
+ return map;
+ }
+
+ factory StackEntityData.fromJson(
+ Map<String, dynamic> json, {
+ ValueSerializer? serializer,
+ }) {
+ serializer ??= driftRuntimeOptions.defaultSerializer;
+ return StackEntityData(
+ id: serializer.fromJson<String>(json['id']),
+ createdAt: serializer.fromJson<DateTime>(json['createdAt']),
+ updatedAt: serializer.fromJson<DateTime>(json['updatedAt']),
+ ownerId: serializer.fromJson<String>(json['ownerId']),
+ primaryAssetId: serializer.fromJson<String>(json['primaryAssetId']),
+ );
+ }
+ @override
+ Map<String, dynamic> toJson({ValueSerializer? serializer}) {
+ serializer ??= driftRuntimeOptions.defaultSerializer;
+ return <String, dynamic>{
+ 'id': serializer.toJson<String>(id),
+ 'createdAt': serializer.toJson<DateTime>(createdAt),
+ 'updatedAt': serializer.toJson<DateTime>(updatedAt),
+ 'ownerId': serializer.toJson<String>(ownerId),
+ 'primaryAssetId': serializer.toJson<String>(primaryAssetId),
+ };
+ }
+
+ StackEntityData copyWith({
+ String? id,
+ DateTime? createdAt,
+ DateTime? updatedAt,
+ String? ownerId,
+ String? primaryAssetId,
+ }) => StackEntityData(
+ id: id ?? this.id,
+ createdAt: createdAt ?? this.createdAt,
+ updatedAt: updatedAt ?? this.updatedAt,
+ ownerId: ownerId ?? this.ownerId,
+ primaryAssetId: primaryAssetId ?? this.primaryAssetId,
+ );
+ StackEntityData copyWithCompanion(StackEntityCompanion data) {
+ return StackEntityData(
+ id: data.id.present ? data.id.value : this.id,
+ createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt,
+ updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt,
+ ownerId: data.ownerId.present ? data.ownerId.value : this.ownerId,
+ primaryAssetId: data.primaryAssetId.present
+ ? data.primaryAssetId.value
+ : this.primaryAssetId,
+ );
+ }
+
+ @override
+ String toString() {
+ return (StringBuffer('StackEntityData(')
+ ..write('id: $id, ')
+ ..write('createdAt: $createdAt, ')
+ ..write('updatedAt: $updatedAt, ')
+ ..write('ownerId: $ownerId, ')
+ ..write('primaryAssetId: $primaryAssetId')
+ ..write(')'))
+ .toString();
+ }
+
+ @override
+ int get hashCode =>
+ Object.hash(id, createdAt, updatedAt, ownerId, primaryAssetId);
+ @override
+ bool operator ==(Object other) =>
+ identical(this, other) ||
+ (other is StackEntityData &&
+ other.id == this.id &&
+ other.createdAt == this.createdAt &&
+ other.updatedAt == this.updatedAt &&
+ other.ownerId == this.ownerId &&
+ other.primaryAssetId == this.primaryAssetId);
+}
+
+class StackEntityCompanion extends UpdateCompanion<StackEntityData> {
+ final Value<String> id;
+ final Value<DateTime> createdAt;
+ final Value<DateTime> updatedAt;
+ final Value<String> ownerId;
+ final Value<String> primaryAssetId;
+ const StackEntityCompanion({
+ this.id = const Value.absent(),
+ this.createdAt = const Value.absent(),
+ this.updatedAt = const Value.absent(),
+ this.ownerId = const Value.absent(),
+ this.primaryAssetId = const Value.absent(),
+ });
+ StackEntityCompanion.insert({
+ required String id,
+ this.createdAt = const Value.absent(),
+ this.updatedAt = const Value.absent(),
+ required String ownerId,
+ required String primaryAssetId,
+ }) : id = Value(id),
+ ownerId = Value(ownerId),
+ primaryAssetId = Value(primaryAssetId);
+ static Insertable<StackEntityData> custom({
+ Expression<String>? id,
+ Expression<DateTime>? createdAt,
+ Expression<DateTime>? updatedAt,
+ Expression<String>? ownerId,
+ Expression<String>? primaryAssetId,
+ }) {
+ return RawValuesInsertable({
+ if (id != null) 'id': id,
+ if (createdAt != null) 'created_at': createdAt,
+ if (updatedAt != null) 'updated_at': updatedAt,
+ if (ownerId != null) 'owner_id': ownerId,
+ if (primaryAssetId != null) 'primary_asset_id': primaryAssetId,
+ });
+ }
+
+ StackEntityCompanion copyWith({
+ Value<String>? id,
+ Value<DateTime>? createdAt,
+ Value<DateTime>? updatedAt,
+ Value<String>? ownerId,
+ Value<String>? primaryAssetId,
+ }) {
+ return StackEntityCompanion(
+ id: id ?? this.id,
+ createdAt: createdAt ?? this.createdAt,
+ updatedAt: updatedAt ?? this.updatedAt,
+ ownerId: ownerId ?? this.ownerId,
+ primaryAssetId: primaryAssetId ?? this.primaryAssetId,
+ );
+ }
+
+ @override
+ Map<String, Expression> toColumns(bool nullToAbsent) {
+ final map = <String, Expression>{};
+ if (id.present) {
+ map['id'] = Variable<String>(id.value);
+ }
+ if (createdAt.present) {
+ map['created_at'] = Variable<DateTime>(createdAt.value);
+ }
+ if (updatedAt.present) {
+ map['updated_at'] = Variable<DateTime>(updatedAt.value);
+ }
+ if (ownerId.present) {
+ map['owner_id'] = Variable<String>(ownerId.value);
+ }
+ if (primaryAssetId.present) {
+ map['primary_asset_id'] = Variable<String>(primaryAssetId.value);
+ }
+ return map;
+ }
+
+ @override
+ String toString() {
+ return (StringBuffer('StackEntityCompanion(')
+ ..write('id: $id, ')
+ ..write('createdAt: $createdAt, ')
+ ..write('updatedAt: $updatedAt, ')
+ ..write('ownerId: $ownerId, ')
+ ..write('primaryAssetId: $primaryAssetId')
+ ..write(')'))
+ .toString();
+ }
+}
+
+class LocalAssetEntity extends Table
+ with TableInfo<LocalAssetEntity, LocalAssetEntityData> {
+ @override
+ final GeneratedDatabase attachedDatabase;
+ final String? _alias;
+ LocalAssetEntity(this.attachedDatabase, [this._alias]);
+ late final GeneratedColumn<String> name = GeneratedColumn<String>(
+ 'name',
+ aliasedName,
+ false,
+ type: DriftSqlType.string,
+ requiredDuringInsert: true,
+ );
+ late final GeneratedColumn<int> type = GeneratedColumn<int>(
+ 'type',
+ aliasedName,
+ false,
+ type: DriftSqlType.int,
+ requiredDuringInsert: true,
+ );
+ late final GeneratedColumn<DateTime> createdAt = GeneratedColumn<DateTime>(
+ 'created_at',
+ aliasedName,
+ false,
+ type: DriftSqlType.dateTime,
+ requiredDuringInsert: false,
+ defaultValue: const CustomExpression('CURRENT_TIMESTAMP'),
+ );
+ late final GeneratedColumn<DateTime> updatedAt = GeneratedColumn<DateTime>(
+ 'updated_at',
+ aliasedName,
+ false,
+ type: DriftSqlType.dateTime,
+ requiredDuringInsert: false,
+ defaultValue: const CustomExpression('CURRENT_TIMESTAMP'),
+ );
+ late final GeneratedColumn<int> width = GeneratedColumn<int>(
+ 'width',
+ aliasedName,
+ true,
+ type: DriftSqlType.int,
+ requiredDuringInsert: false,
+ );
+ late final GeneratedColumn<int> height = GeneratedColumn<int>(
+ 'height',
+ aliasedName,
+ true,
+ type: DriftSqlType.int,
+ requiredDuringInsert: false,
+ );
+ late final GeneratedColumn<int> durationInSeconds = GeneratedColumn<int>(
+ 'duration_in_seconds',
+ aliasedName,
+ true,
+ type: DriftSqlType.int,
+ requiredDuringInsert: false,
+ );
+ late final GeneratedColumn<String> id = GeneratedColumn<String>(
+ 'id',
+ aliasedName,
+ false,
+ type: DriftSqlType.string,
+ requiredDuringInsert: true,
+ );
+ late final GeneratedColumn<String> checksum = GeneratedColumn<String>(
+ 'checksum',
+ aliasedName,
+ true,
+ type: DriftSqlType.string,
+ requiredDuringInsert: false,
+ );
+ late final GeneratedColumn<bool> isFavorite = GeneratedColumn<bool>(
+ 'is_favorite',
+ aliasedName,
+ false,
+ type: DriftSqlType.bool,
+ requiredDuringInsert: false,
+ defaultConstraints: GeneratedColumn.constraintIsAlways(
+ 'CHECK ("is_favorite" IN (0, 1))',
+ ),
+ defaultValue: const CustomExpression('0'),
+ );
+ late final GeneratedColumn<int> orientation = GeneratedColumn<int>(
+ 'orientation',
+ aliasedName,
+ false,
+ type: DriftSqlType.int,
+ requiredDuringInsert: false,
+ defaultValue: const CustomExpression('0'),
+ );
+ late final GeneratedColumn<String> iCloudId = GeneratedColumn<String>(
+ 'i_cloud_id',
+ aliasedName,
+ true,
+ type: DriftSqlType.string,
+ requiredDuringInsert: false,
+ );
+ late final GeneratedColumn<DateTime> adjustmentTime =
+ GeneratedColumn<DateTime>(
+ 'adjustment_time',
+ aliasedName,
+ true,
+ type: DriftSqlType.dateTime,
+ requiredDuringInsert: false,
+ );
+ late final GeneratedColumn<double> latitude = GeneratedColumn<double>(
+ 'latitude',
+ aliasedName,
+ true,
+ type: DriftSqlType.double,
+ requiredDuringInsert: false,
+ );
+ late final GeneratedColumn<double> longitude = GeneratedColumn<double>(
+ 'longitude',
+ aliasedName,
+ true,
+ type: DriftSqlType.double,
+ requiredDuringInsert: false,
+ );
+ @override
+ List<GeneratedColumn> get $columns => [
+ name,
+ type,
+ createdAt,
+ updatedAt,
+ width,
+ height,
+ durationInSeconds,
+ id,
+ checksum,
+ isFavorite,
+ orientation,
+ iCloudId,
+ adjustmentTime,
+ latitude,
+ longitude,
+ ];
+ @override
+ String get aliasedName => _alias ?? actualTableName;
+ @override
+ String get actualTableName => $name;
+ static const String $name = 'local_asset_entity';
+ @override
+ Set<GeneratedColumn> get $primaryKey => {id};
+ @override
+ LocalAssetEntityData map(Map<String, dynamic> data, {String? tablePrefix}) {
+ final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : '';
+ return LocalAssetEntityData(
+ name: attachedDatabase.typeMapping.read(
+ DriftSqlType.string,
+ data['${effectivePrefix}name'],
+ )!,
+ type: attachedDatabase.typeMapping.read(
+ DriftSqlType.int,
+ data['${effectivePrefix}type'],
+ )!,
+ createdAt: attachedDatabase.typeMapping.read(
+ DriftSqlType.dateTime,
+ data['${effectivePrefix}created_at'],
+ )!,
+ updatedAt: attachedDatabase.typeMapping.read(
+ DriftSqlType.dateTime,
+ data['${effectivePrefix}updated_at'],
+ )!,
+ width: attachedDatabase.typeMapping.read(
+ DriftSqlType.int,
+ data['${effectivePrefix}width'],
+ ),
+ height: attachedDatabase.typeMapping.read(
+ DriftSqlType.int,
+ data['${effectivePrefix}height'],
+ ),
+ durationInSeconds: attachedDatabase.typeMapping.read(
+ DriftSqlType.int,
+ data['${effectivePrefix}duration_in_seconds'],
+ ),
+ id: attachedDatabase.typeMapping.read(
+ DriftSqlType.string,
+ data['${effectivePrefix}id'],
+ )!,
+ checksum: attachedDatabase.typeMapping.read(
+ DriftSqlType.string,
+ data['${effectivePrefix}checksum'],
+ ),
+ isFavorite: attachedDatabase.typeMapping.read(
+ DriftSqlType.bool,
+ data['${effectivePrefix}is_favorite'],
+ )!,
+ orientation: attachedDatabase.typeMapping.read(
+ DriftSqlType.int,
+ data['${effectivePrefix}orientation'],
+ )!,
+ iCloudId: attachedDatabase.typeMapping.read(
+ DriftSqlType.string,
+ data['${effectivePrefix}i_cloud_id'],
+ ),
+ adjustmentTime: attachedDatabase.typeMapping.read(
+ DriftSqlType.dateTime,
+ data['${effectivePrefix}adjustment_time'],
+ ),
+ latitude: attachedDatabase.typeMapping.read(
+ DriftSqlType.double,
+ data['${effectivePrefix}latitude'],
+ ),
+ longitude: attachedDatabase.typeMapping.read(
+ DriftSqlType.double,
+ data['${effectivePrefix}longitude'],
+ ),
+ );
+ }
+
+ @override
+ LocalAssetEntity createAlias(String alias) {
+ return LocalAssetEntity(attachedDatabase, alias);
+ }
+
+ @override
+ bool get withoutRowId => true;
+ @override
+ bool get isStrict => true;
+}
+
+class LocalAssetEntityData extends DataClass
+ implements Insertable<LocalAssetEntityData> {
+ final String name;
+ final int type;
+ final DateTime createdAt;
+ final DateTime updatedAt;
+ final int? width;
+ final int? height;
+ final int? durationInSeconds;
+ final String id;
+ final String? checksum;
+ final bool isFavorite;
+ final int orientation;
+ final String? iCloudId;
+ final DateTime? adjustmentTime;
+ final double? latitude;
+ final double? longitude;
+ const LocalAssetEntityData({
+ required this.name,
+ required this.type,
+ required this.createdAt,
+ required this.updatedAt,
+ this.width,
+ this.height,
+ this.durationInSeconds,
+ required this.id,
+ this.checksum,
+ required this.isFavorite,
+ required this.orientation,
+ this.iCloudId,
+ this.adjustmentTime,
+ this.latitude,
+ this.longitude,
+ });
+ @override
+ Map<String, Expression> toColumns(bool nullToAbsent) {
+ final map = <String, Expression>{};
+ map['name'] = Variable<String>(name);
+ map['type'] = Variable<int>(type);
+ map['created_at'] = Variable<DateTime>(createdAt);
+ map['updated_at'] = Variable<DateTime>(updatedAt);
+ if (!nullToAbsent || width != null) {
+ map['width'] = Variable<int>(width);
+ }
+ if (!nullToAbsent || height != null) {
+ map['height'] = Variable<int>(height);
+ }
+ if (!nullToAbsent || durationInSeconds != null) {
+ map['duration_in_seconds'] = Variable<int>(durationInSeconds);
+ }
+ map['id'] = Variable<String>(id);
+ if (!nullToAbsent || checksum != null) {
+ map['checksum'] = Variable<String>(checksum);
+ }
+ map['is_favorite'] = Variable<bool>(isFavorite);
+ map['orientation'] = Variable<int>(orientation);
+ if (!nullToAbsent || iCloudId != null) {
+ map['i_cloud_id'] = Variable<String>(iCloudId);
+ }
+ if (!nullToAbsent || adjustmentTime != null) {
+ map['adjustment_time'] = Variable<DateTime>(adjustmentTime);
+ }
+ if (!nullToAbsent || latitude != null) {
+ map['latitude'] = Variable<double>(latitude);
+ }
+ if (!nullToAbsent || longitude != null) {
+ map['longitude'] = Variable<double>(longitude);
+ }
+ return map;
+ }
+
+ factory LocalAssetEntityData.fromJson(
+ Map<String, dynamic> json, {
+ ValueSerializer? serializer,
+ }) {
+ serializer ??= driftRuntimeOptions.defaultSerializer;
+ return LocalAssetEntityData(
+ name: serializer.fromJson<String>(json['name']),
+ type: serializer.fromJson<int>(json['type']),
+ createdAt: serializer.fromJson<DateTime>(json['createdAt']),
+ updatedAt: serializer.fromJson<DateTime>(json['updatedAt']),
+ width: serializer.fromJson<int?>(json['width']),
+ height: serializer.fromJson<int?>(json['height']),
+ durationInSeconds: serializer.fromJson<int?>(json['durationInSeconds']),
+ id: serializer.fromJson<String>(json['id']),
+ checksum: serializer.fromJson<String?>(json['checksum']),
+ isFavorite: serializer.fromJson<bool>(json['isFavorite']),
+ orientation: serializer.fromJson<int>(json['orientation']),
+ iCloudId: serializer.fromJson<String?>(json['iCloudId']),
+ adjustmentTime: serializer.fromJson<DateTime?>(json['adjustmentTime']),
+ latitude: serializer.fromJson<double?>(json['latitude']),
+ longitude: serializer.fromJson<double?>(json['longitude']),
+ );
+ }
+ @override
+ Map<String, dynamic> toJson({ValueSerializer? serializer}) {
+ serializer ??= driftRuntimeOptions.defaultSerializer;
+ return <String, dynamic>{
+ 'name': serializer.toJson<String>(name),
+ 'type': serializer.toJson<int>(type),
+ 'createdAt': serializer.toJson<DateTime>(createdAt),
+ 'updatedAt': serializer.toJson<DateTime>(updatedAt),
+ 'width': serializer.toJson<int?>(width),
+ 'height': serializer.toJson<int?>(height),
+ 'durationInSeconds': serializer.toJson<int?>(durationInSeconds),
+ 'id': serializer.toJson<String>(id),
+ 'checksum': serializer.toJson<String?>(checksum),
+ 'isFavorite': serializer.toJson<bool>(isFavorite),
+ 'orientation': serializer.toJson<int>(orientation),
+ 'iCloudId': serializer.toJson<String?>(iCloudId),
+ 'adjustmentTime': serializer.toJson<DateTime?>(adjustmentTime),
+ 'latitude': serializer.toJson<double?>(latitude),
+ 'longitude': serializer.toJson<double?>(longitude),
+ };
+ }
+
+ LocalAssetEntityData copyWith({
+ String? name,
+ int? type,
+ DateTime? createdAt,
+ DateTime? updatedAt,
+ Value<int?> width = const Value.absent(),
+ Value<int?> height = const Value.absent(),
+ Value<int?> durationInSeconds = const Value.absent(),
+ String? id,
+ Value<String?> checksum = const Value.absent(),
+ bool? isFavorite,
+ int? orientation,
+ Value<String?> iCloudId = const Value.absent(),
+ Value<DateTime?> adjustmentTime = const Value.absent(),
+ Value<double?> latitude = const Value.absent(),
+ Value<double?> longitude = const Value.absent(),
+ }) => LocalAssetEntityData(
+ name: name ?? this.name,
+ type: type ?? this.type,
+ createdAt: createdAt ?? this.createdAt,
+ updatedAt: updatedAt ?? this.updatedAt,
+ width: width.present ? width.value : this.width,
+ height: height.present ? height.value : this.height,
+ durationInSeconds: durationInSeconds.present
+ ? durationInSeconds.value
+ : this.durationInSeconds,
+ id: id ?? this.id,
+ checksum: checksum.present ? checksum.value : this.checksum,
+ isFavorite: isFavorite ?? this.isFavorite,
+ orientation: orientation ?? this.orientation,
+ iCloudId: iCloudId.present ? iCloudId.value : this.iCloudId,
+ adjustmentTime: adjustmentTime.present
+ ? adjustmentTime.value
+ : this.adjustmentTime,
+ latitude: latitude.present ? latitude.value : this.latitude,
+ longitude: longitude.present ? longitude.value : this.longitude,
+ );
+ LocalAssetEntityData copyWithCompanion(LocalAssetEntityCompanion data) {
+ return LocalAssetEntityData(
+ name: data.name.present ? data.name.value : this.name,
+ type: data.type.present ? data.type.value : this.type,
+ createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt,
+ updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt,
+ width: data.width.present ? data.width.value : this.width,
+ height: data.height.present ? data.height.value : this.height,
+ durationInSeconds: data.durationInSeconds.present
+ ? data.durationInSeconds.value
+ : this.durationInSeconds,
+ id: data.id.present ? data.id.value : this.id,
+ checksum: data.checksum.present ? data.checksum.value : this.checksum,
+ isFavorite: data.isFavorite.present
+ ? data.isFavorite.value
+ : this.isFavorite,
+ orientation: data.orientation.present
+ ? data.orientation.value
+ : this.orientation,
+ iCloudId: data.iCloudId.present ? data.iCloudId.value : this.iCloudId,
+ adjustmentTime: data.adjustmentTime.present
+ ? data.adjustmentTime.value
+ : this.adjustmentTime,
+ latitude: data.latitude.present ? data.latitude.value : this.latitude,
+ longitude: data.longitude.present ? data.longitude.value : this.longitude,
+ );
+ }
+
+ @override
+ String toString() {
+ return (StringBuffer('LocalAssetEntityData(')
+ ..write('name: $name, ')
+ ..write('type: $type, ')
+ ..write('createdAt: $createdAt, ')
+ ..write('updatedAt: $updatedAt, ')
+ ..write('width: $width, ')
+ ..write('height: $height, ')
+ ..write('durationInSeconds: $durationInSeconds, ')
+ ..write('id: $id, ')
+ ..write('checksum: $checksum, ')
+ ..write('isFavorite: $isFavorite, ')
+ ..write('orientation: $orientation, ')
+ ..write('iCloudId: $iCloudId, ')
+ ..write('adjustmentTime: $adjustmentTime, ')
+ ..write('latitude: $latitude, ')
+ ..write('longitude: $longitude')
+ ..write(')'))
+ .toString();
+ }
+
+ @override
+ int get hashCode => Object.hash(
+ name,
+ type,
+ createdAt,
+ updatedAt,
+ width,
+ height,
+ durationInSeconds,
+ id,
+ checksum,
+ isFavorite,
+ orientation,
+ iCloudId,
+ adjustmentTime,
+ latitude,
+ longitude,
+ );
+ @override
+ bool operator ==(Object other) =>
+ identical(this, other) ||
+ (other is LocalAssetEntityData &&
+ other.name == this.name &&
+ other.type == this.type &&
+ other.createdAt == this.createdAt &&
+ other.updatedAt == this.updatedAt &&
+ other.width == this.width &&
+ other.height == this.height &&
+ other.durationInSeconds == this.durationInSeconds &&
+ other.id == this.id &&
+ other.checksum == this.checksum &&
+ other.isFavorite == this.isFavorite &&
+ other.orientation == this.orientation &&
+ other.iCloudId == this.iCloudId &&
+ other.adjustmentTime == this.adjustmentTime &&
+ other.latitude == this.latitude &&
+ other.longitude == this.longitude);
+}
+
+class LocalAssetEntityCompanion extends UpdateCompanion<LocalAssetEntityData> {
+ final Value<String> name;
+ final Value<int> type;
+ final Value<DateTime> createdAt;
+ final Value<DateTime> updatedAt;
+ final Value<int?> width;
+ final Value<int?> height;
+ final Value<int?> durationInSeconds;
+ final Value<String> id;
+ final Value<String?> checksum;
+ final Value<bool> isFavorite;
+ final Value<int> orientation;
+ final Value<String?> iCloudId;
+ final Value<DateTime?> adjustmentTime;
+ final Value<double?> latitude;
+ final Value<double?> longitude;
+ const LocalAssetEntityCompanion({
+ this.name = const Value.absent(),
+ this.type = const Value.absent(),
+ this.createdAt = const Value.absent(),
+ this.updatedAt = const Value.absent(),
+ this.width = const Value.absent(),
+ this.height = const Value.absent(),
+ this.durationInSeconds = const Value.absent(),
+ this.id = const Value.absent(),
+ this.checksum = const Value.absent(),
+ this.isFavorite = const Value.absent(),
+ this.orientation = const Value.absent(),
+ this.iCloudId = const Value.absent(),
+ this.adjustmentTime = const Value.absent(),
+ this.latitude = const Value.absent(),
+ this.longitude = const Value.absent(),
+ });
+ LocalAssetEntityCompanion.insert({
+ required String name,
+ required int type,
+ this.createdAt = const Value.absent(),
+ this.updatedAt = const Value.absent(),
+ this.width = const Value.absent(),
+ this.height = const Value.absent(),
+ this.durationInSeconds = const Value.absent(),
+ required String id,
+ this.checksum = const Value.absent(),
+ this.isFavorite = const Value.absent(),
+ this.orientation = const Value.absent(),
+ this.iCloudId = const Value.absent(),
+ this.adjustmentTime = const Value.absent(),
+ this.latitude = const Value.absent(),
+ this.longitude = const Value.absent(),
+ }) : name = Value(name),
+ type = Value(type),
+ id = Value(id);
+ static Insertable<LocalAssetEntityData> custom({
+ Expression<String>? name,
+ Expression<int>? type,
+ Expression<DateTime>? createdAt,
+ Expression<DateTime>? updatedAt,
+ Expression<int>? width,
+ Expression<int>? height,
+ Expression<int>? durationInSeconds,
+ Expression<String>? id,
+ Expression<String>? checksum,
+ Expression<bool>? isFavorite,
+ Expression<int>? orientation,
+ Expression<String>? iCloudId,
+ Expression<DateTime>? adjustmentTime,
+ Expression<double>? latitude,
+ Expression<double>? longitude,
+ }) {
+ return RawValuesInsertable({
+ if (name != null) 'name': name,
+ if (type != null) 'type': type,
+ if (createdAt != null) 'created_at': createdAt,
+ if (updatedAt != null) 'updated_at': updatedAt,
+ if (width != null) 'width': width,
+ if (height != null) 'height': height,
+ if (durationInSeconds != null) 'duration_in_seconds': durationInSeconds,
+ if (id != null) 'id': id,
+ if (checksum != null) 'checksum': checksum,
+ if (isFavorite != null) 'is_favorite': isFavorite,
+ if (orientation != null) 'orientation': orientation,
+ if (iCloudId != null) 'i_cloud_id': iCloudId,
+ if (adjustmentTime != null) 'adjustment_time': adjustmentTime,
+ if (latitude != null) 'latitude': latitude,
+ if (longitude != null) 'longitude': longitude,
+ });
+ }
+
+ LocalAssetEntityCompanion copyWith({
+ Value<String>? name,
+ Value<int>? type,
+ Value<DateTime>? createdAt,
+ Value<DateTime>? updatedAt,
+ Value<int?>? width,
+ Value<int?>? height,
+ Value<int?>? durationInSeconds,
+ Value<String>? id,
+ Value<String?>? checksum,
+ Value<bool>? isFavorite,
+ Value<int>? orientation,
+ Value<String?>? iCloudId,
+ Value<DateTime?>? adjustmentTime,
+ Value<double?>? latitude,
+ Value<double?>? longitude,
+ }) {
+ return LocalAssetEntityCompanion(
+ name: name ?? this.name,
+ type: type ?? this.type,
+ createdAt: createdAt ?? this.createdAt,
+ updatedAt: updatedAt ?? this.updatedAt,
+ width: width ?? this.width,
+ height: height ?? this.height,
+ durationInSeconds: durationInSeconds ?? this.durationInSeconds,
+ id: id ?? this.id,
+ checksum: checksum ?? this.checksum,
+ isFavorite: isFavorite ?? this.isFavorite,
+ orientation: orientation ?? this.orientation,
+ iCloudId: iCloudId ?? this.iCloudId,
+ adjustmentTime: adjustmentTime ?? this.adjustmentTime,
+ latitude: latitude ?? this.latitude,
+ longitude: longitude ?? this.longitude,
+ );
+ }
+
+ @override
+ Map<String, Expression> toColumns(bool nullToAbsent) {
+ final map = <String, Expression>{};
+ if (name.present) {
+ map['name'] = Variable<String>(name.value);
+ }
+ if (type.present) {
+ map['type'] = Variable<int>(type.value);
+ }
+ if (createdAt.present) {
+ map['created_at'] = Variable<DateTime>(createdAt.value);
+ }
+ if (updatedAt.present) {
+ map['updated_at'] = Variable<DateTime>(updatedAt.value);
+ }
+ if (width.present) {
+ map['width'] = Variable<int>(width.value);
+ }
+ if (height.present) {
+ map['height'] = Variable<int>(height.value);
+ }
+ if (durationInSeconds.present) {
+ map['duration_in_seconds'] = Variable<int>(durationInSeconds.value);
+ }
+ if (id.present) {
+ map['id'] = Variable<String>(id.value);
+ }
+ if (checksum.present) {
+ map['checksum'] = Variable<String>(checksum.value);
+ }
+ if (isFavorite.present) {
+ map['is_favorite'] = Variable<bool>(isFavorite.value);
+ }
+ if (orientation.present) {
+ map['orientation'] = Variable<int>(orientation.value);
+ }
+ if (iCloudId.present) {
+ map['i_cloud_id'] = Variable<String>(iCloudId.value);
+ }
+ if (adjustmentTime.present) {
+ map['adjustment_time'] = Variable<DateTime>(adjustmentTime.value);
+ }
+ if (latitude.present) {
+ map['latitude'] = Variable<double>(latitude.value);
+ }
+ if (longitude.present) {
+ map['longitude'] = Variable<double>(longitude.value);
+ }
+ return map;
+ }
+
+ @override
+ String toString() {
+ return (StringBuffer('LocalAssetEntityCompanion(')
+ ..write('name: $name, ')
+ ..write('type: $type, ')
+ ..write('createdAt: $createdAt, ')
+ ..write('updatedAt: $updatedAt, ')
+ ..write('width: $width, ')
+ ..write('height: $height, ')
+ ..write('durationInSeconds: $durationInSeconds, ')
+ ..write('id: $id, ')
+ ..write('checksum: $checksum, ')
+ ..write('isFavorite: $isFavorite, ')
+ ..write('orientation: $orientation, ')
+ ..write('iCloudId: $iCloudId, ')
+ ..write('adjustmentTime: $adjustmentTime, ')
+ ..write('latitude: $latitude, ')
+ ..write('longitude: $longitude')
+ ..write(')'))
+ .toString();
+ }
+}
+
+class RemoteAlbumEntity extends Table
+ with TableInfo<RemoteAlbumEntity, RemoteAlbumEntityData> {
+ @override
+ final GeneratedDatabase attachedDatabase;
+ final String? _alias;
+ RemoteAlbumEntity(this.attachedDatabase, [this._alias]);
+ late final GeneratedColumn<String> id = GeneratedColumn<String>(
+ 'id',
+ aliasedName,
+ false,
+ type: DriftSqlType.string,
+ requiredDuringInsert: true,
+ );
+ late final GeneratedColumn<String> name = GeneratedColumn<String>(
+ 'name',
+ aliasedName,
+ false,
+ type: DriftSqlType.string,
+ requiredDuringInsert: true,
+ );
+ late final GeneratedColumn<String> description = GeneratedColumn<String>(
+ 'description',
+ aliasedName,
+ false,
+ type: DriftSqlType.string,
+ requiredDuringInsert: false,
+ defaultValue: const CustomExpression('\'\''),
+ );
+ late final GeneratedColumn<DateTime> createdAt = GeneratedColumn<DateTime>(
+ 'created_at',
+ aliasedName,
+ false,
+ type: DriftSqlType.dateTime,
+ requiredDuringInsert: false,
+ defaultValue: const CustomExpression('CURRENT_TIMESTAMP'),
+ );
+ late final GeneratedColumn<DateTime> updatedAt = GeneratedColumn<DateTime>(
+ 'updated_at',
+ aliasedName,
+ false,
+ type: DriftSqlType.dateTime,
+ requiredDuringInsert: false,
+ defaultValue: const CustomExpression('CURRENT_TIMESTAMP'),
+ );
+ late final GeneratedColumn<String> ownerId = GeneratedColumn<String>(
+ 'owner_id',
+ aliasedName,
+ false,
+ type: DriftSqlType.string,
+ requiredDuringInsert: true,
+ defaultConstraints: GeneratedColumn.constraintIsAlways(
+ 'REFERENCES user_entity (id) ON DELETE CASCADE',
+ ),
+ );
+ late final GeneratedColumn<String> thumbnailAssetId = GeneratedColumn<String>(
+ 'thumbnail_asset_id',
+ aliasedName,
+ true,
+ type: DriftSqlType.string,
+ requiredDuringInsert: false,
+ defaultConstraints: GeneratedColumn.constraintIsAlways(
+ 'REFERENCES remote_asset_entity (id) ON DELETE SET NULL',
+ ),
+ );
+ late final GeneratedColumn<bool> isActivityEnabled = GeneratedColumn<bool>(
+ 'is_activity_enabled',
+ aliasedName,
+ false,
+ type: DriftSqlType.bool,
+ requiredDuringInsert: false,
+ defaultConstraints: GeneratedColumn.constraintIsAlways(
+ 'CHECK ("is_activity_enabled" IN (0, 1))',
+ ),
+ defaultValue: const CustomExpression('1'),
+ );
+ late final GeneratedColumn<int> order = GeneratedColumn<int>(
+ 'order',
+ aliasedName,
+ false,
+ type: DriftSqlType.int,
+ requiredDuringInsert: true,
+ );
+ @override
+ List<GeneratedColumn> get $columns => [
+ id,
+ name,
+ description,
+ createdAt,
+ updatedAt,
+ ownerId,
+ thumbnailAssetId,
+ isActivityEnabled,
+ order,
+ ];
+ @override
+ String get aliasedName => _alias ?? actualTableName;
+ @override
+ String get actualTableName => $name;
+ static const String $name = 'remote_album_entity';
+ @override
+ Set<GeneratedColumn> get $primaryKey => {id};
+ @override
+ RemoteAlbumEntityData map(Map<String, dynamic> data, {String? tablePrefix}) {
+ final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : '';
+ return RemoteAlbumEntityData(
+ id: attachedDatabase.typeMapping.read(
+ DriftSqlType.string,
+ data['${effectivePrefix}id'],
+ )!,
+ name: attachedDatabase.typeMapping.read(
+ DriftSqlType.string,
+ data['${effectivePrefix}name'],
+ )!,
+ description: attachedDatabase.typeMapping.read(
+ DriftSqlType.string,
+ data['${effectivePrefix}description'],
+ )!,
+ createdAt: attachedDatabase.typeMapping.read(
+ DriftSqlType.dateTime,
+ data['${effectivePrefix}created_at'],
+ )!,
+ updatedAt: attachedDatabase.typeMapping.read(
+ DriftSqlType.dateTime,
+ data['${effectivePrefix}updated_at'],
+ )!,
+ ownerId: attachedDatabase.typeMapping.read(
+ DriftSqlType.string,
+ data['${effectivePrefix}owner_id'],
+ )!,
+ thumbnailAssetId: attachedDatabase.typeMapping.read(
+ DriftSqlType.string,
+ data['${effectivePrefix}thumbnail_asset_id'],
+ ),
+ isActivityEnabled: attachedDatabase.typeMapping.read(
+ DriftSqlType.bool,
+ data['${effectivePrefix}is_activity_enabled'],
+ )!,
+ order: attachedDatabase.typeMapping.read(
+ DriftSqlType.int,
+ data['${effectivePrefix}order'],
+ )!,
+ );
+ }
+
+ @override
+ RemoteAlbumEntity createAlias(String alias) {
+ return RemoteAlbumEntity(attachedDatabase, alias);
+ }
+
+ @override
+ bool get withoutRowId => true;
+ @override
+ bool get isStrict => true;
+}
+
+class RemoteAlbumEntityData extends DataClass
+ implements Insertable<RemoteAlbumEntityData> {
+ final String id;
+ final String name;
+ final String description;
+ final DateTime createdAt;
+ final DateTime updatedAt;
+ final String ownerId;
+ final String? thumbnailAssetId;
+ final bool isActivityEnabled;
+ final int order;
+ const RemoteAlbumEntityData({
+ required this.id,
+ required this.name,
+ required this.description,
+ required this.createdAt,
+ required this.updatedAt,
+ required this.ownerId,
+ this.thumbnailAssetId,
+ required this.isActivityEnabled,
+ required this.order,
+ });
+ @override
+ Map<String, Expression> toColumns(bool nullToAbsent) {
+ final map = <String, Expression>{};
+ map['id'] = Variable<String>(id);
+ map['name'] = Variable<String>(name);
+ map['description'] = Variable<String>(description);
+ map['created_at'] = Variable<DateTime>(createdAt);
+ map['updated_at'] = Variable<DateTime>(updatedAt);
+ map['owner_id'] = Variable<String>(ownerId);
+ if (!nullToAbsent || thumbnailAssetId != null) {
+ map['thumbnail_asset_id'] = Variable<String>(thumbnailAssetId);
+ }
+ map['is_activity_enabled'] = Variable<bool>(isActivityEnabled);
+ map['order'] = Variable<int>(order);
+ return map;
+ }
+
+ factory RemoteAlbumEntityData.fromJson(
+ Map<String, dynamic> json, {
+ ValueSerializer? serializer,
+ }) {
+ serializer ??= driftRuntimeOptions.defaultSerializer;
+ return RemoteAlbumEntityData(
+ id: serializer.fromJson<String>(json['id']),
+ name: serializer.fromJson<String>(json['name']),
+ description: serializer.fromJson<String>(json['description']),
+ createdAt: serializer.fromJson<DateTime>(json['createdAt']),
+ updatedAt: serializer.fromJson<DateTime>(json['updatedAt']),
+ ownerId: serializer.fromJson<String>(json['ownerId']),
+ thumbnailAssetId: serializer.fromJson<String?>(json['thumbnailAssetId']),
+ isActivityEnabled: serializer.fromJson<bool>(json['isActivityEnabled']),
+ order: serializer.fromJson<int>(json['order']),
+ );
+ }
+ @override
+ Map<String, dynamic> toJson({ValueSerializer? serializer}) {
+ serializer ??= driftRuntimeOptions.defaultSerializer;
+ return <String, dynamic>{
+ 'id': serializer.toJson<String>(id),
+ 'name': serializer.toJson<String>(name),
+ 'description': serializer.toJson<String>(description),
+ 'createdAt': serializer.toJson<DateTime>(createdAt),
+ 'updatedAt': serializer.toJson<DateTime>(updatedAt),
+ 'ownerId': serializer.toJson<String>(ownerId),
+ 'thumbnailAssetId': serializer.toJson<String?>(thumbnailAssetId),
+ 'isActivityEnabled': serializer.toJson<bool>(isActivityEnabled),
+ 'order': serializer.toJson<int>(order),
+ };
+ }
+
+ RemoteAlbumEntityData copyWith({
+ String? id,
+ String? name,
+ String? description,
+ DateTime? createdAt,
+ DateTime? updatedAt,
+ String? ownerId,
+ Value<String?> thumbnailAssetId = const Value.absent(),
+ bool? isActivityEnabled,
+ int? order,
+ }) => RemoteAlbumEntityData(
+ id: id ?? this.id,
+ name: name ?? this.name,
+ description: description ?? this.description,
+ createdAt: createdAt ?? this.createdAt,
+ updatedAt: updatedAt ?? this.updatedAt,
+ ownerId: ownerId ?? this.ownerId,
+ thumbnailAssetId: thumbnailAssetId.present
+ ? thumbnailAssetId.value
+ : this.thumbnailAssetId,
+ isActivityEnabled: isActivityEnabled ?? this.isActivityEnabled,
+ order: order ?? this.order,
+ );
+ RemoteAlbumEntityData copyWithCompanion(RemoteAlbumEntityCompanion data) {
+ return RemoteAlbumEntityData(
+ id: data.id.present ? data.id.value : this.id,
+ name: data.name.present ? data.name.value : this.name,
+ description: data.description.present
+ ? data.description.value
+ : this.description,
+ createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt,
+ updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt,
+ ownerId: data.ownerId.present ? data.ownerId.value : this.ownerId,
+ thumbnailAssetId: data.thumbnailAssetId.present
+ ? data.thumbnailAssetId.value
+ : this.thumbnailAssetId,
+ isActivityEnabled: data.isActivityEnabled.present
+ ? data.isActivityEnabled.value
+ : this.isActivityEnabled,
+ order: data.order.present ? data.order.value : this.order,
+ );
+ }
+
+ @override
+ String toString() {
+ return (StringBuffer('RemoteAlbumEntityData(')
+ ..write('id: $id, ')
+ ..write('name: $name, ')
+ ..write('description: $description, ')
+ ..write('createdAt: $createdAt, ')
+ ..write('updatedAt: $updatedAt, ')
+ ..write('ownerId: $ownerId, ')
+ ..write('thumbnailAssetId: $thumbnailAssetId, ')
+ ..write('isActivityEnabled: $isActivityEnabled, ')
+ ..write('order: $order')
+ ..write(')'))
+ .toString();
+ }
+
+ @override
+ int get hashCode => Object.hash(
+ id,
+ name,
+ description,
+ createdAt,
+ updatedAt,
+ ownerId,
+ thumbnailAssetId,
+ isActivityEnabled,
+ order,
+ );
+ @override
+ bool operator ==(Object other) =>
+ identical(this, other) ||
+ (other is RemoteAlbumEntityData &&
+ other.id == this.id &&
+ other.name == this.name &&
+ other.description == this.description &&
+ other.createdAt == this.createdAt &&
+ other.updatedAt == this.updatedAt &&
+ other.ownerId == this.ownerId &&
+ other.thumbnailAssetId == this.thumbnailAssetId &&
+ other.isActivityEnabled == this.isActivityEnabled &&
+ other.order == this.order);
+}
+
+class RemoteAlbumEntityCompanion
+ extends UpdateCompanion<RemoteAlbumEntityData> {
+ final Value<String> id;
+ final Value<String> name;
+ final Value<String> description;
+ final Value<DateTime> createdAt;
+ final Value<DateTime> updatedAt;
+ final Value<String> ownerId;
+ final Value<String?> thumbnailAssetId;
+ final Value<bool> isActivityEnabled;
+ final Value<int> order;
+ const RemoteAlbumEntityCompanion({
+ this.id = const Value.absent(),
+ this.name = const Value.absent(),
+ this.description = const Value.absent(),
+ this.createdAt = const Value.absent(),
+ this.updatedAt = const Value.absent(),
+ this.ownerId = const Value.absent(),
+ this.thumbnailAssetId = const Value.absent(),
+ this.isActivityEnabled = const Value.absent(),
+ this.order = const Value.absent(),
+ });
+ RemoteAlbumEntityCompanion.insert({
+ required String id,
+ required String name,
+ this.description = const Value.absent(),
+ this.createdAt = const Value.absent(),
+ this.updatedAt = const Value.absent(),
+ required String ownerId,
+ this.thumbnailAssetId = const Value.absent(),
+ this.isActivityEnabled = const Value.absent(),
+ required int order,
+ }) : id = Value(id),
+ name = Value(name),
+ ownerId = Value(ownerId),
+ order = Value(order);
+ static Insertable<RemoteAlbumEntityData> custom({
+ Expression<String>? id,
+ Expression<String>? name,
+ Expression<String>? description,
+ Expression<DateTime>? createdAt,
+ Expression<DateTime>? updatedAt,
+ Expression<String>? ownerId,
+ Expression<String>? thumbnailAssetId,
+ Expression<bool>? isActivityEnabled,
+ Expression<int>? order,
+ }) {
+ return RawValuesInsertable({
+ if (id != null) 'id': id,
+ if (name != null) 'name': name,
+ if (description != null) 'description': description,
+ if (createdAt != null) 'created_at': createdAt,
+ if (updatedAt != null) 'updated_at': updatedAt,
+ if (ownerId != null) 'owner_id': ownerId,
+ if (thumbnailAssetId != null) 'thumbnail_asset_id': thumbnailAssetId,
+ if (isActivityEnabled != null) 'is_activity_enabled': isActivityEnabled,
+ if (order != null) 'order': order,
+ });
+ }
+
+ RemoteAlbumEntityCompanion copyWith({
+ Value<String>? id,
+ Value<String>? name,
+ Value<String>? description,
+ Value<DateTime>? createdAt,
+ Value<DateTime>? updatedAt,
+ Value<String>? ownerId,
+ Value<String?>? thumbnailAssetId,
+ Value<bool>? isActivityEnabled,
+ Value<int>? order,
+ }) {
+ return RemoteAlbumEntityCompanion(
+ id: id ?? this.id,
+ name: name ?? this.name,
+ description: description ?? this.description,
+ createdAt: createdAt ?? this.createdAt,
+ updatedAt: updatedAt ?? this.updatedAt,
+ ownerId: ownerId ?? this.ownerId,
+ thumbnailAssetId: thumbnailAssetId ?? this.thumbnailAssetId,
+ isActivityEnabled: isActivityEnabled ?? this.isActivityEnabled,
+ order: order ?? this.order,
+ );
+ }
+
+ @override
+ Map<String, Expression> toColumns(bool nullToAbsent) {
+ final map = <String, Expression>{};
+ if (id.present) {
+ map['id'] = Variable<String>(id.value);
+ }
+ if (name.present) {
+ map['name'] = Variable<String>(name.value);
+ }
+ if (description.present) {
+ map['description'] = Variable<String>(description.value);
+ }
+ if (createdAt.present) {
+ map['created_at'] = Variable<DateTime>(createdAt.value);
+ }
+ if (updatedAt.present) {
+ map['updated_at'] = Variable<DateTime>(updatedAt.value);
+ }
+ if (ownerId.present) {
+ map['owner_id'] = Variable<String>(ownerId.value);
+ }
+ if (thumbnailAssetId.present) {
+ map['thumbnail_asset_id'] = Variable<String>(thumbnailAssetId.value);
+ }
+ if (isActivityEnabled.present) {
+ map['is_activity_enabled'] = Variable<bool>(isActivityEnabled.value);
+ }
+ if (order.present) {
+ map['order'] = Variable<int>(order.value);
+ }
+ return map;
+ }
+
+ @override
+ String toString() {
+ return (StringBuffer('RemoteAlbumEntityCompanion(')
+ ..write('id: $id, ')
+ ..write('name: $name, ')
+ ..write('description: $description, ')
+ ..write('createdAt: $createdAt, ')
+ ..write('updatedAt: $updatedAt, ')
+ ..write('ownerId: $ownerId, ')
+ ..write('thumbnailAssetId: $thumbnailAssetId, ')
+ ..write('isActivityEnabled: $isActivityEnabled, ')
+ ..write('order: $order')
+ ..write(')'))
+ .toString();
+ }
+}
+
+class LocalAlbumEntity extends Table
+ with TableInfo<LocalAlbumEntity, LocalAlbumEntityData> {
+ @override
+ final GeneratedDatabase attachedDatabase;
+ final String? _alias;
+ LocalAlbumEntity(this.attachedDatabase, [this._alias]);
+ late final GeneratedColumn<String> id = GeneratedColumn<String>(
+ 'id',
+ aliasedName,
+ false,
+ type: DriftSqlType.string,
+ requiredDuringInsert: true,
+ );
+ late final GeneratedColumn<String> name = GeneratedColumn<String>(
+ 'name',
+ aliasedName,
+ false,
+ type: DriftSqlType.string,
+ requiredDuringInsert: true,
+ );
+ late final GeneratedColumn<DateTime> updatedAt = GeneratedColumn<DateTime>(
+ 'updated_at',
+ aliasedName,
+ false,
+ type: DriftSqlType.dateTime,
+ requiredDuringInsert: false,
+ defaultValue: const CustomExpression('CURRENT_TIMESTAMP'),
+ );
+ late final GeneratedColumn<int> backupSelection = GeneratedColumn<int>(
+ 'backup_selection',
+ aliasedName,
+ false,
+ type: DriftSqlType.int,
+ requiredDuringInsert: true,
+ );
+ late final GeneratedColumn<bool> isIosSharedAlbum = GeneratedColumn<bool>(
+ 'is_ios_shared_album',
+ aliasedName,
+ false,
+ type: DriftSqlType.bool,
+ requiredDuringInsert: false,
+ defaultConstraints: GeneratedColumn.constraintIsAlways(
+ 'CHECK ("is_ios_shared_album" IN (0, 1))',
+ ),
+ defaultValue: const CustomExpression('0'),
+ );
+ late final GeneratedColumn<String> linkedRemoteAlbumId =
+ GeneratedColumn<String>(
+ 'linked_remote_album_id',
+ aliasedName,
+ true,
+ type: DriftSqlType.string,
+ requiredDuringInsert: false,
+ defaultConstraints: GeneratedColumn.constraintIsAlways(
+ 'REFERENCES remote_album_entity (id) ON DELETE SET NULL',
+ ),
+ );
+ late final GeneratedColumn<bool> marker_ = GeneratedColumn<bool>(
+ 'marker',
+ aliasedName,
+ true,
+ type: DriftSqlType.bool,
+ requiredDuringInsert: false,
+ defaultConstraints: GeneratedColumn.constraintIsAlways(
+ 'CHECK ("marker" IN (0, 1))',
+ ),
+ );
+ @override
+ List<GeneratedColumn> get $columns => [
+ id,
+ name,
+ updatedAt,
+ backupSelection,
+ isIosSharedAlbum,
+ linkedRemoteAlbumId,
+ marker_,
+ ];
+ @override
+ String get aliasedName => _alias ?? actualTableName;
+ @override
+ String get actualTableName => $name;
+ static const String $name = 'local_album_entity';
+ @override
+ Set<GeneratedColumn> get $primaryKey => {id};
+ @override
+ LocalAlbumEntityData map(Map<String, dynamic> data, {String? tablePrefix}) {
+ final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : '';
+ return LocalAlbumEntityData(
+ id: attachedDatabase.typeMapping.read(
+ DriftSqlType.string,
+ data['${effectivePrefix}id'],
+ )!,
+ name: attachedDatabase.typeMapping.read(
+ DriftSqlType.string,
+ data['${effectivePrefix}name'],
+ )!,
+ updatedAt: attachedDatabase.typeMapping.read(
+ DriftSqlType.dateTime,
+ data['${effectivePrefix}updated_at'],
+ )!,
+ backupSelection: attachedDatabase.typeMapping.read(
+ DriftSqlType.int,
+ data['${effectivePrefix}backup_selection'],
+ )!,
+ isIosSharedAlbum: attachedDatabase.typeMapping.read(
+ DriftSqlType.bool,
+ data['${effectivePrefix}is_ios_shared_album'],
+ )!,
+ linkedRemoteAlbumId: attachedDatabase.typeMapping.read(
+ DriftSqlType.string,
+ data['${effectivePrefix}linked_remote_album_id'],
+ ),
+ marker_: attachedDatabase.typeMapping.read(
+ DriftSqlType.bool,
+ data['${effectivePrefix}marker'],
+ ),
+ );
+ }
+
+ @override
+ LocalAlbumEntity createAlias(String alias) {
+ return LocalAlbumEntity(attachedDatabase, alias);
+ }
+
+ @override
+ bool get withoutRowId => true;
+ @override
+ bool get isStrict => true;
+}
+
+class LocalAlbumEntityData extends DataClass
+ implements Insertable<LocalAlbumEntityData> {
+ final String id;
+ final String name;
+ final DateTime updatedAt;
+ final int backupSelection;
+ final bool isIosSharedAlbum;
+ final String? linkedRemoteAlbumId;
+ final bool? marker_;
+ const LocalAlbumEntityData({
+ required this.id,
+ required this.name,
+ required this.updatedAt,
+ required this.backupSelection,
+ required this.isIosSharedAlbum,
+ this.linkedRemoteAlbumId,
+ this.marker_,
+ });
+ @override
+ Map<String, Expression> toColumns(bool nullToAbsent) {
+ final map = <String, Expression>{};
+ map['id'] = Variable<String>(id);
+ map['name'] = Variable<String>(name);
+ map['updated_at'] = Variable<DateTime>(updatedAt);
+ map['backup_selection'] = Variable<int>(backupSelection);
+ map['is_ios_shared_album'] = Variable<bool>(isIosSharedAlbum);
+ if (!nullToAbsent || linkedRemoteAlbumId != null) {
+ map['linked_remote_album_id'] = Variable<String>(linkedRemoteAlbumId);
+ }
+ if (!nullToAbsent || marker_ != null) {
+ map['marker'] = Variable<bool>(marker_);
+ }
+ return map;
+ }
+
+ factory LocalAlbumEntityData.fromJson(
+ Map<String, dynamic> json, {
+ ValueSerializer? serializer,
+ }) {
+ serializer ??= driftRuntimeOptions.defaultSerializer;
+ return LocalAlbumEntityData(
+ id: serializer.fromJson<String>(json['id']),
+ name: serializer.fromJson<String>(json['name']),
+ updatedAt: serializer.fromJson<DateTime>(json['updatedAt']),
+ backupSelection: serializer.fromJson<int>(json['backupSelection']),
+ isIosSharedAlbum: serializer.fromJson<bool>(json['isIosSharedAlbum']),
+ linkedRemoteAlbumId: serializer.fromJson<String?>(
+ json['linkedRemoteAlbumId'],
+ ),
+ marker_: serializer.fromJson<bool?>(json['marker_']),
+ );
+ }
+ @override
+ Map<String, dynamic> toJson({ValueSerializer? serializer}) {
+ serializer ??= driftRuntimeOptions.defaultSerializer;
+ return <String, dynamic>{
+ 'id': serializer.toJson<String>(id),
+ 'name': serializer.toJson<String>(name),
+ 'updatedAt': serializer.toJson<DateTime>(updatedAt),
+ 'backupSelection': serializer.toJson<int>(backupSelection),
+ 'isIosSharedAlbum': serializer.toJson<bool>(isIosSharedAlbum),
+ 'linkedRemoteAlbumId': serializer.toJson<String?>(linkedRemoteAlbumId),
+ 'marker_': serializer.toJson<bool?>(marker_),
+ };
+ }
+
+ LocalAlbumEntityData copyWith({
+ String? id,
+ String? name,
+ DateTime? updatedAt,
+ int? backupSelection,
+ bool? isIosSharedAlbum,
+ Value<String?> linkedRemoteAlbumId = const Value.absent(),
+ Value<bool?> marker_ = const Value.absent(),
+ }) => LocalAlbumEntityData(
+ id: id ?? this.id,
+ name: name ?? this.name,
+ updatedAt: updatedAt ?? this.updatedAt,
+ backupSelection: backupSelection ?? this.backupSelection,
+ isIosSharedAlbum: isIosSharedAlbum ?? this.isIosSharedAlbum,
+ linkedRemoteAlbumId: linkedRemoteAlbumId.present
+ ? linkedRemoteAlbumId.value
+ : this.linkedRemoteAlbumId,
+ marker_: marker_.present ? marker_.value : this.marker_,
+ );
+ LocalAlbumEntityData copyWithCompanion(LocalAlbumEntityCompanion data) {
+ return LocalAlbumEntityData(
+ id: data.id.present ? data.id.value : this.id,
+ name: data.name.present ? data.name.value : this.name,
+ updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt,
+ backupSelection: data.backupSelection.present
+ ? data.backupSelection.value
+ : this.backupSelection,
+ isIosSharedAlbum: data.isIosSharedAlbum.present
+ ? data.isIosSharedAlbum.value
+ : this.isIosSharedAlbum,
+ linkedRemoteAlbumId: data.linkedRemoteAlbumId.present
+ ? data.linkedRemoteAlbumId.value
+ : this.linkedRemoteAlbumId,
+ marker_: data.marker_.present ? data.marker_.value : this.marker_,
+ );
+ }
+
+ @override
+ String toString() {
+ return (StringBuffer('LocalAlbumEntityData(')
+ ..write('id: $id, ')
+ ..write('name: $name, ')
+ ..write('updatedAt: $updatedAt, ')
+ ..write('backupSelection: $backupSelection, ')
+ ..write('isIosSharedAlbum: $isIosSharedAlbum, ')
+ ..write('linkedRemoteAlbumId: $linkedRemoteAlbumId, ')
+ ..write('marker_: $marker_')
+ ..write(')'))
+ .toString();
+ }
+
+ @override
+ int get hashCode => Object.hash(
+ id,
+ name,
+ updatedAt,
+ backupSelection,
+ isIosSharedAlbum,
+ linkedRemoteAlbumId,
+ marker_,
+ );
+ @override
+ bool operator ==(Object other) =>
+ identical(this, other) ||
+ (other is LocalAlbumEntityData &&
+ other.id == this.id &&
+ other.name == this.name &&
+ other.updatedAt == this.updatedAt &&
+ other.backupSelection == this.backupSelection &&
+ other.isIosSharedAlbum == this.isIosSharedAlbum &&
+ other.linkedRemoteAlbumId == this.linkedRemoteAlbumId &&
+ other.marker_ == this.marker_);
+}
+
+class LocalAlbumEntityCompanion extends UpdateCompanion<LocalAlbumEntityData> {
+ final Value<String> id;
+ final Value<String> name;
+ final Value<DateTime> updatedAt;
+ final Value<int> backupSelection;
+ final Value<bool> isIosSharedAlbum;
+ final Value<String?> linkedRemoteAlbumId;
+ final Value<bool?> marker_;
+ const LocalAlbumEntityCompanion({
+ this.id = const Value.absent(),
+ this.name = const Value.absent(),
+ this.updatedAt = const Value.absent(),
+ this.backupSelection = const Value.absent(),
+ this.isIosSharedAlbum = const Value.absent(),
+ this.linkedRemoteAlbumId = const Value.absent(),
+ this.marker_ = const Value.absent(),
+ });
+ LocalAlbumEntityCompanion.insert({
+ required String id,
+ required String name,
+ this.updatedAt = const Value.absent(),
+ required int backupSelection,
+ this.isIosSharedAlbum = const Value.absent(),
+ this.linkedRemoteAlbumId = const Value.absent(),
+ this.marker_ = const Value.absent(),
+ }) : id = Value(id),
+ name = Value(name),
+ backupSelection = Value(backupSelection);
+ static Insertable<LocalAlbumEntityData> custom({
+ Expression<String>? id,
+ Expression<String>? name,
+ Expression<DateTime>? updatedAt,
+ Expression<int>? backupSelection,
+ Expression<bool>? isIosSharedAlbum,
+ Expression<String>? linkedRemoteAlbumId,
+ Expression<bool>? marker_,
+ }) {
+ return RawValuesInsertable({
+ if (id != null) 'id': id,
+ if (name != null) 'name': name,
+ if (updatedAt != null) 'updated_at': updatedAt,
+ if (backupSelection != null) 'backup_selection': backupSelection,
+ if (isIosSharedAlbum != null) 'is_ios_shared_album': isIosSharedAlbum,
+ if (linkedRemoteAlbumId != null)
+ 'linked_remote_album_id': linkedRemoteAlbumId,
+ if (marker_ != null) 'marker': marker_,
+ });
+ }
+
+ LocalAlbumEntityCompanion copyWith({
+ Value<String>? id,
+ Value<String>? name,
+ Value<DateTime>? updatedAt,
+ Value<int>? backupSelection,
+ Value<bool>? isIosSharedAlbum,
+ Value<String?>? linkedRemoteAlbumId,
+ Value<bool?>? marker_,
+ }) {
+ return LocalAlbumEntityCompanion(
+ id: id ?? this.id,
+ name: name ?? this.name,
+ updatedAt: updatedAt ?? this.updatedAt,
+ backupSelection: backupSelection ?? this.backupSelection,
+ isIosSharedAlbum: isIosSharedAlbum ?? this.isIosSharedAlbum,
+ linkedRemoteAlbumId: linkedRemoteAlbumId ?? this.linkedRemoteAlbumId,
+ marker_: marker_ ?? this.marker_,
+ );
+ }
+
+ @override
+ Map<String, Expression> toColumns(bool nullToAbsent) {
+ final map = <String, Expression>{};
+ if (id.present) {
+ map['id'] = Variable<String>(id.value);
+ }
+ if (name.present) {
+ map['name'] = Variable<String>(name.value);
+ }
+ if (updatedAt.present) {
+ map['updated_at'] = Variable<DateTime>(updatedAt.value);
+ }
+ if (backupSelection.present) {
+ map['backup_selection'] = Variable<int>(backupSelection.value);
+ }
+ if (isIosSharedAlbum.present) {
+ map['is_ios_shared_album'] = Variable<bool>(isIosSharedAlbum.value);
+ }
+ if (linkedRemoteAlbumId.present) {
+ map['linked_remote_album_id'] = Variable<String>(
+ linkedRemoteAlbumId.value,
+ );
+ }
+ if (marker_.present) {
+ map['marker'] = Variable<bool>(marker_.value);
+ }
+ return map;
+ }
+
+ @override
+ String toString() {
+ return (StringBuffer('LocalAlbumEntityCompanion(')
+ ..write('id: $id, ')
+ ..write('name: $name, ')
+ ..write('updatedAt: $updatedAt, ')
+ ..write('backupSelection: $backupSelection, ')
+ ..write('isIosSharedAlbum: $isIosSharedAlbum, ')
+ ..write('linkedRemoteAlbumId: $linkedRemoteAlbumId, ')
+ ..write('marker_: $marker_')
+ ..write(')'))
+ .toString();
+ }
+}
+
+class LocalAlbumAssetEntity extends Table
+ with TableInfo<LocalAlbumAssetEntity, LocalAlbumAssetEntityData> {
+ @override
+ final GeneratedDatabase attachedDatabase;
+ final String? _alias;
+ LocalAlbumAssetEntity(this.attachedDatabase, [this._alias]);
+ late final GeneratedColumn<String> assetId = GeneratedColumn<String>(
+ 'asset_id',
+ aliasedName,
+ false,
+ type: DriftSqlType.string,
+ requiredDuringInsert: true,
+ defaultConstraints: GeneratedColumn.constraintIsAlways(
+ 'REFERENCES local_asset_entity (id) ON DELETE CASCADE',
+ ),
+ );
+ late final GeneratedColumn<String> albumId = GeneratedColumn<String>(
+ 'album_id',
+ aliasedName,
+ false,
+ type: DriftSqlType.string,
+ requiredDuringInsert: true,
+ defaultConstraints: GeneratedColumn.constraintIsAlways(
+ 'REFERENCES local_album_entity (id) ON DELETE CASCADE',
+ ),
+ );
+ late final GeneratedColumn<bool> marker_ = GeneratedColumn<bool>(
+ 'marker',
+ aliasedName,
+ true,
+ type: DriftSqlType.bool,
+ requiredDuringInsert: false,
+ defaultConstraints: GeneratedColumn.constraintIsAlways(
+ 'CHECK ("marker" IN (0, 1))',
+ ),
+ );
+ @override
+ List<GeneratedColumn> get $columns => [assetId, albumId, marker_];
+ @override
+ String get aliasedName => _alias ?? actualTableName;
+ @override
+ String get actualTableName => $name;
+ static const String $name = 'local_album_asset_entity';
+ @override
+ Set<GeneratedColumn> get $primaryKey => {assetId, albumId};
+ @override
+ LocalAlbumAssetEntityData map(
+ Map<String, dynamic> data, {
+ String? tablePrefix,
+ }) {
+ final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : '';
+ return LocalAlbumAssetEntityData(
+ assetId: attachedDatabase.typeMapping.read(
+ DriftSqlType.string,
+ data['${effectivePrefix}asset_id'],
+ )!,
+ albumId: attachedDatabase.typeMapping.read(
+ DriftSqlType.string,
+ data['${effectivePrefix}album_id'],
+ )!,
+ marker_: attachedDatabase.typeMapping.read(
+ DriftSqlType.bool,
+ data['${effectivePrefix}marker'],
+ ),
+ );
+ }
+
+ @override
+ LocalAlbumAssetEntity createAlias(String alias) {
+ return LocalAlbumAssetEntity(attachedDatabase, alias);
+ }
+
+ @override
+ bool get withoutRowId => true;
+ @override
+ bool get isStrict => true;
+}
+
+class LocalAlbumAssetEntityData extends DataClass
+ implements Insertable<LocalAlbumAssetEntityData> {
+ final String assetId;
+ final String albumId;
+ final bool? marker_;
+ const LocalAlbumAssetEntityData({
+ required this.assetId,
+ required this.albumId,
+ this.marker_,
+ });
+ @override
+ Map<String, Expression> toColumns(bool nullToAbsent) {
+ final map = <String, Expression>{};
+ map['asset_id'] = Variable<String>(assetId);
+ map['album_id'] = Variable<String>(albumId);
+ if (!nullToAbsent || marker_ != null) {
+ map['marker'] = Variable<bool>(marker_);
+ }
+ return map;
+ }
+
+ factory LocalAlbumAssetEntityData.fromJson(
+ Map<String, dynamic> json, {
+ ValueSerializer? serializer,
+ }) {
+ serializer ??= driftRuntimeOptions.defaultSerializer;
+ return LocalAlbumAssetEntityData(
+ assetId: serializer.fromJson<String>(json['assetId']),
+ albumId: serializer.fromJson<String>(json['albumId']),
+ marker_: serializer.fromJson<bool?>(json['marker_']),
+ );
+ }
+ @override
+ Map<String, dynamic> toJson({ValueSerializer? serializer}) {
+ serializer ??= driftRuntimeOptions.defaultSerializer;
+ return <String, dynamic>{
+ 'assetId': serializer.toJson<String>(assetId),
+ 'albumId': serializer.toJson<String>(albumId),
+ 'marker_': serializer.toJson<bool?>(marker_),
+ };
+ }
+
+ LocalAlbumAssetEntityData copyWith({
+ String? assetId,
+ String? albumId,
+ Value<bool?> marker_ = const Value.absent(),
+ }) => LocalAlbumAssetEntityData(
+ assetId: assetId ?? this.assetId,
+ albumId: albumId ?? this.albumId,
+ marker_: marker_.present ? marker_.value : this.marker_,
+ );
+ LocalAlbumAssetEntityData copyWithCompanion(
+ LocalAlbumAssetEntityCompanion data,
+ ) {
+ return LocalAlbumAssetEntityData(
+ assetId: data.assetId.present ? data.assetId.value : this.assetId,
+ albumId: data.albumId.present ? data.albumId.value : this.albumId,
+ marker_: data.marker_.present ? data.marker_.value : this.marker_,
+ );
+ }
+
+ @override
+ String toString() {
+ return (StringBuffer('LocalAlbumAssetEntityData(')
+ ..write('assetId: $assetId, ')
+ ..write('albumId: $albumId, ')
+ ..write('marker_: $marker_')
+ ..write(')'))
+ .toString();
+ }
+
+ @override
+ int get hashCode => Object.hash(assetId, albumId, marker_);
+ @override
+ bool operator ==(Object other) =>
+ identical(this, other) ||
+ (other is LocalAlbumAssetEntityData &&
+ other.assetId == this.assetId &&
+ other.albumId == this.albumId &&
+ other.marker_ == this.marker_);
+}
+
+class LocalAlbumAssetEntityCompanion
+ extends UpdateCompanion<LocalAlbumAssetEntityData> {
+ final Value<String> assetId;
+ final Value<String> albumId;
+ final Value<bool?> marker_;
+ const LocalAlbumAssetEntityCompanion({
+ this.assetId = const Value.absent(),
+ this.albumId = const Value.absent(),
+ this.marker_ = const Value.absent(),
+ });
+ LocalAlbumAssetEntityCompanion.insert({
+ required String assetId,
+ required String albumId,
+ this.marker_ = const Value.absent(),
+ }) : assetId = Value(assetId),
+ albumId = Value(albumId);
+ static Insertable<LocalAlbumAssetEntityData> custom({
+ Expression<String>? assetId,
+ Expression<String>? albumId,
+ Expression<bool>? marker_,
+ }) {
+ return RawValuesInsertable({
+ if (assetId != null) 'asset_id': assetId,
+ if (albumId != null) 'album_id': albumId,
+ if (marker_ != null) 'marker': marker_,
+ });
+ }
+
+ LocalAlbumAssetEntityCompanion copyWith({
+ Value<String>? assetId,
+ Value<String>? albumId,
+ Value<bool?>? marker_,
+ }) {
+ return LocalAlbumAssetEntityCompanion(
+ assetId: assetId ?? this.assetId,
+ albumId: albumId ?? this.albumId,
+ marker_: marker_ ?? this.marker_,
+ );
+ }
+
+ @override
+ Map<String, Expression> toColumns(bool nullToAbsent) {
+ final map = <String, Expression>{};
+ if (assetId.present) {
+ map['asset_id'] = Variable<String>(assetId.value);
+ }
+ if (albumId.present) {
+ map['album_id'] = Variable<String>(albumId.value);
+ }
+ if (marker_.present) {
+ map['marker'] = Variable<bool>(marker_.value);
+ }
+ return map;
+ }
+
+ @override
+ String toString() {
+ return (StringBuffer('LocalAlbumAssetEntityCompanion(')
+ ..write('assetId: $assetId, ')
+ ..write('albumId: $albumId, ')
+ ..write('marker_: $marker_')
+ ..write(')'))
+ .toString();
+ }
+}
+
+class AuthUserEntity extends Table
+ with TableInfo<AuthUserEntity, AuthUserEntityData> {
+ @override
+ final GeneratedDatabase attachedDatabase;
+ final String? _alias;
+ AuthUserEntity(this.attachedDatabase, [this._alias]);
+ late final GeneratedColumn<String> id = GeneratedColumn<String>(
+ 'id',
+ aliasedName,
+ false,
+ type: DriftSqlType.string,
+ requiredDuringInsert: true,
+ );
+ late final GeneratedColumn<String> name = GeneratedColumn<String>(
+ 'name',
+ aliasedName,
+ false,
+ type: DriftSqlType.string,
+ requiredDuringInsert: true,
+ );
+ late final GeneratedColumn<String> email = GeneratedColumn<String>(
+ 'email',
+ aliasedName,
+ false,
+ type: DriftSqlType.string,
+ requiredDuringInsert: true,
+ );
+ late final GeneratedColumn<bool> isAdmin = GeneratedColumn<bool>(
+ 'is_admin',
+ aliasedName,
+ false,
+ type: DriftSqlType.bool,
+ requiredDuringInsert: false,
+ defaultConstraints: GeneratedColumn.constraintIsAlways(
+ 'CHECK ("is_admin" IN (0, 1))',
+ ),
+ defaultValue: const CustomExpression('0'),
+ );
+ late final GeneratedColumn<bool> hasProfileImage = GeneratedColumn<bool>(
+ 'has_profile_image',
+ aliasedName,
+ false,
+ type: DriftSqlType.bool,
+ requiredDuringInsert: false,
+ defaultConstraints: GeneratedColumn.constraintIsAlways(
+ 'CHECK ("has_profile_image" IN (0, 1))',
+ ),
+ defaultValue: const CustomExpression('0'),
+ );
+ late final GeneratedColumn<DateTime> profileChangedAt =
+ GeneratedColumn<DateTime>(
+ 'profile_changed_at',
+ aliasedName,
+ false,
+ type: DriftSqlType.dateTime,
+ requiredDuringInsert: false,
+ defaultValue: const CustomExpression('CURRENT_TIMESTAMP'),
+ );
+ late final GeneratedColumn<int> avatarColor = GeneratedColumn<int>(
+ 'avatar_color',
+ aliasedName,
+ false,
+ type: DriftSqlType.int,
+ requiredDuringInsert: true,
+ );
+ late final GeneratedColumn<int> quotaSizeInBytes = GeneratedColumn<int>(
+ 'quota_size_in_bytes',
+ aliasedName,
+ false,
+ type: DriftSqlType.int,
+ requiredDuringInsert: false,
+ defaultValue: const CustomExpression('0'),
+ );
+ late final GeneratedColumn<int> quotaUsageInBytes = GeneratedColumn<int>(
+ 'quota_usage_in_bytes',
+ aliasedName,
+ false,
+ type: DriftSqlType.int,
+ requiredDuringInsert: false,
+ defaultValue: const CustomExpression('0'),
+ );
+ late final GeneratedColumn<String> pinCode = GeneratedColumn<String>(
+ 'pin_code',
+ aliasedName,
+ true,
+ type: DriftSqlType.string,
+ requiredDuringInsert: false,
+ );
+ @override
+ List<GeneratedColumn> get $columns => [
+ id,
+ name,
+ email,
+ isAdmin,
+ hasProfileImage,
+ profileChangedAt,
+ avatarColor,
+ quotaSizeInBytes,
+ quotaUsageInBytes,
+ pinCode,
+ ];
+ @override
+ String get aliasedName => _alias ?? actualTableName;
+ @override
+ String get actualTableName => $name;
+ static const String $name = 'auth_user_entity';
+ @override
+ Set<GeneratedColumn> get $primaryKey => {id};
+ @override
+ AuthUserEntityData map(Map<String, dynamic> data, {String? tablePrefix}) {
+ final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : '';
+ return AuthUserEntityData(
+ id: attachedDatabase.typeMapping.read(
+ DriftSqlType.string,
+ data['${effectivePrefix}id'],
+ )!,
+ name: attachedDatabase.typeMapping.read(
+ DriftSqlType.string,
+ data['${effectivePrefix}name'],
+ )!,
+ email: attachedDatabase.typeMapping.read(
+ DriftSqlType.string,
+ data['${effectivePrefix}email'],
+ )!,
+ isAdmin: attachedDatabase.typeMapping.read(
+ DriftSqlType.bool,
+ data['${effectivePrefix}is_admin'],
+ )!,
+ hasProfileImage: attachedDatabase.typeMapping.read(
+ DriftSqlType.bool,
+ data['${effectivePrefix}has_profile_image'],
+ )!,
+ profileChangedAt: attachedDatabase.typeMapping.read(
+ DriftSqlType.dateTime,
+ data['${effectivePrefix}profile_changed_at'],
+ )!,
+ avatarColor: attachedDatabase.typeMapping.read(
+ DriftSqlType.int,
+ data['${effectivePrefix}avatar_color'],
+ )!,
+ quotaSizeInBytes: attachedDatabase.typeMapping.read(
+ DriftSqlType.int,
+ data['${effectivePrefix}quota_size_in_bytes'],
+ )!,
+ quotaUsageInBytes: attachedDatabase.typeMapping.read(
+ DriftSqlType.int,
+ data['${effectivePrefix}quota_usage_in_bytes'],
+ )!,
+ pinCode: attachedDatabase.typeMapping.read(
+ DriftSqlType.string,
+ data['${effectivePrefix}pin_code'],
+ ),
+ );
+ }
+
+ @override
+ AuthUserEntity createAlias(String alias) {
+ return AuthUserEntity(attachedDatabase, alias);
+ }
+
+ @override
+ bool get withoutRowId => true;
+ @override
+ bool get isStrict => true;
+}
+
+class AuthUserEntityData extends DataClass
+ implements Insertable<AuthUserEntityData> {
+ final String id;
+ final String name;
+ final String email;
+ final bool isAdmin;
+ final bool hasProfileImage;
+ final DateTime profileChangedAt;
+ final int avatarColor;
+ final int quotaSizeInBytes;
+ final int quotaUsageInBytes;
+ final String? pinCode;
+ const AuthUserEntityData({
+ required this.id,
+ required this.name,
+ required this.email,
+ required this.isAdmin,
+ required this.hasProfileImage,
+ required this.profileChangedAt,
+ required this.avatarColor,
+ required this.quotaSizeInBytes,
+ required this.quotaUsageInBytes,
+ this.pinCode,
+ });
+ @override
+ Map<String, Expression> toColumns(bool nullToAbsent) {
+ final map = <String, Expression>{};
+ map['id'] = Variable<String>(id);
+ map['name'] = Variable<String>(name);
+ map['email'] = Variable<String>(email);
+ map['is_admin'] = Variable<bool>(isAdmin);
+ map['has_profile_image'] = Variable<bool>(hasProfileImage);
+ map['profile_changed_at'] = Variable<DateTime>(profileChangedAt);
+ map['avatar_color'] = Variable<int>(avatarColor);
+ map['quota_size_in_bytes'] = Variable<int>(quotaSizeInBytes);
+ map['quota_usage_in_bytes'] = Variable<int>(quotaUsageInBytes);
+ if (!nullToAbsent || pinCode != null) {
+ map['pin_code'] = Variable<String>(pinCode);
+ }
+ return map;
+ }
+
+ factory AuthUserEntityData.fromJson(
+ Map<String, dynamic> json, {
+ ValueSerializer? serializer,
+ }) {
+ serializer ??= driftRuntimeOptions.defaultSerializer;
+ return AuthUserEntityData(
+ id: serializer.fromJson<String>(json['id']),
+ name: serializer.fromJson<String>(json['name']),
+ email: serializer.fromJson<String>(json['email']),
+ isAdmin: serializer.fromJson<bool>(json['isAdmin']),
+ hasProfileImage: serializer.fromJson<bool>(json['hasProfileImage']),
+ profileChangedAt: serializer.fromJson<DateTime>(json['profileChangedAt']),
+ avatarColor: serializer.fromJson<int>(json['avatarColor']),
+ quotaSizeInBytes: serializer.fromJson<int>(json['quotaSizeInBytes']),
+ quotaUsageInBytes: serializer.fromJson<int>(json['quotaUsageInBytes']),
+ pinCode: serializer.fromJson<String?>(json['pinCode']),
+ );
+ }
+ @override
+ Map<String, dynamic> toJson({ValueSerializer? serializer}) {
+ serializer ??= driftRuntimeOptions.defaultSerializer;
+ return <String, dynamic>{
+ 'id': serializer.toJson<String>(id),
+ 'name': serializer.toJson<String>(name),
+ 'email': serializer.toJson<String>(email),
+ 'isAdmin': serializer.toJson<bool>(isAdmin),
+ 'hasProfileImage': serializer.toJson<bool>(hasProfileImage),
+ 'profileChangedAt': serializer.toJson<DateTime>(profileChangedAt),
+ 'avatarColor': serializer.toJson<int>(avatarColor),
+ 'quotaSizeInBytes': serializer.toJson<int>(quotaSizeInBytes),
+ 'quotaUsageInBytes': serializer.toJson<int>(quotaUsageInBytes),
+ 'pinCode': serializer.toJson<String?>(pinCode),
+ };
+ }
+
+ AuthUserEntityData copyWith({
+ String? id,
+ String? name,
+ String? email,
+ bool? isAdmin,
+ bool? hasProfileImage,
+ DateTime? profileChangedAt,
+ int? avatarColor,
+ int? quotaSizeInBytes,
+ int? quotaUsageInBytes,
+ Value<String?> pinCode = const Value.absent(),
+ }) => AuthUserEntityData(
+ id: id ?? this.id,
+ name: name ?? this.name,
+ email: email ?? this.email,
+ isAdmin: isAdmin ?? this.isAdmin,
+ hasProfileImage: hasProfileImage ?? this.hasProfileImage,
+ profileChangedAt: profileChangedAt ?? this.profileChangedAt,
+ avatarColor: avatarColor ?? this.avatarColor,
+ quotaSizeInBytes: quotaSizeInBytes ?? this.quotaSizeInBytes,
+ quotaUsageInBytes: quotaUsageInBytes ?? this.quotaUsageInBytes,
+ pinCode: pinCode.present ? pinCode.value : this.pinCode,
+ );
+ AuthUserEntityData copyWithCompanion(AuthUserEntityCompanion data) {
+ return AuthUserEntityData(
+ id: data.id.present ? data.id.value : this.id,
+ name: data.name.present ? data.name.value : this.name,
+ email: data.email.present ? data.email.value : this.email,
+ isAdmin: data.isAdmin.present ? data.isAdmin.value : this.isAdmin,
+ hasProfileImage: data.hasProfileImage.present
+ ? data.hasProfileImage.value
+ : this.hasProfileImage,
+ profileChangedAt: data.profileChangedAt.present
+ ? data.profileChangedAt.value
+ : this.profileChangedAt,
+ avatarColor: data.avatarColor.present
+ ? data.avatarColor.value
+ : this.avatarColor,
+ quotaSizeInBytes: data.quotaSizeInBytes.present
+ ? data.quotaSizeInBytes.value
+ : this.quotaSizeInBytes,
+ quotaUsageInBytes: data.quotaUsageInBytes.present
+ ? data.quotaUsageInBytes.value
+ : this.quotaUsageInBytes,
+ pinCode: data.pinCode.present ? data.pinCode.value : this.pinCode,
+ );
+ }
+
+ @override
+ String toString() {
+ return (StringBuffer('AuthUserEntityData(')
+ ..write('id: $id, ')
+ ..write('name: $name, ')
+ ..write('email: $email, ')
+ ..write('isAdmin: $isAdmin, ')
+ ..write('hasProfileImage: $hasProfileImage, ')
+ ..write('profileChangedAt: $profileChangedAt, ')
+ ..write('avatarColor: $avatarColor, ')
+ ..write('quotaSizeInBytes: $quotaSizeInBytes, ')
+ ..write('quotaUsageInBytes: $quotaUsageInBytes, ')
+ ..write('pinCode: $pinCode')
+ ..write(')'))
+ .toString();
+ }
+
+ @override
+ int get hashCode => Object.hash(
+ id,
+ name,
+ email,
+ isAdmin,
+ hasProfileImage,
+ profileChangedAt,
+ avatarColor,
+ quotaSizeInBytes,
+ quotaUsageInBytes,
+ pinCode,
+ );
+ @override
+ bool operator ==(Object other) =>
+ identical(this, other) ||
+ (other is AuthUserEntityData &&
+ other.id == this.id &&
+ other.name == this.name &&
+ other.email == this.email &&
+ other.isAdmin == this.isAdmin &&
+ other.hasProfileImage == this.hasProfileImage &&
+ other.profileChangedAt == this.profileChangedAt &&
+ other.avatarColor == this.avatarColor &&
+ other.quotaSizeInBytes == this.quotaSizeInBytes &&
+ other.quotaUsageInBytes == this.quotaUsageInBytes &&
+ other.pinCode == this.pinCode);
+}
+
+class AuthUserEntityCompanion extends UpdateCompanion<AuthUserEntityData> {
+ final Value<String> id;
+ final Value<String> name;
+ final Value<String> email;
+ final Value<bool> isAdmin;
+ final Value<bool> hasProfileImage;
+ final Value<DateTime> profileChangedAt;
+ final Value<int> avatarColor;
+ final Value<int> quotaSizeInBytes;
+ final Value<int> quotaUsageInBytes;
+ final Value<String?> pinCode;
+ const AuthUserEntityCompanion({
+ this.id = const Value.absent(),
+ this.name = const Value.absent(),
+ this.email = const Value.absent(),
+ this.isAdmin = const Value.absent(),
+ this.hasProfileImage = const Value.absent(),
+ this.profileChangedAt = const Value.absent(),
+ this.avatarColor = const Value.absent(),
+ this.quotaSizeInBytes = const Value.absent(),
+ this.quotaUsageInBytes = const Value.absent(),
+ this.pinCode = const Value.absent(),
+ });
+ AuthUserEntityCompanion.insert({
+ required String id,
+ required String name,
+ required String email,
+ this.isAdmin = const Value.absent(),
+ this.hasProfileImage = const Value.absent(),
+ this.profileChangedAt = const Value.absent(),
+ required int avatarColor,
+ this.quotaSizeInBytes = const Value.absent(),
+ this.quotaUsageInBytes = const Value.absent(),
+ this.pinCode = const Value.absent(),
+ }) : id = Value(id),
+ name = Value(name),
+ email = Value(email),
+ avatarColor = Value(avatarColor);
+ static Insertable<AuthUserEntityData> custom({
+ Expression<String>? id,
+ Expression<String>? name,
+ Expression<String>? email,
+ Expression<bool>? isAdmin,
+ Expression<bool>? hasProfileImage,
+ Expression<DateTime>? profileChangedAt,
+ Expression<int>? avatarColor,
+ Expression<int>? quotaSizeInBytes,
+ Expression<int>? quotaUsageInBytes,
+ Expression<String>? pinCode,
+ }) {
+ return RawValuesInsertable({
+ if (id != null) 'id': id,
+ if (name != null) 'name': name,
+ if (email != null) 'email': email,
+ if (isAdmin != null) 'is_admin': isAdmin,
+ if (hasProfileImage != null) 'has_profile_image': hasProfileImage,
+ if (profileChangedAt != null) 'profile_changed_at': profileChangedAt,
+ if (avatarColor != null) 'avatar_color': avatarColor,
+ if (quotaSizeInBytes != null) 'quota_size_in_bytes': quotaSizeInBytes,
+ if (quotaUsageInBytes != null) 'quota_usage_in_bytes': quotaUsageInBytes,
+ if (pinCode != null) 'pin_code': pinCode,
+ });
+ }
+
+ AuthUserEntityCompanion copyWith({
+ Value<String>? id,
+ Value<String>? name,
+ Value<String>? email,
+ Value<bool>? isAdmin,
+ Value<bool>? hasProfileImage,
+ Value<DateTime>? profileChangedAt,
+ Value<int>? avatarColor,
+ Value<int>? quotaSizeInBytes,
+ Value<int>? quotaUsageInBytes,
+ Value<String?>? pinCode,
+ }) {
+ return AuthUserEntityCompanion(
+ id: id ?? this.id,
+ name: name ?? this.name,
+ email: email ?? this.email,
+ isAdmin: isAdmin ?? this.isAdmin,
+ hasProfileImage: hasProfileImage ?? this.hasProfileImage,
+ profileChangedAt: profileChangedAt ?? this.profileChangedAt,
+ avatarColor: avatarColor ?? this.avatarColor,
+ quotaSizeInBytes: quotaSizeInBytes ?? this.quotaSizeInBytes,
+ quotaUsageInBytes: quotaUsageInBytes ?? this.quotaUsageInBytes,
+ pinCode: pinCode ?? this.pinCode,
+ );
+ }
+
+ @override
+ Map<String, Expression> toColumns(bool nullToAbsent) {
+ final map = <String, Expression>{};
+ if (id.present) {
+ map['id'] = Variable<String>(id.value);
+ }
+ if (name.present) {
+ map['name'] = Variable<String>(name.value);
+ }
+ if (email.present) {
+ map['email'] = Variable<String>(email.value);
+ }
+ if (isAdmin.present) {
+ map['is_admin'] = Variable<bool>(isAdmin.value);
+ }
+ if (hasProfileImage.present) {
+ map['has_profile_image'] = Variable<bool>(hasProfileImage.value);
+ }
+ if (profileChangedAt.present) {
+ map['profile_changed_at'] = Variable<DateTime>(profileChangedAt.value);
+ }
+ if (avatarColor.present) {
+ map['avatar_color'] = Variable<int>(avatarColor.value);
+ }
+ if (quotaSizeInBytes.present) {
+ map['quota_size_in_bytes'] = Variable<int>(quotaSizeInBytes.value);
+ }
+ if (quotaUsageInBytes.present) {
+ map['quota_usage_in_bytes'] = Variable<int>(quotaUsageInBytes.value);
+ }
+ if (pinCode.present) {
+ map['pin_code'] = Variable<String>(pinCode.value);
+ }
+ return map;
+ }
+
+ @override
+ String toString() {
+ return (StringBuffer('AuthUserEntityCompanion(')
+ ..write('id: $id, ')
+ ..write('name: $name, ')
+ ..write('email: $email, ')
+ ..write('isAdmin: $isAdmin, ')
+ ..write('hasProfileImage: $hasProfileImage, ')
+ ..write('profileChangedAt: $profileChangedAt, ')
+ ..write('avatarColor: $avatarColor, ')
+ ..write('quotaSizeInBytes: $quotaSizeInBytes, ')
+ ..write('quotaUsageInBytes: $quotaUsageInBytes, ')
+ ..write('pinCode: $pinCode')
+ ..write(')'))
+ .toString();
+ }
+}
+
+class UserMetadataEntity extends Table
+ with TableInfo<UserMetadataEntity, UserMetadataEntityData> {
+ @override
+ final GeneratedDatabase attachedDatabase;
+ final String? _alias;
+ UserMetadataEntity(this.attachedDatabase, [this._alias]);
+ late final GeneratedColumn<String> userId = GeneratedColumn<String>(
+ 'user_id',
+ aliasedName,
+ false,
+ type: DriftSqlType.string,
+ requiredDuringInsert: true,
+ defaultConstraints: GeneratedColumn.constraintIsAlways(
+ 'REFERENCES user_entity (id) ON DELETE CASCADE',
+ ),
+ );
+ late final GeneratedColumn<int> key = GeneratedColumn<int>(
+ 'key',
+ aliasedName,
+ false,
+ type: DriftSqlType.int,
+ requiredDuringInsert: true,
+ );
+ late final GeneratedColumn<Uint8List> value = GeneratedColumn<Uint8List>(
+ 'value',
+ aliasedName,
+ false,
+ type: DriftSqlType.blob,
+ requiredDuringInsert: true,
+ );
+ @override
+ List<GeneratedColumn> get $columns => [userId, key, value];
+ @override
+ String get aliasedName => _alias ?? actualTableName;
+ @override
+ String get actualTableName => $name;
+ static const String $name = 'user_metadata_entity';
+ @override
+ Set<GeneratedColumn> get $primaryKey => {userId, key};
+ @override
+ UserMetadataEntityData map(Map<String, dynamic> data, {String? tablePrefix}) {
+ final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : '';
+ return UserMetadataEntityData(
+ userId: attachedDatabase.typeMapping.read(
+ DriftSqlType.string,
+ data['${effectivePrefix}user_id'],
+ )!,
+ key: attachedDatabase.typeMapping.read(
+ DriftSqlType.int,
+ data['${effectivePrefix}key'],
+ )!,
+ value: attachedDatabase.typeMapping.read(
+ DriftSqlType.blob,
+ data['${effectivePrefix}value'],
+ )!,
+ );
+ }
+
+ @override
+ UserMetadataEntity createAlias(String alias) {
+ return UserMetadataEntity(attachedDatabase, alias);
+ }
+
+ @override
+ bool get withoutRowId => true;
+ @override
+ bool get isStrict => true;
+}
+
+class UserMetadataEntityData extends DataClass
+ implements Insertable<UserMetadataEntityData> {
+ final String userId;
+ final int key;
+ final Uint8List value;
+ const UserMetadataEntityData({
+ required this.userId,
+ required this.key,
+ required this.value,
+ });
+ @override
+ Map<String, Expression> toColumns(bool nullToAbsent) {
+ final map = <String, Expression>{};
+ map['user_id'] = Variable<String>(userId);
+ map['key'] = Variable<int>(key);
+ map['value'] = Variable<Uint8List>(value);
+ return map;
+ }
+
+ factory UserMetadataEntityData.fromJson(
+ Map<String, dynamic> json, {
+ ValueSerializer? serializer,
+ }) {
+ serializer ??= driftRuntimeOptions.defaultSerializer;
+ return UserMetadataEntityData(
+ userId: serializer.fromJson<String>(json['userId']),
+ key: serializer.fromJson<int>(json['key']),
+ value: serializer.fromJson<Uint8List>(json['value']),
+ );
+ }
+ @override
+ Map<String, dynamic> toJson({ValueSerializer? serializer}) {
+ serializer ??= driftRuntimeOptions.defaultSerializer;
+ return <String, dynamic>{
+ 'userId': serializer.toJson<String>(userId),
+ 'key': serializer.toJson<int>(key),
+ 'value': serializer.toJson<Uint8List>(value),
+ };
+ }
+
+ UserMetadataEntityData copyWith({
+ String? userId,
+ int? key,
+ Uint8List? value,
+ }) => UserMetadataEntityData(
+ userId: userId ?? this.userId,
+ key: key ?? this.key,
+ value: value ?? this.value,
+ );
+ UserMetadataEntityData copyWithCompanion(UserMetadataEntityCompanion data) {
+ return UserMetadataEntityData(
+ userId: data.userId.present ? data.userId.value : this.userId,
+ key: data.key.present ? data.key.value : this.key,
+ value: data.value.present ? data.value.value : this.value,
+ );
+ }
+
+ @override
+ String toString() {
+ return (StringBuffer('UserMetadataEntityData(')
+ ..write('userId: $userId, ')
+ ..write('key: $key, ')
+ ..write('value: $value')
+ ..write(')'))
+ .toString();
+ }
+
+ @override
+ int get hashCode => Object.hash(userId, key, $driftBlobEquality.hash(value));
+ @override
+ bool operator ==(Object other) =>
+ identical(this, other) ||
+ (other is UserMetadataEntityData &&
+ other.userId == this.userId &&
+ other.key == this.key &&
+ $driftBlobEquality.equals(other.value, this.value));
+}
+
+class UserMetadataEntityCompanion
+ extends UpdateCompanion<UserMetadataEntityData> {
+ final Value<String> userId;
+ final Value<int> key;
+ final Value<Uint8List> value;
+ const UserMetadataEntityCompanion({
+ this.userId = const Value.absent(),
+ this.key = const Value.absent(),
+ this.value = const Value.absent(),
+ });
+ UserMetadataEntityCompanion.insert({
+ required String userId,
+ required int key,
+ required Uint8List value,
+ }) : userId = Value(userId),
+ key = Value(key),
+ value = Value(value);
+ static Insertable<UserMetadataEntityData> custom({
+ Expression<String>? userId,
+ Expression<int>? key,
+ Expression<Uint8List>? value,
+ }) {
+ return RawValuesInsertable({
+ if (userId != null) 'user_id': userId,
+ if (key != null) 'key': key,
+ if (value != null) 'value': value,
+ });
+ }
+
+ UserMetadataEntityCompanion copyWith({
+ Value<String>? userId,
+ Value<int>? key,
+ Value<Uint8List>? value,
+ }) {
+ return UserMetadataEntityCompanion(
+ userId: userId ?? this.userId,
+ key: key ?? this.key,
+ value: value ?? this.value,
+ );
+ }
+
+ @override
+ Map<String, Expression> toColumns(bool nullToAbsent) {
+ final map = <String, Expression>{};
+ if (userId.present) {
+ map['user_id'] = Variable<String>(userId.value);
+ }
+ if (key.present) {
+ map['key'] = Variable<int>(key.value);
+ }
+ if (value.present) {
+ map['value'] = Variable<Uint8List>(value.value);
+ }
+ return map;
+ }
+
+ @override
+ String toString() {
+ return (StringBuffer('UserMetadataEntityCompanion(')
+ ..write('userId: $userId, ')
+ ..write('key: $key, ')
+ ..write('value: $value')
+ ..write(')'))
+ .toString();
+ }
+}
+
+class PartnerEntity extends Table
+ with TableInfo<PartnerEntity, PartnerEntityData> {
+ @override
+ final GeneratedDatabase attachedDatabase;
+ final String? _alias;
+ PartnerEntity(this.attachedDatabase, [this._alias]);
+ late final GeneratedColumn<String> sharedById = GeneratedColumn<String>(
+ 'shared_by_id',
+ aliasedName,
+ false,
+ type: DriftSqlType.string,
+ requiredDuringInsert: true,
+ defaultConstraints: GeneratedColumn.constraintIsAlways(
+ 'REFERENCES user_entity (id) ON DELETE CASCADE',
+ ),
+ );
+ late final GeneratedColumn<String> sharedWithId = GeneratedColumn<String>(
+ 'shared_with_id',
+ aliasedName,
+ false,
+ type: DriftSqlType.string,
+ requiredDuringInsert: true,
+ defaultConstraints: GeneratedColumn.constraintIsAlways(
+ 'REFERENCES user_entity (id) ON DELETE CASCADE',
+ ),
+ );
+ late final GeneratedColumn<bool> inTimeline = GeneratedColumn<bool>(
+ 'in_timeline',
+ aliasedName,
+ false,
+ type: DriftSqlType.bool,
+ requiredDuringInsert: false,
+ defaultConstraints: GeneratedColumn.constraintIsAlways(
+ 'CHECK ("in_timeline" IN (0, 1))',
+ ),
+ defaultValue: const CustomExpression('0'),
+ );
+ @override
+ List<GeneratedColumn> get $columns => [sharedById, sharedWithId, inTimeline];
+ @override
+ String get aliasedName => _alias ?? actualTableName;
+ @override
+ String get actualTableName => $name;
+ static const String $name = 'partner_entity';
+ @override
+ Set<GeneratedColumn> get $primaryKey => {sharedById, sharedWithId};
+ @override
+ PartnerEntityData map(Map<String, dynamic> data, {String? tablePrefix}) {
+ final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : '';
+ return PartnerEntityData(
+ sharedById: attachedDatabase.typeMapping.read(
+ DriftSqlType.string,
+ data['${effectivePrefix}shared_by_id'],
+ )!,
+ sharedWithId: attachedDatabase.typeMapping.read(
+ DriftSqlType.string,
+ data['${effectivePrefix}shared_with_id'],
+ )!,
+ inTimeline: attachedDatabase.typeMapping.read(
+ DriftSqlType.bool,
+ data['${effectivePrefix}in_timeline'],
+ )!,
+ );
+ }
+
+ @override
+ PartnerEntity createAlias(String alias) {
+ return PartnerEntity(attachedDatabase, alias);
+ }
+
+ @override
+ bool get withoutRowId => true;
+ @override
+ bool get isStrict => true;
+}
+
+class PartnerEntityData extends DataClass
+ implements Insertable<PartnerEntityData> {
+ final String sharedById;
+ final String sharedWithId;
+ final bool inTimeline;
+ const PartnerEntityData({
+ required this.sharedById,
+ required this.sharedWithId,
+ required this.inTimeline,
+ });
+ @override
+ Map<String, Expression> toColumns(bool nullToAbsent) {
+ final map = <String, Expression>{};
+ map['shared_by_id'] = Variable<String>(sharedById);
+ map['shared_with_id'] = Variable<String>(sharedWithId);
+ map['in_timeline'] = Variable<bool>(inTimeline);
+ return map;
+ }
+
+ factory PartnerEntityData.fromJson(
+ Map<String, dynamic> json, {
+ ValueSerializer? serializer,
+ }) {
+ serializer ??= driftRuntimeOptions.defaultSerializer;
+ return PartnerEntityData(
+ sharedById: serializer.fromJson<String>(json['sharedById']),
+ sharedWithId: serializer.fromJson<String>(json['sharedWithId']),
+ inTimeline: serializer.fromJson<bool>(json['inTimeline']),
+ );
+ }
+ @override
+ Map<String, dynamic> toJson({ValueSerializer? serializer}) {
+ serializer ??= driftRuntimeOptions.defaultSerializer;
+ return <String, dynamic>{
+ 'sharedById': serializer.toJson<String>(sharedById),
+ 'sharedWithId': serializer.toJson<String>(sharedWithId),
+ 'inTimeline': serializer.toJson<bool>(inTimeline),
+ };
+ }
+
+ PartnerEntityData copyWith({
+ String? sharedById,
+ String? sharedWithId,
+ bool? inTimeline,
+ }) => PartnerEntityData(
+ sharedById: sharedById ?? this.sharedById,
+ sharedWithId: sharedWithId ?? this.sharedWithId,
+ inTimeline: inTimeline ?? this.inTimeline,
+ );
+ PartnerEntityData copyWithCompanion(PartnerEntityCompanion data) {
+ return PartnerEntityData(
+ sharedById: data.sharedById.present
+ ? data.sharedById.value
+ : this.sharedById,
+ sharedWithId: data.sharedWithId.present
+ ? data.sharedWithId.value
+ : this.sharedWithId,
+ inTimeline: data.inTimeline.present
+ ? data.inTimeline.value
+ : this.inTimeline,
+ );
+ }
+
+ @override
+ String toString() {
+ return (StringBuffer('PartnerEntityData(')
+ ..write('sharedById: $sharedById, ')
+ ..write('sharedWithId: $sharedWithId, ')
+ ..write('inTimeline: $inTimeline')
+ ..write(')'))
+ .toString();
+ }
+
+ @override
+ int get hashCode => Object.hash(sharedById, sharedWithId, inTimeline);
+ @override
+ bool operator ==(Object other) =>
+ identical(this, other) ||
+ (other is PartnerEntityData &&
+ other.sharedById == this.sharedById &&
+ other.sharedWithId == this.sharedWithId &&
+ other.inTimeline == this.inTimeline);
+}
+
+class PartnerEntityCompanion extends UpdateCompanion<PartnerEntityData> {
+ final Value<String> sharedById;
+ final Value<String> sharedWithId;
+ final Value<bool> inTimeline;
+ const PartnerEntityCompanion({
+ this.sharedById = const Value.absent(),
+ this.sharedWithId = const Value.absent(),
+ this.inTimeline = const Value.absent(),
+ });
+ PartnerEntityCompanion.insert({
+ required String sharedById,
+ required String sharedWithId,
+ this.inTimeline = const Value.absent(),
+ }) : sharedById = Value(sharedById),
+ sharedWithId = Value(sharedWithId);
+ static Insertable<PartnerEntityData> custom({
+ Expression<String>? sharedById,
+ Expression<String>? sharedWithId,
+ Expression<bool>? inTimeline,
+ }) {
+ return RawValuesInsertable({
+ if (sharedById != null) 'shared_by_id': sharedById,
+ if (sharedWithId != null) 'shared_with_id': sharedWithId,
+ if (inTimeline != null) 'in_timeline': inTimeline,
+ });
+ }
+
+ PartnerEntityCompanion copyWith({
+ Value<String>? sharedById,
+ Value<String>? sharedWithId,
+ Value<bool>? inTimeline,
+ }) {
+ return PartnerEntityCompanion(
+ sharedById: sharedById ?? this.sharedById,
+ sharedWithId: sharedWithId ?? this.sharedWithId,
+ inTimeline: inTimeline ?? this.inTimeline,
+ );
+ }
+
+ @override
+ Map<String, Expression> toColumns(bool nullToAbsent) {
+ final map = <String, Expression>{};
+ if (sharedById.present) {
+ map['shared_by_id'] = Variable<String>(sharedById.value);
+ }
+ if (sharedWithId.present) {
+ map['shared_with_id'] = Variable<String>(sharedWithId.value);
+ }
+ if (inTimeline.present) {
+ map['in_timeline'] = Variable<bool>(inTimeline.value);
+ }
+ return map;
+ }
+
+ @override
+ String toString() {
+ return (StringBuffer('PartnerEntityCompanion(')
+ ..write('sharedById: $sharedById, ')
+ ..write('sharedWithId: $sharedWithId, ')
+ ..write('inTimeline: $inTimeline')
+ ..write(')'))
+ .toString();
+ }
+}
+
+class RemoteExifEntity extends Table
+ with TableInfo<RemoteExifEntity, RemoteExifEntityData> {
+ @override
+ final GeneratedDatabase attachedDatabase;
+ final String? _alias;
+ RemoteExifEntity(this.attachedDatabase, [this._alias]);
+ late final GeneratedColumn<String> assetId = GeneratedColumn<String>(
+ 'asset_id',
+ aliasedName,
+ false,
+ type: DriftSqlType.string,
+ requiredDuringInsert: true,
+ defaultConstraints: GeneratedColumn.constraintIsAlways(
+ 'REFERENCES remote_asset_entity (id) ON DELETE CASCADE',
+ ),
+ );
+ late final GeneratedColumn<String> city = GeneratedColumn<String>(
+ 'city',
+ aliasedName,
+ true,
+ type: DriftSqlType.string,
+ requiredDuringInsert: false,
+ );
+ late final GeneratedColumn<String> state = GeneratedColumn<String>(
+ 'state',
+ aliasedName,
+ true,
+ type: DriftSqlType.string,
+ requiredDuringInsert: false,
+ );
+ late final GeneratedColumn<String> country = GeneratedColumn<String>(
+ 'country',
+ aliasedName,
+ true,
+ type: DriftSqlType.string,
+ requiredDuringInsert: false,
+ );
+ late final GeneratedColumn<DateTime> dateTimeOriginal =
+ GeneratedColumn<DateTime>(
+ 'date_time_original',
+ aliasedName,
+ true,
+ type: DriftSqlType.dateTime,
+ requiredDuringInsert: false,
+ );
+ late final GeneratedColumn<String> description = GeneratedColumn<String>(
+ 'description',
+ aliasedName,
+ true,
+ type: DriftSqlType.string,
+ requiredDuringInsert: false,
+ );
+ late final GeneratedColumn<int> height = GeneratedColumn<int>(
+ 'height',
+ aliasedName,
+ true,
+ type: DriftSqlType.int,
+ requiredDuringInsert: false,
+ );
+ late final GeneratedColumn<int> width = GeneratedColumn<int>(
+ 'width',
+ aliasedName,
+ true,
+ type: DriftSqlType.int,
+ requiredDuringInsert: false,
+ );
+ late final GeneratedColumn<String> exposureTime = GeneratedColumn<String>(
+ 'exposure_time',
+ aliasedName,
+ true,
+ type: DriftSqlType.string,
+ requiredDuringInsert: false,
+ );
+ late final GeneratedColumn<double> fNumber = GeneratedColumn<double>(
+ 'f_number',
+ aliasedName,
+ true,
+ type: DriftSqlType.double,
+ requiredDuringInsert: false,
+ );
+ late final GeneratedColumn<int> fileSize = GeneratedColumn<int>(
+ 'file_size',
+ aliasedName,
+ true,
+ type: DriftSqlType.int,
+ requiredDuringInsert: false,
+ );
+ late final GeneratedColumn<double> focalLength = GeneratedColumn<double>(
+ 'focal_length',
+ aliasedName,
+ true,
+ type: DriftSqlType.double,
+ requiredDuringInsert: false,
+ );
+ late final GeneratedColumn<double> latitude = GeneratedColumn<double>(
+ 'latitude',
+ aliasedName,
+ true,
+ type: DriftSqlType.double,
+ requiredDuringInsert: false,
+ );
+ late final GeneratedColumn<double> longitude = GeneratedColumn<double>(
+ 'longitude',
+ aliasedName,
+ true,
+ type: DriftSqlType.double,
+ requiredDuringInsert: false,
+ );
+ late final GeneratedColumn<int> iso = GeneratedColumn<int>(
+ 'iso',
+ aliasedName,
+ true,
+ type: DriftSqlType.int,
+ requiredDuringInsert: false,
+ );
+ late final GeneratedColumn<String> make = GeneratedColumn<String>(
+ 'make',
+ aliasedName,
+ true,
+ type: DriftSqlType.string,
+ requiredDuringInsert: false,
+ );
+ late final GeneratedColumn<String> model = GeneratedColumn<String>(
+ 'model',
+ aliasedName,
+ true,
+ type: DriftSqlType.string,
+ requiredDuringInsert: false,
+ );
+ late final GeneratedColumn<String> lens = GeneratedColumn<String>(
+ 'lens',
+ aliasedName,
+ true,
+ type: DriftSqlType.string,
+ requiredDuringInsert: false,
+ );
+ late final GeneratedColumn<String> orientation = GeneratedColumn<String>(
+ 'orientation',
+ aliasedName,
+ true,
+ type: DriftSqlType.string,
+ requiredDuringInsert: false,
+ );
+ late final GeneratedColumn<String> timeZone = GeneratedColumn<String>(
+ 'time_zone',
+ aliasedName,
+ true,
+ type: DriftSqlType.string,
+ requiredDuringInsert: false,
+ );
+ late final GeneratedColumn<int> rating = GeneratedColumn<int>(
+ 'rating',
+ aliasedName,
+ true,
+ type: DriftSqlType.int,
+ requiredDuringInsert: false,
+ );
+ late final GeneratedColumn<String> projectionType = GeneratedColumn<String>(
+ 'projection_type',
+ aliasedName,
+ true,
+ type: DriftSqlType.string,
+ requiredDuringInsert: false,
+ );
+ @override
+ List<GeneratedColumn> get $columns => [
+ assetId,
+ city,
+ state,
+ country,
+ dateTimeOriginal,
+ description,
+ height,
+ width,
+ exposureTime,
+ fNumber,
+ fileSize,
+ focalLength,
+ latitude,
+ longitude,
+ iso,
+ make,
+ model,
+ lens,
+ orientation,
+ timeZone,
+ rating,
+ projectionType,
+ ];
+ @override
+ String get aliasedName => _alias ?? actualTableName;
+ @override
+ String get actualTableName => $name;
+ static const String $name = 'remote_exif_entity';
+ @override
+ Set<GeneratedColumn> get $primaryKey => {assetId};
+ @override
+ RemoteExifEntityData map(Map<String, dynamic> data, {String? tablePrefix}) {
+ final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : '';
+ return RemoteExifEntityData(
+ assetId: attachedDatabase.typeMapping.read(
+ DriftSqlType.string,
+ data['${effectivePrefix}asset_id'],
+ )!,
+ city: attachedDatabase.typeMapping.read(
+ DriftSqlType.string,
+ data['${effectivePrefix}city'],
+ ),
+ state: attachedDatabase.typeMapping.read(
+ DriftSqlType.string,
+ data['${effectivePrefix}state'],
+ ),
+ country: attachedDatabase.typeMapping.read(
+ DriftSqlType.string,
+ data['${effectivePrefix}country'],
+ ),
+ dateTimeOriginal: attachedDatabase.typeMapping.read(
+ DriftSqlType.dateTime,
+ data['${effectivePrefix}date_time_original'],
+ ),
+ description: attachedDatabase.typeMapping.read(
+ DriftSqlType.string,
+ data['${effectivePrefix}description'],
+ ),
+ height: attachedDatabase.typeMapping.read(
+ DriftSqlType.int,
+ data['${effectivePrefix}height'],
+ ),
+ width: attachedDatabase.typeMapping.read(
+ DriftSqlType.int,
+ data['${effectivePrefix}width'],
+ ),
+ exposureTime: attachedDatabase.typeMapping.read(
+ DriftSqlType.string,
+ data['${effectivePrefix}exposure_time'],
+ ),
+ fNumber: attachedDatabase.typeMapping.read(
+ DriftSqlType.double,
+ data['${effectivePrefix}f_number'],
+ ),
+ fileSize: attachedDatabase.typeMapping.read(
+ DriftSqlType.int,
+ data['${effectivePrefix}file_size'],
+ ),
+ focalLength: attachedDatabase.typeMapping.read(
+ DriftSqlType.double,
+ data['${effectivePrefix}focal_length'],
+ ),
+ latitude: attachedDatabase.typeMapping.read(
+ DriftSqlType.double,
+ data['${effectivePrefix}latitude'],
+ ),
+ longitude: attachedDatabase.typeMapping.read(
+ DriftSqlType.double,
+ data['${effectivePrefix}longitude'],
+ ),
+ iso: attachedDatabase.typeMapping.read(
+ DriftSqlType.int,
+ data['${effectivePrefix}iso'],
+ ),
+ make: attachedDatabase.typeMapping.read(
+ DriftSqlType.string,
+ data['${effectivePrefix}make'],
+ ),
+ model: attachedDatabase.typeMapping.read(
+ DriftSqlType.string,
+ data['${effectivePrefix}model'],
+ ),
+ lens: attachedDatabase.typeMapping.read(
+ DriftSqlType.string,
+ data['${effectivePrefix}lens'],
+ ),
+ orientation: attachedDatabase.typeMapping.read(
+ DriftSqlType.string,
+ data['${effectivePrefix}orientation'],
+ ),
+ timeZone: attachedDatabase.typeMapping.read(
+ DriftSqlType.string,
+ data['${effectivePrefix}time_zone'],
+ ),
+ rating: attachedDatabase.typeMapping.read(
+ DriftSqlType.int,
+ data['${effectivePrefix}rating'],
+ ),
+ projectionType: attachedDatabase.typeMapping.read(
+ DriftSqlType.string,
+ data['${effectivePrefix}projection_type'],
+ ),
+ );
+ }
+
+ @override
+ RemoteExifEntity createAlias(String alias) {
+ return RemoteExifEntity(attachedDatabase, alias);
+ }
+
+ @override
+ bool get withoutRowId => true;
+ @override
+ bool get isStrict => true;
+}
+
+class RemoteExifEntityData extends DataClass
+ implements Insertable<RemoteExifEntityData> {
+ final String assetId;
+ final String? city;
+ final String? state;
+ final String? country;
+ final DateTime? dateTimeOriginal;
+ final String? description;
+ final int? height;
+ final int? width;
+ final String? exposureTime;
+ final double? fNumber;
+ final int? fileSize;
+ final double? focalLength;
+ final double? latitude;
+ final double? longitude;
+ final int? iso;
+ final String? make;
+ final String? model;
+ final String? lens;
+ final String? orientation;
+ final String? timeZone;
+ final int? rating;
+ final String? projectionType;
+ const RemoteExifEntityData({
+ required this.assetId,
+ this.city,
+ this.state,
+ this.country,
+ this.dateTimeOriginal,
+ this.description,
+ this.height,
+ this.width,
+ this.exposureTime,
+ this.fNumber,
+ this.fileSize,
+ this.focalLength,
+ this.latitude,
+ this.longitude,
+ this.iso,
+ this.make,
+ this.model,
+ this.lens,
+ this.orientation,
+ this.timeZone,
+ this.rating,
+ this.projectionType,
+ });
+ @override
+ Map<String, Expression> toColumns(bool nullToAbsent) {
+ final map = <String, Expression>{};
+ map['asset_id'] = Variable<String>(assetId);
+ if (!nullToAbsent || city != null) {
+ map['city'] = Variable<String>(city);
+ }
+ if (!nullToAbsent || state != null) {
+ map['state'] = Variable<String>(state);
+ }
+ if (!nullToAbsent || country != null) {
+ map['country'] = Variable<String>(country);
+ }
+ if (!nullToAbsent || dateTimeOriginal != null) {
+ map['date_time_original'] = Variable<DateTime>(dateTimeOriginal);
+ }
+ if (!nullToAbsent || description != null) {
+ map['description'] = Variable<String>(description);
+ }
+ if (!nullToAbsent || height != null) {
+ map['height'] = Variable<int>(height);
+ }
+ if (!nullToAbsent || width != null) {
+ map['width'] = Variable<int>(width);
+ }
+ if (!nullToAbsent || exposureTime != null) {
+ map['exposure_time'] = Variable<String>(exposureTime);
+ }
+ if (!nullToAbsent || fNumber != null) {
+ map['f_number'] = Variable<double>(fNumber);
+ }
+ if (!nullToAbsent || fileSize != null) {
+ map['file_size'] = Variable<int>(fileSize);
+ }
+ if (!nullToAbsent || focalLength != null) {
+ map['focal_length'] = Variable<double>(focalLength);
+ }
+ if (!nullToAbsent || latitude != null) {
+ map['latitude'] = Variable<double>(latitude);
+ }
+ if (!nullToAbsent || longitude != null) {
+ map['longitude'] = Variable<double>(longitude);
+ }
+ if (!nullToAbsent || iso != null) {
+ map['iso'] = Variable<int>(iso);
+ }
+ if (!nullToAbsent || make != null) {
+ map['make'] = Variable<String>(make);
+ }
+ if (!nullToAbsent || model != null) {
+ map['model'] = Variable<String>(model);
+ }
+ if (!nullToAbsent || lens != null) {
+ map['lens'] = Variable<String>(lens);
+ }
+ if (!nullToAbsent || orientation != null) {
+ map['orientation'] = Variable<String>(orientation);
+ }
+ if (!nullToAbsent || timeZone != null) {
+ map['time_zone'] = Variable<String>(timeZone);
+ }
+ if (!nullToAbsent || rating != null) {
+ map['rating'] = Variable<int>(rating);
+ }
+ if (!nullToAbsent || projectionType != null) {
+ map['projection_type'] = Variable<String>(projectionType);
+ }
+ return map;
+ }
+
+ factory RemoteExifEntityData.fromJson(
+ Map<String, dynamic> json, {
+ ValueSerializer? serializer,
+ }) {
+ serializer ??= driftRuntimeOptions.defaultSerializer;
+ return RemoteExifEntityData(
+ assetId: serializer.fromJson<String>(json['assetId']),
+ city: serializer.fromJson<String?>(json['city']),
+ state: serializer.fromJson<String?>(json['state']),
+ country: serializer.fromJson<String?>(json['country']),
+ dateTimeOriginal: serializer.fromJson<DateTime?>(
+ json['dateTimeOriginal'],
+ ),
+ description: serializer.fromJson<String?>(json['description']),
+ height: serializer.fromJson<int?>(json['height']),
+ width: serializer.fromJson<int?>(json['width']),
+ exposureTime: serializer.fromJson<String?>(json['exposureTime']),
+ fNumber: serializer.fromJson<double?>(json['fNumber']),
+ fileSize: serializer.fromJson<int?>(json['fileSize']),
+ focalLength: serializer.fromJson<double?>(json['focalLength']),
+ latitude: serializer.fromJson<double?>(json['latitude']),
+ longitude: serializer.fromJson<double?>(json['longitude']),
+ iso: serializer.fromJson<int?>(json['iso']),
+ make: serializer.fromJson<String?>(json['make']),
+ model: serializer.fromJson<String?>(json['model']),
+ lens: serializer.fromJson<String?>(json['lens']),
+ orientation: serializer.fromJson<String?>(json['orientation']),
+ timeZone: serializer.fromJson<String?>(json['timeZone']),
+ rating: serializer.fromJson<int?>(json['rating']),
+ projectionType: serializer.fromJson<String?>(json['projectionType']),
+ );
+ }
+ @override
+ Map<String, dynamic> toJson({ValueSerializer? serializer}) {
+ serializer ??= driftRuntimeOptions.defaultSerializer;
+ return <String, dynamic>{
+ 'assetId': serializer.toJson<String>(assetId),
+ 'city': serializer.toJson<String?>(city),
+ 'state': serializer.toJson<String?>(state),
+ 'country': serializer.toJson<String?>(country),
+ 'dateTimeOriginal': serializer.toJson<DateTime?>(dateTimeOriginal),
+ 'description': serializer.toJson<String?>(description),
+ 'height': serializer.toJson<int?>(height),
+ 'width': serializer.toJson<int?>(width),
+ 'exposureTime': serializer.toJson<String?>(exposureTime),
+ 'fNumber': serializer.toJson<double?>(fNumber),
+ 'fileSize': serializer.toJson<int?>(fileSize),
+ 'focalLength': serializer.toJson<double?>(focalLength),
+ 'latitude': serializer.toJson<double?>(latitude),
+ 'longitude': serializer.toJson<double?>(longitude),
+ 'iso': serializer.toJson<int?>(iso),
+ 'make': serializer.toJson<String?>(make),
+ 'model': serializer.toJson<String?>(model),
+ 'lens': serializer.toJson<String?>(lens),
+ 'orientation': serializer.toJson<String?>(orientation),
+ 'timeZone': serializer.toJson<String?>(timeZone),
+ 'rating': serializer.toJson<int?>(rating),
+ 'projectionType': serializer.toJson<String?>(projectionType),
+ };
+ }
+
+ RemoteExifEntityData copyWith({
+ String? assetId,
+ Value<String?> city = const Value.absent(),
+ Value<String?> state = const Value.absent(),
+ Value<String?> country = const Value.absent(),
+ Value<DateTime?> dateTimeOriginal = const Value.absent(),
+ Value<String?> description = const Value.absent(),
+ Value<int?> height = const Value.absent(),
+ Value<int?> width = const Value.absent(),
+ Value<String?> exposureTime = const Value.absent(),
+ Value<double?> fNumber = const Value.absent(),
+ Value<int?> fileSize = const Value.absent(),
+ Value<double?> focalLength = const Value.absent(),
+ Value<double?> latitude = const Value.absent(),
+ Value<double?> longitude = const Value.absent(),
+ Value<int?> iso = const Value.absent(),
+ Value<String?> make = const Value.absent(),
+ Value<String?> model = const Value.absent(),
+ Value<String?> lens = const Value.absent(),
+ Value<String?> orientation = const Value.absent(),
+ Value<String?> timeZone = const Value.absent(),
+ Value<int?> rating = const Value.absent(),
+ Value<String?> projectionType = const Value.absent(),
+ }) => RemoteExifEntityData(
+ assetId: assetId ?? this.assetId,
+ city: city.present ? city.value : this.city,
+ state: state.present ? state.value : this.state,
+ country: country.present ? country.value : this.country,
+ dateTimeOriginal: dateTimeOriginal.present
+ ? dateTimeOriginal.value
+ : this.dateTimeOriginal,
+ description: description.present ? description.value : this.description,
+ height: height.present ? height.value : this.height,
+ width: width.present ? width.value : this.width,
+ exposureTime: exposureTime.present ? exposureTime.value : this.exposureTime,
+ fNumber: fNumber.present ? fNumber.value : this.fNumber,
+ fileSize: fileSize.present ? fileSize.value : this.fileSize,
+ focalLength: focalLength.present ? focalLength.value : this.focalLength,
+ latitude: latitude.present ? latitude.value : this.latitude,
+ longitude: longitude.present ? longitude.value : this.longitude,
+ iso: iso.present ? iso.value : this.iso,
+ make: make.present ? make.value : this.make,
+ model: model.present ? model.value : this.model,
+ lens: lens.present ? lens.value : this.lens,
+ orientation: orientation.present ? orientation.value : this.orientation,
+ timeZone: timeZone.present ? timeZone.value : this.timeZone,
+ rating: rating.present ? rating.value : this.rating,
+ projectionType: projectionType.present
+ ? projectionType.value
+ : this.projectionType,
+ );
+ RemoteExifEntityData copyWithCompanion(RemoteExifEntityCompanion data) {
+ return RemoteExifEntityData(
+ assetId: data.assetId.present ? data.assetId.value : this.assetId,
+ city: data.city.present ? data.city.value : this.city,
+ state: data.state.present ? data.state.value : this.state,
+ country: data.country.present ? data.country.value : this.country,
+ dateTimeOriginal: data.dateTimeOriginal.present
+ ? data.dateTimeOriginal.value
+ : this.dateTimeOriginal,
+ description: data.description.present
+ ? data.description.value
+ : this.description,
+ height: data.height.present ? data.height.value : this.height,
+ width: data.width.present ? data.width.value : this.width,
+ exposureTime: data.exposureTime.present
+ ? data.exposureTime.value
+ : this.exposureTime,
+ fNumber: data.fNumber.present ? data.fNumber.value : this.fNumber,
+ fileSize: data.fileSize.present ? data.fileSize.value : this.fileSize,
+ focalLength: data.focalLength.present
+ ? data.focalLength.value
+ : this.focalLength,
+ latitude: data.latitude.present ? data.latitude.value : this.latitude,
+ longitude: data.longitude.present ? data.longitude.value : this.longitude,
+ iso: data.iso.present ? data.iso.value : this.iso,
+ make: data.make.present ? data.make.value : this.make,
+ model: data.model.present ? data.model.value : this.model,
+ lens: data.lens.present ? data.lens.value : this.lens,
+ orientation: data.orientation.present
+ ? data.orientation.value
+ : this.orientation,
+ timeZone: data.timeZone.present ? data.timeZone.value : this.timeZone,
+ rating: data.rating.present ? data.rating.value : this.rating,
+ projectionType: data.projectionType.present
+ ? data.projectionType.value
+ : this.projectionType,
+ );
+ }
+
+ @override
+ String toString() {
+ return (StringBuffer('RemoteExifEntityData(')
+ ..write('assetId: $assetId, ')
+ ..write('city: $city, ')
+ ..write('state: $state, ')
+ ..write('country: $country, ')
+ ..write('dateTimeOriginal: $dateTimeOriginal, ')
+ ..write('description: $description, ')
+ ..write('height: $height, ')
+ ..write('width: $width, ')
+ ..write('exposureTime: $exposureTime, ')
+ ..write('fNumber: $fNumber, ')
+ ..write('fileSize: $fileSize, ')
+ ..write('focalLength: $focalLength, ')
+ ..write('latitude: $latitude, ')
+ ..write('longitude: $longitude, ')
+ ..write('iso: $iso, ')
+ ..write('make: $make, ')
+ ..write('model: $model, ')
+ ..write('lens: $lens, ')
+ ..write('orientation: $orientation, ')
+ ..write('timeZone: $timeZone, ')
+ ..write('rating: $rating, ')
+ ..write('projectionType: $projectionType')
+ ..write(')'))
+ .toString();
+ }
+
+ @override
+ int get hashCode => Object.hashAll([
+ assetId,
+ city,
+ state,
+ country,
+ dateTimeOriginal,
+ description,
+ height,
+ width,
+ exposureTime,
+ fNumber,
+ fileSize,
+ focalLength,
+ latitude,
+ longitude,
+ iso,
+ make,
+ model,
+ lens,
+ orientation,
+ timeZone,
+ rating,
+ projectionType,
+ ]);
+ @override
+ bool operator ==(Object other) =>
+ identical(this, other) ||
+ (other is RemoteExifEntityData &&
+ other.assetId == this.assetId &&
+ other.city == this.city &&
+ other.state == this.state &&
+ other.country == this.country &&
+ other.dateTimeOriginal == this.dateTimeOriginal &&
+ other.description == this.description &&
+ other.height == this.height &&
+ other.width == this.width &&
+ other.exposureTime == this.exposureTime &&
+ other.fNumber == this.fNumber &&
+ other.fileSize == this.fileSize &&
+ other.focalLength == this.focalLength &&
+ other.latitude == this.latitude &&
+ other.longitude == this.longitude &&
+ other.iso == this.iso &&
+ other.make == this.make &&
+ other.model == this.model &&
+ other.lens == this.lens &&
+ other.orientation == this.orientation &&
+ other.timeZone == this.timeZone &&
+ other.rating == this.rating &&
+ other.projectionType == this.projectionType);
+}
+
+class RemoteExifEntityCompanion extends UpdateCompanion<RemoteExifEntityData> {
+ final Value<String> assetId;
+ final Value<String?> city;
+ final Value<String?> state;
+ final Value<String?> country;
+ final Value<DateTime?> dateTimeOriginal;
+ final Value<String?> description;
+ final Value<int?> height;
+ final Value<int?> width;
+ final Value<String?> exposureTime;
+ final Value<double?> fNumber;
+ final Value<int?> fileSize;
+ final Value<double?> focalLength;
+ final Value<double?> latitude;
+ final Value<double?> longitude;
+ final Value<int?> iso;
+ final Value<String?> make;
+ final Value<String?> model;
+ final Value<String?> lens;
+ final Value<String?> orientation;
+ final Value<String?> timeZone;
+ final Value<int?> rating;
+ final Value<String?> projectionType;
+ const RemoteExifEntityCompanion({
+ this.assetId = const Value.absent(),
+ this.city = const Value.absent(),
+ this.state = const Value.absent(),
+ this.country = const Value.absent(),
+ this.dateTimeOriginal = const Value.absent(),
+ this.description = const Value.absent(),
+ this.height = const Value.absent(),
+ this.width = const Value.absent(),
+ this.exposureTime = const Value.absent(),
+ this.fNumber = const Value.absent(),
+ this.fileSize = const Value.absent(),
+ this.focalLength = const Value.absent(),
+ this.latitude = const Value.absent(),
+ this.longitude = const Value.absent(),
+ this.iso = const Value.absent(),
+ this.make = const Value.absent(),
+ this.model = const Value.absent(),
+ this.lens = const Value.absent(),
+ this.orientation = const Value.absent(),
+ this.timeZone = const Value.absent(),
+ this.rating = const Value.absent(),
+ this.projectionType = const Value.absent(),
+ });
+ RemoteExifEntityCompanion.insert({
+ required String assetId,
+ this.city = const Value.absent(),
+ this.state = const Value.absent(),
+ this.country = const Value.absent(),
+ this.dateTimeOriginal = const Value.absent(),
+ this.description = const Value.absent(),
+ this.height = const Value.absent(),
+ this.width = const Value.absent(),
+ this.exposureTime = const Value.absent(),
+ this.fNumber = const Value.absent(),
+ this.fileSize = const Value.absent(),
+ this.focalLength = const Value.absent(),
+ this.latitude = const Value.absent(),
+ this.longitude = const Value.absent(),
+ this.iso = const Value.absent(),
+ this.make = const Value.absent(),
+ this.model = const Value.absent(),
+ this.lens = const Value.absent(),
+ this.orientation = const Value.absent(),
+ this.timeZone = const Value.absent(),
+ this.rating = const Value.absent(),
+ this.projectionType = const Value.absent(),
+ }) : assetId = Value(assetId);
+ static Insertable<RemoteExifEntityData> custom({
+ Expression<String>? assetId,
+ Expression<String>? city,
+ Expression<String>? state,
+ Expression<String>? country,
+ Expression<DateTime>? dateTimeOriginal,
+ Expression<String>? description,
+ Expression<int>? height,
+ Expression<int>? width,
+ Expression<String>? exposureTime,
+ Expression<double>? fNumber,
+ Expression<int>? fileSize,
+ Expression<double>? focalLength,
+ Expression<double>? latitude,
+ Expression<double>? longitude,
+ Expression<int>? iso,
+ Expression<String>? make,
+ Expression<String>? model,
+ Expression<String>? lens,
+ Expression<String>? orientation,
+ Expression<String>? timeZone,
+ Expression<int>? rating,
+ Expression<String>? projectionType,
+ }) {
+ return RawValuesInsertable({
+ if (assetId != null) 'asset_id': assetId,
+ if (city != null) 'city': city,
+ if (state != null) 'state': state,
+ if (country != null) 'country': country,
+ if (dateTimeOriginal != null) 'date_time_original': dateTimeOriginal,
+ if (description != null) 'description': description,
+ if (height != null) 'height': height,
+ if (width != null) 'width': width,
+ if (exposureTime != null) 'exposure_time': exposureTime,
+ if (fNumber != null) 'f_number': fNumber,
+ if (fileSize != null) 'file_size': fileSize,
+ if (focalLength != null) 'focal_length': focalLength,
+ if (latitude != null) 'latitude': latitude,
+ if (longitude != null) 'longitude': longitude,
+ if (iso != null) 'iso': iso,
+ if (make != null) 'make': make,
+ if (model != null) 'model': model,
+ if (lens != null) 'lens': lens,
+ if (orientation != null) 'orientation': orientation,
+ if (timeZone != null) 'time_zone': timeZone,
+ if (rating != null) 'rating': rating,
+ if (projectionType != null) 'projection_type': projectionType,
+ });
+ }
+
+ RemoteExifEntityCompanion copyWith({
+ Value<String>? assetId,
+ Value<String?>? city,
+ Value<String?>? state,
+ Value<String?>? country,
+ Value<DateTime?>? dateTimeOriginal,
+ Value<String?>? description,
+ Value<int?>? height,
+ Value<int?>? width,
+ Value<String?>? exposureTime,
+ Value<double?>? fNumber,
+ Value<int?>? fileSize,
+ Value<double?>? focalLength,
+ Value<double?>? latitude,
+ Value<double?>? longitude,
+ Value<int?>? iso,
+ Value<String?>? make,
+ Value<String?>? model,
+ Value<String?>? lens,
+ Value<String?>? orientation,
+ Value<String?>? timeZone,
+ Value<int?>? rating,
+ Value<String?>? projectionType,
+ }) {
+ return RemoteExifEntityCompanion(
+ assetId: assetId ?? this.assetId,
+ city: city ?? this.city,
+ state: state ?? this.state,
+ country: country ?? this.country,
+ dateTimeOriginal: dateTimeOriginal ?? this.dateTimeOriginal,
+ description: description ?? this.description,
+ height: height ?? this.height,
+ width: width ?? this.width,
+ exposureTime: exposureTime ?? this.exposureTime,
+ fNumber: fNumber ?? this.fNumber,
+ fileSize: fileSize ?? this.fileSize,
+ focalLength: focalLength ?? this.focalLength,
+ latitude: latitude ?? this.latitude,
+ longitude: longitude ?? this.longitude,
+ iso: iso ?? this.iso,
+ make: make ?? this.make,
+ model: model ?? this.model,
+ lens: lens ?? this.lens,
+ orientation: orientation ?? this.orientation,
+ timeZone: timeZone ?? this.timeZone,
+ rating: rating ?? this.rating,
+ projectionType: projectionType ?? this.projectionType,
+ );
+ }
+
+ @override
+ Map<String, Expression> toColumns(bool nullToAbsent) {
+ final map = <String, Expression>{};
+ if (assetId.present) {
+ map['asset_id'] = Variable<String>(assetId.value);
+ }
+ if (city.present) {
+ map['city'] = Variable<String>(city.value);
+ }
+ if (state.present) {
+ map['state'] = Variable<String>(state.value);
+ }
+ if (country.present) {
+ map['country'] = Variable<String>(country.value);
+ }
+ if (dateTimeOriginal.present) {
+ map['date_time_original'] = Variable<DateTime>(dateTimeOriginal.value);
+ }
+ if (description.present) {
+ map['description'] = Variable<String>(description.value);
+ }
+ if (height.present) {
+ map['height'] = Variable<int>(height.value);
+ }
+ if (width.present) {
+ map['width'] = Variable<int>(width.value);
+ }
+ if (exposureTime.present) {
+ map['exposure_time'] = Variable<String>(exposureTime.value);
+ }
+ if (fNumber.present) {
+ map['f_number'] = Variable<double>(fNumber.value);
+ }
+ if (fileSize.present) {
+ map['file_size'] = Variable<int>(fileSize.value);
+ }
+ if (focalLength.present) {
+ map['focal_length'] = Variable<double>(focalLength.value);
+ }
+ if (latitude.present) {
+ map['latitude'] = Variable<double>(latitude.value);
+ }
+ if (longitude.present) {
+ map['longitude'] = Variable<double>(longitude.value);
+ }
+ if (iso.present) {
+ map['iso'] = Variable<int>(iso.value);
+ }
+ if (make.present) {
+ map['make'] = Variable<String>(make.value);
+ }
+ if (model.present) {
+ map['model'] = Variable<String>(model.value);
+ }
+ if (lens.present) {
+ map['lens'] = Variable<String>(lens.value);
+ }
+ if (orientation.present) {
+ map['orientation'] = Variable<String>(orientation.value);
+ }
+ if (timeZone.present) {
+ map['time_zone'] = Variable<String>(timeZone.value);
+ }
+ if (rating.present) {
+ map['rating'] = Variable<int>(rating.value);
+ }
+ if (projectionType.present) {
+ map['projection_type'] = Variable<String>(projectionType.value);
+ }
+ return map;
+ }
+
+ @override
+ String toString() {
+ return (StringBuffer('RemoteExifEntityCompanion(')
+ ..write('assetId: $assetId, ')
+ ..write('city: $city, ')
+ ..write('state: $state, ')
+ ..write('country: $country, ')
+ ..write('dateTimeOriginal: $dateTimeOriginal, ')
+ ..write('description: $description, ')
+ ..write('height: $height, ')
+ ..write('width: $width, ')
+ ..write('exposureTime: $exposureTime, ')
+ ..write('fNumber: $fNumber, ')
+ ..write('fileSize: $fileSize, ')
+ ..write('focalLength: $focalLength, ')
+ ..write('latitude: $latitude, ')
+ ..write('longitude: $longitude, ')
+ ..write('iso: $iso, ')
+ ..write('make: $make, ')
+ ..write('model: $model, ')
+ ..write('lens: $lens, ')
+ ..write('orientation: $orientation, ')
+ ..write('timeZone: $timeZone, ')
+ ..write('rating: $rating, ')
+ ..write('projectionType: $projectionType')
+ ..write(')'))
+ .toString();
+ }
+}
+
+class RemoteAlbumAssetEntity extends Table
+ with TableInfo<RemoteAlbumAssetEntity, RemoteAlbumAssetEntityData> {
+ @override
+ final GeneratedDatabase attachedDatabase;
+ final String? _alias;
+ RemoteAlbumAssetEntity(this.attachedDatabase, [this._alias]);
+ late final GeneratedColumn<String> assetId = GeneratedColumn<String>(
+ 'asset_id',
+ aliasedName,
+ false,
+ type: DriftSqlType.string,
+ requiredDuringInsert: true,
+ defaultConstraints: GeneratedColumn.constraintIsAlways(
+ 'REFERENCES remote_asset_entity (id) ON DELETE CASCADE',
+ ),
+ );
+ late final GeneratedColumn<String> albumId = GeneratedColumn<String>(
+ 'album_id',
+ aliasedName,
+ false,
+ type: DriftSqlType.string,
+ requiredDuringInsert: true,
+ defaultConstraints: GeneratedColumn.constraintIsAlways(
+ 'REFERENCES remote_album_entity (id) ON DELETE CASCADE',
+ ),
+ );
+ @override
+ List<GeneratedColumn> get $columns => [assetId, albumId];
+ @override
+ String get aliasedName => _alias ?? actualTableName;
+ @override
+ String get actualTableName => $name;
+ static const String $name = 'remote_album_asset_entity';
+ @override
+ Set<GeneratedColumn> get $primaryKey => {assetId, albumId};
+ @override
+ RemoteAlbumAssetEntityData map(
+ Map<String, dynamic> data, {
+ String? tablePrefix,
+ }) {
+ final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : '';
+ return RemoteAlbumAssetEntityData(
+ assetId: attachedDatabase.typeMapping.read(
+ DriftSqlType.string,
+ data['${effectivePrefix}asset_id'],
+ )!,
+ albumId: attachedDatabase.typeMapping.read(
+ DriftSqlType.string,
+ data['${effectivePrefix}album_id'],
+ )!,
+ );
+ }
+
+ @override
+ RemoteAlbumAssetEntity createAlias(String alias) {
+ return RemoteAlbumAssetEntity(attachedDatabase, alias);
+ }
+
+ @override
+ bool get withoutRowId => true;
+ @override
+ bool get isStrict => true;
+}
+
+class RemoteAlbumAssetEntityData extends DataClass
+ implements Insertable<RemoteAlbumAssetEntityData> {
+ final String assetId;
+ final String albumId;
+ const RemoteAlbumAssetEntityData({
+ required this.assetId,
+ required this.albumId,
+ });
+ @override
+ Map<String, Expression> toColumns(bool nullToAbsent) {
+ final map = <String, Expression>{};
+ map['asset_id'] = Variable<String>(assetId);
+ map['album_id'] = Variable<String>(albumId);
+ return map;
+ }
+
+ factory RemoteAlbumAssetEntityData.fromJson(
+ Map<String, dynamic> json, {
+ ValueSerializer? serializer,
+ }) {
+ serializer ??= driftRuntimeOptions.defaultSerializer;
+ return RemoteAlbumAssetEntityData(
+ assetId: serializer.fromJson<String>(json['assetId']),
+ albumId: serializer.fromJson<String>(json['albumId']),
+ );
+ }
+ @override
+ Map<String, dynamic> toJson({ValueSerializer? serializer}) {
+ serializer ??= driftRuntimeOptions.defaultSerializer;
+ return <String, dynamic>{
+ 'assetId': serializer.toJson<String>(assetId),
+ 'albumId': serializer.toJson<String>(albumId),
+ };
+ }
+
+ RemoteAlbumAssetEntityData copyWith({String? assetId, String? albumId}) =>
+ RemoteAlbumAssetEntityData(
+ assetId: assetId ?? this.assetId,
+ albumId: albumId ?? this.albumId,
+ );
+ RemoteAlbumAssetEntityData copyWithCompanion(
+ RemoteAlbumAssetEntityCompanion data,
+ ) {
+ return RemoteAlbumAssetEntityData(
+ assetId: data.assetId.present ? data.assetId.value : this.assetId,
+ albumId: data.albumId.present ? data.albumId.value : this.albumId,
+ );
+ }
+
+ @override
+ String toString() {
+ return (StringBuffer('RemoteAlbumAssetEntityData(')
+ ..write('assetId: $assetId, ')
+ ..write('albumId: $albumId')
+ ..write(')'))
+ .toString();
+ }
+
+ @override
+ int get hashCode => Object.hash(assetId, albumId);
+ @override
+ bool operator ==(Object other) =>
+ identical(this, other) ||
+ (other is RemoteAlbumAssetEntityData &&
+ other.assetId == this.assetId &&
+ other.albumId == this.albumId);
+}
+
+class RemoteAlbumAssetEntityCompanion
+ extends UpdateCompanion<RemoteAlbumAssetEntityData> {
+ final Value<String> assetId;
+ final Value<String> albumId;
+ const RemoteAlbumAssetEntityCompanion({
+ this.assetId = const Value.absent(),
+ this.albumId = const Value.absent(),
+ });
+ RemoteAlbumAssetEntityCompanion.insert({
+ required String assetId,
+ required String albumId,
+ }) : assetId = Value(assetId),
+ albumId = Value(albumId);
+ static Insertable<RemoteAlbumAssetEntityData> custom({
+ Expression<String>? assetId,
+ Expression<String>? albumId,
+ }) {
+ return RawValuesInsertable({
+ if (assetId != null) 'asset_id': assetId,
+ if (albumId != null) 'album_id': albumId,
+ });
+ }
+
+ RemoteAlbumAssetEntityCompanion copyWith({
+ Value<String>? assetId,
+ Value<String>? albumId,
+ }) {
+ return RemoteAlbumAssetEntityCompanion(
+ assetId: assetId ?? this.assetId,
+ albumId: albumId ?? this.albumId,
+ );
+ }
+
+ @override
+ Map<String, Expression> toColumns(bool nullToAbsent) {
+ final map = <String, Expression>{};
+ if (assetId.present) {
+ map['asset_id'] = Variable<String>(assetId.value);
+ }
+ if (albumId.present) {
+ map['album_id'] = Variable<String>(albumId.value);
+ }
+ return map;
+ }
+
+ @override
+ String toString() {
+ return (StringBuffer('RemoteAlbumAssetEntityCompanion(')
+ ..write('assetId: $assetId, ')
+ ..write('albumId: $albumId')
+ ..write(')'))
+ .toString();
+ }
+}
+
+class RemoteAlbumUserEntity extends Table
+ with TableInfo<RemoteAlbumUserEntity, RemoteAlbumUserEntityData> {
+ @override
+ final GeneratedDatabase attachedDatabase;
+ final String? _alias;
+ RemoteAlbumUserEntity(this.attachedDatabase, [this._alias]);
+ late final GeneratedColumn<String> albumId = GeneratedColumn<String>(
+ 'album_id',
+ aliasedName,
+ false,
+ type: DriftSqlType.string,
+ requiredDuringInsert: true,
+ defaultConstraints: GeneratedColumn.constraintIsAlways(
+ 'REFERENCES remote_album_entity (id) ON DELETE CASCADE',
+ ),
+ );
+ late final GeneratedColumn<String> userId = GeneratedColumn<String>(
+ 'user_id',
+ aliasedName,
+ false,
+ type: DriftSqlType.string,
+ requiredDuringInsert: true,
+ defaultConstraints: GeneratedColumn.constraintIsAlways(
+ 'REFERENCES user_entity (id) ON DELETE CASCADE',
+ ),
+ );
+ late final GeneratedColumn<int> role = GeneratedColumn<int>(
+ 'role',
+ aliasedName,
+ false,
+ type: DriftSqlType.int,
+ requiredDuringInsert: true,
+ );
+ @override
+ List<GeneratedColumn> get $columns => [albumId, userId, role];
+ @override
+ String get aliasedName => _alias ?? actualTableName;
+ @override
+ String get actualTableName => $name;
+ static const String $name = 'remote_album_user_entity';
+ @override
+ Set<GeneratedColumn> get $primaryKey => {albumId, userId};
+ @override
+ RemoteAlbumUserEntityData map(
+ Map<String, dynamic> data, {
+ String? tablePrefix,
+ }) {
+ final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : '';
+ return RemoteAlbumUserEntityData(
+ albumId: attachedDatabase.typeMapping.read(
+ DriftSqlType.string,
+ data['${effectivePrefix}album_id'],
+ )!,
+ userId: attachedDatabase.typeMapping.read(
+ DriftSqlType.string,
+ data['${effectivePrefix}user_id'],
+ )!,
+ role: attachedDatabase.typeMapping.read(
+ DriftSqlType.int,
+ data['${effectivePrefix}role'],
+ )!,
+ );
+ }
+
+ @override
+ RemoteAlbumUserEntity createAlias(String alias) {
+ return RemoteAlbumUserEntity(attachedDatabase, alias);
+ }
+
+ @override
+ bool get withoutRowId => true;
+ @override
+ bool get isStrict => true;
+}
+
+class RemoteAlbumUserEntityData extends DataClass
+ implements Insertable<RemoteAlbumUserEntityData> {
+ final String albumId;
+ final String userId;
+ final int role;
+ const RemoteAlbumUserEntityData({
+ required this.albumId,
+ required this.userId,
+ required this.role,
+ });
+ @override
+ Map<String, Expression> toColumns(bool nullToAbsent) {
+ final map = <String, Expression>{};
+ map['album_id'] = Variable<String>(albumId);
+ map['user_id'] = Variable<String>(userId);
+ map['role'] = Variable<int>(role);
+ return map;
+ }
+
+ factory RemoteAlbumUserEntityData.fromJson(
+ Map<String, dynamic> json, {
+ ValueSerializer? serializer,
+ }) {
+ serializer ??= driftRuntimeOptions.defaultSerializer;
+ return RemoteAlbumUserEntityData(
+ albumId: serializer.fromJson<String>(json['albumId']),
+ userId: serializer.fromJson<String>(json['userId']),
+ role: serializer.fromJson<int>(json['role']),
+ );
+ }
+ @override
+ Map<String, dynamic> toJson({ValueSerializer? serializer}) {
+ serializer ??= driftRuntimeOptions.defaultSerializer;
+ return <String, dynamic>{
+ 'albumId': serializer.toJson<String>(albumId),
+ 'userId': serializer.toJson<String>(userId),
+ 'role': serializer.toJson<int>(role),
+ };
+ }
+
+ RemoteAlbumUserEntityData copyWith({
+ String? albumId,
+ String? userId,
+ int? role,
+ }) => RemoteAlbumUserEntityData(
+ albumId: albumId ?? this.albumId,
+ userId: userId ?? this.userId,
+ role: role ?? this.role,
+ );
+ RemoteAlbumUserEntityData copyWithCompanion(
+ RemoteAlbumUserEntityCompanion data,
+ ) {
+ return RemoteAlbumUserEntityData(
+ albumId: data.albumId.present ? data.albumId.value : this.albumId,
+ userId: data.userId.present ? data.userId.value : this.userId,
+ role: data.role.present ? data.role.value : this.role,
+ );
+ }
+
+ @override
+ String toString() {
+ return (StringBuffer('RemoteAlbumUserEntityData(')
+ ..write('albumId: $albumId, ')
+ ..write('userId: $userId, ')
+ ..write('role: $role')
+ ..write(')'))
+ .toString();
+ }
+
+ @override
+ int get hashCode => Object.hash(albumId, userId, role);
+ @override
+ bool operator ==(Object other) =>
+ identical(this, other) ||
+ (other is RemoteAlbumUserEntityData &&
+ other.albumId == this.albumId &&
+ other.userId == this.userId &&
+ other.role == this.role);
+}
+
+class RemoteAlbumUserEntityCompanion
+ extends UpdateCompanion<RemoteAlbumUserEntityData> {
+ final Value<String> albumId;
+ final Value<String> userId;
+ final Value<int> role;
+ const RemoteAlbumUserEntityCompanion({
+ this.albumId = const Value.absent(),
+ this.userId = const Value.absent(),
+ this.role = const Value.absent(),
+ });
+ RemoteAlbumUserEntityCompanion.insert({
+ required String albumId,
+ required String userId,
+ required int role,
+ }) : albumId = Value(albumId),
+ userId = Value(userId),
+ role = Value(role);
+ static Insertable<RemoteAlbumUserEntityData> custom({
+ Expression<String>? albumId,
+ Expression<String>? userId,
+ Expression<int>? role,
+ }) {
+ return RawValuesInsertable({
+ if (albumId != null) 'album_id': albumId,
+ if (userId != null) 'user_id': userId,
+ if (role != null) 'role': role,
+ });
+ }
+
+ RemoteAlbumUserEntityCompanion copyWith({
+ Value<String>? albumId,
+ Value<String>? userId,
+ Value<int>? role,
+ }) {
+ return RemoteAlbumUserEntityCompanion(
+ albumId: albumId ?? this.albumId,
+ userId: userId ?? this.userId,
+ role: role ?? this.role,
+ );
+ }
+
+ @override
+ Map<String, Expression> toColumns(bool nullToAbsent) {
+ final map = <String, Expression>{};
+ if (albumId.present) {
+ map['album_id'] = Variable<String>(albumId.value);
+ }
+ if (userId.present) {
+ map['user_id'] = Variable<String>(userId.value);
+ }
+ if (role.present) {
+ map['role'] = Variable<int>(role.value);
+ }
+ return map;
+ }
+
+ @override
+ String toString() {
+ return (StringBuffer('RemoteAlbumUserEntityCompanion(')
+ ..write('albumId: $albumId, ')
+ ..write('userId: $userId, ')
+ ..write('role: $role')
+ ..write(')'))
+ .toString();
+ }
+}
+
+class RemoteAssetCloudIdEntity extends Table
+ with TableInfo<RemoteAssetCloudIdEntity, RemoteAssetCloudIdEntityData> {
+ @override
+ final GeneratedDatabase attachedDatabase;
+ final String? _alias;
+ RemoteAssetCloudIdEntity(this.attachedDatabase, [this._alias]);
+ late final GeneratedColumn<String> assetId = GeneratedColumn<String>(
+ 'asset_id',
+ aliasedName,
+ false,
+ type: DriftSqlType.string,
+ requiredDuringInsert: true,
+ defaultConstraints: GeneratedColumn.constraintIsAlways(
+ 'REFERENCES remote_asset_entity (id) ON DELETE CASCADE',
+ ),
+ );
+ late final GeneratedColumn<String> cloudId = GeneratedColumn<String>(
+ 'cloud_id',
+ aliasedName,
+ true,
+ type: DriftSqlType.string,
+ requiredDuringInsert: false,
+ );
+ late final GeneratedColumn<DateTime> createdAt = GeneratedColumn<DateTime>(
+ 'created_at',
+ aliasedName,
+ true,
+ type: DriftSqlType.dateTime,
+ requiredDuringInsert: false,
+ );
+ late final GeneratedColumn<DateTime> adjustmentTime =
+ GeneratedColumn<DateTime>(
+ 'adjustment_time',
+ aliasedName,
+ true,
+ type: DriftSqlType.dateTime,
+ requiredDuringInsert: false,
+ );
+ late final GeneratedColumn<double> latitude = GeneratedColumn<double>(
+ 'latitude',
+ aliasedName,
+ true,
+ type: DriftSqlType.double,
+ requiredDuringInsert: false,
+ );
+ late final GeneratedColumn<double> longitude = GeneratedColumn<double>(
+ 'longitude',
+ aliasedName,
+ true,
+ type: DriftSqlType.double,
+ requiredDuringInsert: false,
+ );
+ @override
+ List<GeneratedColumn> get $columns => [
+ assetId,
+ cloudId,
+ createdAt,
+ adjustmentTime,
+ latitude,
+ longitude,
+ ];
+ @override
+ String get aliasedName => _alias ?? actualTableName;
+ @override
+ String get actualTableName => $name;
+ static const String $name = 'remote_asset_cloud_id_entity';
+ @override
+ Set<GeneratedColumn> get $primaryKey => {assetId};
+ @override
+ RemoteAssetCloudIdEntityData map(
+ Map<String, dynamic> data, {
+ String? tablePrefix,
+ }) {
+ final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : '';
+ return RemoteAssetCloudIdEntityData(
+ assetId: attachedDatabase.typeMapping.read(
+ DriftSqlType.string,
+ data['${effectivePrefix}asset_id'],
+ )!,
+ cloudId: attachedDatabase.typeMapping.read(
+ DriftSqlType.string,
+ data['${effectivePrefix}cloud_id'],
+ ),
+ createdAt: attachedDatabase.typeMapping.read(
+ DriftSqlType.dateTime,
+ data['${effectivePrefix}created_at'],
+ ),
+ adjustmentTime: attachedDatabase.typeMapping.read(
+ DriftSqlType.dateTime,
+ data['${effectivePrefix}adjustment_time'],
+ ),
+ latitude: attachedDatabase.typeMapping.read(
+ DriftSqlType.double,
+ data['${effectivePrefix}latitude'],
+ ),
+ longitude: attachedDatabase.typeMapping.read(
+ DriftSqlType.double,
+ data['${effectivePrefix}longitude'],
+ ),
+ );
+ }
+
+ @override
+ RemoteAssetCloudIdEntity createAlias(String alias) {
+ return RemoteAssetCloudIdEntity(attachedDatabase, alias);
+ }
+
+ @override
+ bool get withoutRowId => true;
+ @override
+ bool get isStrict => true;
+}
+
+class RemoteAssetCloudIdEntityData extends DataClass
+ implements Insertable<RemoteAssetCloudIdEntityData> {
+ final String assetId;
+ final String? cloudId;
+ final DateTime? createdAt;
+ final DateTime? adjustmentTime;
+ final double? latitude;
+ final double? longitude;
+ const RemoteAssetCloudIdEntityData({
+ required this.assetId,
+ this.cloudId,
+ this.createdAt,
+ this.adjustmentTime,
+ this.latitude,
+ this.longitude,
+ });
+ @override
+ Map<String, Expression> toColumns(bool nullToAbsent) {
+ final map = <String, Expression>{};
+ map['asset_id'] = Variable<String>(assetId);
+ if (!nullToAbsent || cloudId != null) {
+ map['cloud_id'] = Variable<String>(cloudId);
+ }
+ if (!nullToAbsent || createdAt != null) {
+ map['created_at'] = Variable<DateTime>(createdAt);
+ }
+ if (!nullToAbsent || adjustmentTime != null) {
+ map['adjustment_time'] = Variable<DateTime>(adjustmentTime);
+ }
+ if (!nullToAbsent || latitude != null) {
+ map['latitude'] = Variable<double>(latitude);
+ }
+ if (!nullToAbsent || longitude != null) {
+ map['longitude'] = Variable<double>(longitude);
+ }
+ return map;
+ }
+
+ factory RemoteAssetCloudIdEntityData.fromJson(
+ Map<String, dynamic> json, {
+ ValueSerializer? serializer,
+ }) {
+ serializer ??= driftRuntimeOptions.defaultSerializer;
+ return RemoteAssetCloudIdEntityData(
+ assetId: serializer.fromJson<String>(json['assetId']),
+ cloudId: serializer.fromJson<String?>(json['cloudId']),
+ createdAt: serializer.fromJson<DateTime?>(json['createdAt']),
+ adjustmentTime: serializer.fromJson<DateTime?>(json['adjustmentTime']),
+ latitude: serializer.fromJson<double?>(json['latitude']),
+ longitude: serializer.fromJson<double?>(json['longitude']),
+ );
+ }
+ @override
+ Map<String, dynamic> toJson({ValueSerializer? serializer}) {
+ serializer ??= driftRuntimeOptions.defaultSerializer;
+ return <String, dynamic>{
+ 'assetId': serializer.toJson<String>(assetId),
+ 'cloudId': serializer.toJson<String?>(cloudId),
+ 'createdAt': serializer.toJson<DateTime?>(createdAt),
+ 'adjustmentTime': serializer.toJson<DateTime?>(adjustmentTime),
+ 'latitude': serializer.toJson<double?>(latitude),
+ 'longitude': serializer.toJson<double?>(longitude),
+ };
+ }
+
+ RemoteAssetCloudIdEntityData copyWith({
+ String? assetId,
+ Value<String?> cloudId = const Value.absent(),
+ Value<DateTime?> createdAt = const Value.absent(),
+ Value<DateTime?> adjustmentTime = const Value.absent(),
+ Value<double?> latitude = const Value.absent(),
+ Value<double?> longitude = const Value.absent(),
+ }) => RemoteAssetCloudIdEntityData(
+ assetId: assetId ?? this.assetId,
+ cloudId: cloudId.present ? cloudId.value : this.cloudId,
+ createdAt: createdAt.present ? createdAt.value : this.createdAt,
+ adjustmentTime: adjustmentTime.present
+ ? adjustmentTime.value
+ : this.adjustmentTime,
+ latitude: latitude.present ? latitude.value : this.latitude,
+ longitude: longitude.present ? longitude.value : this.longitude,
+ );
+ RemoteAssetCloudIdEntityData copyWithCompanion(
+ RemoteAssetCloudIdEntityCompanion data,
+ ) {
+ return RemoteAssetCloudIdEntityData(
+ assetId: data.assetId.present ? data.assetId.value : this.assetId,
+ cloudId: data.cloudId.present ? data.cloudId.value : this.cloudId,
+ createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt,
+ adjustmentTime: data.adjustmentTime.present
+ ? data.adjustmentTime.value
+ : this.adjustmentTime,
+ latitude: data.latitude.present ? data.latitude.value : this.latitude,
+ longitude: data.longitude.present ? data.longitude.value : this.longitude,
+ );
+ }
+
+ @override
+ String toString() {
+ return (StringBuffer('RemoteAssetCloudIdEntityData(')
+ ..write('assetId: $assetId, ')
+ ..write('cloudId: $cloudId, ')
+ ..write('createdAt: $createdAt, ')
+ ..write('adjustmentTime: $adjustmentTime, ')
+ ..write('latitude: $latitude, ')
+ ..write('longitude: $longitude')
+ ..write(')'))
+ .toString();
+ }
+
+ @override
+ int get hashCode => Object.hash(
+ assetId,
+ cloudId,
+ createdAt,
+ adjustmentTime,
+ latitude,
+ longitude,
+ );
+ @override
+ bool operator ==(Object other) =>
+ identical(this, other) ||
+ (other is RemoteAssetCloudIdEntityData &&
+ other.assetId == this.assetId &&
+ other.cloudId == this.cloudId &&
+ other.createdAt == this.createdAt &&
+ other.adjustmentTime == this.adjustmentTime &&
+ other.latitude == this.latitude &&
+ other.longitude == this.longitude);
+}
+
+class RemoteAssetCloudIdEntityCompanion
+ extends UpdateCompanion<RemoteAssetCloudIdEntityData> {
+ final Value<String> assetId;
+ final Value<String?> cloudId;
+ final Value<DateTime?> createdAt;
+ final Value<DateTime?> adjustmentTime;
+ final Value<double?> latitude;
+ final Value<double?> longitude;
+ const RemoteAssetCloudIdEntityCompanion({
+ this.assetId = const Value.absent(),
+ this.cloudId = const Value.absent(),
+ this.createdAt = const Value.absent(),
+ this.adjustmentTime = const Value.absent(),
+ this.latitude = const Value.absent(),
+ this.longitude = const Value.absent(),
+ });
+ RemoteAssetCloudIdEntityCompanion.insert({
+ required String assetId,
+ this.cloudId = const Value.absent(),
+ this.createdAt = const Value.absent(),
+ this.adjustmentTime = const Value.absent(),
+ this.latitude = const Value.absent(),
+ this.longitude = const Value.absent(),
+ }) : assetId = Value(assetId);
+ static Insertable<RemoteAssetCloudIdEntityData> custom({
+ Expression<String>? assetId,
+ Expression<String>? cloudId,
+ Expression<DateTime>? createdAt,
+ Expression<DateTime>? adjustmentTime,
+ Expression<double>? latitude,
+ Expression<double>? longitude,
+ }) {
+ return RawValuesInsertable({
+ if (assetId != null) 'asset_id': assetId,
+ if (cloudId != null) 'cloud_id': cloudId,
+ if (createdAt != null) 'created_at': createdAt,
+ if (adjustmentTime != null) 'adjustment_time': adjustmentTime,
+ if (latitude != null) 'latitude': latitude,
+ if (longitude != null) 'longitude': longitude,
+ });
+ }
+
+ RemoteAssetCloudIdEntityCompanion copyWith({
+ Value<String>? assetId,
+ Value<String?>? cloudId,
+ Value<DateTime?>? createdAt,
+ Value<DateTime?>? adjustmentTime,
+ Value<double?>? latitude,
+ Value<double?>? longitude,
+ }) {
+ return RemoteAssetCloudIdEntityCompanion(
+ assetId: assetId ?? this.assetId,
+ cloudId: cloudId ?? this.cloudId,
+ createdAt: createdAt ?? this.createdAt,
+ adjustmentTime: adjustmentTime ?? this.adjustmentTime,
+ latitude: latitude ?? this.latitude,
+ longitude: longitude ?? this.longitude,
+ );
+ }
+
+ @override
+ Map<String, Expression> toColumns(bool nullToAbsent) {
+ final map = <String, Expression>{};
+ if (assetId.present) {
+ map['asset_id'] = Variable<String>(assetId.value);
+ }
+ if (cloudId.present) {
+ map['cloud_id'] = Variable<String>(cloudId.value);
+ }
+ if (createdAt.present) {
+ map['created_at'] = Variable<DateTime>(createdAt.value);
+ }
+ if (adjustmentTime.present) {
+ map['adjustment_time'] = Variable<DateTime>(adjustmentTime.value);
+ }
+ if (latitude.present) {
+ map['latitude'] = Variable<double>(latitude.value);
+ }
+ if (longitude.present) {
+ map['longitude'] = Variable<double>(longitude.value);
+ }
+ return map;
+ }
+
+ @override
+ String toString() {
+ return (StringBuffer('RemoteAssetCloudIdEntityCompanion(')
+ ..write('assetId: $assetId, ')
+ ..write('cloudId: $cloudId, ')
+ ..write('createdAt: $createdAt, ')
+ ..write('adjustmentTime: $adjustmentTime, ')
+ ..write('latitude: $latitude, ')
+ ..write('longitude: $longitude')
+ ..write(')'))
+ .toString();
+ }
+}
+
+class MemoryEntity extends Table
+ with TableInfo<MemoryEntity, MemoryEntityData> {
+ @override
+ final GeneratedDatabase attachedDatabase;
+ final String? _alias;
+ MemoryEntity(this.attachedDatabase, [this._alias]);
+ late final GeneratedColumn<String> id = GeneratedColumn<String>(
+ 'id',
+ aliasedName,
+ false,
+ type: DriftSqlType.string,
+ requiredDuringInsert: true,
+ );
+ late final GeneratedColumn<DateTime> createdAt = GeneratedColumn<DateTime>(
+ 'created_at',
+ aliasedName,
+ false,
+ type: DriftSqlType.dateTime,
+ requiredDuringInsert: false,
+ defaultValue: const CustomExpression('CURRENT_TIMESTAMP'),
+ );
+ late final GeneratedColumn<DateTime> updatedAt = GeneratedColumn<DateTime>(
+ 'updated_at',
+ aliasedName,
+ false,
+ type: DriftSqlType.dateTime,
+ requiredDuringInsert: false,
+ defaultValue: const CustomExpression('CURRENT_TIMESTAMP'),
+ );
+ late final GeneratedColumn<DateTime> deletedAt = GeneratedColumn<DateTime>(
+ 'deleted_at',
+ aliasedName,
+ true,
+ type: DriftSqlType.dateTime,
+ requiredDuringInsert: false,
+ );
+ late final GeneratedColumn<String> ownerId = GeneratedColumn<String>(
+ 'owner_id',
+ aliasedName,
+ false,
+ type: DriftSqlType.string,
+ requiredDuringInsert: true,
+ defaultConstraints: GeneratedColumn.constraintIsAlways(
+ 'REFERENCES user_entity (id) ON DELETE CASCADE',
+ ),
+ );
+ late final GeneratedColumn<int> type = GeneratedColumn<int>(
+ 'type',
+ aliasedName,
+ false,
+ type: DriftSqlType.int,
+ requiredDuringInsert: true,
+ );
+ late final GeneratedColumn<String> data = GeneratedColumn<String>(
+ 'data',
+ aliasedName,
+ false,
+ type: DriftSqlType.string,
+ requiredDuringInsert: true,
+ );
+ late final GeneratedColumn<bool> isSaved = GeneratedColumn<bool>(
+ 'is_saved',
+ aliasedName,
+ false,
+ type: DriftSqlType.bool,
+ requiredDuringInsert: false,
+ defaultConstraints: GeneratedColumn.constraintIsAlways(
+ 'CHECK ("is_saved" IN (0, 1))',
+ ),
+ defaultValue: const CustomExpression('0'),
+ );
+ late final GeneratedColumn<DateTime> memoryAt = GeneratedColumn<DateTime>(
+ 'memory_at',
+ aliasedName,
+ false,
+ type: DriftSqlType.dateTime,
+ requiredDuringInsert: true,
+ );
+ late final GeneratedColumn<DateTime> seenAt = GeneratedColumn<DateTime>(
+ 'seen_at',
+ aliasedName,
+ true,
+ type: DriftSqlType.dateTime,
+ requiredDuringInsert: false,
+ );
+ late final GeneratedColumn<DateTime> showAt = GeneratedColumn<DateTime>(
+ 'show_at',
+ aliasedName,
+ true,
+ type: DriftSqlType.dateTime,
+ requiredDuringInsert: false,
+ );
+ late final GeneratedColumn<DateTime> hideAt = GeneratedColumn<DateTime>(
+ 'hide_at',
+ aliasedName,
+ true,
+ type: DriftSqlType.dateTime,
+ requiredDuringInsert: false,
+ );
+ @override
+ List<GeneratedColumn> get $columns => [
+ id,
+ createdAt,
+ updatedAt,
+ deletedAt,
+ ownerId,
+ type,
+ data,
+ isSaved,
+ memoryAt,
+ seenAt,
+ showAt,
+ hideAt,
+ ];
+ @override
+ String get aliasedName => _alias ?? actualTableName;
+ @override
+ String get actualTableName => $name;
+ static const String $name = 'memory_entity';
+ @override
+ Set<GeneratedColumn> get $primaryKey => {id};
+ @override
+ MemoryEntityData map(Map<String, dynamic> data, {String? tablePrefix}) {
+ final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : '';
+ return MemoryEntityData(
+ id: attachedDatabase.typeMapping.read(
+ DriftSqlType.string,
+ data['${effectivePrefix}id'],
+ )!,
+ createdAt: attachedDatabase.typeMapping.read(
+ DriftSqlType.dateTime,
+ data['${effectivePrefix}created_at'],
+ )!,
+ updatedAt: attachedDatabase.typeMapping.read(
+ DriftSqlType.dateTime,
+ data['${effectivePrefix}updated_at'],
+ )!,
+ deletedAt: attachedDatabase.typeMapping.read(
+ DriftSqlType.dateTime,
+ data['${effectivePrefix}deleted_at'],
+ ),
+ ownerId: attachedDatabase.typeMapping.read(
+ DriftSqlType.string,
+ data['${effectivePrefix}owner_id'],
+ )!,
+ type: attachedDatabase.typeMapping.read(
+ DriftSqlType.int,
+ data['${effectivePrefix}type'],
+ )!,
+ data: attachedDatabase.typeMapping.read(
+ DriftSqlType.string,
+ data['${effectivePrefix}data'],
+ )!,
+ isSaved: attachedDatabase.typeMapping.read(
+ DriftSqlType.bool,
+ data['${effectivePrefix}is_saved'],
+ )!,
+ memoryAt: attachedDatabase.typeMapping.read(
+ DriftSqlType.dateTime,
+ data['${effectivePrefix}memory_at'],
+ )!,
+ seenAt: attachedDatabase.typeMapping.read(
+ DriftSqlType.dateTime,
+ data['${effectivePrefix}seen_at'],
+ ),
+ showAt: attachedDatabase.typeMapping.read(
+ DriftSqlType.dateTime,
+ data['${effectivePrefix}show_at'],
+ ),
+ hideAt: attachedDatabase.typeMapping.read(
+ DriftSqlType.dateTime,
+ data['${effectivePrefix}hide_at'],
+ ),
+ );
+ }
+
+ @override
+ MemoryEntity createAlias(String alias) {
+ return MemoryEntity(attachedDatabase, alias);
+ }
+
+ @override
+ bool get withoutRowId => true;
+ @override
+ bool get isStrict => true;
+}
+
+class MemoryEntityData extends DataClass
+ implements Insertable<MemoryEntityData> {
+ final String id;
+ final DateTime createdAt;
+ final DateTime updatedAt;
+ final DateTime? deletedAt;
+ final String ownerId;
+ final int type;
+ final String data;
+ final bool isSaved;
+ final DateTime memoryAt;
+ final DateTime? seenAt;
+ final DateTime? showAt;
+ final DateTime? hideAt;
+ const MemoryEntityData({
+ required this.id,
+ required this.createdAt,
+ required this.updatedAt,
+ this.deletedAt,
+ required this.ownerId,
+ required this.type,
+ required this.data,
+ required this.isSaved,
+ required this.memoryAt,
+ this.seenAt,
+ this.showAt,
+ this.hideAt,
+ });
+ @override
+ Map<String, Expression> toColumns(bool nullToAbsent) {
+ final map = <String, Expression>{};
+ map['id'] = Variable<String>(id);
+ map['created_at'] = Variable<DateTime>(createdAt);
+ map['updated_at'] = Variable<DateTime>(updatedAt);
+ if (!nullToAbsent || deletedAt != null) {
+ map['deleted_at'] = Variable<DateTime>(deletedAt);
+ }
+ map['owner_id'] = Variable<String>(ownerId);
+ map['type'] = Variable<int>(type);
+ map['data'] = Variable<String>(data);
+ map['is_saved'] = Variable<bool>(isSaved);
+ map['memory_at'] = Variable<DateTime>(memoryAt);
+ if (!nullToAbsent || seenAt != null) {
+ map['seen_at'] = Variable<DateTime>(seenAt);
+ }
+ if (!nullToAbsent || showAt != null) {
+ map['show_at'] = Variable<DateTime>(showAt);
+ }
+ if (!nullToAbsent || hideAt != null) {
+ map['hide_at'] = Variable<DateTime>(hideAt);
+ }
+ return map;
+ }
+
+ factory MemoryEntityData.fromJson(
+ Map<String, dynamic> json, {
+ ValueSerializer? serializer,
+ }) {
+ serializer ??= driftRuntimeOptions.defaultSerializer;
+ return MemoryEntityData(
+ id: serializer.fromJson<String>(json['id']),
+ createdAt: serializer.fromJson<DateTime>(json['createdAt']),
+ updatedAt: serializer.fromJson<DateTime>(json['updatedAt']),
+ deletedAt: serializer.fromJson<DateTime?>(json['deletedAt']),
+ ownerId: serializer.fromJson<String>(json['ownerId']),
+ type: serializer.fromJson<int>(json['type']),
+ data: serializer.fromJson<String>(json['data']),
+ isSaved: serializer.fromJson<bool>(json['isSaved']),
+ memoryAt: serializer.fromJson<DateTime>(json['memoryAt']),
+ seenAt: serializer.fromJson<DateTime?>(json['seenAt']),
+ showAt: serializer.fromJson<DateTime?>(json['showAt']),
+ hideAt: serializer.fromJson<DateTime?>(json['hideAt']),
+ );
+ }
+ @override
+ Map<String, dynamic> toJson({ValueSerializer? serializer}) {
+ serializer ??= driftRuntimeOptions.defaultSerializer;
+ return <String, dynamic>{
+ 'id': serializer.toJson<String>(id),
+ 'createdAt': serializer.toJson<DateTime>(createdAt),
+ 'updatedAt': serializer.toJson<DateTime>(updatedAt),
+ 'deletedAt': serializer.toJson<DateTime?>(deletedAt),
+ 'ownerId': serializer.toJson<String>(ownerId),
+ 'type': serializer.toJson<int>(type),
+ 'data': serializer.toJson<String>(data),
+ 'isSaved': serializer.toJson<bool>(isSaved),
+ 'memoryAt': serializer.toJson<DateTime>(memoryAt),
+ 'seenAt': serializer.toJson<DateTime?>(seenAt),
+ 'showAt': serializer.toJson<DateTime?>(showAt),
+ 'hideAt': serializer.toJson<DateTime?>(hideAt),
+ };
+ }
+
+ MemoryEntityData copyWith({
+ String? id,
+ DateTime? createdAt,
+ DateTime? updatedAt,
+ Value<DateTime?> deletedAt = const Value.absent(),
+ String? ownerId,
+ int? type,
+ String? data,
+ bool? isSaved,
+ DateTime? memoryAt,
+ Value<DateTime?> seenAt = const Value.absent(),
+ Value<DateTime?> showAt = const Value.absent(),
+ Value<DateTime?> hideAt = const Value.absent(),
+ }) => MemoryEntityData(
+ id: id ?? this.id,
+ createdAt: createdAt ?? this.createdAt,
+ updatedAt: updatedAt ?? this.updatedAt,
+ deletedAt: deletedAt.present ? deletedAt.value : this.deletedAt,
+ ownerId: ownerId ?? this.ownerId,
+ type: type ?? this.type,
+ data: data ?? this.data,
+ isSaved: isSaved ?? this.isSaved,
+ memoryAt: memoryAt ?? this.memoryAt,
+ seenAt: seenAt.present ? seenAt.value : this.seenAt,
+ showAt: showAt.present ? showAt.value : this.showAt,
+ hideAt: hideAt.present ? hideAt.value : this.hideAt,
+ );
+ MemoryEntityData copyWithCompanion(MemoryEntityCompanion data) {
+ return MemoryEntityData(
+ id: data.id.present ? data.id.value : this.id,
+ createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt,
+ updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt,
+ deletedAt: data.deletedAt.present ? data.deletedAt.value : this.deletedAt,
+ ownerId: data.ownerId.present ? data.ownerId.value : this.ownerId,
+ type: data.type.present ? data.type.value : this.type,
+ data: data.data.present ? data.data.value : this.data,
+ isSaved: data.isSaved.present ? data.isSaved.value : this.isSaved,
+ memoryAt: data.memoryAt.present ? data.memoryAt.value : this.memoryAt,
+ seenAt: data.seenAt.present ? data.seenAt.value : this.seenAt,
+ showAt: data.showAt.present ? data.showAt.value : this.showAt,
+ hideAt: data.hideAt.present ? data.hideAt.value : this.hideAt,
+ );
+ }
+
+ @override
+ String toString() {
+ return (StringBuffer('MemoryEntityData(')
+ ..write('id: $id, ')
+ ..write('createdAt: $createdAt, ')
+ ..write('updatedAt: $updatedAt, ')
+ ..write('deletedAt: $deletedAt, ')
+ ..write('ownerId: $ownerId, ')
+ ..write('type: $type, ')
+ ..write('data: $data, ')
+ ..write('isSaved: $isSaved, ')
+ ..write('memoryAt: $memoryAt, ')
+ ..write('seenAt: $seenAt, ')
+ ..write('showAt: $showAt, ')
+ ..write('hideAt: $hideAt')
+ ..write(')'))
+ .toString();
+ }
+
+ @override
+ int get hashCode => Object.hash(
+ id,
+ createdAt,
+ updatedAt,
+ deletedAt,
+ ownerId,
+ type,
+ data,
+ isSaved,
+ memoryAt,
+ seenAt,
+ showAt,
+ hideAt,
+ );
+ @override
+ bool operator ==(Object other) =>
+ identical(this, other) ||
+ (other is MemoryEntityData &&
+ other.id == this.id &&
+ other.createdAt == this.createdAt &&
+ other.updatedAt == this.updatedAt &&
+ other.deletedAt == this.deletedAt &&
+ other.ownerId == this.ownerId &&
+ other.type == this.type &&
+ other.data == this.data &&
+ other.isSaved == this.isSaved &&
+ other.memoryAt == this.memoryAt &&
+ other.seenAt == this.seenAt &&
+ other.showAt == this.showAt &&
+ other.hideAt == this.hideAt);
+}
+
+class MemoryEntityCompanion extends UpdateCompanion<MemoryEntityData> {
+ final Value<String> id;
+ final Value<DateTime> createdAt;
+ final Value<DateTime> updatedAt;
+ final Value<DateTime?> deletedAt;
+ final Value<String> ownerId;
+ final Value<int> type;
+ final Value<String> data;
+ final Value<bool> isSaved;
+ final Value<DateTime> memoryAt;
+ final Value<DateTime?> seenAt;
+ final Value<DateTime?> showAt;
+ final Value<DateTime?> hideAt;
+ const MemoryEntityCompanion({
+ this.id = const Value.absent(),
+ this.createdAt = const Value.absent(),
+ this.updatedAt = const Value.absent(),
+ this.deletedAt = const Value.absent(),
+ this.ownerId = const Value.absent(),
+ this.type = const Value.absent(),
+ this.data = const Value.absent(),
+ this.isSaved = const Value.absent(),
+ this.memoryAt = const Value.absent(),
+ this.seenAt = const Value.absent(),
+ this.showAt = const Value.absent(),
+ this.hideAt = const Value.absent(),
+ });
+ MemoryEntityCompanion.insert({
+ required String id,
+ this.createdAt = const Value.absent(),
+ this.updatedAt = const Value.absent(),
+ this.deletedAt = const Value.absent(),
+ required String ownerId,
+ required int type,
+ required String data,
+ this.isSaved = const Value.absent(),
+ required DateTime memoryAt,
+ this.seenAt = const Value.absent(),
+ this.showAt = const Value.absent(),
+ this.hideAt = const Value.absent(),
+ }) : id = Value(id),
+ ownerId = Value(ownerId),
+ type = Value(type),
+ data = Value(data),
+ memoryAt = Value(memoryAt);
+ static Insertable<MemoryEntityData> custom({
+ Expression<String>? id,
+ Expression<DateTime>? createdAt,
+ Expression<DateTime>? updatedAt,
+ Expression<DateTime>? deletedAt,
+ Expression<String>? ownerId,
+ Expression<int>? type,
+ Expression<String>? data,
+ Expression<bool>? isSaved,
+ Expression<DateTime>? memoryAt,
+ Expression<DateTime>? seenAt,
+ Expression<DateTime>? showAt,
+ Expression<DateTime>? hideAt,
+ }) {
+ return RawValuesInsertable({
+ if (id != null) 'id': id,
+ if (createdAt != null) 'created_at': createdAt,
+ if (updatedAt != null) 'updated_at': updatedAt,
+ if (deletedAt != null) 'deleted_at': deletedAt,
+ if (ownerId != null) 'owner_id': ownerId,
+ if (type != null) 'type': type,
+ if (data != null) 'data': data,
+ if (isSaved != null) 'is_saved': isSaved,
+ if (memoryAt != null) 'memory_at': memoryAt,
+ if (seenAt != null) 'seen_at': seenAt,
+ if (showAt != null) 'show_at': showAt,
+ if (hideAt != null) 'hide_at': hideAt,
+ });
+ }
+
+ MemoryEntityCompanion copyWith({
+ Value<String>? id,
+ Value<DateTime>? createdAt,
+ Value<DateTime>? updatedAt,
+ Value<DateTime?>? deletedAt,
+ Value<String>? ownerId,
+ Value<int>? type,
+ Value<String>? data,
+ Value<bool>? isSaved,
+ Value<DateTime>? memoryAt,
+ Value<DateTime?>? seenAt,
+ Value<DateTime?>? showAt,
+ Value<DateTime?>? hideAt,
+ }) {
+ return MemoryEntityCompanion(
+ id: id ?? this.id,
+ createdAt: createdAt ?? this.createdAt,
+ updatedAt: updatedAt ?? this.updatedAt,
+ deletedAt: deletedAt ?? this.deletedAt,
+ ownerId: ownerId ?? this.ownerId,
+ type: type ?? this.type,
+ data: data ?? this.data,
+ isSaved: isSaved ?? this.isSaved,
+ memoryAt: memoryAt ?? this.memoryAt,
+ seenAt: seenAt ?? this.seenAt,
+ showAt: showAt ?? this.showAt,
+ hideAt: hideAt ?? this.hideAt,
+ );
+ }
+
+ @override
+ Map<String, Expression> toColumns(bool nullToAbsent) {
+ final map = <String, Expression>{};
+ if (id.present) {
+ map['id'] = Variable<String>(id.value);
+ }
+ if (createdAt.present) {
+ map['created_at'] = Variable<DateTime>(createdAt.value);
+ }
+ if (updatedAt.present) {
+ map['updated_at'] = Variable<DateTime>(updatedAt.value);
+ }
+ if (deletedAt.present) {
+ map['deleted_at'] = Variable<DateTime>(deletedAt.value);
+ }
+ if (ownerId.present) {
+ map['owner_id'] = Variable<String>(ownerId.value);
+ }
+ if (type.present) {
+ map['type'] = Variable<int>(type.value);
+ }
+ if (data.present) {
+ map['data'] = Variable<String>(data.value);
+ }
+ if (isSaved.present) {
+ map['is_saved'] = Variable<bool>(isSaved.value);
+ }
+ if (memoryAt.present) {
+ map['memory_at'] = Variable<DateTime>(memoryAt.value);
+ }
+ if (seenAt.present) {
+ map['seen_at'] = Variable<DateTime>(seenAt.value);
+ }
+ if (showAt.present) {
+ map['show_at'] = Variable<DateTime>(showAt.value);
+ }
+ if (hideAt.present) {
+ map['hide_at'] = Variable<DateTime>(hideAt.value);
+ }
+ return map;
+ }
+
+ @override
+ String toString() {
+ return (StringBuffer('MemoryEntityCompanion(')
+ ..write('id: $id, ')
+ ..write('createdAt: $createdAt, ')
+ ..write('updatedAt: $updatedAt, ')
+ ..write('deletedAt: $deletedAt, ')
+ ..write('ownerId: $ownerId, ')
+ ..write('type: $type, ')
+ ..write('data: $data, ')
+ ..write('isSaved: $isSaved, ')
+ ..write('memoryAt: $memoryAt, ')
+ ..write('seenAt: $seenAt, ')
+ ..write('showAt: $showAt, ')
+ ..write('hideAt: $hideAt')
+ ..write(')'))
+ .toString();
+ }
+}
+
+class MemoryAssetEntity extends Table
+ with TableInfo<MemoryAssetEntity, MemoryAssetEntityData> {
+ @override
+ final GeneratedDatabase attachedDatabase;
+ final String? _alias;
+ MemoryAssetEntity(this.attachedDatabase, [this._alias]);
+ late final GeneratedColumn<String> assetId = GeneratedColumn<String>(
+ 'asset_id',
+ aliasedName,
+ false,
+ type: DriftSqlType.string,
+ requiredDuringInsert: true,
+ defaultConstraints: GeneratedColumn.constraintIsAlways(
+ 'REFERENCES remote_asset_entity (id) ON DELETE CASCADE',
+ ),
+ );
+ late final GeneratedColumn<String> memoryId = GeneratedColumn<String>(
+ 'memory_id',
+ aliasedName,
+ false,
+ type: DriftSqlType.string,
+ requiredDuringInsert: true,
+ defaultConstraints: GeneratedColumn.constraintIsAlways(
+ 'REFERENCES memory_entity (id) ON DELETE CASCADE',
+ ),
+ );
+ @override
+ List<GeneratedColumn> get $columns => [assetId, memoryId];
+ @override
+ String get aliasedName => _alias ?? actualTableName;
+ @override
+ String get actualTableName => $name;
+ static const String $name = 'memory_asset_entity';
+ @override
+ Set<GeneratedColumn> get $primaryKey => {assetId, memoryId};
+ @override
+ MemoryAssetEntityData map(Map<String, dynamic> data, {String? tablePrefix}) {
+ final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : '';
+ return MemoryAssetEntityData(
+ assetId: attachedDatabase.typeMapping.read(
+ DriftSqlType.string,
+ data['${effectivePrefix}asset_id'],
+ )!,
+ memoryId: attachedDatabase.typeMapping.read(
+ DriftSqlType.string,
+ data['${effectivePrefix}memory_id'],
+ )!,
+ );
+ }
+
+ @override
+ MemoryAssetEntity createAlias(String alias) {
+ return MemoryAssetEntity(attachedDatabase, alias);
+ }
+
+ @override
+ bool get withoutRowId => true;
+ @override
+ bool get isStrict => true;
+}
+
+class MemoryAssetEntityData extends DataClass
+ implements Insertable<MemoryAssetEntityData> {
+ final String assetId;
+ final String memoryId;
+ const MemoryAssetEntityData({required this.assetId, required this.memoryId});
+ @override
+ Map<String, Expression> toColumns(bool nullToAbsent) {
+ final map = <String, Expression>{};
+ map['asset_id'] = Variable<String>(assetId);
+ map['memory_id'] = Variable<String>(memoryId);
+ return map;
+ }
+
+ factory MemoryAssetEntityData.fromJson(
+ Map<String, dynamic> json, {
+ ValueSerializer? serializer,
+ }) {
+ serializer ??= driftRuntimeOptions.defaultSerializer;
+ return MemoryAssetEntityData(
+ assetId: serializer.fromJson<String>(json['assetId']),
+ memoryId: serializer.fromJson<String>(json['memoryId']),
+ );
+ }
+ @override
+ Map<String, dynamic> toJson({ValueSerializer? serializer}) {
+ serializer ??= driftRuntimeOptions.defaultSerializer;
+ return <String, dynamic>{
+ 'assetId': serializer.toJson<String>(assetId),
+ 'memoryId': serializer.toJson<String>(memoryId),
+ };
+ }
+
+ MemoryAssetEntityData copyWith({String? assetId, String? memoryId}) =>
+ MemoryAssetEntityData(
+ assetId: assetId ?? this.assetId,
+ memoryId: memoryId ?? this.memoryId,
+ );
+ MemoryAssetEntityData copyWithCompanion(MemoryAssetEntityCompanion data) {
+ return MemoryAssetEntityData(
+ assetId: data.assetId.present ? data.assetId.value : this.assetId,
+ memoryId: data.memoryId.present ? data.memoryId.value : this.memoryId,
+ );
+ }
+
+ @override
+ String toString() {
+ return (StringBuffer('MemoryAssetEntityData(')
+ ..write('assetId: $assetId, ')
+ ..write('memoryId: $memoryId')
+ ..write(')'))
+ .toString();
+ }
+
+ @override
+ int get hashCode => Object.hash(assetId, memoryId);
+ @override
+ bool operator ==(Object other) =>
+ identical(this, other) ||
+ (other is MemoryAssetEntityData &&
+ other.assetId == this.assetId &&
+ other.memoryId == this.memoryId);
+}
+
+class MemoryAssetEntityCompanion
+ extends UpdateCompanion<MemoryAssetEntityData> {
+ final Value<String> assetId;
+ final Value<String> memoryId;
+ const MemoryAssetEntityCompanion({
+ this.assetId = const Value.absent(),
+ this.memoryId = const Value.absent(),
+ });
+ MemoryAssetEntityCompanion.insert({
+ required String assetId,
+ required String memoryId,
+ }) : assetId = Value(assetId),
+ memoryId = Value(memoryId);
+ static Insertable<MemoryAssetEntityData> custom({
+ Expression<String>? assetId,
+ Expression<String>? memoryId,
+ }) {
+ return RawValuesInsertable({
+ if (assetId != null) 'asset_id': assetId,
+ if (memoryId != null) 'memory_id': memoryId,
+ });
+ }
+
+ MemoryAssetEntityCompanion copyWith({
+ Value<String>? assetId,
+ Value<String>? memoryId,
+ }) {
+ return MemoryAssetEntityCompanion(
+ assetId: assetId ?? this.assetId,
+ memoryId: memoryId ?? this.memoryId,
+ );
+ }
+
+ @override
+ Map<String, Expression> toColumns(bool nullToAbsent) {
+ final map = <String, Expression>{};
+ if (assetId.present) {
+ map['asset_id'] = Variable<String>(assetId.value);
+ }
+ if (memoryId.present) {
+ map['memory_id'] = Variable<String>(memoryId.value);
+ }
+ return map;
+ }
+
+ @override
+ String toString() {
+ return (StringBuffer('MemoryAssetEntityCompanion(')
+ ..write('assetId: $assetId, ')
+ ..write('memoryId: $memoryId')
+ ..write(')'))
+ .toString();
+ }
+}
+
+class PersonEntity extends Table
+ with TableInfo<PersonEntity, PersonEntityData> {
+ @override
+ final GeneratedDatabase attachedDatabase;
+ final String? _alias;
+ PersonEntity(this.attachedDatabase, [this._alias]);
+ late final GeneratedColumn<String> id = GeneratedColumn<String>(
+ 'id',
+ aliasedName,
+ false,
+ type: DriftSqlType.string,
+ requiredDuringInsert: true,
+ );
+ late final GeneratedColumn<DateTime> createdAt = GeneratedColumn<DateTime>(
+ 'created_at',
+ aliasedName,
+ false,
+ type: DriftSqlType.dateTime,
+ requiredDuringInsert: false,
+ defaultValue: const CustomExpression('CURRENT_TIMESTAMP'),
+ );
+ late final GeneratedColumn<DateTime> updatedAt = GeneratedColumn<DateTime>(
+ 'updated_at',
+ aliasedName,
+ false,
+ type: DriftSqlType.dateTime,
+ requiredDuringInsert: false,
+ defaultValue: const CustomExpression('CURRENT_TIMESTAMP'),
+ );
+ late final GeneratedColumn<String> ownerId = GeneratedColumn<String>(
+ 'owner_id',
+ aliasedName,
+ false,
+ type: DriftSqlType.string,
+ requiredDuringInsert: true,
+ defaultConstraints: GeneratedColumn.constraintIsAlways(
+ 'REFERENCES user_entity (id) ON DELETE CASCADE',
+ ),
+ );
+ late final GeneratedColumn<String> name = GeneratedColumn<String>(
+ 'name',
+ aliasedName,
+ false,
+ type: DriftSqlType.string,
+ requiredDuringInsert: true,
+ );
+ late final GeneratedColumn<String> faceAssetId = GeneratedColumn<String>(
+ 'face_asset_id',
+ aliasedName,
+ true,
+ type: DriftSqlType.string,
+ requiredDuringInsert: false,
+ );
+ late final GeneratedColumn<bool> isFavorite = GeneratedColumn<bool>(
+ 'is_favorite',
+ aliasedName,
+ false,
+ type: DriftSqlType.bool,
+ requiredDuringInsert: true,
+ defaultConstraints: GeneratedColumn.constraintIsAlways(
+ 'CHECK ("is_favorite" IN (0, 1))',
+ ),
+ );
+ late final GeneratedColumn<bool> isHidden = GeneratedColumn<bool>(
+ 'is_hidden',
+ aliasedName,
+ false,
+ type: DriftSqlType.bool,
+ requiredDuringInsert: true,
+ defaultConstraints: GeneratedColumn.constraintIsAlways(
+ 'CHECK ("is_hidden" IN (0, 1))',
+ ),
+ );
+ late final GeneratedColumn<String> color = GeneratedColumn<String>(
+ 'color',
+ aliasedName,
+ true,
+ type: DriftSqlType.string,
+ requiredDuringInsert: false,
+ );
+ late final GeneratedColumn<DateTime> birthDate = GeneratedColumn<DateTime>(
+ 'birth_date',
+ aliasedName,
+ true,
+ type: DriftSqlType.dateTime,
+ requiredDuringInsert: false,
+ );
+ @override
+ List<GeneratedColumn> get $columns => [
+ id,
+ createdAt,
+ updatedAt,
+ ownerId,
+ name,
+ faceAssetId,
+ isFavorite,
+ isHidden,
+ color,
+ birthDate,
+ ];
+ @override
+ String get aliasedName => _alias ?? actualTableName;
+ @override
+ String get actualTableName => $name;
+ static const String $name = 'person_entity';
+ @override
+ Set<GeneratedColumn> get $primaryKey => {id};
+ @override
+ PersonEntityData map(Map<String, dynamic> data, {String? tablePrefix}) {
+ final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : '';
+ return PersonEntityData(
+ id: attachedDatabase.typeMapping.read(
+ DriftSqlType.string,
+ data['${effectivePrefix}id'],
+ )!,
+ createdAt: attachedDatabase.typeMapping.read(
+ DriftSqlType.dateTime,
+ data['${effectivePrefix}created_at'],
+ )!,
+ updatedAt: attachedDatabase.typeMapping.read(
+ DriftSqlType.dateTime,
+ data['${effectivePrefix}updated_at'],
+ )!,
+ ownerId: attachedDatabase.typeMapping.read(
+ DriftSqlType.string,
+ data['${effectivePrefix}owner_id'],
+ )!,
+ name: attachedDatabase.typeMapping.read(
+ DriftSqlType.string,
+ data['${effectivePrefix}name'],
+ )!,
+ faceAssetId: attachedDatabase.typeMapping.read(
+ DriftSqlType.string,
+ data['${effectivePrefix}face_asset_id'],
+ ),
+ isFavorite: attachedDatabase.typeMapping.read(
+ DriftSqlType.bool,
+ data['${effectivePrefix}is_favorite'],
+ )!,
+ isHidden: attachedDatabase.typeMapping.read(
+ DriftSqlType.bool,
+ data['${effectivePrefix}is_hidden'],
+ )!,
+ color: attachedDatabase.typeMapping.read(
+ DriftSqlType.string,
+ data['${effectivePrefix}color'],
+ ),
+ birthDate: attachedDatabase.typeMapping.read(
+ DriftSqlType.dateTime,
+ data['${effectivePrefix}birth_date'],
+ ),
+ );
+ }
+
+ @override
+ PersonEntity createAlias(String alias) {
+ return PersonEntity(attachedDatabase, alias);
+ }
+
+ @override
+ bool get withoutRowId => true;
+ @override
+ bool get isStrict => true;
+}
+
+class PersonEntityData extends DataClass
+ implements Insertable<PersonEntityData> {
+ final String id;
+ final DateTime createdAt;
+ final DateTime updatedAt;
+ final String ownerId;
+ final String name;
+ final String? faceAssetId;
+ final bool isFavorite;
+ final bool isHidden;
+ final String? color;
+ final DateTime? birthDate;
+ const PersonEntityData({
+ required this.id,
+ required this.createdAt,
+ required this.updatedAt,
+ required this.ownerId,
+ required this.name,
+ this.faceAssetId,
+ required this.isFavorite,
+ required this.isHidden,
+ this.color,
+ this.birthDate,
+ });
+ @override
+ Map<String, Expression> toColumns(bool nullToAbsent) {
+ final map = <String, Expression>{};
+ map['id'] = Variable<String>(id);
+ map['created_at'] = Variable<DateTime>(createdAt);
+ map['updated_at'] = Variable<DateTime>(updatedAt);
+ map['owner_id'] = Variable<String>(ownerId);
+ map['name'] = Variable<String>(name);
+ if (!nullToAbsent || faceAssetId != null) {
+ map['face_asset_id'] = Variable<String>(faceAssetId);
+ }
+ map['is_favorite'] = Variable<bool>(isFavorite);
+ map['is_hidden'] = Variable<bool>(isHidden);
+ if (!nullToAbsent || color != null) {
+ map['color'] = Variable<String>(color);
+ }
+ if (!nullToAbsent || birthDate != null) {
+ map['birth_date'] = Variable<DateTime>(birthDate);
+ }
+ return map;
+ }
+
+ factory PersonEntityData.fromJson(
+ Map<String, dynamic> json, {
+ ValueSerializer? serializer,
+ }) {
+ serializer ??= driftRuntimeOptions.defaultSerializer;
+ return PersonEntityData(
+ id: serializer.fromJson<String>(json['id']),
+ createdAt: serializer.fromJson<DateTime>(json['createdAt']),
+ updatedAt: serializer.fromJson<DateTime>(json['updatedAt']),
+ ownerId: serializer.fromJson<String>(json['ownerId']),
+ name: serializer.fromJson<String>(json['name']),
+ faceAssetId: serializer.fromJson<String?>(json['faceAssetId']),
+ isFavorite: serializer.fromJson<bool>(json['isFavorite']),
+ isHidden: serializer.fromJson<bool>(json['isHidden']),
+ color: serializer.fromJson<String?>(json['color']),
+ birthDate: serializer.fromJson<DateTime?>(json['birthDate']),
+ );
+ }
+ @override
+ Map<String, dynamic> toJson({ValueSerializer? serializer}) {
+ serializer ??= driftRuntimeOptions.defaultSerializer;
+ return <String, dynamic>{
+ 'id': serializer.toJson<String>(id),
+ 'createdAt': serializer.toJson<DateTime>(createdAt),
+ 'updatedAt': serializer.toJson<DateTime>(updatedAt),
+ 'ownerId': serializer.toJson<String>(ownerId),
+ 'name': serializer.toJson<String>(name),
+ 'faceAssetId': serializer.toJson<String?>(faceAssetId),
+ 'isFavorite': serializer.toJson<bool>(isFavorite),
+ 'isHidden': serializer.toJson<bool>(isHidden),
+ 'color': serializer.toJson<String?>(color),
+ 'birthDate': serializer.toJson<DateTime?>(birthDate),
+ };
+ }
+
+ PersonEntityData copyWith({
+ String? id,
+ DateTime? createdAt,
+ DateTime? updatedAt,
+ String? ownerId,
+ String? name,
+ Value<String?> faceAssetId = const Value.absent(),
+ bool? isFavorite,
+ bool? isHidden,
+ Value<String?> color = const Value.absent(),
+ Value<DateTime?> birthDate = const Value.absent(),
+ }) => PersonEntityData(
+ id: id ?? this.id,
+ createdAt: createdAt ?? this.createdAt,
+ updatedAt: updatedAt ?? this.updatedAt,
+ ownerId: ownerId ?? this.ownerId,
+ name: name ?? this.name,
+ faceAssetId: faceAssetId.present ? faceAssetId.value : this.faceAssetId,
+ isFavorite: isFavorite ?? this.isFavorite,
+ isHidden: isHidden ?? this.isHidden,
+ color: color.present ? color.value : this.color,
+ birthDate: birthDate.present ? birthDate.value : this.birthDate,
+ );
+ PersonEntityData copyWithCompanion(PersonEntityCompanion data) {
+ return PersonEntityData(
+ id: data.id.present ? data.id.value : this.id,
+ createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt,
+ updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt,
+ ownerId: data.ownerId.present ? data.ownerId.value : this.ownerId,
+ name: data.name.present ? data.name.value : this.name,
+ faceAssetId: data.faceAssetId.present
+ ? data.faceAssetId.value
+ : this.faceAssetId,
+ isFavorite: data.isFavorite.present
+ ? data.isFavorite.value
+ : this.isFavorite,
+ isHidden: data.isHidden.present ? data.isHidden.value : this.isHidden,
+ color: data.color.present ? data.color.value : this.color,
+ birthDate: data.birthDate.present ? data.birthDate.value : this.birthDate,
+ );
+ }
+
+ @override
+ String toString() {
+ return (StringBuffer('PersonEntityData(')
+ ..write('id: $id, ')
+ ..write('createdAt: $createdAt, ')
+ ..write('updatedAt: $updatedAt, ')
+ ..write('ownerId: $ownerId, ')
+ ..write('name: $name, ')
+ ..write('faceAssetId: $faceAssetId, ')
+ ..write('isFavorite: $isFavorite, ')
+ ..write('isHidden: $isHidden, ')
+ ..write('color: $color, ')
+ ..write('birthDate: $birthDate')
+ ..write(')'))
+ .toString();
+ }
+
+ @override
+ int get hashCode => Object.hash(
+ id,
+ createdAt,
+ updatedAt,
+ ownerId,
+ name,
+ faceAssetId,
+ isFavorite,
+ isHidden,
+ color,
+ birthDate,
+ );
+ @override
+ bool operator ==(Object other) =>
+ identical(this, other) ||
+ (other is PersonEntityData &&
+ other.id == this.id &&
+ other.createdAt == this.createdAt &&
+ other.updatedAt == this.updatedAt &&
+ other.ownerId == this.ownerId &&
+ other.name == this.name &&
+ other.faceAssetId == this.faceAssetId &&
+ other.isFavorite == this.isFavorite &&
+ other.isHidden == this.isHidden &&
+ other.color == this.color &&
+ other.birthDate == this.birthDate);
+}
+
+class PersonEntityCompanion extends UpdateCompanion<PersonEntityData> {
+ final Value<String> id;
+ final Value<DateTime> createdAt;
+ final Value<DateTime> updatedAt;
+ final Value<String> ownerId;
+ final Value<String> name;
+ final Value<String?> faceAssetId;
+ final Value<bool> isFavorite;
+ final Value<bool> isHidden;
+ final Value<String?> color;
+ final Value<DateTime?> birthDate;
+ const PersonEntityCompanion({
+ this.id = const Value.absent(),
+ this.createdAt = const Value.absent(),
+ this.updatedAt = const Value.absent(),
+ this.ownerId = const Value.absent(),
+ this.name = const Value.absent(),
+ this.faceAssetId = const Value.absent(),
+ this.isFavorite = const Value.absent(),
+ this.isHidden = const Value.absent(),
+ this.color = const Value.absent(),
+ this.birthDate = const Value.absent(),
+ });
+ PersonEntityCompanion.insert({
+ required String id,
+ this.createdAt = const Value.absent(),
+ this.updatedAt = const Value.absent(),
+ required String ownerId,
+ required String name,
+ this.faceAssetId = const Value.absent(),
+ required bool isFavorite,
+ required bool isHidden,
+ this.color = const Value.absent(),
+ this.birthDate = const Value.absent(),
+ }) : id = Value(id),
+ ownerId = Value(ownerId),
+ name = Value(name),
+ isFavorite = Value(isFavorite),
+ isHidden = Value(isHidden);
+ static Insertable<PersonEntityData> custom({
+ Expression<String>? id,
+ Expression<DateTime>? createdAt,
+ Expression<DateTime>? updatedAt,
+ Expression<String>? ownerId,
+ Expression<String>? name,
+ Expression<String>? faceAssetId,
+ Expression<bool>? isFavorite,
+ Expression<bool>? isHidden,
+ Expression<String>? color,
+ Expression<DateTime>? birthDate,
+ }) {
+ return RawValuesInsertable({
+ if (id != null) 'id': id,
+ if (createdAt != null) 'created_at': createdAt,
+ if (updatedAt != null) 'updated_at': updatedAt,
+ if (ownerId != null) 'owner_id': ownerId,
+ if (name != null) 'name': name,
+ if (faceAssetId != null) 'face_asset_id': faceAssetId,
+ if (isFavorite != null) 'is_favorite': isFavorite,
+ if (isHidden != null) 'is_hidden': isHidden,
+ if (color != null) 'color': color,
+ if (birthDate != null) 'birth_date': birthDate,
+ });
+ }
+
+ PersonEntityCompanion copyWith({
+ Value<String>? id,
+ Value<DateTime>? createdAt,
+ Value<DateTime>? updatedAt,
+ Value<String>? ownerId,
+ Value<String>? name,
+ Value<String?>? faceAssetId,
+ Value<bool>? isFavorite,
+ Value<bool>? isHidden,
+ Value<String?>? color,
+ Value<DateTime?>? birthDate,
+ }) {
+ return PersonEntityCompanion(
+ id: id ?? this.id,
+ createdAt: createdAt ?? this.createdAt,
+ updatedAt: updatedAt ?? this.updatedAt,
+ ownerId: ownerId ?? this.ownerId,
+ name: name ?? this.name,
+ faceAssetId: faceAssetId ?? this.faceAssetId,
+ isFavorite: isFavorite ?? this.isFavorite,
+ isHidden: isHidden ?? this.isHidden,
+ color: color ?? this.color,
+ birthDate: birthDate ?? this.birthDate,
+ );
+ }
+
+ @override
+ Map<String, Expression> toColumns(bool nullToAbsent) {
+ final map = <String, Expression>{};
+ if (id.present) {
+ map['id'] = Variable<String>(id.value);
+ }
+ if (createdAt.present) {
+ map['created_at'] = Variable<DateTime>(createdAt.value);
+ }
+ if (updatedAt.present) {
+ map['updated_at'] = Variable<DateTime>(updatedAt.value);
+ }
+ if (ownerId.present) {
+ map['owner_id'] = Variable<String>(ownerId.value);
+ }
+ if (name.present) {
+ map['name'] = Variable<String>(name.value);
+ }
+ if (faceAssetId.present) {
+ map['face_asset_id'] = Variable<String>(faceAssetId.value);
+ }
+ if (isFavorite.present) {
+ map['is_favorite'] = Variable<bool>(isFavorite.value);
+ }
+ if (isHidden.present) {
+ map['is_hidden'] = Variable<bool>(isHidden.value);
+ }
+ if (color.present) {
+ map['color'] = Variable<String>(color.value);
+ }
+ if (birthDate.present) {
+ map['birth_date'] = Variable<DateTime>(birthDate.value);
+ }
+ return map;
+ }
+
+ @override
+ String toString() {
+ return (StringBuffer('PersonEntityCompanion(')
+ ..write('id: $id, ')
+ ..write('createdAt: $createdAt, ')
+ ..write('updatedAt: $updatedAt, ')
+ ..write('ownerId: $ownerId, ')
+ ..write('name: $name, ')
+ ..write('faceAssetId: $faceAssetId, ')
+ ..write('isFavorite: $isFavorite, ')
+ ..write('isHidden: $isHidden, ')
+ ..write('color: $color, ')
+ ..write('birthDate: $birthDate')
+ ..write(')'))
+ .toString();
+ }
+}
+
+class AssetFaceEntity extends Table
+ with TableInfo<AssetFaceEntity, AssetFaceEntityData> {
+ @override
+ final GeneratedDatabase attachedDatabase;
+ final String? _alias;
+ AssetFaceEntity(this.attachedDatabase, [this._alias]);
+ late final GeneratedColumn<String> id = GeneratedColumn<String>(
+ 'id',
+ aliasedName,
+ false,
+ type: DriftSqlType.string,
+ requiredDuringInsert: true,
+ );
+ late final GeneratedColumn<String> assetId = GeneratedColumn<String>(
+ 'asset_id',
+ aliasedName,
+ false,
+ type: DriftSqlType.string,
+ requiredDuringInsert: true,
+ defaultConstraints: GeneratedColumn.constraintIsAlways(
+ 'REFERENCES remote_asset_entity (id) ON DELETE CASCADE',
+ ),
+ );
+ late final GeneratedColumn<String> personId = GeneratedColumn<String>(
+ 'person_id',
+ aliasedName,
+ true,
+ type: DriftSqlType.string,
+ requiredDuringInsert: false,
+ defaultConstraints: GeneratedColumn.constraintIsAlways(
+ 'REFERENCES person_entity (id) ON DELETE SET NULL',
+ ),
+ );
+ late final GeneratedColumn<int> imageWidth = GeneratedColumn<int>(
+ 'image_width',
+ aliasedName,
+ false,
+ type: DriftSqlType.int,
+ requiredDuringInsert: true,
+ );
+ late final GeneratedColumn<int> imageHeight = GeneratedColumn<int>(
+ 'image_height',
+ aliasedName,
+ false,
+ type: DriftSqlType.int,
+ requiredDuringInsert: true,
+ );
+ late final GeneratedColumn<int> boundingBoxX1 = GeneratedColumn<int>(
+ 'bounding_box_x1',
+ aliasedName,
+ false,
+ type: DriftSqlType.int,
+ requiredDuringInsert: true,
+ );
+ late final GeneratedColumn<int> boundingBoxY1 = GeneratedColumn<int>(
+ 'bounding_box_y1',
+ aliasedName,
+ false,
+ type: DriftSqlType.int,
+ requiredDuringInsert: true,
+ );
+ late final GeneratedColumn<int> boundingBoxX2 = GeneratedColumn<int>(
+ 'bounding_box_x2',
+ aliasedName,
+ false,
+ type: DriftSqlType.int,
+ requiredDuringInsert: true,
+ );
+ late final GeneratedColumn<int> boundingBoxY2 = GeneratedColumn<int>(
+ 'bounding_box_y2',
+ aliasedName,
+ false,
+ type: DriftSqlType.int,
+ requiredDuringInsert: true,
+ );
+ late final GeneratedColumn<String> sourceType = GeneratedColumn<String>(
+ 'source_type',
+ aliasedName,
+ false,
+ type: DriftSqlType.string,
+ requiredDuringInsert: true,
+ );
+ @override
+ List<GeneratedColumn> get $columns => [
+ id,
+ assetId,
+ personId,
+ imageWidth,
+ imageHeight,
+ boundingBoxX1,
+ boundingBoxY1,
+ boundingBoxX2,
+ boundingBoxY2,
+ sourceType,
+ ];
+ @override
+ String get aliasedName => _alias ?? actualTableName;
+ @override
+ String get actualTableName => $name;
+ static const String $name = 'asset_face_entity';
+ @override
+ Set<GeneratedColumn> get $primaryKey => {id};
+ @override
+ AssetFaceEntityData map(Map<String, dynamic> data, {String? tablePrefix}) {
+ final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : '';
+ return AssetFaceEntityData(
+ id: attachedDatabase.typeMapping.read(
+ DriftSqlType.string,
+ data['${effectivePrefix}id'],
+ )!,
+ assetId: attachedDatabase.typeMapping.read(
+ DriftSqlType.string,
+ data['${effectivePrefix}asset_id'],
+ )!,
+ personId: attachedDatabase.typeMapping.read(
+ DriftSqlType.string,
+ data['${effectivePrefix}person_id'],
+ ),
+ imageWidth: attachedDatabase.typeMapping.read(
+ DriftSqlType.int,
+ data['${effectivePrefix}image_width'],
+ )!,
+ imageHeight: attachedDatabase.typeMapping.read(
+ DriftSqlType.int,
+ data['${effectivePrefix}image_height'],
+ )!,
+ boundingBoxX1: attachedDatabase.typeMapping.read(
+ DriftSqlType.int,
+ data['${effectivePrefix}bounding_box_x1'],
+ )!,
+ boundingBoxY1: attachedDatabase.typeMapping.read(
+ DriftSqlType.int,
+ data['${effectivePrefix}bounding_box_y1'],
+ )!,
+ boundingBoxX2: attachedDatabase.typeMapping.read(
+ DriftSqlType.int,
+ data['${effectivePrefix}bounding_box_x2'],
+ )!,
+ boundingBoxY2: attachedDatabase.typeMapping.read(
+ DriftSqlType.int,
+ data['${effectivePrefix}bounding_box_y2'],
+ )!,
+ sourceType: attachedDatabase.typeMapping.read(
+ DriftSqlType.string,
+ data['${effectivePrefix}source_type'],
+ )!,
+ );
+ }
+
+ @override
+ AssetFaceEntity createAlias(String alias) {
+ return AssetFaceEntity(attachedDatabase, alias);
+ }
+
+ @override
+ bool get withoutRowId => true;
+ @override
+ bool get isStrict => true;
+}
+
+class AssetFaceEntityData extends DataClass
+ implements Insertable<AssetFaceEntityData> {
+ final String id;
+ final String assetId;
+ final String? personId;
+ final int imageWidth;
+ final int imageHeight;
+ final int boundingBoxX1;
+ final int boundingBoxY1;
+ final int boundingBoxX2;
+ final int boundingBoxY2;
+ final String sourceType;
+ const AssetFaceEntityData({
+ required this.id,
+ required this.assetId,
+ this.personId,
+ required this.imageWidth,
+ required this.imageHeight,
+ required this.boundingBoxX1,
+ required this.boundingBoxY1,
+ required this.boundingBoxX2,
+ required this.boundingBoxY2,
+ required this.sourceType,
+ });
+ @override
+ Map<String, Expression> toColumns(bool nullToAbsent) {
+ final map = <String, Expression>{};
+ map['id'] = Variable<String>(id);
+ map['asset_id'] = Variable<String>(assetId);
+ if (!nullToAbsent || personId != null) {
+ map['person_id'] = Variable<String>(personId);
+ }
+ map['image_width'] = Variable<int>(imageWidth);
+ map['image_height'] = Variable<int>(imageHeight);
+ map['bounding_box_x1'] = Variable<int>(boundingBoxX1);
+ map['bounding_box_y1'] = Variable<int>(boundingBoxY1);
+ map['bounding_box_x2'] = Variable<int>(boundingBoxX2);
+ map['bounding_box_y2'] = Variable<int>(boundingBoxY2);
+ map['source_type'] = Variable<String>(sourceType);
+ return map;
+ }
+
+ factory AssetFaceEntityData.fromJson(
+ Map<String, dynamic> json, {
+ ValueSerializer? serializer,
+ }) {
+ serializer ??= driftRuntimeOptions.defaultSerializer;
+ return AssetFaceEntityData(
+ id: serializer.fromJson<String>(json['id']),
+ assetId: serializer.fromJson<String>(json['assetId']),
+ personId: serializer.fromJson<String?>(json['personId']),
+ imageWidth: serializer.fromJson<int>(json['imageWidth']),
+ imageHeight: serializer.fromJson<int>(json['imageHeight']),
+ boundingBoxX1: serializer.fromJson<int>(json['boundingBoxX1']),
+ boundingBoxY1: serializer.fromJson<int>(json['boundingBoxY1']),
+ boundingBoxX2: serializer.fromJson<int>(json['boundingBoxX2']),
+ boundingBoxY2: serializer.fromJson<int>(json['boundingBoxY2']),
+ sourceType: serializer.fromJson<String>(json['sourceType']),
+ );
+ }
+ @override
+ Map<String, dynamic> toJson({ValueSerializer? serializer}) {
+ serializer ??= driftRuntimeOptions.defaultSerializer;
+ return <String, dynamic>{
+ 'id': serializer.toJson<String>(id),
+ 'assetId': serializer.toJson<String>(assetId),
+ 'personId': serializer.toJson<String?>(personId),
+ 'imageWidth': serializer.toJson<int>(imageWidth),
+ 'imageHeight': serializer.toJson<int>(imageHeight),
+ 'boundingBoxX1': serializer.toJson<int>(boundingBoxX1),
+ 'boundingBoxY1': serializer.toJson<int>(boundingBoxY1),
+ 'boundingBoxX2': serializer.toJson<int>(boundingBoxX2),
+ 'boundingBoxY2': serializer.toJson<int>(boundingBoxY2),
+ 'sourceType': serializer.toJson<String>(sourceType),
+ };
+ }
+
+ AssetFaceEntityData copyWith({
+ String? id,
+ String? assetId,
+ Value<String?> personId = const Value.absent(),
+ int? imageWidth,
+ int? imageHeight,
+ int? boundingBoxX1,
+ int? boundingBoxY1,
+ int? boundingBoxX2,
+ int? boundingBoxY2,
+ String? sourceType,
+ }) => AssetFaceEntityData(
+ id: id ?? this.id,
+ assetId: assetId ?? this.assetId,
+ personId: personId.present ? personId.value : this.personId,
+ imageWidth: imageWidth ?? this.imageWidth,
+ imageHeight: imageHeight ?? this.imageHeight,
+ boundingBoxX1: boundingBoxX1 ?? this.boundingBoxX1,
+ boundingBoxY1: boundingBoxY1 ?? this.boundingBoxY1,
+ boundingBoxX2: boundingBoxX2 ?? this.boundingBoxX2,
+ boundingBoxY2: boundingBoxY2 ?? this.boundingBoxY2,
+ sourceType: sourceType ?? this.sourceType,
+ );
+ AssetFaceEntityData copyWithCompanion(AssetFaceEntityCompanion data) {
+ return AssetFaceEntityData(
+ id: data.id.present ? data.id.value : this.id,
+ assetId: data.assetId.present ? data.assetId.value : this.assetId,
+ personId: data.personId.present ? data.personId.value : this.personId,
+ imageWidth: data.imageWidth.present
+ ? data.imageWidth.value
+ : this.imageWidth,
+ imageHeight: data.imageHeight.present
+ ? data.imageHeight.value
+ : this.imageHeight,
+ boundingBoxX1: data.boundingBoxX1.present
+ ? data.boundingBoxX1.value
+ : this.boundingBoxX1,
+ boundingBoxY1: data.boundingBoxY1.present
+ ? data.boundingBoxY1.value
+ : this.boundingBoxY1,
+ boundingBoxX2: data.boundingBoxX2.present
+ ? data.boundingBoxX2.value
+ : this.boundingBoxX2,
+ boundingBoxY2: data.boundingBoxY2.present
+ ? data.boundingBoxY2.value
+ : this.boundingBoxY2,
+ sourceType: data.sourceType.present
+ ? data.sourceType.value
+ : this.sourceType,
+ );
+ }
+
+ @override
+ String toString() {
+ return (StringBuffer('AssetFaceEntityData(')
+ ..write('id: $id, ')
+ ..write('assetId: $assetId, ')
+ ..write('personId: $personId, ')
+ ..write('imageWidth: $imageWidth, ')
+ ..write('imageHeight: $imageHeight, ')
+ ..write('boundingBoxX1: $boundingBoxX1, ')
+ ..write('boundingBoxY1: $boundingBoxY1, ')
+ ..write('boundingBoxX2: $boundingBoxX2, ')
+ ..write('boundingBoxY2: $boundingBoxY2, ')
+ ..write('sourceType: $sourceType')
+ ..write(')'))
+ .toString();
+ }
+
+ @override
+ int get hashCode => Object.hash(
+ id,
+ assetId,
+ personId,
+ imageWidth,
+ imageHeight,
+ boundingBoxX1,
+ boundingBoxY1,
+ boundingBoxX2,
+ boundingBoxY2,
+ sourceType,
+ );
+ @override
+ bool operator ==(Object other) =>
+ identical(this, other) ||
+ (other is AssetFaceEntityData &&
+ other.id == this.id &&
+ other.assetId == this.assetId &&
+ other.personId == this.personId &&
+ other.imageWidth == this.imageWidth &&
+ other.imageHeight == this.imageHeight &&
+ other.boundingBoxX1 == this.boundingBoxX1 &&
+ other.boundingBoxY1 == this.boundingBoxY1 &&
+ other.boundingBoxX2 == this.boundingBoxX2 &&
+ other.boundingBoxY2 == this.boundingBoxY2 &&
+ other.sourceType == this.sourceType);
+}
+
+class AssetFaceEntityCompanion extends UpdateCompanion<AssetFaceEntityData> {
+ final Value<String> id;
+ final Value<String> assetId;
+ final Value<String?> personId;
+ final Value<int> imageWidth;
+ final Value<int> imageHeight;
+ final Value<int> boundingBoxX1;
+ final Value<int> boundingBoxY1;
+ final Value<int> boundingBoxX2;
+ final Value<int> boundingBoxY2;
+ final Value<String> sourceType;
+ const AssetFaceEntityCompanion({
+ this.id = const Value.absent(),
+ this.assetId = const Value.absent(),
+ this.personId = const Value.absent(),
+ this.imageWidth = const Value.absent(),
+ this.imageHeight = const Value.absent(),
+ this.boundingBoxX1 = const Value.absent(),
+ this.boundingBoxY1 = const Value.absent(),
+ this.boundingBoxX2 = const Value.absent(),
+ this.boundingBoxY2 = const Value.absent(),
+ this.sourceType = const Value.absent(),
+ });
+ AssetFaceEntityCompanion.insert({
+ required String id,
+ required String assetId,
+ this.personId = const Value.absent(),
+ required int imageWidth,
+ required int imageHeight,
+ required int boundingBoxX1,
+ required int boundingBoxY1,
+ required int boundingBoxX2,
+ required int boundingBoxY2,
+ required String sourceType,
+ }) : id = Value(id),
+ assetId = Value(assetId),
+ imageWidth = Value(imageWidth),
+ imageHeight = Value(imageHeight),
+ boundingBoxX1 = Value(boundingBoxX1),
+ boundingBoxY1 = Value(boundingBoxY1),
+ boundingBoxX2 = Value(boundingBoxX2),
+ boundingBoxY2 = Value(boundingBoxY2),
+ sourceType = Value(sourceType);
+ static Insertable<AssetFaceEntityData> custom({
+ Expression<String>? id,
+ Expression<String>? assetId,
+ Expression<String>? personId,
+ Expression<int>? imageWidth,
+ Expression<int>? imageHeight,
+ Expression<int>? boundingBoxX1,
+ Expression<int>? boundingBoxY1,
+ Expression<int>? boundingBoxX2,
+ Expression<int>? boundingBoxY2,
+ Expression<String>? sourceType,
+ }) {
+ return RawValuesInsertable({
+ if (id != null) 'id': id,
+ if (assetId != null) 'asset_id': assetId,
+ if (personId != null) 'person_id': personId,
+ if (imageWidth != null) 'image_width': imageWidth,
+ if (imageHeight != null) 'image_height': imageHeight,
+ if (boundingBoxX1 != null) 'bounding_box_x1': boundingBoxX1,
+ if (boundingBoxY1 != null) 'bounding_box_y1': boundingBoxY1,
+ if (boundingBoxX2 != null) 'bounding_box_x2': boundingBoxX2,
+ if (boundingBoxY2 != null) 'bounding_box_y2': boundingBoxY2,
+ if (sourceType != null) 'source_type': sourceType,
+ });
+ }
+
+ AssetFaceEntityCompanion copyWith({
+ Value<String>? id,
+ Value<String>? assetId,
+ Value<String?>? personId,
+ Value<int>? imageWidth,
+ Value<int>? imageHeight,
+ Value<int>? boundingBoxX1,
+ Value<int>? boundingBoxY1,
+ Value<int>? boundingBoxX2,
+ Value<int>? boundingBoxY2,
+ Value<String>? sourceType,
+ }) {
+ return AssetFaceEntityCompanion(
+ id: id ?? this.id,
+ assetId: assetId ?? this.assetId,
+ personId: personId ?? this.personId,
+ imageWidth: imageWidth ?? this.imageWidth,
+ imageHeight: imageHeight ?? this.imageHeight,
+ boundingBoxX1: boundingBoxX1 ?? this.boundingBoxX1,
+ boundingBoxY1: boundingBoxY1 ?? this.boundingBoxY1,
+ boundingBoxX2: boundingBoxX2 ?? this.boundingBoxX2,
+ boundingBoxY2: boundingBoxY2 ?? this.boundingBoxY2,
+ sourceType: sourceType ?? this.sourceType,
+ );
+ }
+
+ @override
+ Map<String, Expression> toColumns(bool nullToAbsent) {
+ final map = <String, Expression>{};
+ if (id.present) {
+ map['id'] = Variable<String>(id.value);
+ }
+ if (assetId.present) {
+ map['asset_id'] = Variable<String>(assetId.value);
+ }
+ if (personId.present) {
+ map['person_id'] = Variable<String>(personId.value);
+ }
+ if (imageWidth.present) {
+ map['image_width'] = Variable<int>(imageWidth.value);
+ }
+ if (imageHeight.present) {
+ map['image_height'] = Variable<int>(imageHeight.value);
+ }
+ if (boundingBoxX1.present) {
+ map['bounding_box_x1'] = Variable<int>(boundingBoxX1.value);
+ }
+ if (boundingBoxY1.present) {
+ map['bounding_box_y1'] = Variable<int>(boundingBoxY1.value);
+ }
+ if (boundingBoxX2.present) {
+ map['bounding_box_x2'] = Variable<int>(boundingBoxX2.value);
+ }
+ if (boundingBoxY2.present) {
+ map['bounding_box_y2'] = Variable<int>(boundingBoxY2.value);
+ }
+ if (sourceType.present) {
+ map['source_type'] = Variable<String>(sourceType.value);
+ }
+ return map;
+ }
+
+ @override
+ String toString() {
+ return (StringBuffer('AssetFaceEntityCompanion(')
+ ..write('id: $id, ')
+ ..write('assetId: $assetId, ')
+ ..write('personId: $personId, ')
+ ..write('imageWidth: $imageWidth, ')
+ ..write('imageHeight: $imageHeight, ')
+ ..write('boundingBoxX1: $boundingBoxX1, ')
+ ..write('boundingBoxY1: $boundingBoxY1, ')
+ ..write('boundingBoxX2: $boundingBoxX2, ')
+ ..write('boundingBoxY2: $boundingBoxY2, ')
+ ..write('sourceType: $sourceType')
+ ..write(')'))
+ .toString();
+ }
+}
+
+class StoreEntity extends Table with TableInfo<StoreEntity, StoreEntityData> {
+ @override
+ final GeneratedDatabase attachedDatabase;
+ final String? _alias;
+ StoreEntity(this.attachedDatabase, [this._alias]);
+ late final GeneratedColumn<int> id = GeneratedColumn<int>(
+ 'id',
+ aliasedName,
+ false,
+ type: DriftSqlType.int,
+ requiredDuringInsert: true,
+ );
+ late final GeneratedColumn<String> stringValue = GeneratedColumn<String>(
+ 'string_value',
+ aliasedName,
+ true,
+ type: DriftSqlType.string,
+ requiredDuringInsert: false,
+ );
+ late final GeneratedColumn<int> intValue = GeneratedColumn<int>(
+ 'int_value',
+ aliasedName,
+ true,
+ type: DriftSqlType.int,
+ requiredDuringInsert: false,
+ );
+ @override
+ List<GeneratedColumn> get $columns => [id, stringValue, intValue];
+ @override
+ String get aliasedName => _alias ?? actualTableName;
+ @override
+ String get actualTableName => $name;
+ static const String $name = 'store_entity';
+ @override
+ Set<GeneratedColumn> get $primaryKey => {id};
+ @override
+ StoreEntityData map(Map<String, dynamic> data, {String? tablePrefix}) {
+ final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : '';
+ return StoreEntityData(
+ id: attachedDatabase.typeMapping.read(
+ DriftSqlType.int,
+ data['${effectivePrefix}id'],
+ )!,
+ stringValue: attachedDatabase.typeMapping.read(
+ DriftSqlType.string,
+ data['${effectivePrefix}string_value'],
+ ),
+ intValue: attachedDatabase.typeMapping.read(
+ DriftSqlType.int,
+ data['${effectivePrefix}int_value'],
+ ),
+ );
+ }
+
+ @override
+ StoreEntity createAlias(String alias) {
+ return StoreEntity(attachedDatabase, alias);
+ }
+
+ @override
+ bool get withoutRowId => true;
+ @override
+ bool get isStrict => true;
+}
+
+class StoreEntityData extends DataClass implements Insertable<StoreEntityData> {
+ final int id;
+ final String? stringValue;
+ final int? intValue;
+ const StoreEntityData({required this.id, this.stringValue, this.intValue});
+ @override
+ Map<String, Expression> toColumns(bool nullToAbsent) {
+ final map = <String, Expression>{};
+ map['id'] = Variable<int>(id);
+ if (!nullToAbsent || stringValue != null) {
+ map['string_value'] = Variable<String>(stringValue);
+ }
+ if (!nullToAbsent || intValue != null) {
+ map['int_value'] = Variable<int>(intValue);
+ }
+ return map;
+ }
+
+ factory StoreEntityData.fromJson(
+ Map<String, dynamic> json, {
+ ValueSerializer? serializer,
+ }) {
+ serializer ??= driftRuntimeOptions.defaultSerializer;
+ return StoreEntityData(
+ id: serializer.fromJson<int>(json['id']),
+ stringValue: serializer.fromJson<String?>(json['stringValue']),
+ intValue: serializer.fromJson<int?>(json['intValue']),
+ );
+ }
+ @override
+ Map<String, dynamic> toJson({ValueSerializer? serializer}) {
+ serializer ??= driftRuntimeOptions.defaultSerializer;
+ return <String, dynamic>{
+ 'id': serializer.toJson<int>(id),
+ 'stringValue': serializer.toJson<String?>(stringValue),
+ 'intValue': serializer.toJson<int?>(intValue),
+ };
+ }
+
+ StoreEntityData copyWith({
+ int? id,
+ Value<String?> stringValue = const Value.absent(),
+ Value<int?> intValue = const Value.absent(),
+ }) => StoreEntityData(
+ id: id ?? this.id,
+ stringValue: stringValue.present ? stringValue.value : this.stringValue,
+ intValue: intValue.present ? intValue.value : this.intValue,
+ );
+ StoreEntityData copyWithCompanion(StoreEntityCompanion data) {
+ return StoreEntityData(
+ id: data.id.present ? data.id.value : this.id,
+ stringValue: data.stringValue.present
+ ? data.stringValue.value
+ : this.stringValue,
+ intValue: data.intValue.present ? data.intValue.value : this.intValue,
+ );
+ }
+
+ @override
+ String toString() {
+ return (StringBuffer('StoreEntityData(')
+ ..write('id: $id, ')
+ ..write('stringValue: $stringValue, ')
+ ..write('intValue: $intValue')
+ ..write(')'))
+ .toString();
+ }
+
+ @override
+ int get hashCode => Object.hash(id, stringValue, intValue);
+ @override
+ bool operator ==(Object other) =>
+ identical(this, other) ||
+ (other is StoreEntityData &&
+ other.id == this.id &&
+ other.stringValue == this.stringValue &&
+ other.intValue == this.intValue);
+}
+
+class StoreEntityCompanion extends UpdateCompanion<StoreEntityData> {
+ final Value<int> id;
+ final Value<String?> stringValue;
+ final Value<int?> intValue;
+ const StoreEntityCompanion({
+ this.id = const Value.absent(),
+ this.stringValue = const Value.absent(),
+ this.intValue = const Value.absent(),
+ });
+ StoreEntityCompanion.insert({
+ required int id,
+ this.stringValue = const Value.absent(),
+ this.intValue = const Value.absent(),
+ }) : id = Value(id);
+ static Insertable<StoreEntityData> custom({
+ Expression<int>? id,
+ Expression<String>? stringValue,
+ Expression<int>? intValue,
+ }) {
+ return RawValuesInsertable({
+ if (id != null) 'id': id,
+ if (stringValue != null) 'string_value': stringValue,
+ if (intValue != null) 'int_value': intValue,
+ });
+ }
+
+ StoreEntityCompanion copyWith({
+ Value<int>? id,
+ Value<String?>? stringValue,
+ Value<int?>? intValue,
+ }) {
+ return StoreEntityCompanion(
+ id: id ?? this.id,
+ stringValue: stringValue ?? this.stringValue,
+ intValue: intValue ?? this.intValue,
+ );
+ }
+
+ @override
+ Map<String, Expression> toColumns(bool nullToAbsent) {
+ final map = <String, Expression>{};
+ if (id.present) {
+ map['id'] = Variable<int>(id.value);
+ }
+ if (stringValue.present) {
+ map['string_value'] = Variable<String>(stringValue.value);
+ }
+ if (intValue.present) {
+ map['int_value'] = Variable<int>(intValue.value);
+ }
+ return map;
+ }
+
+ @override
+ String toString() {
+ return (StringBuffer('StoreEntityCompanion(')
+ ..write('id: $id, ')
+ ..write('stringValue: $stringValue, ')
+ ..write('intValue: $intValue')
+ ..write(')'))
+ .toString();
+ }
+}
+
+class TrashedLocalAssetEntity extends Table
+ with TableInfo<TrashedLocalAssetEntity, TrashedLocalAssetEntityData> {
+ @override
+ final GeneratedDatabase attachedDatabase;
+ final String? _alias;
+ TrashedLocalAssetEntity(this.attachedDatabase, [this._alias]);
+ late final GeneratedColumn<String> name = GeneratedColumn<String>(
+ 'name',
+ aliasedName,
+ false,
+ type: DriftSqlType.string,
+ requiredDuringInsert: true,
+ );
+ late final GeneratedColumn<int> type = GeneratedColumn<int>(
+ 'type',
+ aliasedName,
+ false,
+ type: DriftSqlType.int,
+ requiredDuringInsert: true,
+ );
+ late final GeneratedColumn<DateTime> createdAt = GeneratedColumn<DateTime>(
+ 'created_at',
+ aliasedName,
+ false,
+ type: DriftSqlType.dateTime,
+ requiredDuringInsert: false,
+ defaultValue: const CustomExpression('CURRENT_TIMESTAMP'),
+ );
+ late final GeneratedColumn<DateTime> updatedAt = GeneratedColumn<DateTime>(
+ 'updated_at',
+ aliasedName,
+ false,
+ type: DriftSqlType.dateTime,
+ requiredDuringInsert: false,
+ defaultValue: const CustomExpression('CURRENT_TIMESTAMP'),
+ );
+ late final GeneratedColumn<int> width = GeneratedColumn<int>(
+ 'width',
+ aliasedName,
+ true,
+ type: DriftSqlType.int,
+ requiredDuringInsert: false,
+ );
+ late final GeneratedColumn<int> height = GeneratedColumn<int>(
+ 'height',
+ aliasedName,
+ true,
+ type: DriftSqlType.int,
+ requiredDuringInsert: false,
+ );
+ late final GeneratedColumn<int> durationInSeconds = GeneratedColumn<int>(
+ 'duration_in_seconds',
+ aliasedName,
+ true,
+ type: DriftSqlType.int,
+ requiredDuringInsert: false,
+ );
+ late final GeneratedColumn<String> id = GeneratedColumn<String>(
+ 'id',
+ aliasedName,
+ false,
+ type: DriftSqlType.string,
+ requiredDuringInsert: true,
+ );
+ late final GeneratedColumn<String> albumId = GeneratedColumn<String>(
+ 'album_id',
+ aliasedName,
+ false,
+ type: DriftSqlType.string,
+ requiredDuringInsert: true,
+ );
+ late final GeneratedColumn<String> checksum = GeneratedColumn<String>(
+ 'checksum',
+ aliasedName,
+ true,
+ type: DriftSqlType.string,
+ requiredDuringInsert: false,
+ );
+ late final GeneratedColumn<bool> isFavorite = GeneratedColumn<bool>(
+ 'is_favorite',
+ aliasedName,
+ false,
+ type: DriftSqlType.bool,
+ requiredDuringInsert: false,
+ defaultConstraints: GeneratedColumn.constraintIsAlways(
+ 'CHECK ("is_favorite" IN (0, 1))',
+ ),
+ defaultValue: const CustomExpression('0'),
+ );
+ late final GeneratedColumn<int> orientation = GeneratedColumn<int>(
+ 'orientation',
+ aliasedName,
+ false,
+ type: DriftSqlType.int,
+ requiredDuringInsert: false,
+ defaultValue: const CustomExpression('0'),
+ );
+ late final GeneratedColumn<int> source = GeneratedColumn<int>(
+ 'source',
+ aliasedName,
+ false,
+ type: DriftSqlType.int,
+ requiredDuringInsert: true,
+ );
+ @override
+ List<GeneratedColumn> get $columns => [
+ name,
+ type,
+ createdAt,
+ updatedAt,
+ width,
+ height,
+ durationInSeconds,
+ id,
+ albumId,
+ checksum,
+ isFavorite,
+ orientation,
+ source,
+ ];
+ @override
+ String get aliasedName => _alias ?? actualTableName;
+ @override
+ String get actualTableName => $name;
+ static const String $name = 'trashed_local_asset_entity';
+ @override
+ Set<GeneratedColumn> get $primaryKey => {id, albumId};
+ @override
+ TrashedLocalAssetEntityData map(
+ Map<String, dynamic> data, {
+ String? tablePrefix,
+ }) {
+ final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : '';
+ return TrashedLocalAssetEntityData(
+ name: attachedDatabase.typeMapping.read(
+ DriftSqlType.string,
+ data['${effectivePrefix}name'],
+ )!,
+ type: attachedDatabase.typeMapping.read(
+ DriftSqlType.int,
+ data['${effectivePrefix}type'],
+ )!,
+ createdAt: attachedDatabase.typeMapping.read(
+ DriftSqlType.dateTime,
+ data['${effectivePrefix}created_at'],
+ )!,
+ updatedAt: attachedDatabase.typeMapping.read(
+ DriftSqlType.dateTime,
+ data['${effectivePrefix}updated_at'],
+ )!,
+ width: attachedDatabase.typeMapping.read(
+ DriftSqlType.int,
+ data['${effectivePrefix}width'],
+ ),
+ height: attachedDatabase.typeMapping.read(
+ DriftSqlType.int,
+ data['${effectivePrefix}height'],
+ ),
+ durationInSeconds: attachedDatabase.typeMapping.read(
+ DriftSqlType.int,
+ data['${effectivePrefix}duration_in_seconds'],
+ ),
+ id: attachedDatabase.typeMapping.read(
+ DriftSqlType.string,
+ data['${effectivePrefix}id'],
+ )!,
+ albumId: attachedDatabase.typeMapping.read(
+ DriftSqlType.string,
+ data['${effectivePrefix}album_id'],
+ )!,
+ checksum: attachedDatabase.typeMapping.read(
+ DriftSqlType.string,
+ data['${effectivePrefix}checksum'],
+ ),
+ isFavorite: attachedDatabase.typeMapping.read(
+ DriftSqlType.bool,
+ data['${effectivePrefix}is_favorite'],
+ )!,
+ orientation: attachedDatabase.typeMapping.read(
+ DriftSqlType.int,
+ data['${effectivePrefix}orientation'],
+ )!,
+ source: attachedDatabase.typeMapping.read(
+ DriftSqlType.int,
+ data['${effectivePrefix}source'],
+ )!,
+ );
+ }
+
+ @override
+ TrashedLocalAssetEntity createAlias(String alias) {
+ return TrashedLocalAssetEntity(attachedDatabase, alias);
+ }
+
+ @override
+ bool get withoutRowId => true;
+ @override
+ bool get isStrict => true;
+}
+
+class TrashedLocalAssetEntityData extends DataClass
+ implements Insertable<TrashedLocalAssetEntityData> {
+ final String name;
+ final int type;
+ final DateTime createdAt;
+ final DateTime updatedAt;
+ final int? width;
+ final int? height;
+ final int? durationInSeconds;
+ final String id;
+ final String albumId;
+ final String? checksum;
+ final bool isFavorite;
+ final int orientation;
+ final int source;
+ const TrashedLocalAssetEntityData({
+ required this.name,
+ required this.type,
+ required this.createdAt,
+ required this.updatedAt,
+ this.width,
+ this.height,
+ this.durationInSeconds,
+ required this.id,
+ required this.albumId,
+ this.checksum,
+ required this.isFavorite,
+ required this.orientation,
+ required this.source,
+ });
+ @override
+ Map<String, Expression> toColumns(bool nullToAbsent) {
+ final map = <String, Expression>{};
+ map['name'] = Variable<String>(name);
+ map['type'] = Variable<int>(type);
+ map['created_at'] = Variable<DateTime>(createdAt);
+ map['updated_at'] = Variable<DateTime>(updatedAt);
+ if (!nullToAbsent || width != null) {
+ map['width'] = Variable<int>(width);
+ }
+ if (!nullToAbsent || height != null) {
+ map['height'] = Variable<int>(height);
+ }
+ if (!nullToAbsent || durationInSeconds != null) {
+ map['duration_in_seconds'] = Variable<int>(durationInSeconds);
+ }
+ map['id'] = Variable<String>(id);
+ map['album_id'] = Variable<String>(albumId);
+ if (!nullToAbsent || checksum != null) {
+ map['checksum'] = Variable<String>(checksum);
+ }
+ map['is_favorite'] = Variable<bool>(isFavorite);
+ map['orientation'] = Variable<int>(orientation);
+ map['source'] = Variable<int>(source);
+ return map;
+ }
+
+ factory TrashedLocalAssetEntityData.fromJson(
+ Map<String, dynamic> json, {
+ ValueSerializer? serializer,
+ }) {
+ serializer ??= driftRuntimeOptions.defaultSerializer;
+ return TrashedLocalAssetEntityData(
+ name: serializer.fromJson<String>(json['name']),
+ type: serializer.fromJson<int>(json['type']),
+ createdAt: serializer.fromJson<DateTime>(json['createdAt']),
+ updatedAt: serializer.fromJson<DateTime>(json['updatedAt']),
+ width: serializer.fromJson<int?>(json['width']),
+ height: serializer.fromJson<int?>(json['height']),
+ durationInSeconds: serializer.fromJson<int?>(json['durationInSeconds']),
+ id: serializer.fromJson<String>(json['id']),
+ albumId: serializer.fromJson<String>(json['albumId']),
+ checksum: serializer.fromJson<String?>(json['checksum']),
+ isFavorite: serializer.fromJson<bool>(json['isFavorite']),
+ orientation: serializer.fromJson<int>(json['orientation']),
+ source: serializer.fromJson<int>(json['source']),
+ );
+ }
+ @override
+ Map<String, dynamic> toJson({ValueSerializer? serializer}) {
+ serializer ??= driftRuntimeOptions.defaultSerializer;
+ return <String, dynamic>{
+ 'name': serializer.toJson<String>(name),
+ 'type': serializer.toJson<int>(type),
+ 'createdAt': serializer.toJson<DateTime>(createdAt),
+ 'updatedAt': serializer.toJson<DateTime>(updatedAt),
+ 'width': serializer.toJson<int?>(width),
+ 'height': serializer.toJson<int?>(height),
+ 'durationInSeconds': serializer.toJson<int?>(durationInSeconds),
+ 'id': serializer.toJson<String>(id),
+ 'albumId': serializer.toJson<String>(albumId),
+ 'checksum': serializer.toJson<String?>(checksum),
+ 'isFavorite': serializer.toJson<bool>(isFavorite),
+ 'orientation': serializer.toJson<int>(orientation),
+ 'source': serializer.toJson<int>(source),
+ };
+ }
+
+ TrashedLocalAssetEntityData copyWith({
+ String? name,
+ int? type,
+ DateTime? createdAt,
+ DateTime? updatedAt,
+ Value<int?> width = const Value.absent(),
+ Value<int?> height = const Value.absent(),
+ Value<int?> durationInSeconds = const Value.absent(),
+ String? id,
+ String? albumId,
+ Value<String?> checksum = const Value.absent(),
+ bool? isFavorite,
+ int? orientation,
+ int? source,
+ }) => TrashedLocalAssetEntityData(
+ name: name ?? this.name,
+ type: type ?? this.type,
+ createdAt: createdAt ?? this.createdAt,
+ updatedAt: updatedAt ?? this.updatedAt,
+ width: width.present ? width.value : this.width,
+ height: height.present ? height.value : this.height,
+ durationInSeconds: durationInSeconds.present
+ ? durationInSeconds.value
+ : this.durationInSeconds,
+ id: id ?? this.id,
+ albumId: albumId ?? this.albumId,
+ checksum: checksum.present ? checksum.value : this.checksum,
+ isFavorite: isFavorite ?? this.isFavorite,
+ orientation: orientation ?? this.orientation,
+ source: source ?? this.source,
+ );
+ TrashedLocalAssetEntityData copyWithCompanion(
+ TrashedLocalAssetEntityCompanion data,
+ ) {
+ return TrashedLocalAssetEntityData(
+ name: data.name.present ? data.name.value : this.name,
+ type: data.type.present ? data.type.value : this.type,
+ createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt,
+ updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt,
+ width: data.width.present ? data.width.value : this.width,
+ height: data.height.present ? data.height.value : this.height,
+ durationInSeconds: data.durationInSeconds.present
+ ? data.durationInSeconds.value
+ : this.durationInSeconds,
+ id: data.id.present ? data.id.value : this.id,
+ albumId: data.albumId.present ? data.albumId.value : this.albumId,
+ checksum: data.checksum.present ? data.checksum.value : this.checksum,
+ isFavorite: data.isFavorite.present
+ ? data.isFavorite.value
+ : this.isFavorite,
+ orientation: data.orientation.present
+ ? data.orientation.value
+ : this.orientation,
+ source: data.source.present ? data.source.value : this.source,
+ );
+ }
+
+ @override
+ String toString() {
+ return (StringBuffer('TrashedLocalAssetEntityData(')
+ ..write('name: $name, ')
+ ..write('type: $type, ')
+ ..write('createdAt: $createdAt, ')
+ ..write('updatedAt: $updatedAt, ')
+ ..write('width: $width, ')
+ ..write('height: $height, ')
+ ..write('durationInSeconds: $durationInSeconds, ')
+ ..write('id: $id, ')
+ ..write('albumId: $albumId, ')
+ ..write('checksum: $checksum, ')
+ ..write('isFavorite: $isFavorite, ')
+ ..write('orientation: $orientation, ')
+ ..write('source: $source')
+ ..write(')'))
+ .toString();
+ }
+
+ @override
+ int get hashCode => Object.hash(
+ name,
+ type,
+ createdAt,
+ updatedAt,
+ width,
+ height,
+ durationInSeconds,
+ id,
+ albumId,
+ checksum,
+ isFavorite,
+ orientation,
+ source,
+ );
+ @override
+ bool operator ==(Object other) =>
+ identical(this, other) ||
+ (other is TrashedLocalAssetEntityData &&
+ other.name == this.name &&
+ other.type == this.type &&
+ other.createdAt == this.createdAt &&
+ other.updatedAt == this.updatedAt &&
+ other.width == this.width &&
+ other.height == this.height &&
+ other.durationInSeconds == this.durationInSeconds &&
+ other.id == this.id &&
+ other.albumId == this.albumId &&
+ other.checksum == this.checksum &&
+ other.isFavorite == this.isFavorite &&
+ other.orientation == this.orientation &&
+ other.source == this.source);
+}
+
+class TrashedLocalAssetEntityCompanion
+ extends UpdateCompanion<TrashedLocalAssetEntityData> {
+ final Value<String> name;
+ final Value<int> type;
+ final Value<DateTime> createdAt;
+ final Value<DateTime> updatedAt;
+ final Value<int?> width;
+ final Value<int?> height;
+ final Value<int?> durationInSeconds;
+ final Value<String> id;
+ final Value<String> albumId;
+ final Value<String?> checksum;
+ final Value<bool> isFavorite;
+ final Value<int> orientation;
+ final Value<int> source;
+ const TrashedLocalAssetEntityCompanion({
+ this.name = const Value.absent(),
+ this.type = const Value.absent(),
+ this.createdAt = const Value.absent(),
+ this.updatedAt = const Value.absent(),
+ this.width = const Value.absent(),
+ this.height = const Value.absent(),
+ this.durationInSeconds = const Value.absent(),
+ this.id = const Value.absent(),
+ this.albumId = const Value.absent(),
+ this.checksum = const Value.absent(),
+ this.isFavorite = const Value.absent(),
+ this.orientation = const Value.absent(),
+ this.source = const Value.absent(),
+ });
+ TrashedLocalAssetEntityCompanion.insert({
+ required String name,
+ required int type,
+ this.createdAt = const Value.absent(),
+ this.updatedAt = const Value.absent(),
+ this.width = const Value.absent(),
+ this.height = const Value.absent(),
+ this.durationInSeconds = const Value.absent(),
+ required String id,
+ required String albumId,
+ this.checksum = const Value.absent(),
+ this.isFavorite = const Value.absent(),
+ this.orientation = const Value.absent(),
+ required int source,
+ }) : name = Value(name),
+ type = Value(type),
+ id = Value(id),
+ albumId = Value(albumId),
+ source = Value(source);
+ static Insertable<TrashedLocalAssetEntityData> custom({
+ Expression<String>? name,
+ Expression<int>? type,
+ Expression<DateTime>? createdAt,
+ Expression<DateTime>? updatedAt,
+ Expression<int>? width,
+ Expression<int>? height,
+ Expression<int>? durationInSeconds,
+ Expression<String>? id,
+ Expression<String>? albumId,
+ Expression<String>? checksum,
+ Expression<bool>? isFavorite,
+ Expression<int>? orientation,
+ Expression<int>? source,
+ }) {
+ return RawValuesInsertable({
+ if (name != null) 'name': name,
+ if (type != null) 'type': type,
+ if (createdAt != null) 'created_at': createdAt,
+ if (updatedAt != null) 'updated_at': updatedAt,
+ if (width != null) 'width': width,
+ if (height != null) 'height': height,
+ if (durationInSeconds != null) 'duration_in_seconds': durationInSeconds,
+ if (id != null) 'id': id,
+ if (albumId != null) 'album_id': albumId,
+ if (checksum != null) 'checksum': checksum,
+ if (isFavorite != null) 'is_favorite': isFavorite,
+ if (orientation != null) 'orientation': orientation,
+ if (source != null) 'source': source,
+ });
+ }
+
+ TrashedLocalAssetEntityCompanion copyWith({
+ Value<String>? name,
+ Value<int>? type,
+ Value<DateTime>? createdAt,
+ Value<DateTime>? updatedAt,
+ Value<int?>? width,
+ Value<int?>? height,
+ Value<int?>? durationInSeconds,
+ Value<String>? id,
+ Value<String>? albumId,
+ Value<String?>? checksum,
+ Value<bool>? isFavorite,
+ Value<int>? orientation,
+ Value<int>? source,
+ }) {
+ return TrashedLocalAssetEntityCompanion(
+ name: name ?? this.name,
+ type: type ?? this.type,
+ createdAt: createdAt ?? this.createdAt,
+ updatedAt: updatedAt ?? this.updatedAt,
+ width: width ?? this.width,
+ height: height ?? this.height,
+ durationInSeconds: durationInSeconds ?? this.durationInSeconds,
+ id: id ?? this.id,
+ albumId: albumId ?? this.albumId,
+ checksum: checksum ?? this.checksum,
+ isFavorite: isFavorite ?? this.isFavorite,
+ orientation: orientation ?? this.orientation,
+ source: source ?? this.source,
+ );
+ }
+
+ @override
+ Map<String, Expression> toColumns(bool nullToAbsent) {
+ final map = <String, Expression>{};
+ if (name.present) {
+ map['name'] = Variable<String>(name.value);
+ }
+ if (type.present) {
+ map['type'] = Variable<int>(type.value);
+ }
+ if (createdAt.present) {
+ map['created_at'] = Variable<DateTime>(createdAt.value);
+ }
+ if (updatedAt.present) {
+ map['updated_at'] = Variable<DateTime>(updatedAt.value);
+ }
+ if (width.present) {
+ map['width'] = Variable<int>(width.value);
+ }
+ if (height.present) {
+ map['height'] = Variable<int>(height.value);
+ }
+ if (durationInSeconds.present) {
+ map['duration_in_seconds'] = Variable<int>(durationInSeconds.value);
+ }
+ if (id.present) {
+ map['id'] = Variable<String>(id.value);
+ }
+ if (albumId.present) {
+ map['album_id'] = Variable<String>(albumId.value);
+ }
+ if (checksum.present) {
+ map['checksum'] = Variable<String>(checksum.value);
+ }
+ if (isFavorite.present) {
+ map['is_favorite'] = Variable<bool>(isFavorite.value);
+ }
+ if (orientation.present) {
+ map['orientation'] = Variable<int>(orientation.value);
+ }
+ if (source.present) {
+ map['source'] = Variable<int>(source.value);
+ }
+ return map;
+ }
+
+ @override
+ String toString() {
+ return (StringBuffer('TrashedLocalAssetEntityCompanion(')
+ ..write('name: $name, ')
+ ..write('type: $type, ')
+ ..write('createdAt: $createdAt, ')
+ ..write('updatedAt: $updatedAt, ')
+ ..write('width: $width, ')
+ ..write('height: $height, ')
+ ..write('durationInSeconds: $durationInSeconds, ')
+ ..write('id: $id, ')
+ ..write('albumId: $albumId, ')
+ ..write('checksum: $checksum, ')
+ ..write('isFavorite: $isFavorite, ')
+ ..write('orientation: $orientation, ')
+ ..write('source: $source')
+ ..write(')'))
+ .toString();
+ }
+}
+
+class DatabaseAtV17 extends GeneratedDatabase {
+ DatabaseAtV17(QueryExecutor e) : super(e);
+ late final UserEntity userEntity = UserEntity(this);
+ late final RemoteAssetEntity remoteAssetEntity = RemoteAssetEntity(this);
+ late final StackEntity stackEntity = StackEntity(this);
+ late final LocalAssetEntity localAssetEntity = LocalAssetEntity(this);
+ late final RemoteAlbumEntity remoteAlbumEntity = RemoteAlbumEntity(this);
+ late final LocalAlbumEntity localAlbumEntity = LocalAlbumEntity(this);
+ late final LocalAlbumAssetEntity localAlbumAssetEntity =
+ LocalAlbumAssetEntity(this);
+ late final Index idxLocalAssetChecksum = Index(
+ 'idx_local_asset_checksum',
+ 'CREATE INDEX IF NOT EXISTS idx_local_asset_checksum ON local_asset_entity (checksum)',
+ );
+ late final Index idxLocalAssetCloudId = Index(
+ 'idx_local_asset_cloud_id',
+ 'CREATE INDEX IF NOT EXISTS idx_local_asset_cloud_id ON local_asset_entity (i_cloud_id)',
+ );
+ late final Index idxRemoteAssetOwnerChecksum = Index(
+ 'idx_remote_asset_owner_checksum',
+ 'CREATE INDEX IF NOT EXISTS idx_remote_asset_owner_checksum ON remote_asset_entity (owner_id, checksum)',
+ );
+ late final Index uQRemoteAssetsOwnerChecksum = Index(
+ 'UQ_remote_assets_owner_checksum',
+ 'CREATE UNIQUE INDEX IF NOT EXISTS UQ_remote_assets_owner_checksum ON remote_asset_entity (owner_id, checksum) WHERE(library_id IS NULL)',
+ );
+ late final Index uQRemoteAssetsOwnerLibraryChecksum = Index(
+ 'UQ_remote_assets_owner_library_checksum',
+ 'CREATE UNIQUE INDEX IF NOT EXISTS UQ_remote_assets_owner_library_checksum ON remote_asset_entity (owner_id, library_id, checksum) WHERE(library_id IS NOT NULL)',
+ );
+ late final Index idxRemoteAssetChecksum = Index(
+ 'idx_remote_asset_checksum',
+ 'CREATE INDEX IF NOT EXISTS idx_remote_asset_checksum ON remote_asset_entity (checksum)',
+ );
+ late final AuthUserEntity authUserEntity = AuthUserEntity(this);
+ late final UserMetadataEntity userMetadataEntity = UserMetadataEntity(this);
+ late final PartnerEntity partnerEntity = PartnerEntity(this);
+ late final RemoteExifEntity remoteExifEntity = RemoteExifEntity(this);
+ late final RemoteAlbumAssetEntity remoteAlbumAssetEntity =
+ RemoteAlbumAssetEntity(this);
+ late final RemoteAlbumUserEntity remoteAlbumUserEntity =
+ RemoteAlbumUserEntity(this);
+ late final RemoteAssetCloudIdEntity remoteAssetCloudIdEntity =
+ RemoteAssetCloudIdEntity(this);
+ late final MemoryEntity memoryEntity = MemoryEntity(this);
+ late final MemoryAssetEntity memoryAssetEntity = MemoryAssetEntity(this);
+ late final PersonEntity personEntity = PersonEntity(this);
+ late final AssetFaceEntity assetFaceEntity = AssetFaceEntity(this);
+ late final StoreEntity storeEntity = StoreEntity(this);
+ late final TrashedLocalAssetEntity trashedLocalAssetEntity =
+ TrashedLocalAssetEntity(this);
+ late final Index idxLatLng = Index(
+ 'idx_lat_lng',
+ 'CREATE INDEX IF NOT EXISTS idx_lat_lng ON remote_exif_entity (latitude, longitude)',
+ );
+ late final Index idxTrashedLocalAssetChecksum = Index(
+ 'idx_trashed_local_asset_checksum',
+ 'CREATE INDEX IF NOT EXISTS idx_trashed_local_asset_checksum ON trashed_local_asset_entity (checksum)',
+ );
+ late final Index idxTrashedLocalAssetAlbum = Index(
+ 'idx_trashed_local_asset_album',
+ 'CREATE INDEX IF NOT EXISTS idx_trashed_local_asset_album ON trashed_local_asset_entity (album_id)',
+ );
+ @override
+ Iterable<TableInfo<Table, Object?>> get allTables =>
+ allSchemaEntities.whereType<TableInfo<Table, Object?>>();
+ @override
+ List<DatabaseSchemaEntity> get allSchemaEntities => [
+ userEntity,
+ remoteAssetEntity,
+ stackEntity,
+ localAssetEntity,
+ remoteAlbumEntity,
+ localAlbumEntity,
+ localAlbumAssetEntity,
+ idxLocalAssetChecksum,
+ idxLocalAssetCloudId,
+ idxRemoteAssetOwnerChecksum,
+ uQRemoteAssetsOwnerChecksum,
+ uQRemoteAssetsOwnerLibraryChecksum,
+ idxRemoteAssetChecksum,
+ authUserEntity,
+ userMetadataEntity,
+ partnerEntity,
+ remoteExifEntity,
+ remoteAlbumAssetEntity,
+ remoteAlbumUserEntity,
+ remoteAssetCloudIdEntity,
+ memoryEntity,
+ memoryAssetEntity,
+ personEntity,
+ assetFaceEntity,
+ storeEntity,
+ trashedLocalAssetEntity,
+ idxLatLng,
+ idxTrashedLocalAssetChecksum,
+ idxTrashedLocalAssetAlbum,
+ ];
+ @override
+ int get schemaVersion => 17;
+ @override
+ DriftDatabaseOptions get options =>
+ const DriftDatabaseOptions(storeDateTimeAsText: true);
+}
diff --git a/mobile/test/fixtures/asset.stub.dart b/mobile/test/fixtures/asset.stub.dart
index 8d92011999..f3d6ab42a8 100644
--- a/mobile/test/fixtures/asset.stub.dart
+++ b/mobile/test/fixtures/asset.stub.dart
@@ -64,6 +64,7 @@ abstract final class LocalAssetStub {
type: AssetType.image,
createdAt: DateTime(2025),
updatedAt: DateTime(2025, 2),
+ isEdited: false,
);
static final image2 = LocalAsset(
@@ -72,5 +73,6 @@ abstract final class LocalAssetStub {
type: AssetType.image,
createdAt: DateTime(2000),
updatedAt: DateTime(20021),
+ isEdited: false,
);
}
diff --git a/mobile/test/fixtures/sync_stream.stub.dart b/mobile/test/fixtures/sync_stream.stub.dart
index 9ab6a5685d..c2254c0a03 100644
--- a/mobile/test/fixtures/sync_stream.stub.dart
+++ b/mobile/test/fixtures/sync_stream.stub.dart
@@ -128,7 +128,7 @@ abstract final class SyncStreamStub {
visibility: AssetVisibility.timeline,
width: null,
height: null,
- editCount: 0,
+ isEdited: false,
),
ack: ack,
);
diff --git a/mobile/test/services/background_upload.service_test.dart b/mobile/test/services/background_upload.service_test.dart
index d0374c3987..41dc46823d 100644
--- a/mobile/test/services/background_upload.service_test.dart
+++ b/mobile/test/services/background_upload.service_test.dart
@@ -194,6 +194,7 @@ void main() {
latitude: 37.7749,
longitude: -122.4194,
adjustmentTime: DateTime(2026, 1, 2),
+ isEdited: false,
);
final mockEntity = MockAssetEntity();
@@ -242,6 +243,7 @@ void main() {
cloudId: 'cloud-id-123',
latitude: 37.7749,
longitude: -122.4194,
+ isEdited: false,
);
final mockEntity = MockAssetEntity();
@@ -279,6 +281,7 @@ void main() {
createdAt: DateTime(2025, 1, 1),
updatedAt: DateTime(2025, 1, 2),
cloudId: null, // No cloudId
+ isEdited: false,
);
final mockEntity = MockAssetEntity();
@@ -320,6 +323,7 @@ void main() {
cloudId: 'cloud-id-livephoto',
latitude: 37.7749,
longitude: -122.4194,
+ isEdited: false,
);
final mockEntity = MockAssetEntity();
diff --git a/mobile/test/test_utils.dart b/mobile/test/test_utils.dart
index 498607e3d2..9d94e71052 100644
--- a/mobile/test/test_utils.dart
+++ b/mobile/test/test_utils.dart
@@ -131,6 +131,7 @@ abstract final class TestUtils {
isFavorite: false,
width: width,
height: height,
+ isEdited: false,
);
}
@@ -154,6 +155,7 @@ abstract final class TestUtils {
width: width,
height: height,
orientation: orientation,
+ isEdited: false,
);
}
}
diff --git a/mobile/test/test_utils/medium_factory.dart b/mobile/test/test_utils/medium_factory.dart
index 19ad7166c6..b6f39ac3bd 100644
--- a/mobile/test/test_utils/medium_factory.dart
+++ b/mobile/test/test_utils/medium_factory.dart
@@ -27,6 +27,7 @@ class MediumFactory {
type: type ?? AssetType.image,
createdAt: createdAt ?? DateTime.fromMillisecondsSinceEpoch(random.nextInt(1000000000)),
updatedAt: updatedAt ?? DateTime.fromMillisecondsSinceEpoch(random.nextInt(1000000000)),
+ isEdited: false,
);
}
diff --git a/mobile/test/utils/action_button_utils_test.dart b/mobile/test/utils/action_button_utils_test.dart
index d93d59d3c7..4152155d24 100644
--- a/mobile/test/utils/action_button_utils_test.dart
+++ b/mobile/test/utils/action_button_utils_test.dart
@@ -23,6 +23,7 @@ LocalAsset createLocalAsset({
createdAt: createdAt ?? DateTime.now(),
updatedAt: updatedAt ?? DateTime.now(),
isFavorite: isFavorite,
+ isEdited: false,
);
}
@@ -45,6 +46,7 @@ RemoteAsset createRemoteAsset({
createdAt: createdAt ?? DateTime.now(),
updatedAt: updatedAt ?? DateTime.now(),
isFavorite: isFavorite,
+ isEdited: false,
);
}
diff --git a/open-api/immich-openapi-specs.json b/open-api/immich-openapi-specs.json
index 1535b509cc..491d67efe2 100644
--- a/open-api/immich-openapi-specs.json
+++ b/open-api/immich-openapi-specs.json
@@ -21291,9 +21291,6 @@
"nullable": true,
"type": "string"
},
- "editCount": {
- "type": "integer"
- },
"fileCreatedAt": {
"format": "date-time",
"nullable": true,
@@ -21311,6 +21308,9 @@
"id": {
"type": "string"
},
+ "isEdited": {
+ "type": "boolean"
+ },
"isFavorite": {
"type": "boolean"
},
@@ -21364,11 +21364,11 @@
"checksum",
"deletedAt",
"duration",
- "editCount",
"fileCreatedAt",
"fileModifiedAt",
"height",
"id",
+ "isEdited",
"isFavorite",
"libraryId",
"livePhotoVideoId",
diff --git a/server/src/database.ts b/server/src/database.ts
index 61a08df14b..7a64eb06ba 100644
--- a/server/src/database.ts
+++ b/server/src/database.ts
@@ -395,7 +395,7 @@ export const columns = {
'asset.libraryId',
'asset.width',
'asset.height',
- 'asset.editCount',
+ 'asset.isEdited',
],
syncAlbumUser: ['album_user.albumId as albumId', 'album_user.userId as userId', 'album_user.role'],
syncStack: ['stack.id', 'stack.createdAt', 'stack.updatedAt', 'stack.primaryAssetId', 'stack.ownerId'],
diff --git a/server/src/dtos/asset-response.dto.ts b/server/src/dtos/asset-response.dto.ts
index 5d66c0c08b..92ee3c5875 100644
--- a/server/src/dtos/asset-response.dto.ts
+++ b/server/src/dtos/asset-response.dto.ts
@@ -139,7 +139,7 @@ export type MapAsset = {
type: AssetType;
width: number | null;
height: number | null;
- editCount: number;
+ isEdited: boolean;
};
export class AssetStackResponseDto {
@@ -248,6 +248,6 @@ export function mapAsset(entity: MapAsset, options: AssetMapOptions = {}): Asset
resized: true,
width: entity.width,
height: entity.height,
- isEdited: entity.editCount > 0,
+ isEdited: entity.isEdited,
};
}
diff --git a/server/src/dtos/sync.dto.ts b/server/src/dtos/sync.dto.ts
index f775a22116..0d1ab0e74d 100644
--- a/server/src/dtos/sync.dto.ts
+++ b/server/src/dtos/sync.dto.ts
@@ -121,8 +121,8 @@ export class SyncAssetV1 {
width!: number | null;
@ApiProperty({ type: 'integer' })
height!: number | null;
- @ApiProperty({ type: 'integer' })
- editCount!: number;
+ @ApiProperty({ type: 'boolean' })
+ isEdited!: boolean;
}
@ExtraModel()
diff --git a/server/src/queries/sync.repository.sql b/server/src/queries/sync.repository.sql
index c57530050d..f817ad57b3 100644
--- a/server/src/queries/sync.repository.sql
+++ b/server/src/queries/sync.repository.sql
@@ -71,7 +71,7 @@ select
"asset"."libraryId",
"asset"."width",
"asset"."height",
- "asset"."editCount",
+ "asset"."isEdited",
"album_asset"."updateId"
from
"album_asset" as "album_asset"
@@ -104,7 +104,7 @@ select
"asset"."libraryId",
"asset"."width",
"asset"."height",
- "asset"."editCount",
+ "asset"."isEdited",
"asset"."updateId"
from
"asset" as "asset"
@@ -143,7 +143,7 @@ select
"asset"."libraryId",
"asset"."width",
"asset"."height",
- "asset"."editCount"
+ "asset"."isEdited"
from
"album_asset" as "album_asset"
inner join "asset" on "asset"."id" = "album_asset"."assetId"
@@ -459,7 +459,7 @@ select
"asset"."libraryId",
"asset"."width",
"asset"."height",
- "asset"."editCount",
+ "asset"."isEdited",
"asset"."updateId"
from
"asset" as "asset"
@@ -755,7 +755,7 @@ select
"asset"."libraryId",
"asset"."width",
"asset"."height",
- "asset"."editCount",
+ "asset"."isEdited",
"asset"."updateId"
from
"asset" as "asset"
@@ -807,7 +807,7 @@ select
"asset"."libraryId",
"asset"."width",
"asset"."height",
- "asset"."editCount",
+ "asset"."isEdited",
"asset"."updateId"
from
"asset" as "asset"
diff --git a/server/src/repositories/websocket.repository.ts b/server/src/repositories/websocket.repository.ts
index c2da06786c..bfed556895 100644
--- a/server/src/repositories/websocket.repository.ts
+++ b/server/src/repositories/websocket.repository.ts
@@ -37,7 +37,7 @@ export interface ClientEventMap {
AssetUploadReadyV1: [{ asset: SyncAssetV1; exif: SyncAssetExifV1 }];
AppRestartV1: [AppRestartEvent];
- AssetEditReadyV1: [{ assetId: string }];
+ AssetEditReadyV1: [{ asset: SyncAssetV1 }];
}
export type AuthFn = (client: Socket) => Promise<AuthDto>;
diff --git a/server/src/schema/functions.ts b/server/src/schema/functions.ts
index 8988bf38d2..d7dabfef4c 100644
--- a/server/src/schema/functions.ts
+++ b/server/src/schema/functions.ts
@@ -263,8 +263,9 @@ export const asset_edit_insert = registerFunction({
body: `
BEGIN
UPDATE asset
- SET "editCount" = "editCount" + 1
- WHERE "id" = NEW."assetId";
+ SET "isEdited" = true
+ FROM inserted_edit
+ WHERE asset.id = inserted_edit."assetId" AND NOT asset."isEdited";
RETURN NULL;
END
`,
@@ -277,8 +278,10 @@ export const asset_edit_delete = registerFunction({
body: `
BEGIN
UPDATE asset
- SET "editCount" = "editCount" - 1
- WHERE "id" = OLD."assetId";
+ SET "isEdited" = false
+ FROM deleted_edit
+ WHERE asset.id = deleted_edit."assetId" AND asset."isEdited"
+ AND NOT EXISTS (SELECT FROM asset_edit edit WHERE edit."assetId" = asset.id);
RETURN NULL;
END
`,
diff --git a/server/src/schema/migrations/1768757482271-SwitchToIsEdited.ts b/server/src/schema/migrations/1768757482271-SwitchToIsEdited.ts
new file mode 100644
index 0000000000..0660b7303d
--- /dev/null
+++ b/server/src/schema/migrations/1768757482271-SwitchToIsEdited.ts
@@ -0,0 +1,89 @@
+import { Kysely, sql } from 'kysely';
+
+export async function up(db: Kysely<any>): Promise<void> {
+ await sql`CREATE OR REPLACE FUNCTION asset_edit_insert()
+ RETURNS TRIGGER
+ LANGUAGE PLPGSQL
+ AS $$
+ BEGIN
+ UPDATE asset
+ SET "isEdited" = true
+ FROM inserted_edit
+ WHERE asset.id = inserted_edit."assetId" AND NOT asset."isEdited";
+ RETURN NULL;
+ END
+ $$;`.execute(db);
+ await sql`CREATE OR REPLACE FUNCTION asset_edit_delete()
+ RETURNS TRIGGER
+ LANGUAGE PLPGSQL
+ AS $$
+ BEGIN
+ UPDATE asset
+ SET "isEdited" = false
+ FROM deleted_edit
+ WHERE asset.id = deleted_edit."assetId" AND asset."isEdited"
+ AND NOT EXISTS (SELECT FROM asset_edit edit WHERE edit."assetId" = asset.id);
+ RETURN NULL;
+ END
+ $$;`.execute(db);
+ await sql`ALTER TABLE "asset" ADD "isEdited" boolean NOT NULL DEFAULT false;`.execute(db);
+ await sql`CREATE OR REPLACE TRIGGER "asset_edit_delete"
+ AFTER DELETE ON "asset_edit"
+ REFERENCING OLD TABLE AS "deleted_edit"
+ FOR EACH STATEMENT
+ WHEN (pg_trigger_depth() = 0)
+ EXECUTE FUNCTION asset_edit_delete();`.execute(db);
+ await sql`CREATE OR REPLACE TRIGGER "asset_edit_insert"
+ AFTER INSERT ON "asset_edit"
+ REFERENCING NEW TABLE AS "inserted_edit"
+ FOR EACH STATEMENT
+ EXECUTE FUNCTION asset_edit_insert();`.execute(db);
+ await sql`ALTER TABLE "asset" DROP COLUMN "editCount";`.execute(db);
+ await sql`UPDATE "migration_overrides" SET "value" = '{"type":"function","name":"asset_edit_insert","sql":"CREATE OR REPLACE FUNCTION asset_edit_insert()\\n RETURNS TRIGGER\\n LANGUAGE PLPGSQL\\n AS $$\\n BEGIN\\n UPDATE asset\\n SET \\"isEdited\\" = true\\n FROM inserted_edit\\n WHERE asset.id = inserted_edit.\\"assetId\\" AND NOT asset.\\"isEdited\\";\\n RETURN NULL;\\n END\\n $$;"}'::jsonb WHERE "name" = 'function_asset_edit_insert';`.execute(db);
+ await sql`UPDATE "migration_overrides" SET "value" = '{"type":"function","name":"asset_edit_delete","sql":"CREATE OR REPLACE FUNCTION asset_edit_delete()\\n RETURNS TRIGGER\\n LANGUAGE PLPGSQL\\n AS $$\\n BEGIN\\n UPDATE asset\\n SET \\"isEdited\\" = false\\n FROM deleted_edit\\n WHERE asset.id = deleted_edit.\\"assetId\\" AND asset.\\"isEdited\\" \\n AND NOT EXISTS (SELECT FROM asset_edit edit WHERE edit.\\"assetId\\" = asset.id);\\n RETURN NULL;\\n END\\n $$;"}'::jsonb WHERE "name" = 'function_asset_edit_delete';`.execute(db);
+ await sql`UPDATE "migration_overrides" SET "value" = '{"type":"trigger","name":"asset_edit_delete","sql":"CREATE OR REPLACE TRIGGER \\"asset_edit_delete\\"\\n AFTER DELETE ON \\"asset_edit\\"\\n REFERENCING OLD TABLE AS \\"deleted_edit\\"\\n FOR EACH STATEMENT\\n WHEN (pg_trigger_depth() = 0)\\n EXECUTE FUNCTION asset_edit_delete();"}'::jsonb WHERE "name" = 'trigger_asset_edit_delete';`.execute(db);
+ await sql`UPDATE "migration_overrides" SET "value" = '{"type":"trigger","name":"asset_edit_insert","sql":"CREATE OR REPLACE TRIGGER \\"asset_edit_insert\\"\\n AFTER INSERT ON \\"asset_edit\\"\\n REFERENCING NEW TABLE AS \\"inserted_edit\\"\\n FOR EACH STATEMENT\\n EXECUTE FUNCTION asset_edit_insert();"}'::jsonb WHERE "name" = 'trigger_asset_edit_insert';`.execute(db);
+}
+
+export async function down(db: Kysely<any>): Promise<void> {
+ await sql`CREATE OR REPLACE FUNCTION public.asset_edit_insert()
+ RETURNS trigger
+ LANGUAGE plpgsql
+AS $function$
+ BEGIN
+ UPDATE asset
+ SET "editCount" = "editCount" + 1
+ WHERE "id" = NEW."assetId";
+ RETURN NULL;
+ END
+ $function$
+`.execute(db);
+ await sql`CREATE OR REPLACE FUNCTION public.asset_edit_delete()
+ RETURNS trigger
+ LANGUAGE plpgsql
+AS $function$
+ BEGIN
+ UPDATE asset
+ SET "editCount" = "editCount" - 1
+ WHERE "id" = OLD."assetId";
+ RETURN NULL;
+ END
+ $function$
+`.execute(db);
+ await sql`ALTER TABLE "asset" ADD "editCount" integer NOT NULL DEFAULT 0;`.execute(db);
+ await sql`CREATE OR REPLACE TRIGGER "asset_edit_delete"
+ AFTER DELETE ON "asset_edit"
+ REFERENCING OLD TABLE AS "old"
+ FOR EACH ROW
+ WHEN ((pg_trigger_depth() = 0))
+ EXECUTE FUNCTION asset_edit_delete();`.execute(db);
+ await sql`CREATE OR REPLACE TRIGGER "asset_edit_insert"
+ AFTER INSERT ON "asset_edit"
+ FOR EACH ROW
+ EXECUTE FUNCTION asset_edit_insert();`.execute(db);
+ await sql`ALTER TABLE "asset" DROP COLUMN "isEdited";`.execute(db);
+ await sql`UPDATE "migration_overrides" SET "value" = '{"sql":"CREATE OR REPLACE FUNCTION asset_edit_insert()\\n RETURNS TRIGGER\\n LANGUAGE PLPGSQL\\n AS $$\\n BEGIN\\n UPDATE asset\\n SET \\"editCount\\" = \\"editCount\\" + 1\\n WHERE \\"id\\" = NEW.\\"assetId\\";\\n RETURN NULL;\\n END\\n $$;","name":"asset_edit_insert","type":"function"}'::jsonb WHERE "name" = 'function_asset_edit_insert';`.execute(db);
+ await sql`UPDATE "migration_overrides" SET "value" = '{"sql":"CREATE OR REPLACE FUNCTION asset_edit_delete()\\n RETURNS TRIGGER\\n LANGUAGE PLPGSQL\\n AS $$\\n BEGIN\\n UPDATE asset\\n SET \\"editCount\\" = \\"editCount\\" - 1\\n WHERE \\"id\\" = OLD.\\"assetId\\";\\n RETURN NULL;\\n END\\n $$;","name":"asset_edit_delete","type":"function"}'::jsonb WHERE "name" = 'function_asset_edit_delete';`.execute(db);
+ await sql`UPDATE "migration_overrides" SET "value" = '{"sql":"CREATE OR REPLACE TRIGGER \\"asset_edit_delete\\"\\n AFTER DELETE ON \\"asset_edit\\"\\n REFERENCING OLD TABLE AS \\"old\\"\\n FOR EACH ROW\\n WHEN (pg_trigger_depth() = 0)\\n EXECUTE FUNCTION asset_edit_delete();","name":"asset_edit_delete","type":"trigger"}'::jsonb WHERE "name" = 'trigger_asset_edit_delete';`.execute(db);
+ await sql`UPDATE "migration_overrides" SET "value" = '{"sql":"CREATE OR REPLACE TRIGGER \\"asset_edit_insert\\"\\n AFTER INSERT ON \\"asset_edit\\"\\n FOR EACH ROW\\n EXECUTE FUNCTION asset_edit_insert();","name":"asset_edit_insert","type":"trigger"}'::jsonb WHERE "name" = 'trigger_asset_edit_insert';`.execute(db);
+}
diff --git a/server/src/schema/tables/asset-edit.table.ts b/server/src/schema/tables/asset-edit.table.ts
index 4c4bf45cf2..ad0b443b69 100644
--- a/server/src/schema/tables/asset-edit.table.ts
+++ b/server/src/schema/tables/asset-edit.table.ts
@@ -12,11 +12,11 @@ import {
} from 'src/sql-tools';
@Table('asset_edit')
-@AfterInsertTrigger({ scope: 'row', function: asset_edit_insert })
+@AfterInsertTrigger({ scope: 'statement', function: asset_edit_insert, referencingNewTableAs: 'inserted_edit' })
@AfterDeleteTrigger({
- scope: 'row',
+ scope: 'statement',
function: asset_edit_delete,
- referencingOldTableAs: 'old',
+ referencingOldTableAs: 'deleted_edit',
when: 'pg_trigger_depth() = 0',
})
export class AssetEditTable<T extends AssetEditAction = AssetEditAction> {
diff --git a/server/src/schema/tables/asset.table.ts b/server/src/schema/tables/asset.table.ts
index fb21b67afd..0b3da710ac 100644
--- a/server/src/schema/tables/asset.table.ts
+++ b/server/src/schema/tables/asset.table.ts
@@ -144,6 +144,6 @@ export class AssetTable {
@Column({ type: 'integer', nullable: true })
height!: number | null;
- @Column({ type: 'integer', default: 0 })
- editCount!: Generated<number>;
+ @Column({ type: 'boolean', default: false })
+ isEdited!: Generated<boolean>;
}
diff --git a/server/src/services/job.service.ts b/server/src/services/job.service.ts
index 5cca0a8f8e..2a47745a6c 100644
--- a/server/src/services/job.service.ts
+++ b/server/src/services/job.service.ts
@@ -100,7 +100,29 @@ export class JobService extends BaseService {
const asset = await this.assetRepository.getById(item.data.id);
if (asset) {
- this.websocketRepository.clientSend('AssetEditReadyV1', asset.ownerId, { assetId: item.data.id });
+ this.websocketRepository.clientSend('AssetEditReadyV1', asset.ownerId, {
+ asset: {
+ id: asset.id,
+ ownerId: asset.ownerId,
+ originalFileName: asset.originalFileName,
+ thumbhash: asset.thumbhash ? hexOrBufferToBase64(asset.thumbhash) : null,
+ checksum: hexOrBufferToBase64(asset.checksum),
+ fileCreatedAt: asset.fileCreatedAt,
+ fileModifiedAt: asset.fileModifiedAt,
+ localDateTime: asset.localDateTime,
+ duration: asset.duration,
+ type: asset.type,
+ deletedAt: asset.deletedAt,
+ isFavorite: asset.isFavorite,
+ visibility: asset.visibility,
+ livePhotoVideoId: asset.livePhotoVideoId,
+ stackId: asset.stackId,
+ libraryId: asset.libraryId,
+ width: asset.width,
+ height: asset.height,
+ isEdited: asset.isEdited,
+ },
+ });
}
break;
@@ -153,7 +175,7 @@ export class JobService extends BaseService {
libraryId: asset.libraryId,
width: asset.width,
height: asset.height,
- editCount: asset.editCount,
+ isEdited: asset.isEdited,
},
exif: {
assetId: exif.assetId,
diff --git a/server/test/fixtures/asset.stub.ts b/server/test/fixtures/asset.stub.ts
index 21ffbda599..0a6108a653 100644
--- a/server/test/fixtures/asset.stub.ts
+++ b/server/test/fixtures/asset.stub.ts
@@ -86,7 +86,7 @@ export const assetStub = {
make: 'FUJIFILM',
model: 'X-T50',
lensModel: 'XF27mm F2.8 R WR',
- editCount: 0,
+ isEdited: false,
...asset,
}),
noResizePath: Object.freeze({
@@ -126,7 +126,7 @@ export const assetStub = {
width: null,
height: null,
edits: [],
- editCount: 0,
+ isEdited: false,
}),
noWebpPath: Object.freeze({
@@ -168,7 +168,7 @@ export const assetStub = {
width: null,
height: null,
edits: [],
- editCount: 0,
+ isEdited: false,
}),
noThumbhash: Object.freeze({
@@ -207,7 +207,7 @@ export const assetStub = {
width: null,
height: null,
edits: [],
- editCount: 0,
+ isEdited: false,
}),
primaryImage: Object.freeze({
@@ -256,7 +256,7 @@ export const assetStub = {
width: null,
height: null,
edits: [],
- editCount: 0,
+ isEdited: false,
}),
image: Object.freeze({
@@ -303,7 +303,7 @@ export const assetStub = {
width: null,
visibility: AssetVisibility.Timeline,
edits: [],
- editCount: 0,
+ isEdited: false,
}),
trashed: Object.freeze({
@@ -347,7 +347,7 @@ export const assetStub = {
width: null,
height: null,
edits: [],
- editCount: 0,
+ isEdited: false,
}),
trashedOffline: Object.freeze({
@@ -391,7 +391,7 @@ export const assetStub = {
width: null,
height: null,
edits: [],
- editCount: 0,
+ isEdited: false,
}),
archived: Object.freeze({
id: 'asset-id',
@@ -434,7 +434,7 @@ export const assetStub = {
width: null,
height: null,
edits: [],
- editCount: 0,
+ isEdited: false,
}),
external: Object.freeze({
@@ -477,7 +477,7 @@ export const assetStub = {
width: null,
height: null,
edits: [],
- editCount: 0,
+ isEdited: false,
}),
image1: Object.freeze({
@@ -520,7 +520,7 @@ export const assetStub = {
width: null,
height: null,
edits: [],
- editCount: 0,
+ isEdited: false,
}),
imageFrom2015: Object.freeze({
@@ -562,7 +562,7 @@ export const assetStub = {
width: null,
height: null,
edits: [],
- editCount: 0,
+ isEdited: false,
}),
video: Object.freeze({
@@ -606,7 +606,7 @@ export const assetStub = {
width: null,
height: null,
edits: [],
- editCount: 0,
+ isEdited: false,
}),
livePhotoMotionAsset: Object.freeze({
@@ -627,7 +627,7 @@ export const assetStub = {
width: null,
height: null,
edits: [] as AssetEditActionItem[],
- editCount: 0,
+ isEdited: false,
} as MapAsset & { faces: AssetFace[]; files: AssetFile[]; exifInfo: Exif; edits: AssetEditActionItem[] }),
livePhotoStillAsset: Object.freeze({
@@ -649,7 +649,7 @@ export const assetStub = {
width: null,
height: null,
edits: [] as AssetEditActionItem[],
- editCount: 0,
+ isEdited: false,
} as MapAsset & { faces: AssetFace[]; files: AssetFile[]; edits: AssetEditActionItem[] }),
livePhotoWithOriginalFileName: Object.freeze({
@@ -673,7 +673,7 @@ export const assetStub = {
width: null,
height: null,
edits: [] as AssetEditActionItem[],
- editCount: 0,
+ isEdited: false,
} as MapAsset & { faces: AssetFace[]; files: AssetFile[]; edits: AssetEditActionItem[] }),
withLocation: Object.freeze({
@@ -721,7 +721,7 @@ export const assetStub = {
width: null,
height: null,
edits: [],
- editCount: 0,
+ isEdited: false,
}),
sidecar: Object.freeze({
@@ -760,7 +760,7 @@ export const assetStub = {
width: null,
height: null,
edits: [],
- editCount: 0,
+ isEdited: false,
}),
sidecarWithoutExt: Object.freeze({
@@ -796,7 +796,7 @@ export const assetStub = {
width: null,
height: null,
edits: [],
- editCount: 0,
+ isEdited: false,
}),
hasEncodedVideo: Object.freeze({
@@ -839,7 +839,7 @@ export const assetStub = {
width: null,
height: null,
edits: [],
- editCount: 0,
+ isEdited: false,
}),
hasFileExtension: Object.freeze({
@@ -879,7 +879,7 @@ export const assetStub = {
width: null,
height: null,
edits: [],
- editCount: 0,
+ isEdited: false,
}),
imageDng: Object.freeze({
@@ -923,7 +923,7 @@ export const assetStub = {
width: null,
height: null,
edits: [],
- editCount: 0,
+ isEdited: false,
}),
imageHif: Object.freeze({
@@ -967,7 +967,7 @@ export const assetStub = {
width: null,
height: null,
edits: [],
- editCount: 0,
+ isEdited: false,
}),
panoramaTif: Object.freeze({
@@ -1068,7 +1068,7 @@ export const assetStub = {
},
},
] as AssetEditActionItem[],
- editCount: 1,
+ isEdited: true,
}),
withoutEdits: Object.freeze({
@@ -1116,6 +1116,6 @@ export const assetStub = {
width: 2160,
visibility: AssetVisibility.Timeline,
edits: [],
- editCount: 0,
+ isEdited: false,
}),
};
diff --git a/server/test/fixtures/shared-link.stub.ts b/server/test/fixtures/shared-link.stub.ts
index a080b505d4..0f16057431 100644
--- a/server/test/fixtures/shared-link.stub.ts
+++ b/server/test/fixtures/shared-link.stub.ts
@@ -159,7 +159,7 @@ export const sharedLinkStub = {
visibility: AssetVisibility.Timeline,
width: 500,
height: 500,
- editCount: 0,
+ isEdited: false,
},
],
albumId: null,
diff --git a/server/test/medium.factory.ts b/server/test/medium.factory.ts
index acca3092c1..ac3ffed794 100644
--- a/server/test/medium.factory.ts
+++ b/server/test/medium.factory.ts
@@ -537,7 +537,7 @@ const assetInsert = (asset: Partial<Insertable<AssetTable>> = {}) => {
fileModifiedAt: now,
localDateTime: now,
visibility: AssetVisibility.Timeline,
- editCount: 0,
+ isEdited: false,
};
return {
diff --git a/server/test/medium/specs/repositories/asset-edit.repository.spec.ts b/server/test/medium/specs/repositories/asset-edit.repository.spec.ts
index da025299f5..512c6c73f4 100644
--- a/server/test/medium/specs/repositories/asset-edit.repository.spec.ts
+++ b/server/test/medium/specs/repositories/asset-edit.repository.spec.ts
@@ -24,32 +24,32 @@ beforeAll(async () => {
describe(AssetEditRepository.name, () => {
describe('replaceAll', () => {
- it('should increment editCount on insert', async () => {
+ it('should set isEdited on insert', async () => {
const { ctx, sut } = setup();
const { user } = await ctx.newUser();
const { asset } = await ctx.newAsset({ ownerId: user.id });
await expect(
- ctx.database.selectFrom('asset').select('editCount').where('id', '=', asset.id).executeTakeFirstOrThrow(),
- ).resolves.toEqual({ editCount: 0 });
+ ctx.database.selectFrom('asset').select('isEdited').where('id', '=', asset.id).executeTakeFirstOrThrow(),
+ ).resolves.toEqual({ isEdited: false });
await sut.replaceAll(asset.id, [
{ action: AssetEditAction.Crop, parameters: { height: 1, width: 1, x: 1, y: 1 } },
]);
await expect(
- ctx.database.selectFrom('asset').select('editCount').where('id', '=', asset.id).executeTakeFirstOrThrow(),
- ).resolves.toEqual({ editCount: 1 });
+ ctx.database.selectFrom('asset').select('isEdited').where('id', '=', asset.id).executeTakeFirstOrThrow(),
+ ).resolves.toEqual({ isEdited: true });
});
- it('should increment editCount when inserting multiple edits', async () => {
+ it('should set isEdited when inserting multiple edits', async () => {
const { ctx, sut } = setup();
const { user } = await ctx.newUser();
const { asset } = await ctx.newAsset({ ownerId: user.id });
await expect(
- ctx.database.selectFrom('asset').select('editCount').where('id', '=', asset.id).executeTakeFirstOrThrow(),
- ).resolves.toEqual({ editCount: 0 });
+ ctx.database.selectFrom('asset').select('isEdited').where('id', '=', asset.id).executeTakeFirstOrThrow(),
+ ).resolves.toEqual({ isEdited: false });
await sut.replaceAll(asset.id, [
{ action: AssetEditAction.Crop, parameters: { height: 1, width: 1, x: 1, y: 1 } },
@@ -58,18 +58,18 @@ describe(AssetEditRepository.name, () => {
]);
await expect(
- ctx.database.selectFrom('asset').select('editCount').where('id', '=', asset.id).executeTakeFirstOrThrow(),
- ).resolves.toEqual({ editCount: 3 });
+ ctx.database.selectFrom('asset').select('isEdited').where('id', '=', asset.id).executeTakeFirstOrThrow(),
+ ).resolves.toEqual({ isEdited: true });
});
- it('should decrement editCount', async () => {
+ it('should keep isEdited when removing some edits', async () => {
const { ctx, sut } = setup();
const { user } = await ctx.newUser();
const { asset } = await ctx.newAsset({ ownerId: user.id });
await expect(
- ctx.database.selectFrom('asset').select('editCount').where('id', '=', asset.id).executeTakeFirstOrThrow(),
- ).resolves.toEqual({ editCount: 0 });
+ ctx.database.selectFrom('asset').select('isEdited').where('id', '=', asset.id).executeTakeFirstOrThrow(),
+ ).resolves.toEqual({ isEdited: false });
await sut.replaceAll(asset.id, [
{ action: AssetEditAction.Crop, parameters: { height: 1, width: 1, x: 1, y: 1 } },
@@ -77,23 +77,27 @@ describe(AssetEditRepository.name, () => {
{ action: AssetEditAction.Rotate, parameters: { angle: 90 } },
]);
+ await expect(
+ ctx.database.selectFrom('asset').select('isEdited').where('id', '=', asset.id).executeTakeFirstOrThrow(),
+ ).resolves.toEqual({ isEdited: true });
+
await sut.replaceAll(asset.id, [
{ action: AssetEditAction.Crop, parameters: { height: 1, width: 1, x: 1, y: 1 } },
]);
await expect(
- ctx.database.selectFrom('asset').select('editCount').where('id', '=', asset.id).executeTakeFirstOrThrow(),
- ).resolves.toEqual({ editCount: 1 });
+ ctx.database.selectFrom('asset').select('isEdited').where('id', '=', asset.id).executeTakeFirstOrThrow(),
+ ).resolves.toEqual({ isEdited: true });
});
- it('should set editCount to 0 if all edits are deleted', async () => {
+ it('should set isEdited to false if all edits are deleted', async () => {
const { ctx, sut } = setup();
const { user } = await ctx.newUser();
const { asset } = await ctx.newAsset({ ownerId: user.id });
await expect(
- ctx.database.selectFrom('asset').select('editCount').where('id', '=', asset.id).executeTakeFirstOrThrow(),
- ).resolves.toEqual({ editCount: 0 });
+ ctx.database.selectFrom('asset').select('isEdited').where('id', '=', asset.id).executeTakeFirstOrThrow(),
+ ).resolves.toEqual({ isEdited: false });
await sut.replaceAll(asset.id, [
{ action: AssetEditAction.Crop, parameters: { height: 1, width: 1, x: 1, y: 1 } },
@@ -104,8 +108,8 @@ describe(AssetEditRepository.name, () => {
await sut.replaceAll(asset.id, []);
await expect(
- ctx.database.selectFrom('asset').select('editCount').where('id', '=', asset.id).executeTakeFirstOrThrow(),
- ).resolves.toEqual({ editCount: 0 });
+ ctx.database.selectFrom('asset').select('isEdited').where('id', '=', asset.id).executeTakeFirstOrThrow(),
+ ).resolves.toEqual({ isEdited: false });
});
});
});
diff --git a/server/test/medium/specs/sync/sync-album-asset.spec.ts b/server/test/medium/specs/sync/sync-album-asset.spec.ts
index b271956dc5..123b6f9484 100644
--- a/server/test/medium/specs/sync/sync-album-asset.spec.ts
+++ b/server/test/medium/specs/sync/sync-album-asset.spec.ts
@@ -83,7 +83,7 @@ describe(SyncRequestType.AlbumAssetsV1, () => {
libraryId: asset.libraryId,
width: asset.width,
height: asset.height,
- editCount: asset.editCount,
+ isEdited: asset.isEdited,
},
type: SyncEntityType.AlbumAssetCreateV1,
},
diff --git a/server/test/medium/specs/sync/sync-asset.spec.ts b/server/test/medium/specs/sync/sync-asset.spec.ts
index 839923ce14..a1a898d9b3 100644
--- a/server/test/medium/specs/sync/sync-asset.spec.ts
+++ b/server/test/medium/specs/sync/sync-asset.spec.ts
@@ -64,7 +64,7 @@ describe(SyncEntityType.AssetV1, () => {
libraryId: asset.libraryId,
width: asset.width,
height: asset.height,
- editCount: asset.editCount,
+ isEdited: asset.isEdited,
},
type: 'AssetV1',
},
diff --git a/server/test/medium/specs/sync/sync-partner-asset.spec.ts b/server/test/medium/specs/sync/sync-partner-asset.spec.ts
index af38160545..345d4a1e29 100644
--- a/server/test/medium/specs/sync/sync-partner-asset.spec.ts
+++ b/server/test/medium/specs/sync/sync-partner-asset.spec.ts
@@ -63,7 +63,7 @@ describe(SyncRequestType.PartnerAssetsV1, () => {
type: asset.type,
visibility: asset.visibility,
duration: asset.duration,
- editCount: asset.editCount,
+ isEdited: asset.isEdited,
stackId: null,
livePhotoVideoId: null,
libraryId: asset.libraryId,
diff --git a/server/test/small.factory.ts b/server/test/small.factory.ts
index 9d998f5ae4..83d3a4777b 100644
--- a/server/test/small.factory.ts
+++ b/server/test/small.factory.ts
@@ -253,7 +253,7 @@ const assetFactory = (asset: Partial<MapAsset> = {}) => ({
visibility: AssetVisibility.Timeline,
width: null,
height: null,
- editCount: 0,
+ isEdited: false,
...asset,
});
diff --git a/web/src/lib/components/asset-viewer/asset-viewer-nav-bar.svelte b/web/src/lib/components/asset-viewer/asset-viewer-nav-bar.svelte
index 8d30439dc0..b0396f939f 100644
--- a/web/src/lib/components/asset-viewer/asset-viewer-nav-bar.svelte
+++ b/web/src/lib/components/asset-viewer/asset-viewer-nav-bar.svelte
@@ -7,6 +7,7 @@
import AddToStackAction from '$lib/components/asset-viewer/actions/add-to-stack-action.svelte';
import ArchiveAction from '$lib/components/asset-viewer/actions/archive-action.svelte';
import DeleteAction from '$lib/components/asset-viewer/actions/delete-action.svelte';
+ import EditAction from '$lib/components/asset-viewer/actions/edit-action.svelte';
import KeepThisDeleteOthersAction from '$lib/components/asset-viewer/actions/keep-this-delete-others.svelte';
import RatingAction from '$lib/components/asset-viewer/actions/rating-action.svelte';
import RemoveAssetFromStack from '$lib/components/asset-viewer/actions/remove-asset-from-stack.svelte';
@@ -19,6 +20,7 @@
import UnstackAction from '$lib/components/asset-viewer/actions/unstack-action.svelte';
import ButtonContextMenu from '$lib/components/shared-components/context-menu/button-context-menu.svelte';
import MenuOption from '$lib/components/shared-components/context-menu/menu-option.svelte';
+ import { ProjectionType } from '$lib/constants';
import { featureFlagsManager } from '$lib/managers/feature-flags-manager.svelte';
import { Route } from '$lib/route';
import { getGlobalActions } from '$lib/services/app.service';
@@ -71,7 +73,7 @@
onUndoDelete?: OnUndoDelete;
onRunJob: (name: AssetJobName) => void;
onPlaySlideshow: () => void;
- // onEdit: () => void;
+ onEdit: () => void;
onClose?: () => void;
playOriginalVideo: boolean;
setPlayOriginalVideo: (value: boolean) => void;
@@ -91,7 +93,7 @@
onRunJob,
onPlaySlideshow,
onClose,
- // onEdit,
+ onEdit,
playOriginalVideo = false,
setPlayOriginalVideo,
}: Props = $props();
@@ -126,17 +128,17 @@
const sharedLink = getSharedLink();
// TODO: Enable when edits are ready for release
- // let showEditorButton = $derived(
- // isOwner &&
- // asset.type === AssetTypeEnum.Image &&
- // !(
- // asset.exifInfo?.projectionType === ProjectionType.EQUIRECTANGULAR ||
- // (asset.originalPath && asset.originalPath.toLowerCase().endsWith('.insp'))
- // ) &&
- // !(asset.originalPath && asset.originalPath.toLowerCase().endsWith('.gif')) &&
- // !(asset.originalPath && asset.originalPath.toLowerCase().endsWith('.svg')) &&
- // !asset.livePhotoVideoId,
- // );
+ let showEditorButton = $derived(
+ isOwner &&
+ asset.type === AssetTypeEnum.Image &&
+ !(
+ asset.exifInfo?.projectionType === ProjectionType.EQUIRECTANGULAR ||
+ (asset.originalPath && asset.originalPath.toLowerCase().endsWith('.insp'))
+ ) &&
+ !(asset.originalPath && asset.originalPath.toLowerCase().endsWith('.gif')) &&
+ !(asset.originalPath && asset.originalPath.toLowerCase().endsWith('.svg')) &&
+ !asset.livePhotoVideoId,
+ );
</script>
<CommandPaletteDefaultProvider
@@ -189,9 +191,9 @@
<RatingAction {asset} {onAction} />
{/if}
- <!-- {#if showEditorButton}
+ {#if showEditorButton}
<EditAction onAction={onEdit} />
- {/if} -->
+ {/if}
{#if isOwner}
<DeleteAction {asset} {onAction} {preAction} {onUndoDelete} />
diff --git a/web/src/lib/components/asset-viewer/asset-viewer.svelte b/web/src/lib/components/asset-viewer/asset-viewer.svelte
index 58811ff975..334c7c1032 100644
--- a/web/src/lib/components/asset-viewer/asset-viewer.svelte
+++ b/web/src/lib/components/asset-viewer/asset-viewer.svelte
@@ -254,12 +254,12 @@
});
};
- // const showEditor = () => {
- // if (assetViewerManager.isShowActivityPanel) {
- // assetViewerManager.isShowActivityPanel = false;
- // }
- // isShowEditor = !isShowEditor;
- // };
+ const showEditor = () => {
+ if (assetViewerManager.isShowActivityPanel) {
+ assetViewerManager.isShowActivityPanel = false;
+ }
+ isShowEditor = !isShowEditor;
+ };
const handleRunJob = async (name: AssetJobName) => {
try {
@@ -466,6 +466,7 @@
preAction={handlePreAction}
onAction={handleAction}
{onUndoDelete}
+ onEdit={showEditor}
onRunJob={handleRunJob}
onPlaySlideshow={() => ($slideshowState = SlideshowState.PlaySlideshow)}
onClose={onClose ? () => onClose(asset) : undefined}
diff --git a/web/src/lib/managers/edit/edit-manager.svelte.ts b/web/src/lib/managers/edit/edit-manager.svelte.ts
index b8ebea1cf0..ef326f2661 100644
--- a/web/src/lib/managers/edit/edit-manager.svelte.ts
+++ b/web/src/lib/managers/edit/edit-manager.svelte.ts
@@ -115,7 +115,7 @@ export class EditManager {
// Setup the websocket listener before sending the edit request
const editCompleted = waitForWebsocketEvent(
'AssetEditReadyV1',
- (event) => event.assetId === this.currentAsset!.id,
+ (event) => event.asset.id === this.currentAsset!.id,
10_000,
);
diff --git a/web/src/lib/stores/websocket.ts b/web/src/lib/stores/websocket.ts
index 1246341311..75fa57bb2a 100644
--- a/web/src/lib/stores/websocket.ts
+++ b/web/src/lib/stores/websocket.ts
@@ -31,7 +31,7 @@ export interface Events {
on_notification: (notification: NotificationDto) => void;
AppRestartV1: (event: AppRestartEvent) => void;
- AssetEditReadyV1: (data: { assetId: string }) => void;
+ AssetEditReadyV1: (data: { asset: { id: string } }) => void;
}
const websocket: Socket<Events> = io({