Uploaded image for project: 'Ambari'
  1. Ambari
  2. AMBARI-5211

Cleanup foreign key contraints after upgrade

    XMLWordPrintableJSON

Details

    • Task
    • Status: Resolved
    • Critical
    • Resolution: Fixed
    • 1.5.0
    • 1.5.0
    • ambari-server
    • None

    Description

      Situation:

      • We modified constraint names for foreign keys to fit Oracle restriction
      • However, did not make names consistent across all DB types
      • Now Upgrade java code has to have smaller length constraint names to work with Oracle
      • So after upgrade there could be:
        1. More that 1 constraint for same set of columns. (Postgres)
        OR
        2. Exceptions in the logs saying cannot add a constraint. (Oracle)

      Fix:

      • Drop old constraints before adding new ones. (Only for the ones which are different in both CREATE sql scripts)

      Attachments

        Issue Links

          Activity

            People

              mpapirkovskyy Papirkovskyy Myroslav
              mpapirkovskyy Papirkovskyy Myroslav
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: