fix migrations and data passing from server

This commit is contained in:
Kacper Donat 2018-09-11 21:15:42 +02:00
parent 3ce3f6d3d2
commit 8bc9c94b72
3 changed files with 7 additions and 3 deletions

View File

@ -56,5 +56,5 @@ export default {
get: `${base}/stops/{id}`,
tracks: `${base}/stops/{id}/tracks`
},
prepare: (url: string, params: UrlParams = { }) => prepare(url, Object.assign({}, { provider: window['app'].provider }, params))
prepare: (url: string, params: UrlParams = { }) => prepare(url, Object.assign({}, { provider: window['data'].provider }, params))
}

View File

@ -3,8 +3,10 @@
namespace App\Service;
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
{
@ -30,7 +32,9 @@ class DataUpdater
public function update()
{
$schema = $this->em->getConnection()->getSchemaManager();
collect($schema->listTables())->each([$schema, 'dropAndCreateTable']);
collect($schema->listTables())->reject(function (Table $schema) {
return $schema->getName() === 'migrations';
})->each([$schema, 'dropAndCreateTable']);
$this->dispatcher->dispatch(self::UPDATE_EVENT, new DataUpdateEvent());
}

View File

@ -19,7 +19,7 @@
{% block javascripts %}
<script>
window.app = {
window.data = {
provider: {{ provider.identifier|json_encode|raw }}
}
</script>