@@ -795,20 +795,26 @@ private function auto_check_update() {
795795 }
796796
797797 /**
798- * Triggers migration if current phar version > version in ee_option table
798+ * Triggers migration if current phar version > version in ee_option table.
799+ * Also, trigger migrations if phar version >= version in ee_option table but nightly version differ.
799800 */
800801 private function maybe_trigger_migration () {
802+
801803 $ db_version = Option::get ( 'version ' );
802- $ current_version = preg_replace ( ' /-nightly.*$/ ' , '' , EE_VERSION ) ;
804+ $ current_version = EE_VERSION ;
803805
804806 if ( ! $ db_version ) {
805807 $ this ->trigger_migration ( $ current_version );
808+
806809 return ;
807810 }
808811
809- if ( Comparator::lessThan ( $ current_version , $ db_version ) ) {
810- EE ::error ( 'It seems you \'re not running latest version. Please download and run latest version of EasyEngine ' );
811- } elseif ( Comparator::greaterThan ( $ current_version , $ db_version ) ) {
812+ $ base_db_version = preg_replace ( '/-nightly.*$/ ' , '' , $ db_version );
813+ $ base_current_version = preg_replace ( '/-nightly.*$/ ' , '' , EE_VERSION );
814+
815+ if ( Comparator::lessThan ( $ base_current_version , $ base_db_version ) ) {
816+ EE ::error ( 'It seems you \'re not running latest version. Please download and run latest version of EasyEngine. ' );
817+ } elseif ( $ db_version !== $ current_version ) {
812818 EE ::log ( 'Executing migrations. This might take some time. ' );
813819 $ this ->trigger_migration ( $ current_version );
814820 }
0 commit comments