Skip to content

Commit

Permalink
MBS-9374: Migrate instance table
Browse files Browse the repository at this point in the history
  • Loading branch information
PhMemmel committed Sep 18, 2024
1 parent fa9fc57 commit d564e7c
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions db/upgrade.php
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,22 @@ function xmldb_local_ai_manager_upgrade($oldversion) {
}
$rs->close();

$rs = $DB->get_recordset('local_ai_manager_instance');
foreach ($rs as $record) {
if ($record->model === 'preconfigured') {
if ($record->connector === 'chatgpt') {
$record->model = 'chatgpt_preconfigured_azure';
} else if ($record->connector === 'openaitts') {
$record->model = 'openaitts_preconfigured_azure';
} else if ($record->connector === 'dalle') {
$record->model = 'dalle_preconfigured_azure';
}
}
$DB->update_record('local_ai_manager_instance', $record);
}

$rs->close();

upgrade_plugin_savepoint(true, 2024091800, 'local', 'ai_manager');
}
return true;
Expand Down

0 comments on commit d564e7c

Please sign in to comment.