Skip to content

Commit

Permalink
Fix removal of WebsitesRequestBuilder
Browse files Browse the repository at this point in the history
Signed-off-by: Daniel Rudolf <[email protected]>
  • Loading branch information
PhrozenByte committed Jan 17, 2022
1 parent 284c93f commit d3c3c30
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
8 changes: 4 additions & 4 deletions lib/Migration/Version010000.php
Original file line number Diff line number Diff line change
Expand Up @@ -108,12 +108,12 @@ public function changeSchema(IOutput $output, \Closure $schemaClosure, array $op
$themeColumn->setLength(64);
}

if (!$table->hasIndex(WebsitesRequestBuilder::TABLE_WEBSITES . '_user_id')) {
$table->addIndex([ 'user_id' ], WebsitesRequestBuilder::TABLE_WEBSITES . '_user_id');
if (!$table->hasIndex(WebsitesRequest::TABLE_NAME . '_user_id')) {
$table->addIndex([ 'user_id' ], WebsitesRequest::TABLE_NAME . '_user_id');
}

if (!$table->hasIndex(WebsitesRequestBuilder::TABLE_WEBSITES . '_site')) {
$table->addIndex([ 'site' ], WebsitesRequestBuilder::TABLE_WEBSITES . '_site');
if (!$table->hasIndex(WebsitesRequest::TABLE_NAME . '_site')) {
$table->addIndex([ 'site' ], WebsitesRequest::TABLE_NAME . '_site');
}

return $schema;
Expand Down
12 changes: 6 additions & 6 deletions lib/Migration/Version010017.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

namespace OCA\CMSPico\Migration;

use OCA\CMSPico\Db\WebsitesRequestBuilder;
use OCA\CMSPico\Db\WebsitesRequest;
use OCP\DB\ISchemaWrapper;
use OCP\Migration\IOutput;
use OCP\Migration\SimpleMigrationStep;
Expand All @@ -43,22 +43,22 @@ public function changeSchema(IOutput $output, \Closure $schemaClosure, array $op
/** @var ISchemaWrapper $schema */
$schema = $schemaClosure();

$table = $schema->getTable(WebsitesRequestBuilder::TABLE_WEBSITES);
$table = $schema->getTable(WebsitesRequest::TABLE_NAME);

if ($table->hasIndex('user_id')) {
$table->dropIndex('user_id');
}

if (!$table->hasIndex(WebsitesRequestBuilder::TABLE_WEBSITES . '_user_id')) {
$table->addIndex([ 'user_id' ], WebsitesRequestBuilder::TABLE_WEBSITES . '_user_id');
if (!$table->hasIndex(WebsitesRequest::TABLE_NAME . '_user_id')) {
$table->addIndex([ 'user_id' ], WebsitesRequest::TABLE_NAME . '_user_id');
}

if ($table->hasIndex('site')) {
$table->dropIndex('site');
}

if (!$table->hasIndex(WebsitesRequestBuilder::TABLE_WEBSITES . '_site')) {
$table->addIndex([ 'site' ], WebsitesRequestBuilder::TABLE_WEBSITES . '_site');
if (!$table->hasIndex(WebsitesRequest::TABLE_NAME . '_site')) {
$table->addIndex([ 'site' ], WebsitesRequest::TABLE_NAME . '_site');
}

return $schema;
Expand Down

0 comments on commit d3c3c30

Please sign in to comment.