Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How can we use xinclude in Liquibase XML changlelog? #37

Open
Umartahir93 opened this issue Jan 21, 2020 · 0 comments
Open

How can we use xinclude in Liquibase XML changlelog? #37

Umartahir93 opened this issue Jan 21, 2020 · 0 comments

Comments

@Umartahir93
Copy link

Umartahir93 commented Jan 21, 2020

I am trying to include another xml file which is a fragement of XML file into my changelog. Whenever I execute my changelog in liquibase it gets executed successfully (without any parsing error) but no table is created in the database.

I am not sure we can use xInclude in liquibsae, but I think it should be possible as we are using xml underneath in liquibase. Plus I coulndt find any example of xinclude in liquibase and in offical documentation.

Changelog.xml

<?xml version="1.0" encoding="UTF-8"?>
<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-3.8.xsd"
                       xmlns:xi="http://www.w3c.org/2001/Xinclude">

	<changeSet id="id-1234"
		author="umarTahir">

		<comment>creates table: employee</comment>
		<xi:include
			href="employee.xml" parse="xml"
         xpointer="title"/>

		<rollback>
			<dropTable schemaName="employee_test" tableName="employee" />
		</rollback>
	</changeSet>

</databaseChangeLog>

employee.xml

<createTable tableName="employee" xml:id="title">
	<column name="employee_id" type="UUID">
		<constraints primaryKey="true"
			primaryKeyName="employee_pkey" />
	</column>
	<column name="first_name" type="TEXT" />
	<column name="middle_name" type="TEXT" />
	<column name="last_name" type="TEXT" />
	<column name="email" type="TEXT" />
	<column name="n_created_by" type="TEXT" />
	<column name="n_created" type="TIMESTAMP WITHOUT TIME ZONE" />
	<column name="n_last_modified_by" type="TEXT" />
	<column name="n_last_modified"
		type="TIMESTAMP WITHOUT TIME ZONE" />
</createTable>

┆Issue is synchronized with this Jira Bug by Unito

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant