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


PHP Blueprint::dropColumn方法代碼示例

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


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

示例1: testDropColumn

 public function testDropColumn()
 {
     $blueprint = new Blueprint('users');
     $blueprint->dropColumn('foo');
     $statements = $blueprint->toSql($this->getGrammar());
     $this->assertEquals(1, count($statements));
     $this->assertEquals('alter table "users" drop "foo"', $statements[0]);
     $blueprint = new Blueprint('users');
     $blueprint->dropColumn(array('foo', 'bar'));
     $statements = $blueprint->toSql($this->getGrammar());
     $this->assertEquals(1, count($statements));
     $this->assertEquals('alter table "users" drop "foo", drop "bar"', $statements[0]);
 }
開發者ID:hochanh,項目名稱:Bootsoft-Bowling,代碼行數:13,代碼來源:SqlServerSchemaGrammarTest.php

示例2: ifUsersTableExists

 protected function ifUsersTableExists(Blueprint $table)
 {
     if (Schema::hasColumn('users', 'name')) {
         $table->dropColumn('name');
     }
     $table->string('last_name')->after('id');
     $table->string('first_name')->after('id');
     $table->string('avatar')->after('email');
     $table->string('provider')->after('email');
     $table->string('provider_id')->unique()->after('email');
     $table->longText('provider_token')->after('email');
     $table->string('link')->after('password');
     $table->string('gender')->nullable()->after('password');
     $table->boolean('verified')->default(false)->after('password');
 }
開發者ID:jayaregalinada,項目名稱:common,代碼行數:15,代碼來源:common_create_users_table.php

示例3: dropColumn

 /**
  * Excluir campo.
  *
  * @param  string|array $columns
  *
  * @return \Illuminate\Support\Fluent
  */
 public function dropColumn($columns)
 {
     $columns = is_array($columns) ? $columns : (array) func_get_args();
     // Verificar se deve excluir constrain dos campos lookups antes
     foreach ($columns as $column) {
         if (ForeignKey::isAssociation($column)) {
             parent::dropForeign(ForeignKey::makeName($this->table, $column));
         }
     }
     return parent::dropColumn($columns);
 }
開發者ID:bugotech,項目名稱:database,代碼行數:18,代碼來源:Table.php

示例4: dropColumns

 /**
  * Drop NestedSet columns.
  *
  * @param \Illuminate\Database\Schema\Blueprint $table
  */
 public static function dropColumns(Blueprint $table)
 {
     $columns = self::getDefaultColumns();
     $table->dropIndex($columns);
     $table->dropColumn($columns);
 }
開發者ID:nutsdo,項目名稱:nong-store,代碼行數:11,代碼來源:NestedSet.php

示例5: drop

 /**
  * 컬럼 제거
  *
  * @param \Illuminate\Database\Schema\Blueprint $table  schema builder
  * @param string                                $prefix column 이름 앞에 붙일 문자열
  * @return void
  */
 public function drop(Blueprint $table, $prefix = '')
 {
     $table->dropColumn(camel_case($prefix . $this->__get('name')));
 }
開發者ID:mint-soft-com,項目名稱:xpressengine,代碼行數:11,代碼來源:ColumnEntity.php

示例6: onDatabaseDrop

 /**
  * @param Blueprint $table
  */
 public function onDatabaseDrop(Blueprint $table)
 {
     $table->dropColumn($this->getDBKey());
 }
開發者ID:KodiComponents,項目名稱:module-datasource,代碼行數:7,代碼來源:Field.php

示例7: dropColumn

 /**
  * Drop the field type column.
  *
  * @param Blueprint $table
  */
 public function dropColumn(Blueprint $table)
 {
     $table->dropColumn($this->fieldType->getColumnName() . '_type');
     $table->dropColumn($this->fieldType->getColumnName() . '_id');
 }
開發者ID:visualturk,項目名稱:polymorphic-field_type,代碼行數:10,代碼來源:PolymorphicFieldTypeSchema.php

示例8: dropColumn

 /**
  * Drop the field type column from the table.
  *
  * @param Blueprint $table
  */
 public function dropColumn(Blueprint $table)
 {
     // Skip if no column type.
     if (!$this->fieldType->getColumnType()) {
         return;
     }
     // Skip if the column doesn't exist.
     if (!$this->schema->hasColumn($table->getTable(), $this->fieldType->getColumnName())) {
         return;
     }
     // Drop dat 'ole column.
     $table->dropColumn($this->fieldType->getColumnName());
 }
開發者ID:jacksun101,項目名稱:streams-platform,代碼行數:18,代碼來源:FieldTypeSchema.php

示例9: testDropColumn

 public function testDropColumn()
 {
     $blueprint = new Blueprint('users');
     $blueprint->dropColumn('foo');
     $statements = $blueprint->toSql($this->getConnection(), $this->getGrammar());
     $this->assertEquals(1, count($statements));
     $this->assertEquals('alter table users drop ( foo )', $statements[0]);
     $blueprint = new Blueprint('users');
     $blueprint->dropColumn(['foo', 'bar']);
     $statements = $blueprint->toSql($this->getConnection(), $this->getGrammar());
     $this->assertEquals(1, count($statements));
     $this->assertEquals('alter table users drop ( foo, bar )', $statements[0]);
 }
開發者ID:mickael83,項目名稱:Laravel-OracleDB,代碼行數:13,代碼來源:OracleDBSchemaGrammarTest.php

示例10: testDropColumn

 /**
  * @expectedException BadMethodCallException
  */
 public function testDropColumn()
 {
     $blueprint = new Blueprint('users');
     $blueprint->dropColumn('foo');
     $statements = $blueprint->toSql($this->getGrammar());
 }
開發者ID:hochanh,項目名稱:Bootsoft-Bowling,代碼行數:9,代碼來源:SQLiteSchemaGrammarTest.php

示例11: removeFromModel

 /**
  * Removes column for this field from our DynamicModel
  *
  * @param \Illuminate\Database\Schema\Blueprint $table
  *
  * @return $this
  */
 public function removeFromModel(Blueprint $table)
 {
     $table->dropColumn($this->getFieldName());
     return $this;
 }
開發者ID:sodacms,項目名稱:sodacms,代碼行數:12,代碼來源:AbstractFormField.php


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