Skip to content

Commit

Permalink
#14862 - Remove condition if table exists
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeckerson committed Feb 26, 2020
1 parent a4b3b63 commit 6384c54
Showing 1 changed file with 3 additions and 10 deletions.
13 changes: 3 additions & 10 deletions tests/_data/fixtures/Migrations/AbstractMigration.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,16 +78,9 @@ public function clear()
'delete from ' . $this->table . ';'
);
} else {
$schema = getenv('DATA_POSTGRES_SCHEMA');
$exists = $this
->connection
->query("SELECT to_regclass('$schema.$this->table') AS exists;")
->fetchColumn();
if ($exists) {
$this->connection->exec(
'truncate table ' . $this->table . ' cascade;'
);
}
$this->connection->exec(
'truncate table ' . $this->table . ' cascade;'
);
}
}
}
Expand Down

0 comments on commit 6384c54

Please sign in to comment.