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 6999257
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T20:31:05+00:00 2026-05-27T20:31:05+00:00

I am using the create-drop option for development, when deploying to mysql database (using

  • 0

I am using the create-drop option for development, when deploying to mysql database (using hibernate 4) I get the following output:

15:18:07,715 ERROR SchemaExport:426 - HHH000389: Unsuccessful: alter table my_table drop foreign key FKD42DEFE312AC02F1
15:18:07,715 ERROR SchemaExport:427 - Table 'my_db.my_table' doesn't exist

It seems its attempting to alter a table before it has created it. The table and FK are succesfully created. What causes the error message ?

  • 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-05-27T20:31:05+00:00Added an answer on May 27, 2026 at 8:31 pm

    The problem is that:

    • if you have two tables A and B and a foreign key reference in A that references B.
    • and you want to delete the tables

    You need to remove the foreign key constraint first. (except you know the right sequence and have no circular dependencies)

    So you normaly remove all constrains first and then drop the tables.

    If one table does not exists (because it is new) then you use drop table if exists But unfortunaly my-sql as no statement to remove a forainkey only if the table exists. So it is more a lack of features than a bug.


    I solved it, but my setup is different.
    I use hibernate only in validation mode and run the scripts to update the database by hand.
    The scripts are generated by hibernate org.hibernate.tool.hbm2ddl.SchemaExport. Then I take the generated file, added set foreign_key_checks = 0; in the beginning and set foreign_key_checks = 1; at the end. Then I commented out (add -- at the beginning) every line that match the pattern alter table *. drop foreign key *.;

    @See https://stackoverflow.com/a/34038447/280244 for more details

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

Sidebar

Related Questions

I'm trying to create a drop down select option using PHP, MySQL, and ajadx
I am trying to create a drop down list using jQuery, PHP and mySQL,
I'm trying to create a custom drop down and using the code below it
I'm using codeigniter to create a web app. I'm creating the drop down menus
I'm using Grails 1.3.7 + MySQL 5.5 + Liquibase through the database-migration plugin 0.2.1.
I am using HtmlAgilityPack. I create an HtmlDocument and LoadHtml with the following string:
I am currently using jsp and I wanted to create a dynamic drop down
I am using HAML to create a drop down list as shown below: %select.categories
I am using this code in my form to create a drop down menu.
I created drop down list using java. But i am not aware of creating

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.