@@ -837,14 +837,16 @@ const attributesToCreate = async (remoteAttributes, localAttributes, collection,
837837
838838 if ( ! cliConfig . force ) {
839839 if ( deleting . length > 0 && ! isIndex ) {
840- console . log ( `${ chalk . red ( '------------------------------------------------------- ' ) } ` ) ;
840+ console . log ( `${ chalk . red ( '------------------------------------------------------' ) } ` ) ;
841841 console . log ( `${ chalk . red ( '| WARNING: Attribute deletion may cause loss of data |' ) } ` ) ;
842- console . log ( `${ chalk . red ( '-------------------------------------------------------' ) } ` ) ;
842+ console . log ( `${ chalk . red ( '------------------------------------------------------' ) } ` ) ;
843+ console . log ( ) ;
843844 }
844845 if ( conflicts . length > 0 && ! isIndex ) {
845- console . log ( `${ chalk . red ( '--------------------------------------------------------- ' ) } ` ) ;
846+ console . log ( `${ chalk . red ( '--------------------------------------------------------' ) } ` ) ;
846847 console . log ( `${ chalk . red ( '| WARNING: Attribute recreation may cause loss of data |' ) } ` ) ;
847- console . log ( `${ chalk . red ( '---------------------------------------------------------' ) } ` ) ;
848+ console . log ( `${ chalk . red ( '--------------------------------------------------------' ) } ` ) ;
849+ console . log ( ) ;
848850 }
849851
850852 if ( ( await getConfirmation ( ) ) !== true ) {
@@ -1725,9 +1727,10 @@ const checkAndApplyTablesDBChanges = async () => {
17251727 toDelete . push ( remoteDB ) ;
17261728 changes . push ( {
17271729 id : remoteDB . $id ,
1730+ action : chalk . red ( 'deleting' ) ,
17281731 key : 'Database' ,
1729- remote : chalk . red ( ` ${ remoteDB . name } ( ${ remoteDB . $id } )` ) ,
1730- local : chalk . green ( '(deleted locally)' )
1732+ remote : remoteDB . name ,
1733+ local : '(deleted locally)'
17311734 } ) ;
17321735 }
17331736 }
@@ -1740,9 +1743,10 @@ const checkAndApplyTablesDBChanges = async () => {
17401743 toCreate . push ( localDB ) ;
17411744 changes . push ( {
17421745 id : localDB . $id ,
1746+ action : chalk . green ( 'creating' ) ,
17431747 key : 'Database' ,
1744- remote : chalk . red ( '(does not exist)' ) ,
1745- local : chalk . green ( ` ${ localDB . name } ( ${ localDB . $id } )` )
1748+ remote : '(does not exist)' ,
1749+ local : localDB . name
17461750 } ) ;
17471751 } else {
17481752 let hasChanges = false ;
@@ -1751,19 +1755,21 @@ const checkAndApplyTablesDBChanges = async () => {
17511755 hasChanges = true ;
17521756 changes . push ( {
17531757 id : localDB . $id ,
1758+ action : chalk . yellow ( 'updating' ) ,
17541759 key : 'Name' ,
1755- remote : chalk . red ( remoteDB . name ) ,
1756- local : chalk . green ( localDB . name )
1760+ remote : remoteDB . name ,
1761+ local : localDB . name
17571762 } ) ;
17581763 }
17591764
17601765 if ( remoteDB . enabled !== localDB . enabled ) {
17611766 hasChanges = true ;
17621767 changes . push ( {
17631768 id : localDB . $id ,
1764- key : 'Enabled?' ,
1765- remote : chalk . red ( remoteDB . enabled ) ,
1766- local : chalk . green ( localDB . enabled )
1769+ action : chalk . yellow ( 'updating' ) ,
1770+ key : 'Enabled' ,
1771+ remote : remoteDB . enabled ,
1772+ local : localDB . enabled
17671773 } ) ;
17681774 }
17691775
@@ -1774,16 +1780,19 @@ const checkAndApplyTablesDBChanges = async () => {
17741780 }
17751781
17761782 if ( changes . length === 0 ) {
1783+ console . log ( 'No changes found in tablesDB resource' ) ;
1784+ console . log ( ) ;
17771785 return { applied : false , resyncNeeded : false } ;
17781786 }
17791787
1780- log ( 'Found changes in tablesDB resources :' ) ;
1788+ log ( 'Found changes in tablesDB resource :' ) ;
17811789 drawTable ( changes ) ;
17821790
17831791 if ( toDelete . length > 0 ) {
1784- console . log ( `${ chalk . red ( '------------------------------------------------------------------- ' ) } ` ) ;
1792+ console . log ( `${ chalk . red ( '------------------------------------------------------------------' ) } ` ) ;
17851793 console . log ( `${ chalk . red ( '| WARNING: Database deletion will also delete all related tables |' ) } ` ) ;
1786- console . log ( `${ chalk . red ( '-------------------------------------------------------------------' ) } ` ) ;
1794+ console . log ( `${ chalk . red ( '------------------------------------------------------------------' ) } ` ) ;
1795+ console . log ( ) ;
17871796 }
17881797
17891798 if ( ( await getConfirmation ( ) ) !== true ) {
@@ -1841,6 +1850,10 @@ const checkAndApplyTablesDBChanges = async () => {
18411850 }
18421851 }
18431852
1853+ if ( toDelete . length === 0 ) {
1854+ console . log ( ) ;
1855+ }
1856+
18441857 return { applied : true , resyncNeeded : needsResync } ;
18451858} ;
18461859
@@ -1868,6 +1881,7 @@ const pushTable = async ({ returnOnZero, attempts } = { returnOnZero: false }) =
18681881 localConfig . set ( 'tablesDB' , validTablesDBs ) ;
18691882
18701883 success ( 'Configuration resynced successfully.' ) ;
1884+ console . log ( ) ;
18711885 }
18721886
18731887 if ( cliConfig . all ) {
0 commit comments