Merge pull request #701 from acelaya-forks/feature/fix-migration

Fixed query in migration for postgres
This commit is contained in:
Alejandro Celaya 2020-03-29 12:25:19 +02:00 committed by GitHub
commit 7105add009
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 31 additions and 7 deletions

View file

@ -4,6 +4,29 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com), and this project adheres to [Semantic Versioning](https://semver.org).
## [Unreleased]
#### Added
* *Nothing*
#### Changed
* *Nothing*
#### Deprecated
* *Nothing*
#### Removed
* *Nothing*
#### Fixed
* [#700](https://github.com/shlinkio/shlink/issues/700) Fixed migration not working with postgres.
## 2.1.1 - 2020-03-28
#### Added

View file

@ -22,15 +22,16 @@ final class Version20200323190014 extends AbstractMigration
{
$qb = $this->connection->createQueryBuilder();
$qb->update('visit_locations')
->set('is_empty', true)
->where($qb->expr()->eq('country_code', ':empty'))
->andWhere($qb->expr()->eq('country_name', ':empty'))
->andWhere($qb->expr()->eq('region_name', ':empty'))
->andWhere($qb->expr()->eq('city_name', ':empty'))
->andWhere($qb->expr()->eq('timezone', ':empty'))
->set('is_empty', ':isEmpty')
->where($qb->expr()->eq('country_code', ':emptyString'))
->andWhere($qb->expr()->eq('country_name', ':emptyString'))
->andWhere($qb->expr()->eq('region_name', ':emptyString'))
->andWhere($qb->expr()->eq('city_name', ':emptyString'))
->andWhere($qb->expr()->eq('timezone', ':emptyString'))
->andWhere($qb->expr()->eq('lat', 0))
->andWhere($qb->expr()->eq('lon', 0))
->setParameter('empty', '')
->setParameter('isEmpty', true)
->setParameter('emptyString', '')
->execute();
}