升级插件

此示例显示如何在 upgrade.xml 中添加 <migrate> 元素,以指定升级中要使用的命令。

要创建升级,首先在 plugin.xml 中增大 <identifier> 元素的 version 属性的数字。然后,在 upgrade.xml 中创建具有包含新数字的 to-version 属性的 <migrate> 元素。最后,将与更新后的 plugin.xml 文件匹配的 property 和 step-type 元素放置在此元素中,如下图中所示。

<?xml version="1.0" encoding="UTF-8"?>
<plugin-upgrade
        xmlns="http://www.&company;.com/UpgradeXMLSchema_v1"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <migrate to-version="3">
    <migrate-command name="Run SQLPlus script">
      <migrate-properties>
        <migrate-property name="sqlFiles" old="sqlFile"/>
      </migrate-properties>
    </migrate-command>
  </migrate>
  <migrate to-version="4">
    <migrate-command name="Run SQLPlus script" />
  </migrate>
  <migrate to-version="5">
    <migrate-command name="Run SQLPlus script" />
  </migrate>
</plugin-upgrade>

您还可以生成仅脚本升级,即,包含对步骤的相关联脚本和文件的更改的升级,但是该升级不会更改 plugin.xml。此机制对于插件开发和小错误修订/更新很有用。


反馈