当前位置: 首页>>代码示例>>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;未经允许,请勿转载。