001
014
015 package com.liferay.portal.upgrade.v6_0_3;
016
017 import com.liferay.portal.kernel.dao.jdbc.DataAccess;
018 import com.liferay.portal.kernel.upgrade.UpgradeProcess;
019 import com.liferay.portal.kernel.uuid.PortalUUIDUtil;
020
021 import java.sql.Connection;
022 import java.sql.PreparedStatement;
023 import java.sql.ResultSet;
024
025
028 public class UpgradeLayout extends UpgradeProcess {
029
030 @Override
031 protected void doUpgrade() throws Exception {
032 Connection con = null;
033 PreparedStatement ps = null;
034 ResultSet rs = null;
035
036 try {
037 con = DataAccess.getUpgradeOptimizedConnection();
038
039 ps = con.prepareStatement(
040 "select plid from Layout where uuid_ is null");
041
042 rs = ps.executeQuery();
043
044 while (rs.next()) {
045 long plid = rs.getLong("plid");
046
047 runSQL(
048 "update Layout set uuid_ = '" + PortalUUIDUtil.generate() +
049 "' where plid = " + plid);
050 }
051 }
052 finally {
053 DataAccess.cleanUp(con, ps, rs);
054 }
055 }
056
057 }