Quantcast
Channel: Liquibase Forums
Viewing all articles
Browse latest Browse all 2993

Table comment conflicts with modifySQL.append

$
0
0
Hi everyone,

In Oracle, you can create a partitioned table like below:
  1. CREATE TABLE FOO(ID NUMBER(10)) PARTITION BY RANGE (ID) INTERVAL (1);

Oracle XE does not allow to use partitioning so the same table should look like:
  1. CREATE TABLE FOO(ID NUMBER(10));

I tried creating the following script:
  1. <changeSet id="TBL_FOO">
  2.     <createTable remarks="Table comments" tableName="FOO">
  3.         <column name="ID" type="NUMBER(10)"/>
  4.     </createTable>
  5.     <modifySql context="nonxe">
  6.         <append value="PARTITION BY RANGE (ID) INTERVAL (1)"/>
  7.     </modifySql>
  8. </changeSet>

However, Liquibase creates two statements for the above script and appends the partition clause to the COMMENT statement, which breaks the build.
  1. CREATE TABLE...;
  2. COMMENT ON TABLE FOO IS ".....";PARTITION BY RANGE (ID) INTERVAL (1)
Is there a nice way (e.g. not using replaceRegExp with "CREATE TABLE (.*);" and backreferences) to achieve the correct behavior?

PS: In fact, this problem is not tied to XE/nonXE differences. Even if you simply want to create an Oracle partitioned table with comment, you face that behavior.

Viewing all articles
Browse latest Browse all 2993

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>