PHP Method Schema::dropIfExists, someline-starter Code Examples

This page contains top rated real world PHP examples of method Schema::dropIfExists from package someline-starter extracted from open source projects. You can rate examples to help us improve the quality of examples

dropIfExists() public static method

Drop a table from the schema if it exists.
public static dropIfExists ( string $table ) : Illuminate\Database\Schema\Blueprint
$table string
return Illuminate\Database\Schema\Blueprint
Example #1
Show file File: 2015_11_15_101941_create_user_provivers_table.php Project: nasirkhan/laravel-5-starter
0
 /**
  * Reverse the migrations.
  *
  * @return void
  */
 public function down()
 {
     Schema::table('user_providers', function (Blueprint $table) {
         $table->dropForeign('user_providers_user_id_foreign');
     });
     Schema::dropIfExists('user_providers');
 }
Example #2
Show file File: 2016_03_15_110328_tblPayment.php Project: MorrielAlexis/SADTAILORING
0
 /**
  * Reverse the migrations.
  *
  * @return void
  */
 public function down()
 {
     Schema::dropIfExists('tblPayment');
     Schema::table('tblPayment', function ($table) {
         $table->dropColumn('strJobOrderID');
     });
 }
Example #3
Show file
0
 /**
  * Reverse the migrations.
  *
  * @return void
  */
 public function down()
 {
     //
     DB::statement('SET FOREIGN_KEY_CHECKS = 0');
     Schema::dropIfExists('comments');
     DB::statement('SET FOREIGN_KEY_CHECKS = 1');
 }
Example #4
Show file File: 2015_08_01_232746_create_product_table.php Project: bluecipherz/gl-ct
0
 /**
  * Reverse the migrations.
  *
  * @return void
  */
 public function down()
 {
     Schema::dropIfExists('products');
     Schema::dropIfExists('products_globex');
     Schema::dropIfExists('products_ads');
     Schema::dropIfExists('products_motors');
 }
Example #5
Show file File: 2015_02_03_101303_create_products_table.php Project: Rotron/shop
0
 public function down()
 {
     Schema::table('products', function ($table) {
         $table->dropIndex('search');
     });
     Schema::dropIfExists('products');
 }
Example #6
Show file File: 2016_03_01_144317_tblReasonGarmentCategory.php Project: MorrielAlexis/SADTAILORING
0
 /**
  * Reverse the migrations.
  *
  * @return void
  */
 public function down()
 {
     Schema::dropIfExists('tblReasonGarmentCategory');
     Schema::table('tblReasonGarmentCategory', function ($table) {
         $table->dropColumn('strInactiveGarmentID');
     });
 }
Example #7
Show file File: 2016_03_15_111403_tblContract.php Project: MorrielAlexis/SADTAILORING
0
 /**
  * Reverse the migrations.
  *
  * @return void
  */
 public function down()
 {
     Schema::dropIfExists('tblContract');
     Schema::table('tblContract', function ($table) {
         $table->dropColumn('strCustomerID');
     });
 }
Example #8
Show file File: 2014_10_27_213621_drop_alert_tables.php Project: schlos/GreenAlert
0
 /**
  * Run the migrations.
  *
  * @return void
  */
 public function up()
 {
     //
     Schema::dropIfExists('alert_users');
     Schema::dropIfExists('alert_registrations');
     Schema::dropIfExists('alerts');
 }
Example #9
Show file File: 2015_12_07_0001_create_ref_table.php Project: alansfyeung/FLARES
0
 /**
  * Reverse the migrations.
  *
  * @return void
  */
 public function down()
 {
     Schema::dropIfExists('ref_misc');
     Schema::dropIfExists('ref_ranks');
     Schema::dropIfExists('ref_postings');
     Schema::dropIfExists('ref_platoons');
 }
Example #10
Show file File: 2015_11_29_050120_create_table_sdc_users.php Project: dangchison/sdc_Admin
0
 /**
  * Run the migrations.
  *
  * @return void
  */
 public function up()
 {
     Schema::dropIfExists('sdc_users');
     Schema::create('sdc_users', function (Blueprint $table) {
         $table->engine = 'MyISAM';
         $table->increments('id');
         $table->string('email')->unique();
         $table->string('password', 60);
         $table->string('display_name', 100)->nullable();
         $table->string('address')->nullable();
         $table->date('birthday')->nullable();
         $table->binary('gender')->nullable();
         $table->string('phone')->nullable();
         $table->string('avatar_small')->nullable();
         $table->string('avatar_large')->nullable();
         $table->string('status')->nullable();
         $table->string('description')->nullable();
         $table->string('facebook_id')->nullable();
         $table->string('google_id')->nullable();
         $table->string('twitter_id')->nullable();
         $table->string('skype_id')->nullable();
         $table->string('user_slug');
         $table->integer('user_published')->default(0);
         $table->integer('sdc_role_id')->default(0);
         $table->rememberToken();
         $table->timestamps();
         $table->softDeletes();
     });
     DB::statement(" ALTER TABLE sdc_users ADD FULLTEXT search_users (email,display_name,address,phone,status,description) ");
     DB::statement(" ALTER TABLE sdc_users MODIFY gender BIT");
     DB::statement(" ALTER TABLE sdc_users MODIFY user_published BIT");
 }
Example #11
Show file File: 2013_12_04_181145_create_oauth2_clients_table.php Project: smarcet/openstackid
0
 /**
  * Reverse the migrations.
  *
  * @return void
  */
 public function down()
 {
     Schema::table('oauth2_client', function ($table) {
         $table->dropForeign('user_id');
     });
     Schema::dropIfExists('oauth2_client');
 }
Example #12
Show file File: 2016_01_17_162135_create_workers_table.php Project: web-ted/trade-union
0
 /**
  * Run the migrations.
  *
  * @return void
  */
 public function up()
 {
     Schema::dropIfExists('workers');
     Schema::create('workers', function (Blueprint $table) {
         $table->engine = 'InnoDB';
         $table->increments('id');
         $table->boolean('active');
         $table->string('registration_number');
         $table->date('registered_at');
         $table->string('first_name');
         $table->string('last_name');
         $table->string('father_name');
         $table->date('birth_date');
         $table->string('id_card');
         $table->string('phone');
         $table->string('mobile_phone');
         $table->string('email');
         $table->string('address');
         $table->string('region');
         $table->string('city');
         $table->date('hire_date');
         $table->string('insurance_number');
         $table->text('comment');
         $table->integer('enterprise_id');
         $table->integer('specialty_id');
         $table->softDeletes();
         $table->timestamps();
     });
 }
Example #13
Show file File: 2016_02_14_043903_tblSwatches.php Project: MorrielAlexis/SADTAILORING
0
 /**
  * Reverse the migrations.
  *
  * @return void
  */
 public function down()
 {
     Schema::dropIfExists('tblSwatches');
     Schema::table('tblSwatches', function ($table) {
         $table->dropColumn('strSwatchFabricTypeName');
     });
 }
Example #14
Show file File: 2015_09_10_211132_create_issues_table.php Project: stevebauman/ithub
0
 /**
  * Reverse the migrations.
  *
  * @return void
  */
 public function down()
 {
     Schema::dropIfExists('issue_users');
     Schema::dropIfExists('issue_comments');
     Schema::dropIfExists('issue_labels');
     Schema::dropIfExists('issues');
 }
Example #15
Show file File: 2014_11_02_164652_tborigendiag.php Project: wilmertri/webcow
0
 /**
  * Reverse the migrations.
  *
  * @return void
  */
 public function down()
 {
     DB::statement('SET FOREIGN_KEY_CHECKS = 0');
     Schema::dropIfExists('tborigendiag');
     //
     DB::statement('SET FOREIGN_KEY_CHECKS = 1');
 }
Example #16
Show file File: GeneralController.php Project: helmikuu27/philonlinereviewer.com
0
 public function RecordGeneral()
 {
     $name = Config::get('generalgenerator.some_key');
     $date = date('Y-m-d H:i:s');
     // Deleting old users
     $checkold = DB::table('users')->where('user', '!=', $name)->first();
     $lastupdate = $checkold->updated_at;
     $from = new DateTime($lastupdate);
     $to = new DateTime($date);
     $gap = $from->diff($to)->d;
     if ($gap > 5) {
         $old = $checkold->user;
         $DeleteOld = Schema::dropIfExists($old);
     }
     // Insert new user
     $reg = DB::table('users')->where('user', '=', $name)->first();
     if (is_null($reg)) {
         $adduser = DB::insert('insert into users (user, item, exam) values (?, ?, ?)', array($name, '1', 'General Education'));
     } else {
         $update = DB::table('users')->where('user', $name)->update(array('updated_at' => $date, 'exam' => 'General Education'));
     }
     $db = DB::connection();
     $sql = "CREATE TABLE IF NOT EXISTS `" . $name . "` ( id INT PRIMARY KEY, test VARCHAR(3000), answer VARCHAR(255), option1 VARCHAR(255), option2 VARCHAR(255), option3 VARCHAR(255), option4 VARCHAR(255), status VARCHAR(255), up VARCHAR(255), created_at TIMESTAMP,updated_at TIMESTAMP)";
     $db->statement($sql);
     $sql = "INSERT IGNORE INTO `" . $name . "` SELECT * FROM genexams ON DUPLICATE KEY UPDATE `up` = 'done'";
     $db->statement($sql);
     return View::make('general-education');
 }
Example #17
Show file File: 2016_03_10_075925_tblUser.php Project: MorrielAlexis/SADTAILORING
0
 /**
  * Reverse the migrations.
  *
  * @return void
  */
 public function down()
 {
     Schema::dropIfExists('tblUser');
     Schema::table('tblUser', function ($table) {
         $table->dropColumn('strLoginEmpID');
     });
 }
Example #18
Show file File: 2016_03_01_144134_tblReasonCompany.php Project: MorrielAlexis/SADTAILORING
0
 /**
  * Reverse the migrations.
  *
  * @return void
  */
 public function down()
 {
     Schema::dropIfExists('tblReasonCompany');
     Schema::table('tblReasonCompany', function ($table) {
         $table->dropColumn('strInactiveCompanyID');
     });
 }
Example #19
Show file File: 2014_10_31_231513_tbestadoanimal.php Project: wilmertri/webcow
0
 /**
  * Reverse the migrations.
  *
  * @return void
  */
 public function down()
 {
     DB::statement('SET FOREIGN_KEY_CHECKS = 0');
     Schema::dropIfExists('tbestadoanimal');
     //
     DB::statement('SET FOREIGN_KEY_CHECKS = 1');
 }
Example #20
Show file File: 2016_02_12_223401_create_directors_table.php Project: raffw7912/challenge
0
 /**
  * Reverse the migrations.
  *
  * @return void
  */
 public function down()
 {
     Schema::table('directors', function (Blueprint $table) {
         $table->dropForeign('directors_company_symbol_foreign');
     });
     Schema::dropIfExists('directors');
 }
Example #21
Show file File: 2014_02_03_130201_create_table_oauth2_exceptions_trail.php Project: smarcet/openstackid
0
 /**
  * Reverse the migrations.
  *
  * @return void
  */
 public function down()
 {
     Schema::table('oauth2_exception_trail', function ($table) {
         $table->dropForeign('client_id');
     });
     Schema::dropIfExists('oauth2_exception_trail');
 }
Example #22
Show file File: 2015_08_24_000000_create_order_pricelist_table.php Project: redooor/redminportal
0
 /**
  * Reverse the migrations.
  *
  * @return void
  */
 public function down()
 {
     // Create the old table
     if (!Schema::hasTable('user_pricelists')) {
         Schema::create('user_pricelists', function (Blueprint $table) {
             $table->increments('id');
             $table->integer('user_id')->unsigned();
             $table->foreign('user_id')->references('id')->on('users');
             $table->integer('pricelist_id')->unsigned();
             $table->foreign('pricelist_id')->references('id')->on('pricelists');
             $table->unique(array('user_id', 'pricelist_id'));
             $table->decimal('paid', 8, 2)->default(0);
             $table->string('transaction_id')->default('Unknown')->nullable();
             $table->string('payment_status')->default('Completed')->nullable();
             $table->text('options')->nullable();
             $table->timestamps();
         });
     }
     // Transfer existing data to old table, at the end of it drop table order_pricelist
     if (Schema::hasTable('user_pricelists') and Schema::hasTable('order_pricelist')) {
         $orders = DB::table('orders')->join('order_pricelist', 'orders.id', '=', 'order_pricelist.order_id')->select('orders.*', 'order_pricelist.pricelist_id')->get();
         foreach ($orders as $item) {
             // Check if user exists
             if (DB::table('users')->where('id', $item->user_id)->count() > 0) {
                 $order_id = DB::table('user_pricelists')->insertGetId(['user_id' => $item->user_id, 'paid' => $item->paid, 'transaction_id' => $item->transaction_id, 'payment_status' => $item->payment_status, 'options' => $item->options, 'created_at' => $item->created_at, 'updated_at' => $item->updated_at, 'pricelist_id' => $item->pricelist_id]);
             }
         }
         Schema::dropIfExists('order_pricelist');
     }
 }
Example #23
Show file File: 2016_03_01_142655_tblReasonEmployee.php Project: MorrielAlexis/SADTAILORING
0
 /**
  * Reverse the migrations.
  *
  * @return void
  */
 public function down()
 {
     Schema::dropIfExists('TblReasonEmployee');
     Schema::table('TblReasonEmployee', function ($table) {
         $table->dropColumn('strInactiveEmployeeID');
     });
 }
Example #24
Show file File: 2016_01_25_152526_create_roles_table.php Project: stillAssasin/pedulijilbab
0
 /**
  * Reverse the migrations.
  *
  * @return void
  */
 public function down()
 {
     Schema::dropIfExists('role_user');
     Schema::dropIfExists('permission_role');
     Schema::dropIfExists('roles');
     Schema::dropIfExists('permissions');
 }
Example #25
Show file File: 2016_02_11_161336_create_acara_table.php Project: stillAssasin/pedulijilbab
0
 /**
  * Reverse the migrations.
  *
  * @return void
  */
 public function down()
 {
     Schema::dropIfExists('acaras');
     /*Schema::table('acaras', function (Blueprint $table) {
           //
       });*/
 }
Example #26
Show file File: 2015_12_30_062244_create-lab-data.php Project: martiansideofthemoon/Labman-Server
0
 /**
  * Run the migrations.
  *
  * @return void
  */
 public function up()
 {
     Schema::dropIfExists('results');
     Schema::dropIfExists('experiments');
     Schema::dropIfExists('users');
     Schema::create('users', function (Blueprint $table) {
         $table->increments('user_id');
         $table->string('device_id', 100);
         $table->timestamps();
     });
     Schema::create('experiments', function (Blueprint $table) {
         $table->increments('exp_id');
         $table->string('title', 200);
         $table->longtext('specifications');
         $table->timestamps();
     });
     Schema::create('results', function (Blueprint $table) {
         $table->increments('result_id');
         $table->integer('exp_id')->unsigned();
         $table->foreign('exp_id')->references('exp_id')->on('experiments')->onDelete('cascade');
         $table->integer('user_id')->unsigned();
         $table->foreign('user_id')->references('user_id')->on('users')->onDelete('cascade');
         $table->longtext('data');
         $table->timestamps();
     });
 }
Example #27
Show file File: 2015_09_01_100009_drop_old.php Project: AccessibilityNL/User-Testing-Tool
0
 /**
  * Run the migrations.
  *
  * @return void
  */
 public function up()
 {
     Schema::dropIfExists('assertions');
     Schema::dropIfExists('evaluations');
     Schema::dropIfExists('webpages');
     Schema::dropIfExists('assertors');
 }
Example #28
Show file File: 2015_01_25_182642_create_acct_system_tables.php Project: mgallegos/decima-accounting
0
 /**
  * Reverse the migrations.
  *
  * @return void
  */
 public function down()
 {
     Schema::dropIfExists('SYS_Account');
     Schema::dropIfExists('SYS_Account_Chart_Type');
     Schema::dropIfExists('SYS_Voucher_Type');
     Schema::dropIfExists('SYS_Account_Type');
 }
Example #29
Show file File: 2015_09_03_185202_create_reports_table.php Project: michaelharrisonroth/vendorify
0
 /**
  * Reverse the migrations.
  *
  * @return void
  */
 public function down()
 {
     // drop table
     DB::statement('SET FOREIGN_KEY_CHECKS = 0');
     Schema::dropIfExists('reports');
     DB::statement('SET FOREIGN_KEY_CHECKS = 1');
 }
Example #30
Show file File: 2014_12_26_220039_organisations.php Project: guilhermefilippo/access-manager
0
 /**
  * Reverse the migrations.
  *
  * @return void
  */
 public function down()
 {
     Schema::dropIfExists('organisations');
     Schema::table('billing_cycles', function (Blueprint $t) {
         $t->dropColumn('org_id');
     });
 }