SHARE
TWEET

Untitled

a guest Aug 21st, 2019 73 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.             Schema::table('file_resource_roles', function (Blueprint $table) {
  2.                 $schemaManager = Schema::getConnection()->getDoctrineSchemaManager();
  3.                 $indexesFound = $schemaManager->listTableIndexes('file_resource_roles');
  4.                 $indexesToCheck = ['role_id', 'file_resource_id'];
  5.  
  6.                 foreach ($indexesToCheck AS $indexToCheck) {
  7.                     if (array_key_exists('file_resource_roles_'.$indexToCheck.'_fk', $indexesFound)) {
  8.                         $table->dropForeign('file_resource_roles_'.$indexToCheck.'_fk');
  9.                         $table->dropIndex('file_resource_roles_'.$indexToCheck.'_fk');
  10.                     }
  11.                 }
  12.             });
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top