Skip to content

ci: add liquibase schema versioning#4401

Open
gracecluvohio wants to merge 4 commits intoapache:mainfrom
gracecluvohio:add-liquidbase
Open

ci: add liquibase schema versioning#4401
gracecluvohio wants to merge 4 commits intoapache:mainfrom
gracecluvohio:add-liquidbase

Conversation

@gracecluvohio
Copy link
Copy Markdown
Contributor

What changes were proposed in this PR?

This PR adds Liquibase to automate local database migrations. Running docker compose up will now automatically apply any pending SQL migrations under sql/updates, so developers no longer need to manually run SQL scripts after pulling changes.

NB:

  • The author of the PR with the schema change will need to add a <changeSet> element to changelog.xml so that Liquibase can detect the new update.
  • \c texera_db is a line that is being used in every sql update file under sql/updates. However, this is a psql command and not SQL, so Liquibase will throw an error. Authors should not add this line to their update scripts, since the database is already set to texera_db for Liquibase in docker-compose.yml.

Any related issues, documentation, discussions?

Closes #4400

How was this PR tested?

Locally

Was this PR authored or co-authored using generative AI tooling?

No

Copy link
Copy Markdown
Contributor

@aglinxinyuan aglinxinyuan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this under file-service folder?

@gracecluvohio
Copy link
Copy Markdown
Contributor Author

Why is this under file-service folder?

I just wanted to keep it with the docker-compose.yml file. Not sure where else to put it. Would sql be a better folder?

@aglinxinyuan
Copy link
Copy Markdown
Contributor

Why is this under file-service folder?

I just wanted to keep it with the docker-compose.yml file. Not sure where else to put it. Would sql be a better folder?

Yes. Please put it in the SQL folder as a separate docker-compose.yml file so the user can choose whether to use it. Please also fix the Apache header.

Copy link
Copy Markdown
Contributor

@mengw15 mengw15 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree with Xinyuan's comments. Additionally, do not hard code the Postgres username and password, since its configurations in storage.conf, and devs may use different credentials. Also please double-check host.docker.internal's cross-platform support.

@mengw15
Copy link
Copy Markdown
Contributor

mengw15 commented Apr 17, 2026

One question, do we need to use docker compose to do this task? is there other options?

@gracecluvohio
Copy link
Copy Markdown
Contributor Author

One question, do we need to use docker compose to do this task? is there other options?

It is easiest for developers if it is integrated into docker compose so that developers don’t need to locally install Liquibase.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add Liquibase Schema Change Automation

4 participants