0
我需要制作一个Liquibase迁移脚本,只在主键尚未添加时才会将主键添加到数据库表中。做这件事的最好方法是什么?这将是这样的:如何使用Liquibase有条件地将主键添加到数据库表中?
<changeSet id="...">
<preConditions>
(What goes here? Should I use <sqlCheck>, or is there a better alternative?)
</preConditions>
<addPrimaryKey tableName="foo" columnNames="bar" constraintName="foo_pk" />
</changeSet>