當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Blueprint::create方法代碼示例

本文整理匯總了PHP中Illuminate\Database\Schema\Blueprint::create方法的典型用法代碼示例。如果您正苦於以下問題:PHP Blueprint::create方法的具體用法?PHP Blueprint::create怎麽用?PHP Blueprint::create使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Illuminate\Database\Schema\Blueprint的用法示例。


在下文中一共展示了Blueprint::create方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: create

 protected function create(Blueprint $table)
 {
     $table->create();
     $table->integer('user_id')->unsigned();
     $table->integer('topic_id')->unsigned();
     $table->primary(array('user_id', 'topic_id'));
 }
開發者ID:fluxbb,項目名稱:core,代碼行數:7,代碼來源:TopicSubscriptions.php

示例2: create

 protected function create(Blueprint $table)
 {
     $table->create();
     $table->increments('id');
     $table->string('title', 50)->default('');
     $table->integer('parent_group_id')->unsigned()->nullable();
 }
開發者ID:fluxbb,項目名稱:core,代碼行數:7,代碼來源:Groups.php

示例3: create

 protected function create(Blueprint $table)
 {
     $table->create();
     $table->string('conf_name', 255)->default('');
     $table->text('conf_value')->nullable();
     $table->primary('conf_name');
 }
開發者ID:fluxbb,項目名稱:core,代碼行數:7,代碼來源:Config.php

示例4: create

 protected function create(Blueprint $table)
 {
     $table->create();
     $table->increments('id');
     $table->integer('group_id')->unsigned();
     $table->string('name', 50);
     $table->boolean('value');
 }
開發者ID:fluxbb,項目名稱:core,代碼行數:8,代碼來源:GroupPermissions.php

示例5: create

 protected function create(Blueprint $table)
 {
     $table->create();
     $table->string('slug', 100)->primary();
     $table->string('name');
     $table->integer('position')->default(0);
     $table->boolean('conversations_enabled')->default(true);
     $table->timestamps();
 }
開發者ID:fluxbb,項目名稱:core,代碼行數:9,代碼來源:Categories.php

示例6: table

 /**
  * 
  * @param sting $table
  * @return $this
  */
 public function table($table)
 {
     $this->table = $table;
     $this->blueprint = new Blueprint($table);
     if (!Schema::hasTable($table)) {
         $this->blueprint->create();
         $this->blueprint->increments('id');
     }
     return $this;
 }
開發者ID:boyhagemann,項目名稱:framework,代碼行數:15,代碼來源:ModelBuilder.php

示例7: create

 protected function create(Blueprint $table)
 {
     $table->create();
     $table->integer('group_id')->unsigned();
     $table->integer('forum_id')->unsigned();
     $table->boolean('read_forum')->default(true);
     $table->boolean('post_replies')->default(true);
     $table->boolean('post_topics')->default(true);
     $table->primary(array('group_id', 'forum_id'));
 }
開發者ID:fluxbb,項目名稱:core,代碼行數:10,代碼來源:ForumPerms.php

示例8: testBasicCreateTableWithPrefix

 public function testBasicCreateTableWithPrefix()
 {
     $blueprint = new Blueprint('users');
     $blueprint->create();
     $blueprint->increments('id');
     $blueprint->string('email');
     $grammar = $this->getGrammar();
     $grammar->setTablePrefix('prefix_');
     $statements = $blueprint->toSql($grammar);
     $this->assertEquals(1, count($statements));
     $this->assertEquals('create table `prefix_users` (`id` int not null auto_increment primary key, `email` varchar(255) not null)', $statements[0]);
 }
開發者ID:hochanh,項目名稱:Bootsoft-Bowling,代碼行數:12,代碼來源:MySqlSchemaGrammarTest.php

示例9: create

 protected function create(Blueprint $table)
 {
     $table->create();
     $table->string('id', 40);
     $table->integer('user_id')->unsigned()->default(1);
     $table->integer('created')->unsigned()->default(0);
     $table->integer('last_activity')->unsigned()->default(0);
     $table->string('last_ip', 200)->default('0.0.0.0');
     $table->text('payload');
     $table->primary('id');
     $table->index('user_id');
 }
開發者ID:fluxbb,項目名稱:core,代碼行數:12,代碼來源:Sessions.php

示例10: testBasicCreateTable

 public function testBasicCreateTable()
 {
     $blueprint = new Blueprint('users');
     $blueprint->create();
     $blueprint->increments('id');
     $blueprint->string('email');
     $statements = $blueprint->toSql($this->getGrammar());
     $this->assertEquals(1, count($statements));
     $this->assertEquals('create table "users" ("id" int identity primary key not null, "email" nvarchar(255) not null)', $statements[0]);
     $blueprint = new Blueprint('users');
     $blueprint->increments('id');
     $blueprint->string('email');
     $statements = $blueprint->toSql($this->getGrammar());
     $this->assertEquals(1, count($statements));
     $this->assertEquals('alter table "users" add "id" int identity primary key not null, add "email" nvarchar(255) not null', $statements[0]);
 }
開發者ID:hochanh,項目名稱:Bootsoft-Bowling,代碼行數:16,代碼來源:SqlServerSchemaGrammarTest.php

示例11: create

 protected function create(Blueprint $table)
 {
     $table->create();
     $table->increments('id');
     $table->string('poster', 200)->default('');
     $table->integer('poster_id')->unsigned()->default(1);
     $table->string('poster_ip', 39)->nullable();
     $table->text('message')->nullable();
     $table->boolean('hide_smilies')->default(false);
     $table->integer('posted')->unsigned()->default(0);
     $table->integer('edited')->unsigned()->nullable();
     $table->string('edited_by', 200)->nullable();
     $table->integer('conversation_id')->unsigned();
     $table->index('conversation_id');
     $table->index(['poster_id', 'conversation_id']);
 }
開發者ID:fluxbb,項目名稱:core,代碼行數:16,代碼來源:Posts.php

示例12: create

 protected function create(Blueprint $table)
 {
     $table->create();
     $table->increments('id');
     $table->string('category_slug', 100)->nullable()->index();
     $table->string('title');
     $table->string('poster', 200)->default('');
     $table->integer('posted')->unsigned()->default(0);
     $table->integer('first_post_id')->unsigned()->default(0);
     $table->integer('last_post')->unsigned()->default(0);
     $table->integer('last_post_id')->unsigned()->default(0);
     $table->string('last_poster', 200)->nullable();
     $table->integer('num_views')->unsigned()->default(0);
     $table->integer('num_replies')->unsigned()->default(0);
     $table->timestamps();
 }
開發者ID:fluxbb,項目名稱:core,代碼行數:16,代碼來源:Conversations.php

示例13: create

 protected function create(Blueprint $table)
 {
     $table->create();
     $table->increments('id');
     $table->integer('group_id')->unsigned()->default(3);
     $table->string('username', 200)->default('');
     $table->string('password', 60)->default('');
     $table->string('email', 80)->default('');
     $table->string('title', 50)->nullable();
     $table->string('realname', 40)->nullable();
     $table->string('url', 100)->nullable();
     $table->string('location', 30)->nullable();
     $table->text('signature')->nullable();
     $table->integer('disp_topics')->unsigned()->nullable();
     $table->integer('disp_posts')->unsigned()->nullable();
     $table->integer('email_setting')->unsigned()->default(1);
     $table->boolean('notify_with_post')->default(false);
     $table->boolean('auto_notify')->default(false);
     $table->boolean('show_smilies')->default(true);
     $table->boolean('show_img')->default(true);
     $table->boolean('show_img_sig')->default(true);
     $table->boolean('show_avatars')->default(true);
     $table->boolean('show_sig')->default(true);
     $table->float('timezone')->default(0);
     $table->boolean('dst')->default(false);
     $table->integer('time_format')->unsigned()->default(0);
     $table->integer('date_format')->unsigned()->default(0);
     $table->string('language', 25)->default('');
     $table->string('style', 25)->default('');
     $table->integer('num_posts')->unsigned()->default(0);
     $table->integer('last_post')->unsigned()->nullable();
     $table->integer('last_search')->unsigned()->nullable();
     $table->integer('last_email_sent')->unsigned()->nullable();
     $table->integer('last_report_sent')->unsigned()->nullable();
     $table->integer('registered')->unsigned()->default(0);
     $table->string('registration_ip', 35)->default('0.0.0.0');
     $table->integer('last_visit')->unsigned()->default(0);
     $table->string('admin_note', 30)->nullable();
     $table->string('activate_string', 80)->nullable();
     $table->string('activate_key', 8)->nullable();
     $table->string('remember_token')->nullable();
     $table->unique('username');
     $table->index('registered');
 }
開發者ID:fluxbb,項目名稱:core,代碼行數:44,代碼來源:Users.php

示例14: testBasicSelectNotUsingQuotes

 public function testBasicSelectNotUsingQuotes()
 {
     $blueprint = new Blueprint('users');
     $blueprint->create();
     $blueprint->increments('id');
     $blueprint->string('email');
     $conn = $this->getConnection();
     $statements = $blueprint->toSql($conn, $this->getGrammar(false));
     $this->assertEquals(1, count($statements));
     $this->assertEquals('create table users ( id number(10,0) not null, email varchar2(255) not null, constraint users_id_primary primary key ( id ) )', $statements[0]);
 }
開發者ID:mickael83,項目名稱:Laravel-OracleDB,代碼行數:11,代碼來源:OracleDBSchemaGrammarTest.php

示例15: testAddingForeignKey

 public function testAddingForeignKey()
 {
     $blueprint = new Blueprint('users');
     $blueprint->create();
     $blueprint->string('foo')->primary();
     $blueprint->string('order_id');
     $blueprint->foreign('order_id')->references('id')->on('orders');
     $statements = $blueprint->toSql($this->getGrammar());
     $this->assertEquals(1, count($statements));
     $this->assertEquals('create table "users" ("foo" varchar not null, "order_id" varchar not null, foreign key("order_id") references "orders"("id"), primary key ("foo"))', $statements[0]);
 }
開發者ID:hochanh,項目名稱:Bootsoft-Bowling,代碼行數:11,代碼來源:SQLiteSchemaGrammarTest.php


注:本文中的Illuminate\Database\Schema\Blueprint::create方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。