| name | atomicupdate |
| description | Create a new Koha atomicupdate file for a bug. Arguments: bug number (e.g. 12345) and a short description of the DB change. |
Create an atomicupdate file for Koha bug $ARGUMENTS.
Steps:
- Parse arguments: first token is the bug number, remainder is the description.
- Create the file
installer/data/mysql/atomicupdate/bug_BUGNUMBER.pl using the skeleton below.
- Replace
BUG_NUMBER with the actual bug number and DESCRIPTION with the description.
- Leave the
$dbh->do(q{}) placeholder in place — the user will fill in the actual SQL.
- Make the file executable:
chmod +x installer/data/mysql/atomicupdate/bug_BUGNUMBER.pl (Koha QA's file_permissions check enforces this).
- Report the created file path.
Skeleton (based on installer/data/mysql/atomicupdate/skeleton.pl):
use Modern::Perl;
use Koha::Installer::Output qw(say_warning say_success say_info);
return {
bug_number => "BUG_NUMBER",
description => "DESCRIPTION",
up => sub {
my ($args) = @_;
my ( $dbh, $out ) = @$args{qw(dbh out)};
$dbh->do(q{});
say_success( $out, "Done" );
},
};
After the user fills in the SQL, remind them of the wider workflow:
- Update
installer/data/mysql/kohastructure.sql to match.
- Apply inside KTD:
perl installer/data/mysql/updatedatabase.pl.
- Regenerate DBIC schema:
dbic --force inside KTD.
- For new
tinyint(1) columns that semantically represent yes/no flags, add '+colname' => { is_boolean => 1 } to the Result module BELOW the # DO NOT MODIFY THIS OR ANYTHING ABOVE! line (QA SQL12 / tinyint_has_boolean_flag).
- Commit auto-generated DBIC changes as
Bug XXXXX: Automated Schema Update, then commit any manual is_boolean / relationship additions as a separate commit.