Full-stack dev quiz question #58
Liquibase preconditions are more advanced elements of changeset. However, they may help when there are discrepancies between databases on different environments. Check fifty eighth question of full-stack dev quiz to check if you understand preconditions.
Below code is a Liquibase changeset, that will be applied to a database that already have test_table table by using an update command. Look at it and choose the sentences, that are true about it.
<changeSet id="Changeset 1" author="DBA presents">
<columnExists tableName="test_table" columnName="test" />
<column name="test" type="int" />
Choose all valid answers.
- It will add a test column to a table if the column does not exist, yet.
- If a test column already exists, the update operation will fail.
- It will try to apply addColumn change no matter if a test column exists or not.
- If a test column already exists, the update operation will succeed.
- After the database update, Changeset 1 will be marked as executed no matter if a test column existed or not.
For the correct answer scroll down