0

I have directory structure for migrations as follow:

db1:

  • latest/ (triggers,functions,procedures)
  • tables/
  • v000/master.xml
  • update.xml

db1/update.xml

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
         xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-2.0.xsd">

    <include   file="v000/master.xml" relativeToChangelogFile="true"/>

</databaseChangeLog>

db2: (try to include db1/update.xml) schema here , as I need to extend/add to db1 schema )

  • update.xml

db2/update.xml

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
         xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-2.0.xsd">


    <include   file="../db1/update.xml" />

</databaseChangeLog>

db1> liquibase --changeLogFile=update.xml update , successful

but

db2 > liquibase --changeLogFile=update.xml validate

show validation errors for tables included from db1/v000/master.xml

<include file="tables/12_createTable_audiences.xml" />

Error Reading Migration File:tables/12_createTable_audiences.xml .....

if I fix the error by following changes (for each table: in db1/v000/mater.xml)

 <include file="../tables/12_createTable_audiences.xml" relativeToChangelogFile="true"/>

db2 > liquibase --changeLogFile=update.xml validate/update works fine

but

db2 > liquibase --changeLogFile=update.xml dbDocs ~/docs/db1

fails on table 12_createTable_audiences.xml

Does any one know how to fix these (path issues) ? Why update and dbDoc commands behave differently for same paths ?

thanks for your kind support.

4

1 回答 1

0

relativeToChangelogFile尝试从根目录指定包含文件中的路径,而不是使用属性。就像是

<iuclude file = "./Update/db1/update.xml" />
于 2013-02-13T05:51:23.650 回答