当前位置: 首页>>代码示例>>PHP>>正文


PHP Schema::dropIfExists方法代码示例

本文整理汇总了PHP中Schema::dropIfExists方法的典型用法代码示例。如果您正苦于以下问题:PHP Schema::dropIfExists方法的具体用法?PHP Schema::dropIfExists怎么用?PHP Schema::dropIfExists使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Schema的用法示例。


在下文中一共展示了Schema::dropIfExists方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: down

 /**
  * 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');
 }
开发者ID:nasirkhan,项目名称:laravel-5-starter,代码行数:12,代码来源:2015_11_15_101941_create_user_provivers_table.php

示例2: down

 /**
  * Reverse the migrations.
  *
  * @return void
  */
 public function down()
 {
     Schema::dropIfExists('tblPayment');
     Schema::table('tblPayment', function ($table) {
         $table->dropColumn('strJobOrderID');
     });
 }
开发者ID:MorrielAlexis,项目名称:SADTAILORING,代码行数:12,代码来源:2016_03_15_110328_tblPayment.php

示例3: down

 /**
  * Reverse the migrations.
  *
  * @return void
  */
 public function down()
 {
     Schema::dropIfExists('products');
     Schema::dropIfExists('products_globex');
     Schema::dropIfExists('products_ads');
     Schema::dropIfExists('products_motors');
 }
开发者ID:bluecipherz,项目名称:gl-ct,代码行数:12,代码来源:2015_08_01_232746_create_product_table.php

示例4: down

 public function down()
 {
     Schema::table('products', function ($table) {
         $table->dropIndex('search');
     });
     Schema::dropIfExists('products');
 }
开发者ID:Rotron,项目名称:shop,代码行数:7,代码来源:2015_02_03_101303_create_products_table.php

示例5: up

 /**
  * Run the migrations.
  *
  * @return void
  */
 public function up()
 {
     //
     Schema::dropIfExists('alert_users');
     Schema::dropIfExists('alert_registrations');
     Schema::dropIfExists('alerts');
 }
开发者ID:schlos,项目名称:GreenAlert,代码行数:12,代码来源:2014_10_27_213621_drop_alert_tables.php

示例6: up

 /**
  * 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");
 }
开发者ID:dangchison,项目名称:sdc_Admin,代码行数:37,代码来源:2015_11_29_050120_create_table_sdc_users.php

示例7: down

 /**
  * Reverse the migrations.
  *
  * @return void
  */
 public function down()
 {
     Schema::table('oauth2_client', function ($table) {
         $table->dropForeign('user_id');
     });
     Schema::dropIfExists('oauth2_client');
 }
开发者ID:smarcet,项目名称:openstackid,代码行数:12,代码来源:2013_12_04_181145_create_oauth2_clients_table.php

示例8: up

 /**
  * 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();
     });
 }
开发者ID:web-ted,项目名称:trade-union,代码行数:34,代码来源:2016_01_17_162135_create_workers_table.php

示例9: down

 /**
  * 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');
 }
开发者ID:wilmertri,项目名称:webcow,代码行数:12,代码来源:2014_11_02_164652_tborigendiag.php

示例10: RecordGeneral

 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');
 }
开发者ID:helmikuu27,项目名称:philonlinereviewer.com,代码行数:28,代码来源:GeneralController.php

示例11: down

 /**
  * 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');
     }
 }
开发者ID:redooor,项目名称:redminportal,代码行数:35,代码来源:2015_08_24_000000_create_order_pricelist_table.php

示例12: down

 /**
  * Reverse the migrations.
  *
  * @return void
  */
 public function down()
 {
     Schema::dropIfExists('acaras');
     /*Schema::table('acaras', function (Blueprint $table) {
           //
       });*/
 }
开发者ID:stillAssasin,项目名称:pedulijilbab,代码行数:12,代码来源:2016_02_11_161336_create_acara_table.php

示例13: up

 /**
  * 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();
     });
 }
开发者ID:martiansideofthemoon,项目名称:Labman-Server,代码行数:31,代码来源:2015_12_30_062244_create-lab-data.php

示例14: up

 /**
  * Run the migrations.
  *
  * @return void
  */
 public function up()
 {
     Schema::dropIfExists('assertions');
     Schema::dropIfExists('evaluations');
     Schema::dropIfExists('webpages');
     Schema::dropIfExists('assertors');
 }
开发者ID:AccessibilityNL,项目名称:User-Testing-Tool,代码行数:12,代码来源:2015_09_01_100009_drop_old.php

示例15: down

 /**
  * 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');
 }
开发者ID:michaelharrisonroth,项目名称:vendorify,代码行数:12,代码来源:2015_09_03_185202_create_reports_table.php


注:本文中的Schema::dropIfExists方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。