fix migrations and data passing from server
This commit is contained in:
parent
3ce3f6d3d2
commit
8bc9c94b72
@ -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))
|
||||
}
|
@ -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());
|
||||
}
|
||||
|
@ -19,7 +19,7 @@
|
||||
|
||||
{% block javascripts %}
|
||||
<script>
|
||||
window.app = {
|
||||
window.data = {
|
||||
provider: {{ provider.identifier|json_encode|raw }}
|
||||
}
|
||||
</script>
|
||||
|
Loading…
Reference in New Issue
Block a user