fix migrations

This commit is contained in:
Kacper Donat 2018-09-13 22:19:45 +02:00
parent 6ebd62a71e
commit a6b14cce7f
2 changed files with 2 additions and 3 deletions

View File

@ -131,7 +131,7 @@ class ZtmGdanskDataUpdateSubscriber implements EventSubscriberInterface
return StopEntity::createFromArray([
'id' => $this->ids->generate($provider, $stop['stopId']),
'name' => trim($stop['stopName'] ?? $stop['stopDesc']),
'variant' => trim($stop['zoneName'] == 'Gdańsk' ? $stop['subName'] : null),
'variant' => trim($stop['zoneName'] == 'Gdańsk' ? $stop['stopCode'] : null),
'latitude' => $stop['stopLat'],
'longitude' => $stop['stopLon'],
'onDemand' => (bool)$stop['onDemand'],

View File

@ -6,7 +6,6 @@ use App\Event\DataUpdateEvent;
use Doctrine\DBAL\Schema\Table;
use Doctrine\ORM\EntityManagerInterface;
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
use Kadet\Functional\Predicats as p;
class DataUpdater
{
@ -33,7 +32,7 @@ class DataUpdater
{
$schema = $this->em->getConnection()->getSchemaManager();
collect($schema->listTables())->reject(function (Table $schema) {
return $schema->getName() === 'migrations';
return $schema->getName() === 'migration_versions';
})->each([$schema, 'dropAndCreateTable']);
$this->dispatcher->dispatch(self::UPDATE_EVENT, new DataUpdateEvent());