Skip to:
I see this error when trying to add a column to a table that already exists.
Unexpected error running Liquibase: Table 'DATABASECHANGELOG' already exists
The ChangeLog file, that i am executing from the Command prompt is :
<?xml version="1.0" encoding="UTF-8"?>
<databaseChangeLogxmlns="http://www.liquibase.org/xml/ns/dbchangelog"xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangeloghttp://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.1.xsd">
<changeSet id="1.0" author="Jitu"><createTable tableName="student"><column name="id" type="int"></column><column name="name" type="varchar(50)"></column><column name="enrolled" type="boolean"/></createTable></changeSet><changeSet id="2.0" author="Jitu"><addColumn tableName="student"><column name="grade" type="float(7,2)"></column> </addColumn></changeSet> </databaseChangeLog>
ChangeSet id 2.0 is giving me this issue.
Please help!
I am using Liquibase 3.6.2 and connecting to a Mysql database in a docker container on my windows 10 machine.
Not sure if i had to downgrade the version. But this was 'fixed' by going to schema 'sys' in place of 'mysql'.
I see this error when trying to add a column to a table that already exists.
Unexpected error running Liquibase: Table 'DATABASECHANGELOG' already exists
The ChangeLog file, that i am executing from the Command prompt is :
<?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.1.xsd">
<changeSet id="1.0" author="Jitu">
<createTable tableName="student">
<column name="id" type="int">
</column>
<column name="name" type="varchar(50)">
</column>
<column name="enrolled" type="boolean"/>
</createTable>
</changeSet>
<changeSet id="2.0" author="Jitu">
<addColumn tableName="student">
<column name="grade" type="float(7,2)">
</column>
</addColumn>
</changeSet>
</databaseChangeLog>
ChangeSet id 2.0 is giving me this issue.
Please help!