Changeset Managment for Tabels

So i have been trying to implement Liquibase For our Work.

The use case is something like we have a sql file say employee.sql

–liquibase formatted sql
–changeset liquibase:create_table
–comment create table
CREATE OR REPLACE TABLE .EMPLOYEE (NAME VARCHAR(20), EMPLOYEE_ID VARCHAR(10));

Later once this sql is deployed we want to add a alter statement in the same file as a new changeset below

–liquibase formatted sql
–changeset liquibase:alter_table
–comment create table
Alter table employee add Column Address VARHAR(100);

So as per the documents i read the liquibase should the pick the new changeset and not the one that is already applied.

But what i saw is that liquibase is checking the checksum for the first changeset as well and as the checksum would be different it gives validation error.

So my end goal is to manage create and alter statements in a single file with each modification of the table going as a New Changeset in the same file and liquibase to apply those and not check the already deployed one

You are correct, Liquibase will only consider new or “pending” changsets when executing (unless runOnChange or runAlways is used).

If you are adding a new changeset to an existing changelog, then your changelog should look like this after adding the alter table:

–liquibase formatted sql

–changeset liquibase:create_table
–comment create table
CREATE OR REPLACE TABLE EMPLOYEE (NAME VARCHAR(20), EMPLOYEE_ID VARCHAR(10));

–changeset liquibase:alter_table
–comment alter table
Alter table employee add Column Address VARHAR(100);