Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PHRAS-2069 rescan file metadata command #4420

Merged
merged 11 commits into from
Nov 29, 2023

Conversation

aynsix
Copy link
Collaborator

@aynsix aynsix commented Nov 24, 2023

Changelog

Adds

  • PHRAS-2069: rescan file metadata command
  • bin/console records:rescan-files-metadata

@aynsix aynsix added the 4.1 label Nov 24, 2023
}

$stmt->execute();
$rows = $stmt->fetchAll(\PDO::FETCH_ASSOC);
Copy link
Member

@jygaulier jygaulier Nov 27, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

beware of big databoxes : better read row by row, and get only the needed column record_id

->addOption('source', null, InputOption::VALUE_REQUIRED, 'tag to search exemple IPTC:KEYWORD')
->addOption('destination', null, InputOption::VALUE_REQUIRED, "ID of the field de fill")
->addOption('overwrite', null, InputOption::VALUE_NONE, "act even if the destination field has a value in databox")
->addOption('multi', null, InputOption::VALUE_REQUIRED, "replace or merge for multi value field")
Copy link
Member

@jygaulier jygaulier Nov 27, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should be --method :

  • replace : overwrite the whole value with new one(s)
  • merge : for multi only = merge actual and new values
  • prepend : for mono only = add before (to do later because need to enhance setMetaByActions() )
  • append : for mono only = add after (to do later)


$sql_where = join(" AND ", $clauses);

$sql = "SELECT * FROM record WHERE " . $sql_where;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

don't use * ;
overwrite = null optim: ... left join metadata... where ... and isnull(metadata) so the select will not fetch records with value(s).

@nmaillat nmaillat merged commit 7bfd956 into master Nov 29, 2023
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants