From beed3c7ad826491235bfbc586329e16ca4e8cc6b Mon Sep 17 00:00:00 2001 From: Zixuan James Li Date: Mon, 16 Dec 2024 15:33:31 -0500 Subject: [PATCH] db [nfc]: Remove handwritten copy of copyWithCompanion This has been addressed in Greg's upstream PR: https://github.com/simolus3/drift/pull/3022 Signed-off-by: Zixuan James Li --- lib/model/database.dart | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/lib/model/database.dart b/lib/model/database.dart index 687011026f..6ca2aa3726 100644 --- a/lib/model/database.dart +++ b/lib/model/database.dart @@ -39,8 +39,6 @@ class Accounts extends Table { Column get ackedPushToken => text().nullable()(); - // If adding a column, be sure to add it to copyWithCompanion too. - @override List>> get uniqueKeys => [ {realmUrl, userId}, @@ -48,22 +46,6 @@ class Accounts extends Table { ]; } -extension AccountExtension on Account { - Account copyWithCompanion(AccountsCompanion data) { // TODO(drift): generate this - return Account( - id: data.id.present ? data.id.value : id, - realmUrl: data.realmUrl.present ? data.realmUrl.value : realmUrl, - userId: data.userId.present ? data.userId.value : userId, - email: data.email.present ? data.email.value : email, - apiKey: data.apiKey.present ? data.apiKey.value : apiKey, - zulipVersion: data.zulipVersion.present ? data.zulipVersion.value : zulipVersion, - zulipMergeBase: data.zulipMergeBase.present ? data.zulipMergeBase.value : zulipMergeBase, - zulipFeatureLevel: data.zulipFeatureLevel.present ? data.zulipFeatureLevel.value : zulipFeatureLevel, - ackedPushToken: data.ackedPushToken.present ? data.ackedPushToken.value : ackedPushToken, - ); - } -} - class UriConverter extends TypeConverter { const UriConverter(); @override String toSql(Uri value) => value.toString();