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

Precondition onFail="WARN" doesn't work properly #1389

Closed
sync-by-unito bot opened this issue Sep 9, 2020 · 1 comment
Closed

Precondition onFail="WARN" doesn't work properly #1389

sync-by-unito bot opened this issue Sep 9, 2020 · 1 comment
Labels
DBAll hacktoberfest a month-long celebration of open-source software and Developers contribute by completing PRs ImpactLow IntegrationAny Severity3 TypeBug

Comments

@sync-by-unito
Copy link

sync-by-unito bot commented Sep 9, 2020

Environment

Windows 10, Oracle
Liquibase Version: version 3.10.2-SNAPSHOT #19
Liquibase Integration & Version: CLI

Description

If you add precondition with attribute onFail="WARN" to your changelog and this precondition fails, liquibase doesn't show WARN message.

Steps To Reproduce

  1. Create changelog for Oracle database with a simple create table changeset and with precondition onFail="WARN"
<?xml version="1.1" encoding="UTF-8" standalone="no"?>
<databaseChangeLog
	xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
	xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xmlns:pro="http://www.liquibase.org/xml/ns/pro"
	xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog-ext http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd 
http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.6.xsd
http://www.liquibase.org/xml/ns/pro http://www.liquibase.org/xml/ns/pro/liquibase-pro-3.8.xsd">

	<preConditions onFail="WARN">  
        <dbms type="mysql"  />
    </preConditions>   

	<changeSet author="Liquibase Pro User"
		id="1::createTable" objectQuotingStrategy="QUOTE_ALL_OBJECTS"
		labels="setup,community,pro,defaultSchemaName">
		<createTable tableName="ACCOUNT">
			<column name="ACCT_NUM" type="NUMBER(*, 0)" />
			<column name="AMOUNT" type="NUMBER(10, 2)" />
		</createTable>
	</changeSet>

</databaseChangeLog>
  1. Create liquibase.properties file with your Oracle database connection information.
  2. Execute liquibase --changeLogFile=changelog.xml update command.

[^changelog.xml]

Actual Behavior

Liquibase successfully executes update command without showing any WARN message.

!changelog.png|width=200,height=183!

!cmd_result.png|width=200,height=183!

!properties.png|width=200,height=183!

Expected/Desired Behavior

Liquibase should show WARN message that database on which you run the changelog is different from the database specified in the preconditions.

@ro-rah ro-rah added the hacktoberfest a month-long celebration of open-source software and Developers contribute by completing PRs label Sep 28, 2020
@sync-by-unito
Copy link
Author

sync-by-unito bot commented Nov 2, 2020

➤ Pavlo Tytarchuk commented:

Moving to 'Ready to Merge'. Verified with version 4.2.0-LB-654-SNAPSHOT #2 on Windows 10.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
DBAll hacktoberfest a month-long celebration of open-source software and Developers contribute by completing PRs ImpactLow IntegrationAny Severity3 TypeBug
Projects
None yet
Development

No branches or pull requests

3 participants