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

  • Home
  • SEARCH
  • 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 8213043
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T10:58:48+00:00 2026-06-07T10:58:48+00:00

Very odd situation. I have a root changelog.groovy which is the current production database.

  • 0

Very odd situation. I have a root changelog.groovy which is the current production database. I also have a latest-changelog.groovy which is basically a diff with some minor diff corrections (because diff isn’t perfect).

Starting with an empty database, the following works (Scenario 1):

  • mysqldump production database
  • source into dev database
  • remove include of latest-changelog.groovy
  • execute dbm-changelog-sync
  • add include of latest-changelog.groovy
  • execute dbm-update

The following does not work (Scenario 2):

  • drop dev database
  • create empty dev database
  • execute dbm-update

What happens is the initial changelog.groovy runs without a hitch. But when it gets to the latest-changelog.groovy it fails with the following:

Caused by: java.sql.SQLException: Error on rename of
‘./main_dev/#sql-b4_2334’ to
‘./main_dev/book_project_note’ (errno: 150)

I have a table defined like so:

mysql> desc book_project_note;
+---------------------------+------------+------+-----+---------+-------+
| Field                     | Type       | Null | Key | Default | Extra |
+---------------------------+------------+------+-----+---------+-------+
| book_project_id           | bigint(20) | NO   | PRI | NULL    |       |
| note_id                   | bigint(20) | NO   | PRI | NULL    |       |
| book_project_note_type_id | bigint(20) | NO   | PRI | NULL    |       |
+---------------------------+------------+------+-----+---------+-------+

The following changeset is what fails:

changeSet(author: "gdboling (generated)", id: "1341248060406-80") {
  dropPrimaryKey(tableName: "book_project_note")
}

What I’m trying to do here is drop the primary keys and then recreate 2 of them with the following:

changeSet(author: "gdboling (generated)", id: "1341248060406-72") {
  addPrimaryKey(columnNames: "book_project_id, note_id", constraintName: "book_project_PK", tableName: "book_project_note")
}

I’m wondering why it works with Scenario 1 but fails in Scenario 2.

  • 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-07T10:58:49+00:00Added an answer on June 7, 2026 at 10:58 am

    Not sure this is the actual answer to the problem but I have figured out what is causing it to fail. There are 3 FK’s on the book_project_note table. Those FK’s have to be dropped before the dropPrimaryKey (duh).

    However, that still doesn’t tell me how it possibly works in Scenario 1 but I think it might have something to do with the deferrable attribute in addForeignKeyConstraint. Still trying to research what that actually means.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've got an odd situation. Basically, I have two custom bindings which are used
I have a very odd issue. When I execute a specific database stored procedure
I have very odd situation where I'm appending children (thumbnails) to a div and
I have one very odd and strange xml(which is not my fault) and i
I basically am running into a very odd situation in a system call that
This is a very odd one and I'm not sure how to proceed. Basically,
This is very odd. I have never had this issue with ShowDialog in C#.
I came across this very odd situation, and i thought i would throw it
I'm running into some very odd beheaviour regarding frames and internet explorer. The situation
I have a very odd problem. A class property is mysteriously reset between method

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.