Skip to content

Commit

Permalink
Merge pull request #218 from praxisdigital/fmp_fix_upgrade_script
Browse files Browse the repository at this point in the history
Fix upgrade script
  • Loading branch information
frederikmillingpytlick authored Sep 17, 2024
2 parents c72dc00 + b63fabf commit c4c289a
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 10 deletions.
23 changes: 14 additions & 9 deletions db/upgrade.php
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ function xmldb_block_sharing_cart_upgrade($oldversion = 0): bool
upgrade_block_savepoint(true, 2024011800, 'sharing_cart');
}

if ($oldversion < 2024032100) {
if ($oldversion < 2024072900) {
/**
* Create block_sharing_cart_items table.
*/
Expand Down Expand Up @@ -462,17 +462,22 @@ function xmldb_block_sharing_cart_upgrade($oldversion = 0): bool
$dbman->drop_table($table);
}

upgrade_block_savepoint(true, 2024032100, 'sharing_cart');
upgrade_block_savepoint(true, 2024072900, 'sharing_cart');
}

if ($oldversion < 2024032101) {
if ($oldversion < 2024072900) {
$xmldb_table = new xmldb_table('block_sharing_cart_items');
$dbman->add_field(
$xmldb_table,
new xmldb_field(
'sortorder', XMLDB_TYPE_INTEGER, '10', notnull: false
)
);

if (!$dbman->field_exists($xmldb_table, 'sortorder')) {
$dbman->add_field(
$xmldb_table,
new xmldb_field(
'sortorder', XMLDB_TYPE_INTEGER, '10', notnull: false
)
);
}

upgrade_block_savepoint(true, 2024072900, 'sharing_cart');
}

return true;
Expand Down
2 changes: 1 addition & 1 deletion version.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

/** @var object $plugin */
$plugin->component = 'block_sharing_cart';
$plugin->version = 2024081900;
$plugin->version = 2024081901;
$plugin->requires = 2023042400; // Moodle 4.2.0
$plugin->release = '5.0, release 1';
$plugin->maturity = MATURITY_STABLE;

0 comments on commit c4c289a

Please sign in to comment.