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

PostgreSQL do not support alias in update queries #78

Merged
merged 1 commit into from
Oct 2, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions bundle/Command/ConvertXmlTextToRichTextCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -368,13 +368,13 @@ protected function convertFieldDefinitions($dryRun, OutputInterface $output)
$output->writeln("Found $count field definiton to convert.");

$updateQuery = $this->dbal->createQueryBuilder();
$updateQuery->update('ezcontentclass_attribute', 'a')
->set('a.data_type_string', ':newdatatypestring')
$updateQuery->update('ezcontentclass_attribute')
->set('data_type_string', ':newdatatypestring')
// was tagPreset in ezxmltext, unused in RichText
->set('a.data_text2', ':datatext2')
->set('data_text2', ':datatext2')
->where(
$updateQuery->expr()->eq(
'a.data_type_string',
'data_type_string',
':olddatatypestring'
)
)
Expand Down Expand Up @@ -462,18 +462,18 @@ protected function getFieldRows($datatypeString, $contentId, $offset, $limit)
protected function updateFieldRow($dryRun, $id, $version, $datatext)
{
$updateQuery = $this->dbal->createQueryBuilder();
$updateQuery->update('ezcontentobject_attribute', 'a')
->set('a.data_type_string', ':datatypestring')
->set('a.data_text', ':datatext')
$updateQuery->update('ezcontentobject_attribute')
->set('data_type_string', ':datatypestring')
->set('data_text', ':datatext')
->where(
$updateQuery->expr()->eq(
'a.id',
'id',
':id'
)
)
->andWhere(
$updateQuery->expr()->eq(
'a.version',
'version',
':version'
)
)
Expand Down
10 changes: 5 additions & 5 deletions bundle/Command/ImportXmlCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -261,23 +261,23 @@ protected function contentObjectAttributeExists($objectId, $attributeId, $versio
protected function updateContentObjectAttribute($xml, $objectId, $attributeId, $version, $language)
{
$updateQuery = $this->dbal->createQueryBuilder();
$updateQuery->update('ezcontentobject_attribute', 'a')
->set('a.data_text', ':newxml')
$updateQuery->update('ezcontentobject_attribute')
->set('data_text', ':newxml')
->where(
$updateQuery->expr()->eq(
'a.data_type_string',
'data_type_string',
':datatypestring'
)
)
->andWhere(
$updateQuery->expr()->eq(
'a.contentobject_id',
'contentobject_id',
':objectid'
)
)
->andWhere(
$updateQuery->expr()->eq(
'a.id',
'id',
':attributeid'
)
)
Expand Down