Uploaded image for project: 'OpenMRS Core'
  1. OpenMRS Core
  2. TRUNK-3993

Foreign key constraint violation when altering privilege.privilege column

    XMLWordPrintable

    Details

      Description

      The liquibase changesets with id 1-increase-privilege-col-size-privilege alters the column size of privilege.privilege column, mysql i think with innoDB requires that the referenced and foreign key column have the same datatype and size at anytime, meaning all foreign keys constraints referencing privilege.privilege have to be dropped before running the changeset and added back after altering the column size of privilege.privilege and all known foreign key columns.

      The sql scripts below can be used to get the foregn keys that need to be dropped and readded:

      use information_schema;
      select distinct table_name, 
             column_name, 
             constraint_name,  
             referenced_table_name, 
             referenced_column_name 
      from   key_column_usage 
      where  constraint_schema = 'openmrs' 
         and referenced_table_name = 'privilege'  
         and referenced_column_name = 'privilege';
      

      This is a blocker to installing the latest builds of openmrs future upgrades to versions 1.10 when it is out.

        Gliffy Diagrams

          Attachments

            Activity

              People

              Assignee:
              wyclif Wyclif Luyima
              Reporter:
              wyclif Wyclif Luyima
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - 2 hours
                  2h
                  Remaining:
                  Time Spent - 1 hour, 30 minutes Remaining Estimate - 30 minutes
                  30m
                  Logged:
                  Time Spent - 1 hour, 30 minutes Remaining Estimate - 30 minutes
                  1h 30m