2025-06-26 19:20:39 +05:30
|
|
|
import 'package:drift/drift.dart';
|
|
|
|
|
import 'package:immich_mobile/domain/models/album/album.model.dart';
|
|
|
|
|
import 'package:immich_mobile/infrastructure/entities/remote_asset.entity.dart';
|
|
|
|
|
import 'package:immich_mobile/infrastructure/entities/user.entity.dart';
|
|
|
|
|
import 'package:immich_mobile/infrastructure/utils/drift_default.mixin.dart';
|
|
|
|
|
|
|
|
|
|
class RemoteAlbumEntity extends Table with DriftDefaultsMixin {
|
|
|
|
|
const RemoteAlbumEntity();
|
|
|
|
|
|
|
|
|
|
TextColumn get id => text()();
|
|
|
|
|
|
|
|
|
|
TextColumn get name => text()();
|
|
|
|
|
|
|
|
|
|
TextColumn get description => text().withDefault(const Constant(''))();
|
|
|
|
|
|
|
|
|
|
DateTimeColumn get createdAt => dateTime().withDefault(currentDateAndTime)();
|
|
|
|
|
|
|
|
|
|
DateTimeColumn get updatedAt => dateTime().withDefault(currentDateAndTime)();
|
|
|
|
|
|
2025-07-25 08:07:22 +05:30
|
|
|
TextColumn get ownerId => text().references(UserEntity, #id, onDelete: KeyAction.cascade)();
|
2025-06-26 19:20:39 +05:30
|
|
|
|
2025-07-25 08:07:22 +05:30
|
|
|
TextColumn get thumbnailAssetId =>
|
|
|
|
|
text().references(RemoteAssetEntity, #id, onDelete: KeyAction.setNull).nullable()();
|
2025-06-26 19:20:39 +05:30
|
|
|
|
2025-07-25 08:07:22 +05:30
|
|
|
BoolColumn get isActivityEnabled => boolean().withDefault(const Constant(true))();
|
2025-06-26 19:20:39 +05:30
|
|
|
|
|
|
|
|
IntColumn get order => intEnum<AlbumAssetOrder>()();
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
Set<Column> get primaryKey => {id};
|
|
|
|
|
}
|