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


PHP Schema::hasTable方法代码示例

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


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

示例1: up

 /**
  * Run the migrations.
  *
  * @return void
  */
 public function up()
 {
     if (!Schema::hasTable('insurance')) {
         Schema::create('insurance', function ($table) {
             $table->increments('insurance_id');
             $table->bigInteger('pid')->nullable();
             $table->bigInteger('address_id')->nullable();
             $table->string('insurance_plan_name', 255)->nullable();
             $table->string('insurance_order', 255)->nullable();
             $table->string('insurance_id_num', 255)->nullable();
             $table->string('insurance_group', 255)->nullable();
             $table->string('insurance_relationship', 255)->nullable();
             $table->string('insurance_copay', 255)->nullable();
             $table->string('insurance_deductible', 255)->nullable();
             $table->longtext('insurance_comments')->nullable();
             $table->string('insurance_plan_active', 255)->nullable();
             $table->string('insurance_insu_firstname', 255)->nullable();
             $table->string('insurance_insu_lastname', 255)->nullable();
             $table->string('insurance_insu_address', 255)->nullable();
             $table->string('insurance_insu_city', 255)->nullable();
             $table->string('insurance_insu_state', 255)->nullable();
             $table->string('insurance_insu_zip', 255)->nullable();
             $table->string('insurance_insu_phone', 255)->nullable();
             $table->dateTime('insurance_insu_dob')->nullable();
             $table->string('insurance_insu_gender', 255)->nullable();
         });
     }
 }
开发者ID:carlosqueiroz,项目名称:nosh-core,代码行数:33,代码来源:2014_01_12_142343_create_insurance_table.php

示例2: up

 public function up()
 {
     if (!Schema::hasTable($this->table)) {
         Schema::create($this->table, function (Blueprint $table) {
             $table->increments('id');
             $table->string('module', 32)->nullable()->index();
             $table->integer('unit_id')->unsigned()->nullable()->index();
             $table->string('language', 16)->nullable()->index();
             /*
             ALTER TABLE `seo` ADD `language` VARCHAR( 16 ) NULL AFTER `unit_id`;
             ALTER TABLE `seo` ADD INDEX ( `language` );
             */
             $table->string('title', 256)->nullable();
             $table->text('description')->nullable();
             $table->text('keywords')->nullable();
             $table->string('url', 256)->nullable()->index();
             $table->string('h1', 256)->nullable();
             $table->timestamps();
             $table->index('module', 'unit_id');
         });
         echo ' + ' . $this->table . PHP_EOL;
     } else {
         echo '...' . $this->table . PHP_EOL;
     }
 }
开发者ID:Grapheme,项目名称:amway,代码行数:25,代码来源:2014_01_01_100110_create_seo_table.php

示例3: up

 /**
  * Run the migrations.
  *
  * @return void
  */
 public function up()
 {
     if (!Schema::hasTable('005_044_email_campaign')) {
         Schema::create('005_044_email_campaign', function ($table) {
             $table->engine = 'InnoDB';
             $table->increments('id_044')->unsigned();
             $table->string('name_044');
             $table->integer('email_account_id_044')->unsigned();
             $table->integer('template_id_044')->unsigned()->nullable();
             $table->string('subject_044');
             $table->string('theme_044');
             $table->text('header_044');
             $table->text('body_044');
             $table->text('footer_044');
             $table->text('text_044');
             $table->text('data_044');
             $table->integer('shipping_date_044')->nullable()->unsigned()->default(0);
             $table->string('shipping_date_text_044')->nullable();
             $table->integer('persistence_date_044')->nullable()->unsigned()->default(0);
             $table->string('persistence_date_text_044')->nullable();
             $table->smallInteger('sorting_044')->nullable()->unsigned()->default(0);
             // estado en true, cuando estamos enviando los emails correspondientes a la campaña a cola de envíos
             $table->boolean('processing_044')->default(false);
             // estado en true, cuando todos los correos que tienen que ser enviados a cola de envíos se han enviado
             $table->boolean('created_044')->default(false);
             $table->integer('viewed_044')->unsigned()->default(0);
             $table->foreign('email_account_id_044', 'fk01_005_044_email_campaign')->references('id_013')->on('001_013_email_account')->onDelete('restrict')->onUpdate('cascade');
             $table->foreign('template_id_044', 'fk02_005_044_email_campaign')->references('id_043')->on('005_043_email_template')->onDelete('restrict')->onUpdate('cascade');
         });
     }
 }
开发者ID:syscover,项目名称:comunik,代码行数:36,代码来源:2003_01_01_000050_comunik_create_table_email_campaign.php

示例4: 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

示例5: up

 /**
  * Run the migrations.
  *
  * @return void
  */
 public function up()
 {
     if (Schema::hasTable('post_types') == false) {
         Schema::create('post_types', function (Blueprint $table) {
             $table->increments('id');
             $table->timestamps();
             $table->string('name');
         });
     }
     if (Schema::hasTable('posts') == false) {
         Schema::create('posts', function (Blueprint $table) {
             $table->increments('id');
             $table->string('title');
             $table->string('slug');
             $table->string('hero_url')->nullable()->default(NULL);
             $table->text('body');
             $table->text('excerpt')->nullable()->default(NULL);
             $table->integer('user_id');
             $table->integer('post_type_id');
             $table->string('status');
             $table->softDeletes();
             $table->timestamps();
         });
     }
 }
开发者ID:vanderlin,项目名称:halp,代码行数:30,代码来源:2015_02_09_154251_create_posts_table.php

示例6: up

 /**
  * Run the migrations.
  *
  * @return void
  */
 public function up()
 {
     if (!Schema::hasTable('staffs_timetable')) {
         Schema::create('staffs_timetable', function (Blueprint $table) {
             $table->increments('id');
             $table->string('period');
             $table->integer('mon')->unsigned()->nullable()->default(null);
             $table->integer('tue')->unsigned()->nullable()->default(null);
             $table->integer('wed')->unsigned()->nullable()->default(null);
             $table->integer('thu')->unsigned()->nullable()->default(null);
             $table->integer('fri')->unsigned()->nullable()->default(null);
             $table->integer('sat')->unsigned()->nullable()->default(null);
             $table->integer('staff_id')->unsigned();
             $table->timestamps();
         });
         Schema::table('staffs_timetable', function (Blueprint $table) {
             $table->foreign('mon')->references('id')->on('courses');
             $table->foreign('tue')->references('id')->on('courses');
             $table->foreign('wed')->references('id')->on('courses');
             $table->foreign('thu')->references('id')->on('courses');
             $table->foreign('fri')->references('id')->on('courses');
             $table->foreign('sat')->references('id')->on('courses');
             $table->foreign('staff_id')->references('id')->on('users')->onDelete('cascade');
         });
     }
 }
开发者ID:razikallayi,项目名称:peaceschools,代码行数:31,代码来源:2015_09_06_172535_create_staffs_timetable_table.php

示例7: up

 /**
  * Run the migrations.
  *
  * @return void
  */
 public function up()
 {
     Schema::create('usuarios', function (Blueprint $table) {
         $table->increments('id');
         $table->string('fbuid', 20);
         $table->string('rut', 20);
         $table->string('firstname', 100);
         $table->string('lastname', 100);
         $table->string('genero', 20);
         $table->string('phone', 20);
         $table->string('address', 200);
         $table->string('email', 200);
         $table->integer('comuna_id')->unsigned();
         $table->string('ip', 20);
         $table->char('complete', 1);
         $table->text('meta', 20);
         $table->text('access_token', 20);
         $table->text('expire_token', 20);
         $table->timestamps();
         #Indices
         $table->index('comuna_id');
         #FK
         if (Schema::hasTable('comunas')) {
             $table->foreign('comuna_id')->references('id')->on('comunas');
         }
     });
 }
开发者ID:bowl13,项目名称:FB_Base_Laravel_AngularJS,代码行数:32,代码来源:2014_07_22_171929_create_usuarios_table.php

示例8: up

 /**
  * Run the migrations.
  *
  * @return void
  */
 public function up()
 {
     if (!Schema::hasTable('immunizations')) {
         Schema::create('immunizations', function ($table) {
             $table->increments('imm_id');
             $table->bigInteger('pid')->nullable();
             $table->bigInteger('eid')->nullable();
             $table->string('cpt', 255)->nullable();
             $table->dateTime('imm_date')->nullable();
             $table->string('imm_immunization', 255)->nullable();
             $table->string('imm_sequence', 255)->nullable();
             $table->string('imm_body_site', 255)->nullable();
             $table->string('imm_dosage', 255)->nullable();
             $table->string('imm_dosage_unit', 255)->nullable();
             $table->string('imm_route', 255)->nullable();
             $table->string('imm_elsewhere', 255)->nullable();
             $table->string('imm_vis', 255)->nullable();
             $table->string('imm_lot', 255)->nullable();
             $table->string('imm_manufacturer', 255)->nullable();
             $table->dateTime('imm_expiration')->nullable();
             $table->string('imm_brand', 255)->nullable();
             $table->string('imm_cvxcode', 255)->nullable();
             $table->string('imm_provider', 255)->nullable();
         });
     }
 }
开发者ID:carlosqueiroz,项目名称:nosh-core,代码行数:31,代码来源:2014_01_12_142343_create_immunizations_table.php

示例9: up

 /**
  * Run the migrations.
  *
  * @return void
  */
 public function up()
 {
     if (!Schema::hasTable('004_403_record')) {
         Schema::create('004_403_record', function (Blueprint $table) {
             $table->engine = 'InnoDB';
             $table->increments('id_403')->unsigned();
             $table->integer('form_id_403')->unsigned();
             $table->integer('date_403')->unsigned();
             $table->string('date_text_403', 25);
             $table->integer('state_id_403')->unsigned()->nullable();
             $table->string('subject_403', 255)->nullable();
             $table->string('company_403', 100)->nullable();
             $table->string('name_403', 50)->nullable();
             $table->string('surname_403', 50)->nullable();
             $table->string('email_403', 100)->nullable();
             $table->string('country_id_403', 2)->nullable();
             $table->string('territorial_area_1_id_403', 6)->nullable();
             $table->string('territorial_area_2_id_403', 10)->nullable();
             $table->string('territorial_area_3_id_403', 10)->nullable();
             $table->boolean('opened_403')->default(false);
             $table->boolean('dispatched_403')->default(false);
             $table->text('data_403');
             $table->foreign('form_id_403', 'fk01_004_403_record')->references('id_401')->on('004_401_form')->onDelete('cascade')->onUpdate('cascade');
             $table->foreign('state_id_403', 'fk02_004_403_record')->references('id_400')->on('004_400_state')->onDelete('restrict')->onUpdate('cascade');
             $table->foreign('country_id_403', 'fk03_004_403_record')->references('id_002')->on('001_002_country')->onDelete('restrict')->onUpdate('cascade');
             $table->foreign('territorial_area_1_id_403', 'fk04_004_403_record')->references('id_003')->on('001_003_territorial_area_1')->onDelete('restrict')->onUpdate('cascade');
             $table->foreign('territorial_area_2_id_403', 'fk05_004_403_record')->references('id_004')->on('001_004_territorial_area_2')->onDelete('restrict')->onUpdate('cascade');
             $table->foreign('territorial_area_3_id_403', 'fk06_004_403_record')->references('id_005')->on('001_005_territorial_area_3')->onDelete('restrict')->onUpdate('cascade');
         });
     }
 }
开发者ID:syscover,项目名称:forms,代码行数:36,代码来源:2004_01_01_000040_forms_create_table_record.php

示例10: up

 /**
  * Run the migrations.
  *
  * @return void
  */
 public function up()
 {
     if (!Schema::hasTable('sexoffenders')) {
         Schema::create('sexoffenders', function (Blueprint $table) {
             $table->increments('id');
             $table->string('state_name')->index();
             $table->string('state_code')->index();
             $table->string('state_url');
             $table->string('status');
             $table->integer('records_crawled')->unsigned()->default(0);
             $table->integer('records_expected')->unsigned()->default(0);
             $table->enum('crawl_state', ['running', 'stopped', 'paused', 'completed', 'incomplete'])->default('incomplete')->index();
             $table->enum('paused', ['0', '1'])->default('0')->comment = '0-normal, 1-paused';
             $table->timestamp('expected_time')->nullable();
             $table->timestamp('started_at')->nullable();
             $table->timestamp('completed_at')->nullable();
         });
     }
     if (!Schema::hasTable('sexoffenders_stats')) {
         Schema::create('sexoffenders_stats', function (Blueprint $table) {
             $table->increments('id');
             $table->integer('sexoffender_id')->unsigned();
             $table->foreign('sexoffender_id')->references('id')->on('sexoffenders');
             $table->integer('records_crawled')->unsigned()->default(0);
             $table->time('crawl_time');
             $table->time('record_time');
             $table->timestamp('started_at')->nullable();
             $table->timestamp('completed_at')->nullable();
         });
     }
 }
开发者ID:kirantcyquent,项目名称:LaravelOffenders,代码行数:36,代码来源:2015_05_11_181912_create_sexoffenders_table.php

示例11: up

 /**
  * Run the migrations.
  *
  * @return void
  */
 public function up()
 {
     if (Schema::hasTable('notifications') || Schema::hasTable('notification_activities')) {
         return;
     }
     /**
      * Create Table Notifications
      */
     Schema::create('notifications', function (Blueprint $table) {
         $table->increments('id');
         $table->text('job');
         $table->text('data');
         $table->timestamps();
         $table->softDeletes();
     });
     /**
      * Create Table for Activities
      */
     Schema::create('notification_activities', function (Blueprint $table) {
         $table->increments('id');
         $table->unsignedInteger('notification_id');
         $table->foreign('notification_id')->references('id')->on('notifications')->onDelete('cascade');
         /**
          * There is no foreign key set, so one can use his own database structure for UserInterface
          */
         $table->unsignedInteger('user_id')->nullable()->default(null)->index();
         $table->string('activity');
         $table->timestamps();
         $table->index(['notification_id', 'user_id']);
     });
 }
开发者ID:ipunkt,项目名称:laravel-notify,代码行数:36,代码来源:2014_07_25_115118_notify_create_table_notifications.php

示例12: up

 /**
  * Run the migrations.
  *
  * @return void
  */
 public function up()
 {
     if (!Schema::hasTable($this->table)) {
         Schema::create($this->table, function (Blueprint $table) {
             $table->engine = 'InnoDB';
             /* Primary Key */
             $table->increments('id');
             /* Main Data*/
             $table->string('fullname');
             $table->string('email')->unique();
             $table->string('no_telp')->nullable();
             $table->string('username')->unique();
             $table->string('password', 255);
             $table->string('image', 255)->nullable();
             $table->text('address')->nullable();
             $table->tinyInteger('status')->default(0);
             $table->rememberToken();
             /* Foreign Key */
             $table->integer('id_group')->unsigned();
             $table->foreign('id_group')->references('id')->on('groups')->onDelete('cascade')->onUpdate('cascade');
             /* Action Data */
             $table->string('created_by')->nullable()->default('system');
             $table->timestamps();
         });
     }
 }
开发者ID:Abdulhmid,项目名称:wecando,代码行数:31,代码来源:2016_01_14_174846_create_table_users.php

示例13: up

 /**
  * Run the migrations.
  *
  * @return void
  */
 public function up()
 {
     if (!Schema::hasTable('users_list')) {
         Schema::create('users_list', function (Blueprint $table) {
             $table->increments('id');
             $table->timestamps();
             $table->softDeletes();
             $table->string('fullname');
             $table->string('email', 40)->unique();
             $table->string('password', 100);
             $table->string('remember_token', 100);
         });
     }
     if (!Schema::hasTable('users_groups')) {
         Schema::create("users_groups", function (Blueprint $table) {
             $table->increments('id');
             $table->timestamps();
             $table->softDeletes();
             $table->string('title', 30);
             $table->integer('level');
         });
     }
     if (!Schema::hasTable('users_per_groups')) {
         Schema::create("users_per_groups", function (Blueprint $table) {
             $table->integer('user_id');
             $table->integer('group_id');
         });
     }
 }
开发者ID:karloleary,项目名称:users,代码行数:34,代码来源:2016_01_21_151634_karloleary_users_initial_migration.php

示例14: up

 /**
  * Run the migrations.
  *
  * @return void
  */
 public function up()
 {
     if (!Schema::hasTable('orders')) {
         Schema::create('orders', function ($table) {
             $table->bigIncrements('orders_id');
             $table->bigInteger('address_id')->nullable();
             $table->bigInteger('eid')->nullable();
             $table->bigInteger('t_messages_id')->nullable();
             $table->bigInteger('pid')->nullable();
             $table->string('encounter_provider', 255)->nullable();
             $table->timestamp('orders_date')->default(DB::raw('CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP'));
             $table->string('orders_insurance', 255)->nullable();
             $table->longtext('orders_referrals')->nullable();
             $table->longtext('orders_labs')->nullable();
             $table->longtext('orders_radiology')->nullable();
             $table->longtext('orders_cp')->nullable();
             $table->string('orders_referrals_icd', 255)->nullable();
             $table->string('orders_labs_icd', 255)->nullable();
             $table->string('orders_radiology_icd', 255)->nullable();
             $table->string('orders_cp_icd', 255)->nullable();
             $table->string('orders_labs_obtained', 255)->nullable();
             $table->boolean('orders_completed')->nullable();
             $table->bigInteger('id')->nullable();
         });
     }
 }
开发者ID:carlosqueiroz,项目名称:nosh-core,代码行数:31,代码来源:2014_01_12_142343_create_orders_table.php

示例15: down

 /**
  * Reverse the migrations.
  *
  * @return void
  */
 public function down()
 {
     // drop all table to back to revision
     if (Schema::hasTable('freelancer_info_skill')) {
         Schema::drop('freelancer_info_skill');
     }
     if (Schema::hasTable('freelancer_info')) {
         if (Schema::hasTable('accepted_job_links')) {
             Schema::drop('accepted_job_links');
         }
         if (Schema::hasTable('accepted_job')) {
             Schema::drop('accepted_job');
         }
         if (Schema::hasTable('job_category')) {
             Schema::drop('job_category');
         }
         if (Schema::hasTable('job')) {
             Schema::drop('job');
         }
         if (Schema::hasTable('category')) {
             Schema::drop('category');
         }
         Schema::drop('freelancer_info');
     }
 }
开发者ID:sagaekakristi,项目名称:ppla02,代码行数:30,代码来源:2016_04_11_025340_create-freelancer-info.php


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