https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20581 --- Comment #56 from Josef Moravec <josef.moravec@gmail.com> --- Comment on attachment 80279 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=80279 Bug 20581: Modifications to database schema Review of attachment 80279: --> (https://bugs.koha-community.org/bugzilla3/page.cgi?id=splinter.html&bug=20581&attachment=80279) ----------------------------------------------------------------- I would not add the file ill_auth_cat.sql, but as you add the category on database update, it makes more sense to add it to mandatory/auth_val_cat.sql ::: installer/data/mysql/atomicupdate/bug_20581-add_new_illrequests_status_alias_column.perl @@ +1,4 @@
+$DBversion = 'XXX'; # will be replaced by the RM +if( CheckVersion( $DBversion ) ) { + + $dbh->do( "ALTER TABLE illrequests ADD COLUMN status_alias integer DEFAULT NULL" );
Please add a test on column existance and add AFTER statement to be sure the column order is same on all installations @@ +1,5 @@
+$DBversion = 'XXX'; # will be replaced by the RM +if( CheckVersion( $DBversion ) ) { + + $dbh->do( "ALTER TABLE illrequests ADD COLUMN status_alias integer DEFAULT NULL" ); + $dbh->do( "ALTER TABLE illrequests ADD CONSTRAINT illrequests_safk FOREIGN KEY (status_alias) REFERENCES authorised_values(id) ON DELETE SET NULL" );
Please add ON UPDATE statement to exactly say what will happen ::: installer/data/mysql/kohastructure.sql @@ +4157,5 @@
ON UPDATE CASCADE ON DELETE CASCADE + CONSTRAINT `illrequests_safk` + FOREIGN KEY (`status_alias`) + REFERENCES `authorised_values` (`id`) + ON DELETE SET NULL
Add ON UPDATE statement -- You are receiving this mail because: You are watching all bug changes.