001
014
015 package com.liferay.portal.upgrade.v6_0_3;
016
017 import com.liferay.portal.kernel.upgrade.UpgradeProcess;
018 import com.liferay.portal.kernel.util.LoggingTimer;
019 import com.liferay.portal.kernel.uuid.PortalUUIDUtil;
020
021 import java.sql.PreparedStatement;
022 import java.sql.ResultSet;
023
024
027 public class UpgradeLayout extends UpgradeProcess {
028
029 @Override
030 protected void doUpgrade() throws Exception {
031 updateLayouts();
032 }
033
034 protected void updateLayouts() throws Exception {
035 try (LoggingTimer loggingTimer = new LoggingTimer();
036 PreparedStatement ps = connection.prepareStatement(
037 "select plid from Layout where uuid_ is null");
038 ResultSet rs = ps.executeQuery()) {
039
040 while (rs.next()) {
041 long plid = rs.getLong("plid");
042
043 runSQL(
044 "update Layout set uuid_ = '" + PortalUUIDUtil.generate() +
045 "' where plid = " + plid);
046 }
047 }
048 }
049
050 }