1
22
23 package com.liferay.portal.upgrade.v4_3_3;
24
25 import com.liferay.portal.kernel.log.Log;
26 import com.liferay.portal.kernel.log.LogFactoryUtil;
27 import com.liferay.portal.upgrade.UpgradeException;
28 import com.liferay.portal.upgrade.UpgradeProcess;
29 import com.liferay.portal.upgrade.util.DefaultUpgradeTableImpl;
30 import com.liferay.portal.upgrade.util.UpgradeTable;
31 import com.liferay.portlet.softwarecatalog.model.impl.SCFrameworkVersionImpl;
32 import com.liferay.portlet.softwarecatalog.model.impl.SCLicenseImpl;
33 import com.liferay.portlet.softwarecatalog.model.impl.SCProductEntryImpl;
34 import com.liferay.portlet.softwarecatalog.model.impl.SCProductVersionImpl;
35
36
42 public class UpgradeSoftwareCatalog extends UpgradeProcess {
43
44 public void upgrade() throws UpgradeException {
45 _log.info("Upgrading");
46
47 try {
48 doUpgrade();
49 }
50 catch (Exception e) {
51 throw new UpgradeException(e);
52 }
53 }
54
55 protected void doUpgrade() throws Exception {
56
57
59 UpgradeTable upgradeTable = new DefaultUpgradeTableImpl(
60 SCFrameworkVersionImpl.TABLE_NAME,
61 SCFrameworkVersionImpl.TABLE_COLUMNS);
62
63 upgradeTable.setCreateSQL(SCFrameworkVersionImpl.TABLE_SQL_CREATE);
64
65 upgradeTable.updateTable();
66
67
69 upgradeTable = new DefaultUpgradeTableImpl(
70 SCLicenseImpl.TABLE_NAME, SCLicenseImpl.TABLE_COLUMNS);
71
72 upgradeTable.setCreateSQL(SCLicenseImpl.TABLE_SQL_CREATE);
73
74 upgradeTable.updateTable();
75
76
78 upgradeTable = new DefaultUpgradeTableImpl(
79 SCProductEntryImpl.TABLE_NAME, SCProductEntryImpl.TABLE_COLUMNS);
80
81 upgradeTable.setCreateSQL(SCProductEntryImpl.TABLE_SQL_CREATE);
82
83 upgradeTable.updateTable();
84
85
87 upgradeTable = new DefaultUpgradeTableImpl(
88 SCProductVersionImpl.TABLE_NAME,
89 SCProductVersionImpl.TABLE_COLUMNS);
90
91 upgradeTable.setCreateSQL(SCProductVersionImpl.TABLE_SQL_CREATE);
92
93 upgradeTable.updateTable();
94 }
95
96 private static Log _log =
97 LogFactoryUtil.getLog(UpgradeSoftwareCatalog.class);
98
99 }