@ -440,17 +440,59 @@
class = "mt-4"
>
< h4 class = "text-sm font-medium text-gray-900 mb-2" >
Added Contacts :
Added Contacts ( { { comparison . differences . contacts . added . length } } ) :
< / h4 >
< div class = "max-h-32 overflow-y-auto space-y-1" >
< div class = "space-y-1" >
< div
v - for = "contact in comparison.differences.contacts.added"
: key = "contact.did"
class = "text-xs text-gray-600 bg-gray-50 p-2 rounded"
>
{ { contact . name || "Unnamed" } } ( { {
contact . did . substring ( 0 , 20 )
} } ... )
< div class = "font-medium" > { { contact . name || '<empty>' } } < / div >
< div class = "text-gray-500" > { { contact . did } } < / div >
< div class = "text-gray-400" > { { contact . contactMethods ? . length || 0 } } contact methods < / div >
< / div >
< / div >
< / div >
<!-- Modified Contacts -- >
< div
v - if = "comparison.differences.contacts.modified.length > 0"
class = "mt-4"
>
< h4 class = "text-sm font-medium text-gray-900 mb-2" >
Modified Contacts ( { { comparison . differences . contacts . modified . length } } ) :
< / h4 >
< div class = "space-y-1" >
< div
v - for = "contact in comparison.differences.contacts.modified"
: key = "contact.did"
class = "text-xs text-gray-600 bg-gray-50 p-2 rounded"
>
< div class = "font-medium" > { { contact . name || '<empty>' } } < / div >
< div class = "text-gray-500" > { { contact . did } } < / div >
< div class = "text-gray-400" > { { contact . contactMethods ? . length || 0 } } contact methods < / div >
< / div >
< / div >
< / div >
<!-- Missing Contacts -- >
< div
v - if = "comparison.differences.contacts.missing.filter(c => c.did).length > 0"
class = "mt-4"
>
< h4 class = "text-sm font-medium text-gray-900 mb-2" >
Missing Contacts ( { { comparison . differences . contacts . missing . filter ( c => c . did ) . length } } ) :
< / h4 >
< div class = "space-y-1" >
< div
v - for = "contact in comparison.differences.contacts.missing.filter(c => c.did)"
: key = "contact.did"
class = "text-xs text-gray-600 bg-gray-50 p-2 rounded"
>
< div class = "font-medium" > { { contact . name || '<empty>' } } < / div >
< div class = "text-gray-500" > { { contact . did } } < / div >
< div class = "text-gray-400" > { { contact . contactMethods ? . length || 0 } } contact methods < / div >
< / div >
< / div >
< / div >
@ -521,15 +563,59 @@
class = "mt-4"
>
< h4 class = "text-sm font-medium text-gray-900 mb-2" >
Added Settings :
Added Settings ( { { comparison . differences . settings . added . length } } ) :
< / h4 >
< div class = "max-h-32 overflow-y-auto space-y-1" >
< div class = "space-y-1" >
< div
v - for = "setting in comparison.differences.settings.added"
: key = "setting.id"
class = "text-xs text-gray-600 bg-gray-50 p-2 rounded"
>
ID : { { setting . id } } - { { setting . firstName || "Unnamed" } }
< div class = "font-medium" > ID : { { setting . id } } ( { { setting . id === 1 ? 'master' : 'account' } } ) < / div >
< div class = "text-gray-500" > { { setting . activeDid || setting . accountDid } } < / div >
< div class = "text-gray-400" > Registered : { { setting . isRegistered ? 'Yes' : 'No' } } < / div >
< / div >
< / div >
< / div >
<!-- Modified Settings -- >
< div
v - if = "comparison.differences.settings.modified.length > 0"
class = "mt-4"
>
< h4 class = "text-sm font-medium text-gray-900 mb-2" >
Modified Settings ( { { comparison . differences . settings . modified . length } } ) :
< / h4 >
< div class = "space-y-1" >
< div
v - for = "setting in comparison.differences.settings.modified"
: key = "setting.id"
class = "text-xs text-gray-600 bg-gray-50 p-2 rounded"
>
< div class = "font-medium" > ID : { { setting . id } } ( { { setting . id === 1 ? 'master' : 'account' } } ) < / div >
< div class = "text-gray-500" > { { setting . activeDid || setting . accountDid } } < / div >
< div class = "text-gray-400" > Registered : { { setting . isRegistered ? 'Yes' : 'No' } } < / div >
< / div >
< / div >
< / div >
<!-- Missing Settings -- >
< div
v - if = "comparison.differences.settings.missing.filter(s => s.accountDid || s.activeDid).length > 0"
class = "mt-4"
>
< h4 class = "text-sm font-medium text-gray-900 mb-2" >
Missing Settings ( { { comparison . differences . settings . missing . filter ( s => s . accountDid || s . activeDid ) . length } } ) :
< / h4 >
< div class = "space-y-1" >
< div
v - for = "setting in comparison.differences.settings.missing.filter(s => s.accountDid || s.activeDid)"
: key = "setting.id"
class = "text-xs text-gray-600 bg-gray-50 p-2 rounded"
>
< div class = "font-medium" > ID : { { setting . id } } ( { { setting . id === 1 ? 'master' : 'account' } } ) < / div >
< div class = "text-gray-500" > { { setting . activeDid || setting . accountDid } } < / div >
< div class = "text-gray-400" > Registered : { { setting . isRegistered ? 'Yes' : 'No' } } < / div >
< / div >
< / div >
< / div >
@ -600,15 +686,65 @@
class = "mt-4"
>
< h4 class = "text-sm font-medium text-gray-900 mb-2" >
Added Accounts :
Added Accounts ( { { comparison . differences . accounts . added . length } } ) :
< / h4 >
< div class = "max-h-32 overflow-y-auto space-y-1" >
< div class = "space-y-1" >
< div
v - for = "account in comparison.differences.accounts.added"
: key = "account.id"
class = "text-xs text-gray-600 bg-gray-50 p-2 rounded"
>
ID : { { account . id } } - { { account . did . substring ( 0 , 20 ) } } ...
< div class = "font-medium" > ID : { { account . id } } < / div >
< div class = "text-gray-500" > { { account . did } } < / div >
< div class = "text-gray-400" > Created : { { account . dateCreated } } < / div >
< div class = "text-gray-400" > Has Identity : { { account . identity ? 'Yes' : 'No' } } < / div >
< div class = "text-gray-400" > Has Mnemonic : { { account . mnemonic ? 'Yes' : 'No' } } < / div >
< / div >
< / div >
< / div >
<!-- Modified Accounts -- >
< div
v - if = "comparison.differences.accounts.modified.length > 0"
class = "mt-4"
>
< h4 class = "text-sm font-medium text-gray-900 mb-2" >
Modified Accounts ( { { comparison . differences . accounts . modified . length } } ) :
< / h4 >
< div class = "space-y-1" >
< div
v - for = "account in comparison.differences.accounts.modified"
: key = "account.id"
class = "text-xs text-gray-600 bg-gray-50 p-2 rounded"
>
< div class = "font-medium" > ID : { { account . id } } < / div >
< div class = "text-gray-500" > { { account . did } } < / div >
< div class = "text-gray-400" > Created : { { account . dateCreated } } < / div >
< div class = "text-gray-400" > Has Identity : { { account . identity ? 'Yes' : 'No' } } < / div >
< div class = "text-gray-400" > Has Mnemonic : { { account . mnemonic ? 'Yes' : 'No' } } < / div >
< / div >
< / div >
< / div >
<!-- Missing Accounts -- >
< div
v - if = "comparison.differences.accounts.missing.filter(a => a.did).length > 0"
class = "mt-4"
>
< h4 class = "text-sm font-medium text-gray-900 mb-2" >
Missing Accounts ( { { comparison . differences . accounts . missing . filter ( a => a . did ) . length } } ) :
< / h4 >
< div class = "space-y-1" >
< div
v - for = "account in comparison.differences.accounts.missing.filter(a => a.did)"
: key = "account.id"
class = "text-xs text-gray-600 bg-gray-50 p-2 rounded"
>
< div class = "font-medium" > ID : { { account . id } } < / div >
< div class = "text-gray-500" > { { account . did } } < / div >
< div class = "text-gray-400" > Created : { { account . dateCreated } } < / div >
< div class = "text-gray-400" > Has Identity : { { account . identity ? 'Yes' : 'No' } } < / div >
< div class = "text-gray-400" > Has Mnemonic : { { account . mnemonic ? 'Yes' : 'No' } } < / div >
< / div >
< / div >
< / div >
@ -746,6 +882,9 @@ export default class DatabaseMigration extends Vue {
"[DatabaseMigration] Complete migration successful" ,
result ,
) ;
/ / R e f r e s h c o m p a r i s o n d a t a a f t e r s u c c e s s f u l m i g r a t i o n
this . comparison = await compareDatabases ( ) ;
} else {
this . error = ` Migration failed: ${ result . errors . join ( ", " ) } ` ;
logger . error (
@ -819,6 +958,9 @@ export default class DatabaseMigration extends Vue {
"[DatabaseMigration] Contact migration completed successfully" ,
result ,
) ;
/ / R e f r e s h c o m p a r i s o n d a t a a f t e r s u c c e s s f u l m i g r a t i o n
this . comparison = await compareDatabases ( ) ;
} else {
this . error = ` Migration failed: ${ result . errors . join ( ", " ) } ` ;
logger . error (
@ -861,6 +1003,9 @@ export default class DatabaseMigration extends Vue {
"[DatabaseMigration] Settings migration completed successfully" ,
result ,
) ;
/ / R e f r e s h c o m p a r i s o n d a t a a f t e r s u c c e s s f u l m i g r a t i o n
this . comparison = await compareDatabases ( ) ;
} else {
this . error = ` Migration failed: ${ result . errors . join ( ", " ) } ` ;
logger . error (
@ -904,6 +1049,9 @@ export default class DatabaseMigration extends Vue {
"[DatabaseMigration] Account migration completed successfully" ,
result ,
) ;
/ / R e f r e s h c o m p a r i s o n d a t a a f t e r s u c c e s s f u l m i g r a t i o n
this . comparison = await compareDatabases ( ) ;
} else {
this . error = ` Migration failed: ${ result . errors . join ( ", " ) } ` ;
logger . error (
@ -937,32 +1085,69 @@ export default class DatabaseMigration extends Vue {
try {
const newComparison = await compareDatabases ( ) ;
/ / C h e c k i f t h e r e a r e a n y r e m a i n i n g d i f f e r e n c e s
const totalRemaining =
newComparison . differences . contacts . added . length +
newComparison . differences . contacts . modified . length +
newComparison . differences . contacts . missing . length +
newComparison . differences . settings . added . length +
newComparison . differences . settings . modified . length +
newComparison . differences . settings . missing . length +
newComparison . differences . accounts . added . length +
newComparison . differences . accounts . modified . length +
newComparison . differences . accounts . missing . length ;
/ / C a l c u l a t e d i f f e r e n c e s b y t y p e f o r e a c h t a b l e
const differences = {
contacts : {
added : newComparison . differences . contacts . added . length ,
modified : newComparison . differences . contacts . modified . length ,
missing : newComparison . differences . contacts . missing . length ,
} ,
settings : {
added : newComparison . differences . settings . added . length ,
modified : newComparison . differences . settings . modified . length ,
missing : newComparison . differences . settings . missing . length ,
} ,
accounts : {
added : newComparison . differences . accounts . added . length ,
modified : newComparison . differences . accounts . modified . length ,
missing : newComparison . differences . accounts . missing . length ,
} ,
} ;
const totalRemaining = Object . values ( differences ) . reduce (
( sum , table ) =>
sum + table . added + table . modified + table . missing ,
0
) ;
/ / B u i l d a d e t a i l e d m e s s a g e
const detailMessages = [ ] ;
if ( differences . contacts . added + differences . contacts . modified + differences . contacts . missing > 0 ) {
detailMessages . push (
` Contacts: ${ differences . contacts . added } to add, ${ differences . contacts . modified } modified, ${ differences . contacts . missing } missing `
) ;
}
if ( differences . settings . added + differences . settings . modified + differences . settings . missing > 0 ) {
detailMessages . push (
` Settings: ${ differences . settings . added } to add, ${ differences . settings . modified } modified, ${ differences . settings . missing } missing `
) ;
}
if ( differences . accounts . added + differences . accounts . modified + differences . accounts . missing > 0 ) {
detailMessages . push (
` Accounts: ${ differences . accounts . added } to add, ${ differences . accounts . modified } modified, ${ differences . accounts . missing } missing `
) ;
}
if ( totalRemaining === 0 ) {
this . successMessage =
"✅ Migration verification successful! All data has been migrated correctly." ;
logger . info (
"[DatabaseMigration] Migration verification successful - no differences found" ,
"[DatabaseMigration] Migration verification successful - no differences found"
) ;
} else {
this . successMessage = ` ⚠️ Migration verification completed. Found ${ totalRemaining } remaining differences. Consider running additional migrations if needed. ` ;
this . successMessage = ` ⚠️ Migration verification completed. Found ${ totalRemaining } remaining differences: \ n ${ detailMessages . join ( "\n" ) } ` ;
if ( differences . settings . modified > 0 || differences . settings . missing > 0 ) {
this . successMessage += "\n\nNote: Some settings differences may be expected due to default values in SQLite." ;
}
logger . warn (
"[DatabaseMigration] Migration verification found remaining differences" ,
{
remaining : totalRemaining ,
differences : newComparison . differences ,
} ,
differences : differences ,
}
) ;
}