Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8637099
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T10:23:40+00:00 2026-06-12T10:23:40+00:00

I have an existing table with data in it. foobar_table foo bar baz I

  • 0

I have an existing table with data in it.

foobar_table
    foo
    bar
    baz

I want to split the baz column out of the foobar_table table and create a new table called baz_table that contains it. After the operation is done I would have the following structure with each column containing the data it had before the operation started:

foobar_table
    foo
    bar

baz_table
    baz

How can I do this with Liquibase?

P.S. Using Liquibase via the Grails Database Migration plugin. The grailsChange tag gives me hope, but lack of example documentation leave me wanting.

Update:

I wasn’t aware of the sql that can be used in change sets. I found out about it in the example here and I think it is what I needed.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T10:23:41+00:00Added an answer on June 12, 2026 at 10:23 am

    As you already found out, you can run arbitary SQL queries as a part of changeset. I go over common caveats in my blog post.

    So for your example:

    <changeset>
      <createTable tableName="baz_table"/>
      <sql>insert into baz_table(baz) select baz from foobar</sql>
      <dropColumn tableName="foobar_table" columName="baz"/>
    </changeset>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to save some data to an existing table. So i have column
I have a new database table called schools . I have an existing database
I have table with data. Is it possible slug field automatically generated on existing
I have an existing table with a 'price_info' column of type NVARCHAR . I'd
I have 2 databases, and I want to transport an existing table containing a
After loading data from a csv into an existing Postgres table, I will have
I have an existing table that has 100 users and passwords. The data type
I have an existing table and a new table. The tables contain at least
I have a DB table that already has an existing value that I don't
I have existing java code and need to create Design Document based on that.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.