feat: home grid
This commit is contained in:
@@ -1,8 +1,13 @@
|
||||
import 'package:drift/drift.dart';
|
||||
import 'package:immich_mobile/domain/models/asset/asset.model.dart';
|
||||
import 'package:immich_mobile/domain/models/asset.model.dart';
|
||||
|
||||
@TableIndex(name: 'asset_localid', columns: {#localId})
|
||||
@TableIndex(name: 'asset_remoteid', columns: {#remoteId})
|
||||
class Asset extends Table {
|
||||
const Asset();
|
||||
|
||||
IntColumn get id => integer().autoIncrement()();
|
||||
|
||||
TextColumn get name => text()();
|
||||
TextColumn get checksum => text().unique()();
|
||||
IntColumn get height => integer().nullable()();
|
||||
@@ -12,4 +17,11 @@ class Asset extends Table {
|
||||
DateTimeColumn get modifiedTime =>
|
||||
dateTime().withDefault(currentDateAndTime)();
|
||||
IntColumn get duration => integer().withDefault(const Constant(0))();
|
||||
|
||||
// Local only
|
||||
TextColumn get localId => text().nullable()();
|
||||
|
||||
// Remote only
|
||||
TextColumn get remoteId => text().nullable()();
|
||||
TextColumn get livePhotoVideoId => text().nullable()();
|
||||
}
|
||||
|
||||
@@ -1,11 +0,0 @@
|
||||
import 'package:drift/drift.dart';
|
||||
import 'package:immich_mobile/domain/entities/asset.entity.dart';
|
||||
|
||||
class LocalAsset extends Asset {
|
||||
const LocalAsset();
|
||||
|
||||
TextColumn get localId => text()();
|
||||
|
||||
@override
|
||||
Set<Column> get primaryKey => {localId};
|
||||
}
|
||||
@@ -1,12 +0,0 @@
|
||||
import 'package:drift/drift.dart';
|
||||
import 'package:immich_mobile/domain/entities/asset.entity.dart';
|
||||
|
||||
class RemoteAsset extends Asset {
|
||||
const RemoteAsset();
|
||||
|
||||
TextColumn get remoteId => text()();
|
||||
TextColumn get livePhotoVideoId => text().nullable()();
|
||||
|
||||
@override
|
||||
Set<Column> get primaryKey => {remoteId};
|
||||
}
|
||||
Reference in New Issue
Block a user