Lines 1-8
Link Here
|
1 |
$DBversion = 'XXX'; # will be replaced by the RM |
1 |
$DBversion = 'XXX'; # will be replaced by the RM |
2 |
if( CheckVersion( $DBversion ) ) { |
2 |
if( CheckVersion( $DBversion ) ) { |
3 |
|
3 |
|
4 |
$dbh->do( "ALTER TABLE illrequests ADD COLUMN status_alias integer DEFAULT NULL" ); |
4 |
if ( !column_exists( 'illrequests', 'status_alias' ) ) { |
5 |
$dbh->do( "ALTER TABLE illrequests ADD CONSTRAINT illrequests_safk FOREIGN KEY (status_alias) REFERENCES authorised_values(id) ON DELETE SET NULL" ); |
5 |
$dbh->do( "ALTER TABLE illrequests ADD COLUMN status_alias integer DEFAULT NULL AFTER status" ); |
|
|
6 |
} |
7 |
if ( !foreign_key_exists( 'illrequests', 'illrequests_safk' ) ) { |
8 |
$dbh->do( "ALTER TABLE illrequests ADD CONSTRAINT illrequests_safk FOREIGN KEY (status_alias) REFERENCES authorised_values(id) ON UPDATE CASCADE ON DELETE SET NULL" ); |
9 |
} |
6 |
$dbh->do( "INSERT IGNORE INTO authorised_value_categories SET category_name = 'ILLSTATUS'"); |
10 |
$dbh->do( "INSERT IGNORE INTO authorised_value_categories SET category_name = 'ILLSTATUS'"); |
7 |
|
11 |
|
8 |
SetVersion( $DBversion ); |
12 |
SetVersion( $DBversion ); |