fix: remove foreign constraint on stack.primaryAssetId (#20052)

* fix: remove foreign constraint in stack.primaryAssetId

* fix migration

---------

Co-authored-by: shenlong-tanwen <139912620+shalong-tanwen@users.noreply.github.com>
This commit is contained in:
shenlong 2025-07-22 01:50:41 +05:30 committed by GitHub
parent 5fc4393e7a
commit 1dc62fce5f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 5521 additions and 126 deletions

View file

@ -1,5 +1,4 @@
import 'package:drift/drift.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';
@ -15,7 +14,7 @@ class StackEntity extends Table with DriftDefaultsMixin {
TextColumn get ownerId =>
text().references(UserEntity, #id, onDelete: KeyAction.cascade)();
TextColumn get primaryAssetId => text().references(RemoteAssetEntity, #id)();
TextColumn get primaryAssetId => text()();
@override
Set<Column> get primaryKey => {id};