1
0
mirror of https://github.com/immich-app/immich.git synced 2025-03-11 15:09:45 +02:00

chore: make profileImagePath nullable

This commit is contained in:
shenlong-tanwen 2025-03-07 06:18:47 +05:30
parent bdc04259e0
commit 8fb2da5ef7
3 changed files with 12 additions and 16 deletions

View File

@ -1 +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":"int","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"uid","getter_name":"uid","moor_type":"string","nullable":false,"customConstraints":null,"defaultConstraints":"UNIQUE","dialectAwareDefaultConstraints":{"sqlite":"UNIQUE"},"default_dart":null,"default_client_dart":null,"dsl_features":["unknown"]},{"name":"updated_at","getter_name":"updatedAt","moor_type":"dateTime","nullable":false,"customConstraints":null,"default_dart":"const CustomExpression('CAST(strftime(\\'%s\\', CURRENT_TIMESTAMP) AS INTEGER)')","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":"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":"is_partner_shared_by","getter_name":"isPartnerSharedBy","moor_type":"bool","nullable":false,"customConstraints":null,"defaultConstraints":"CHECK (\"is_partner_shared_by\" IN (0, 1))","dialectAwareDefaultConstraints":{"sqlite":"CHECK (\"is_partner_shared_by\" IN (0, 1))"},"default_dart":"const CustomExpression('0')","default_client_dart":null,"dsl_features":[]},{"name":"is_partner_shared_with","getter_name":"isPartnerSharedWith","moor_type":"bool","nullable":false,"customConstraints":null,"defaultConstraints":"CHECK (\"is_partner_shared_with\" IN (0, 1))","dialectAwareDefaultConstraints":{"sqlite":"CHECK (\"is_partner_shared_with\" IN (0, 1))"},"default_dart":"const CustomExpression('0')","default_client_dart":null,"dsl_features":[]},{"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":[]},{"name":"profile_image_path","getter_name":"profileImagePath","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"memory_enabled","getter_name":"memoryEnabled","moor_type":"bool","nullable":false,"customConstraints":null,"defaultConstraints":"CHECK (\"memory_enabled\" IN (0, 1))","dialectAwareDefaultConstraints":{"sqlite":"CHECK (\"memory_enabled\" IN (0, 1))"},"default_dart":"const CustomExpression('1')","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"}}],"is_virtual":false,"without_rowid":false,"constraints":[],"explicit_pk":["id"]}},{"id":1,"references":[0],"type":"index","data":{"on":0,"name":"user_uid","sql":null,"unique":false,"columns":["uid"]}}]}
{"_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":"int","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"uid","getter_name":"uid","moor_type":"string","nullable":false,"customConstraints":null,"defaultConstraints":"UNIQUE","dialectAwareDefaultConstraints":{"sqlite":"UNIQUE"},"default_dart":null,"default_client_dart":null,"dsl_features":["unknown"]},{"name":"updated_at","getter_name":"updatedAt","moor_type":"dateTime","nullable":false,"customConstraints":null,"default_dart":"const CustomExpression('CAST(strftime(\\'%s\\', CURRENT_TIMESTAMP) AS INTEGER)')","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":"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":"is_partner_shared_by","getter_name":"isPartnerSharedBy","moor_type":"bool","nullable":false,"customConstraints":null,"defaultConstraints":"CHECK (\"is_partner_shared_by\" IN (0, 1))","dialectAwareDefaultConstraints":{"sqlite":"CHECK (\"is_partner_shared_by\" IN (0, 1))"},"default_dart":"const CustomExpression('0')","default_client_dart":null,"dsl_features":[]},{"name":"is_partner_shared_with","getter_name":"isPartnerSharedWith","moor_type":"bool","nullable":false,"customConstraints":null,"defaultConstraints":"CHECK (\"is_partner_shared_with\" IN (0, 1))","dialectAwareDefaultConstraints":{"sqlite":"CHECK (\"is_partner_shared_with\" IN (0, 1))"},"default_dart":"const CustomExpression('0')","default_client_dart":null,"dsl_features":[]},{"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":[]},{"name":"profile_image_path","getter_name":"profileImagePath","moor_type":"string","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"memory_enabled","getter_name":"memoryEnabled","moor_type":"bool","nullable":false,"customConstraints":null,"defaultConstraints":"CHECK (\"memory_enabled\" IN (0, 1))","dialectAwareDefaultConstraints":{"sqlite":"CHECK (\"memory_enabled\" IN (0, 1))"},"default_dart":"const CustomExpression('1')","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"}}],"is_virtual":false,"without_rowid":false,"constraints":[],"explicit_pk":["id"]}},{"id":1,"references":[0],"type":"index","data":{"on":0,"name":"user_uid","sql":null,"unique":false,"columns":["uid"]}}]}

View File

@ -95,7 +95,7 @@ class UserEntity extends Table {
boolean().withDefault(const Constant(false))();
BoolColumn get inTimeline => boolean().withDefault(const Constant(false))();
// User prefs
TextColumn get profileImagePath => text()();
TextColumn get profileImagePath => text().nullable()();
BoolColumn get memoryEnabled => boolean().withDefault(const Constant(true))();
IntColumn get avatarColor => intEnum<model.AvatarColor>()();

View File

@ -20,7 +20,7 @@ typedef $$UserEntityTableCreateCompanionBuilder = i2.UserEntityCompanion
i0.Value<bool> isPartnerSharedBy,
i0.Value<bool> isPartnerSharedWith,
i0.Value<bool> inTimeline,
required String profileImagePath,
i0.Value<String?> profileImagePath,
i0.Value<bool> memoryEnabled,
required i1.AvatarColor avatarColor,
});
@ -37,7 +37,7 @@ typedef $$UserEntityTableUpdateCompanionBuilder = i2.UserEntityCompanion
i0.Value<bool> isPartnerSharedBy,
i0.Value<bool> isPartnerSharedWith,
i0.Value<bool> inTimeline,
i0.Value<String> profileImagePath,
i0.Value<String?> profileImagePath,
i0.Value<bool> memoryEnabled,
i0.Value<i1.AvatarColor> avatarColor,
});
@ -254,7 +254,7 @@ class $$UserEntityTableTableManager extends i0.RootTableManager<
i0.Value<bool> isPartnerSharedBy = const i0.Value.absent(),
i0.Value<bool> isPartnerSharedWith = const i0.Value.absent(),
i0.Value<bool> inTimeline = const i0.Value.absent(),
i0.Value<String> profileImagePath = const i0.Value.absent(),
i0.Value<String?> profileImagePath = const i0.Value.absent(),
i0.Value<bool> memoryEnabled = const i0.Value.absent(),
i0.Value<i1.AvatarColor> avatarColor = const i0.Value.absent(),
}) =>
@ -286,7 +286,7 @@ class $$UserEntityTableTableManager extends i0.RootTableManager<
i0.Value<bool> isPartnerSharedBy = const i0.Value.absent(),
i0.Value<bool> isPartnerSharedWith = const i0.Value.absent(),
i0.Value<bool> inTimeline = const i0.Value.absent(),
required String profileImagePath,
i0.Value<String?> profileImagePath = const i0.Value.absent(),
i0.Value<bool> memoryEnabled = const i0.Value.absent(),
required i1.AvatarColor avatarColor,
}) =>
@ -429,8 +429,8 @@ class $UserEntityTable extends i3.UserEntity
const i0.VerificationMeta('profileImagePath');
@override
late final i0.GeneratedColumn<String> profileImagePath =
i0.GeneratedColumn<String>('profile_image_path', aliasedName, false,
type: i0.DriftSqlType.string, requiredDuringInsert: true);
i0.GeneratedColumn<String>('profile_image_path', aliasedName, true,
type: i0.DriftSqlType.string, requiredDuringInsert: false);
static const i0.VerificationMeta _memoryEnabledMeta =
const i0.VerificationMeta('memoryEnabled');
@override
@ -540,8 +540,6 @@ class $UserEntityTable extends i3.UserEntity
_profileImagePathMeta,
profileImagePath.isAcceptableOrUnknown(
data['profile_image_path']!, _profileImagePathMeta));
} else if (isInserting) {
context.missing(_profileImagePathMeta);
}
if (data.containsKey('memory_enabled')) {
context.handle(
@ -570,8 +568,7 @@ class $UserEntityTable extends i3.UserEntity
updatedAt: attachedDatabase.typeMapping.read(
i0.DriftSqlType.dateTime, data['${effectivePrefix}updated_at'])!,
profileImagePath: attachedDatabase.typeMapping.read(
i0.DriftSqlType.string,
data['${effectivePrefix}profile_image_path'])!,
i0.DriftSqlType.string, data['${effectivePrefix}profile_image_path']),
avatarColor: i2.$UserEntityTable.$converteravatarColor.fromSql(
attachedDatabase.typeMapping.read(
i0.DriftSqlType.int, data['${effectivePrefix}avatar_color'])!),
@ -612,7 +609,7 @@ class UserEntityCompanion extends i0.UpdateCompanion<i1.User> {
final i0.Value<bool> isPartnerSharedBy;
final i0.Value<bool> isPartnerSharedWith;
final i0.Value<bool> inTimeline;
final i0.Value<String> profileImagePath;
final i0.Value<String?> profileImagePath;
final i0.Value<bool> memoryEnabled;
final i0.Value<i1.AvatarColor> avatarColor;
const UserEntityCompanion({
@ -643,13 +640,12 @@ class UserEntityCompanion extends i0.UpdateCompanion<i1.User> {
this.isPartnerSharedBy = const i0.Value.absent(),
this.isPartnerSharedWith = const i0.Value.absent(),
this.inTimeline = const i0.Value.absent(),
required String profileImagePath,
this.profileImagePath = const i0.Value.absent(),
this.memoryEnabled = const i0.Value.absent(),
required i1.AvatarColor avatarColor,
}) : uid = i0.Value(uid),
name = i0.Value(name),
email = i0.Value(email),
profileImagePath = i0.Value(profileImagePath),
avatarColor = i0.Value(avatarColor);
static i0.Insertable<i1.User> custom({
i0.Expression<int>? id,
@ -698,7 +694,7 @@ class UserEntityCompanion extends i0.UpdateCompanion<i1.User> {
i0.Value<bool>? isPartnerSharedBy,
i0.Value<bool>? isPartnerSharedWith,
i0.Value<bool>? inTimeline,
i0.Value<String>? profileImagePath,
i0.Value<String?>? profileImagePath,
i0.Value<bool>? memoryEnabled,
i0.Value<i1.AvatarColor>? avatarColor}) {
return i2.UserEntityCompanion(