Skip to content

Commit

Permalink
refs #95 safely drop indexes in last migration step
Browse files Browse the repository at this point in the history
Signed-off-by: Julien Veyssier <[email protected]>
  • Loading branch information
julien-nc committed Apr 28, 2024
1 parent 7321ec5 commit 1ff6a3f
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions lib/Migration/Version020000Date20240325142435.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,21 +31,27 @@ public function changeSchema(IOutput $output, Closure $schemaClosure, array $opt

if ($schema->hasTable('openai_prompts')) {
$table = $schema->getTable('openai_prompts');
$table->dropIndex('openai_prompt_userid');
if ($table->hasIndex('openai_prompt_userid')) {
$table->dropIndex('openai_prompt_userid');
}
$schema->dropTable('openai_prompts');
$schemaChanged = true;
}

if ($schema->hasTable('openai_i_gen')) {
$table = $schema->getTable('openai_i_gen');
$table->dropIndex('openai_i_gen_hash');
if ($table->hasIndex('openai_i_gen_hash')) {
$table->dropIndex('openai_i_gen_hash');
}
$schema->dropTable('openai_i_gen');
$schemaChanged = true;
}

if ($schema->hasTable('openai_i_url')) {
$table = $schema->getTable('openai_i_url');
$table->dropIndex('openai_i_url_gen_id');
if ($table->hasIndex('openai_i_url_gen_id')) {
$table->dropIndex('openai_i_url_gen_id');
}
$schema->dropTable('openai_i_url');
$schemaChanged = true;
}
Expand Down

0 comments on commit 1ff6a3f

Please sign in to comment.