View | Details | Raw Unified | Return to bug 23805
Collapse All | Expand All

(-)a/installer/data/mysql/updatedatabase.pl (-20 / +9 lines)
Lines 20010-20025 if ( CheckVersion($DBversion) ) { Link Here
20010
        );
20010
        );
20011
    }
20011
    }
20012
20012
20013
    # Dropping the check constraint in accountlines
20014
    $dbh->do(
20015
        qq{
20016
          ALTER TABLE
20017
            accountlines
20018
          DROP CHECK
20019
            `accountlines_check_type`
20020
        }
20021
    );
20022
20023
    # Update accountype 'C' to 'CREDIT'
20013
    # Update accountype 'C' to 'CREDIT'
20024
    $dbh->do(
20014
    $dbh->do(
20025
        qq{
20015
        qq{
Lines 20075-20085 if ( CheckVersion($DBversion) ) { Link Here
20075
          UPDATE
20065
          UPDATE
20076
            accountlines 
20066
            accountlines 
20077
          SET
20067
          SET
20078
            credit_type_code = accounttype, accounttype = NULL
20068
            credit_type_code = accounttype
20079
          WHERE accounttype IN (SELECT code from account_credit_types)
20069
          WHERE accounttype IN (SELECT code from account_credit_types)
20080
        }
20070
        }
20081
    );
20071
    );
20082
20072
20073
    # Drop accounttype field
20074
    $dbh->do(
20075
        qq{
20076
          ALTER TABLE accountlines
20077
          DROP COLUMN `accounttype`
20078
        }
20079
    );
20080
20083
    # Adding a check constraints to accountlines
20081
    # Adding a check constraints to accountlines
20084
    $dbh->do(
20082
    $dbh->do(
20085
        qq{
20083
        qq{
Lines 20091-20104 if ( CheckVersion($DBversion) ) { Link Here
20091
        }
20089
        }
20092
    );
20090
    );
20093
20091
20094
    # Drop accounttype field
20095
    $dbh->do(
20096
        qq{
20097
          ALTER TABLE accountlines
20098
          DROP COLUMN `accounttype`
20099
        }
20100
    );
20101
20102
    SetVersion($DBversion);
20092
    SetVersion($DBversion);
20103
    print "Upgrade to $DBversion done (Bug 23805 - Add account credit_types)\n";
20093
    print "Upgrade to $DBversion done (Bug 23805 - Add account credit_types)\n";
20104
}
20094
}
20105
- 

Return to bug 23805