Checks if api tables exists before apllaying patch

This commit is contained in:
Nicolas Le Goff
2014-03-10 15:16:09 +01:00
parent 8fc7ec3714
commit 426816e2d3

View File

@@ -67,6 +67,9 @@ class patch_390alpha17a extends patchAbstract
private function fillApplicationTable(EntityManager $em) private function fillApplicationTable(EntityManager $em)
{ {
if (false === $this->tableExists($em, 'api_applications')) {
return true;
}
$em->getConnection()->executeUpdate( $em->getConnection()->executeUpdate(
'INSERT INTO ApiApplications 'INSERT INTO ApiApplications
( (
@@ -88,6 +91,9 @@ class patch_390alpha17a extends patchAbstract
private function fillAccountTable(EntityManager $em) private function fillAccountTable(EntityManager $em)
{ {
if (false === $this->tableExists($em, 'api_accounts')) {
return true;
}
$em->getConnection()->executeUpdate( $em->getConnection()->executeUpdate(
'INSERT INTO ApiAccounts 'INSERT INTO ApiAccounts
( (
@@ -108,6 +114,9 @@ class patch_390alpha17a extends patchAbstract
private function fillLogTable(EntityManager $em) private function fillLogTable(EntityManager $em)
{ {
if (false === $this->tableExists($em, 'api_accounts')) {
return true;
}
$em->getConnection()->executeUpdate( $em->getConnection()->executeUpdate(
'INSERT INTO ApiLogs 'INSERT INTO ApiLogs
( (
@@ -129,6 +138,9 @@ class patch_390alpha17a extends patchAbstract
private function fillCodeTable(EntityManager $em) private function fillCodeTable(EntityManager $em)
{ {
if (false === $this->tableExists($em, 'api_oauth_codes')) {
return true;
}
$em->getConnection()->executeUpdate( $em->getConnection()->executeUpdate(
'INSERT INTO ApiOauthCodes 'INSERT INTO ApiOauthCodes
( (
@@ -148,6 +160,9 @@ class patch_390alpha17a extends patchAbstract
private function fillRefreshTokenTable(EntityManager $em) private function fillRefreshTokenTable(EntityManager $em)
{ {
if (false === $this->tableExists($em, 'api_oauth_refresh_tokens')) {
return true;
}
$em->getConnection()->executeUpdate( $em->getConnection()->executeUpdate(
'INSERT INTO ApiOauthRefreshTokens 'INSERT INTO ApiOauthRefreshTokens
( (
@@ -168,6 +183,9 @@ class patch_390alpha17a extends patchAbstract
private function fillOauthTokenTable(EntityManager $em) private function fillOauthTokenTable(EntityManager $em)
{ {
if (false === $this->tableExists($em, 'api_oauth_tokens')) {
return true;
}
$em->getConnection()->executeUpdate( $em->getConnection()->executeUpdate(
'INSERT INTO ApiOauthTokens 'INSERT INTO ApiOauthTokens
( (