Uploaded image for project: 'PUBLIC - Liferay Portal Community Edition'
  1. PUBLIC - Liferay Portal Community Edition
  2. LPS-96012

DBInspector.hasColumnType method does not check current type from database

    Details

      Description

      Steps to reproduce it:

      1. Startup the portal
      2. After database has been created, modify the field UserNotificationEvent.type_ to convert into a Boolean field (Tinyint in MySQL):
        ALTER TABLE UserNotificationEvent MODIFY type_ tinyint; 
      3. Go to Control Panel/Server Administration/Script
      4. Execute the following script:
        import com.liferay.portal.kernel.upgrade.UpgradeProcess;
        import com.liferay.portal.kernel.log.Log;
        import com.liferay.portal.kernel.log.LogFactoryUtil;
        import com.liferay.portal.upgrade.v7_0_0.util.UserNotificationEventTable;
        
        public class UpgradeUserNotificationEvent extends UpgradeProcess {
        
        	@Override
        	protected void doUpgrade() throws Exception {
        		_log.println(hasColumnType(UserNotificationEventTable.class, "type_","BOOLEAN null"))
        	}
        
                private static final Log _log = LogFactoryUtil.getLog(UpgradeUserNotificationEvent.class);
        }
        
        (new UpgradeUserNotificationEvent()).upgrade()
        

      Results:
      False is printed in the log

      Expected results:
      True should be printed since the field is now boolean.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                summer.zhang Summer Zhang
                Reporter:
                alberto.chaparro Alberto Chaparro
                Participants of an Issue:
                Recent user:
                Clarissa Velazquez
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Days since last comment:
                  37 weeks, 2 days ago

                  Packages

                  Version Package
                  7.1.10 DXP FP16
                  7.1.X
                  7.2.10 DXP FP1
                  7.2.X
                  7.2.1 CE GA2
                  Master