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


PHP Builder::create方法代码示例

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


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

示例1: up

 /**
  * Run the migrations.
  *
  * @return void
  */
 public function up()
 {
     $this->schema->create('roles', function (Blueprint $table) {
         $table->increments('id');
         $table->string('name')->unique();
     });
 }
开发者ID:SkysoulDesign,项目名称:mirage.dev,代码行数:12,代码来源:2016_02_06_055314_create_roles_table.php

示例2: up

 /**
  * Run the migrations.
  */
 public function up()
 {
     $this->schema->create('password_resets', function (Blueprint $table) {
         $table->string('email')->index();
         $table->string('token')->index();
         $table->timestamp('created_at');
     });
 }
开发者ID:codecasts,项目名称:laravel,代码行数:11,代码来源:CreatePasswordResetsTable.php

示例3: up

 /**
  * Run the migrations.
  *
  * @return void
  */
 public function up()
 {
     $this->schema->create('ages', function (Blueprint $table) {
         $table->increments('id');
         $table->string('from');
         $table->string('to');
     });
 }
开发者ID:SkysoulDesign,项目名称:mirage.dev,代码行数:13,代码来源:2016_02_01_071908_create_ages_table.php

示例4: up

 /**
  * Do the migration
  */
 public function up()
 {
     //Create
     $this->schema->create('account_status', function ($table) {
         $table->increments('id');
         $table->string('value', 200);
         $table->dateTime('created_at')->default(DB::raw('CURRENT_TIMESTAMP'));
     });
 }
开发者ID:AshniSukhoo,项目名称:UOM_connect,代码行数:12,代码来源:20151017193305_CreateAccountStatusTable.php

示例5: up

 /**
  * Run the migrations.
  *
  * @return void
  */
 public function up()
 {
     $this->schema->create('notifications', function (Blueprint $table) {
         $table->increments('id');
         $table->string('title');
         $table->string('body');
         $table->dateTime('release_date');
         $table->timestamps();
     });
 }
开发者ID:SkysoulDesign,项目名称:mirage.dev,代码行数:15,代码来源:2016_02_04_024203_create_notifications_table.php

示例6: handle

 /**
  * Install the extensions table.
  */
 public function handle()
 {
     $this->schema->dropIfExists('addons_extensions');
     $this->schema->create('addons_extensions', function (Blueprint $table) {
         $table->increments('id');
         $table->string('slug');
         $table->boolean('installed')->default(0);
         $table->boolean('enabled')->default(0);
     });
 }
开发者ID:huglester,项目名称:streams-platform,代码行数:13,代码来源:InstallExtensionsTableHandler.php

示例7: up

 /**
  * Run the migrations.
  *
  * @return void
  */
 public function up()
 {
     $this->schema->create('user_roles', function (Blueprint $table) {
         $table->increments('id');
         $table->integer('user_id')->unsigned()->index();
         $table->foreign('user_id')->references('id')->on('users')->onDelete('cascade');
         $table->integer('role_id')->unsigned()->index();
         $table->foreign('role_id')->references('id')->on('roles')->onDelete('cascade');
     });
 }
开发者ID:SkysoulDesign,项目名称:mirage.dev,代码行数:15,代码来源:2016_02_06_063709_create_user_roles_table.php

示例8: up

 /**
  * Do the migration
  */
 public function up()
 {
     $this->schema->create('posts', function ($table) {
         $table->increments('id');
         $table->integer('user_id')->unsigned();
         $table->text('content');
         $table->timestamps();
         $table->softDeletes();
         $table->foreign('user_id')->references('id')->on('users');
     });
 }
开发者ID:AshniSukhoo,项目名称:UOM_connect,代码行数:14,代码来源:20160205180020_CreatePostTable.php

示例9: up

 /**
  * Do the migration
  */
 public function up()
 {
     //Create table
     $this->schema->create('ci_sessions', function ($table) {
         $table->string('session_id', 40);
         $table->string('ip_address', 45);
         $table->string('user_agent', 120);
         $table->integer('last_activity')->unsigned();
         $table->text('user_data');
     });
 }
开发者ID:AshniSukhoo,项目名称:UOM_connect,代码行数:14,代码来源:20151017200703_CreateCISessionsTable.php

示例10: up

 /**
  * Run the migrations.
  */
 public function up()
 {
     $this->schema->create('users', function (Blueprint $table) {
         $table->increments('id');
         $table->string('name');
         $table->string('email')->unique();
         $table->string('password');
         $table->rememberToken();
         $table->timestamps();
     });
 }
开发者ID:codecasts,项目名称:laravel,代码行数:14,代码来源:CreateUsersTable.php

示例11: up

 /**
  * Run the migrations.
  *
  * @return void
  */
 public function up()
 {
     $this->schema->create('products', function (Blueprint $table) {
         $table->increments('id');
         $table->string('name');
         $table->string('code')->unique();
         $table->string('image');
         $table->string('poster');
         $table->timestamps();
     });
 }
开发者ID:SkysoulDesign,项目名称:mirage.dev,代码行数:16,代码来源:2016_02_01_035731_create_products_table.php

示例12: up

 /**
  * Do the migration
  */
 public function up()
 {
     //Creates contents table
     $this->schema->create('contents', function ($table) {
         $table->increments('id');
         $table->string('title');
         $table->text('text');
         $table->timestamps();
         $table->softDeletes();
     });
 }
开发者ID:AshniSukhoo,项目名称:UOM_connect,代码行数:14,代码来源:20160319185708_create_contents_table.php

示例13: up

 /**
  * Run the migrations.
  *
  * @return void
  */
 public function up()
 {
     $this->schema->create('profiles', function (Blueprint $table) {
         $table->increments('id');
         $table->string('image');
         $table->longText('description');
         $table->integer('product_id')->unsigned()->index();
         $table->foreign('product_id')->references('id')->on('products')->onDelete('cascade');
         $table->timestamps();
     });
 }
开发者ID:SkysoulDesign,项目名称:mirage.dev,代码行数:16,代码来源:2016_03_08_075048_create_profiles_table.php

示例14: up

 /**
  * Do the migration
  */
 public function up()
 {
     $this->schema->create('likes', function ($table) {
         $table->increments('id');
         $table->integer('user_id')->unsigned();
         $table->string('resourceable_type');
         $table->string('resourceable_id');
         $table->timestamps();
         $table->softDeletes();
         $table->foreign('user_id')->references('id')->on('users');
     });
 }
开发者ID:AshniSukhoo,项目名称:UOM_connect,代码行数:15,代码来源:20160205182727_CreateLikeTable.php

示例15: runTestMigrations

 /**
  * Run migrations for tables only used for testing purposes.
  *
  * @return void
  */
 protected function runTestMigrations()
 {
     include_once __DIR__ . '/../resources/migrations/create_adjustments_table.php.stub';
     (new \CreateAdjustmentsTable())->up();
     if (!$this->schema->hasTable('fruits')) {
         $this->schema->create('fruits', function (Blueprint $table) {
             $table->increments('id');
             $table->string('name');
             $table->integer('price');
         });
     }
 }
开发者ID:mangopixel,项目名称:laravel-adjuster,代码行数:17,代码来源:TestCase.php


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