mirror of https://github.com/wallabag/wallabag.git
Use hasTable instead of try/catch
This commit is contained in:
parent
43e1711eb6
commit
ad46f2fb46
|
@ -28,13 +28,7 @@ class Version20160401000000 extends AbstractMigration implements ContainerAwareI
|
||||||
*/
|
*/
|
||||||
public function up(Schema $schema)
|
public function up(Schema $schema)
|
||||||
{
|
{
|
||||||
try {
|
$this->skipIf($schema->hasTable($this->getTable('entry')), 'Database already initialized');
|
||||||
$schema->getTable($this->getTable('entry'));
|
|
||||||
|
|
||||||
$this->skipIf(true, 'Database already initialized');
|
|
||||||
} catch (SchemaException $e) {
|
|
||||||
// it's ok, the table does not exist we can proceed to the initial migration
|
|
||||||
}
|
|
||||||
|
|
||||||
switch ($this->connection->getDatabasePlatform()->getName()) {
|
switch ($this->connection->getDatabasePlatform()->getName()) {
|
||||||
case 'sqlite':
|
case 'sqlite':
|
||||||
|
|
Loading…
Reference in New Issue