From 426816e2d325a4ff77b5eabb7aad10bb7b4b98cb Mon Sep 17 00:00:00 2001 From: Nicolas Le Goff Date: Mon, 10 Mar 2014 15:16:09 +0100 Subject: [PATCH] Checks if api tables exists before apllaying patch --- lib/classes/patch/390alpha17a.php | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/lib/classes/patch/390alpha17a.php b/lib/classes/patch/390alpha17a.php index 05a96c6cdf..5c167c1f4b 100644 --- a/lib/classes/patch/390alpha17a.php +++ b/lib/classes/patch/390alpha17a.php @@ -67,6 +67,9 @@ class patch_390alpha17a extends patchAbstract private function fillApplicationTable(EntityManager $em) { + if (false === $this->tableExists($em, 'api_applications')) { + return true; + } $em->getConnection()->executeUpdate( 'INSERT INTO ApiApplications ( @@ -88,6 +91,9 @@ class patch_390alpha17a extends patchAbstract private function fillAccountTable(EntityManager $em) { + if (false === $this->tableExists($em, 'api_accounts')) { + return true; + } $em->getConnection()->executeUpdate( 'INSERT INTO ApiAccounts ( @@ -108,6 +114,9 @@ class patch_390alpha17a extends patchAbstract private function fillLogTable(EntityManager $em) { + if (false === $this->tableExists($em, 'api_accounts')) { + return true; + } $em->getConnection()->executeUpdate( 'INSERT INTO ApiLogs ( @@ -129,6 +138,9 @@ class patch_390alpha17a extends patchAbstract private function fillCodeTable(EntityManager $em) { + if (false === $this->tableExists($em, 'api_oauth_codes')) { + return true; + } $em->getConnection()->executeUpdate( 'INSERT INTO ApiOauthCodes ( @@ -148,6 +160,9 @@ class patch_390alpha17a extends patchAbstract private function fillRefreshTokenTable(EntityManager $em) { + if (false === $this->tableExists($em, 'api_oauth_refresh_tokens')) { + return true; + } $em->getConnection()->executeUpdate( 'INSERT INTO ApiOauthRefreshTokens ( @@ -168,6 +183,9 @@ class patch_390alpha17a extends patchAbstract private function fillOauthTokenTable(EntityManager $em) { + if (false === $this->tableExists($em, 'api_oauth_tokens')) { + return true; + } $em->getConnection()->executeUpdate( 'INSERT INTO ApiOauthTokens (