Skip to content

Commit

Permalink
Tweak, tweak
Browse files Browse the repository at this point in the history
  • Loading branch information
bobdenotter committed Sep 10, 2023
1 parent 2c0f4b1 commit 4cea8ce
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/Command/UpdateListFormatCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
{
$io = new SymfonyStyle($input, $output);

$io->text('// Clearing the Bolt Content `list_format` and `title` columns.');
$io->text('// Updating the Bolt Content `list_format` and `title` columns.');

$amount = 10000;

Expand Down
6 changes: 6 additions & 0 deletions src/Utils/ListFormatHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,12 @@ public function clearColumns(): bool

public function updateColumns(int $limit = 100): bool
{
$query = sprintf('SELECT COUNT(id) FROM %scontent WHERE title = "" OR list_format = "" LIMIT %d', $this->prefix, $limit);

$result = $this->connection->fetchAssociative($query);

printf("%d records to go", $result['COUNT(id)']);

$query = sprintf('SELECT id FROM %scontent WHERE title = "" OR list_format = "" LIMIT %d', $this->prefix, $limit);

$rows = $this->connection->fetchAllAssociative($query);
Expand Down

0 comments on commit 4cea8ce

Please sign in to comment.