本文整理汇总了PHP中Illuminate\Database\Schema\Builder::table方法的典型用法代码示例。如果您正苦于以下问题:PHP Builder::table方法的具体用法?PHP Builder::table怎么用?PHP Builder::table使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Illuminate\Database\Schema\Builder
的用法示例。
在下文中一共展示了Builder::table方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: down
/**
* Undo the migration
*/
public function down()
{
//Remove Field
$this->schema->table('user_details', function ($table) {
$table->dropColumn('profile_picture');
});
}
开发者ID:AshniSukhoo,项目名称:UOM_connect,代码行数:10,代码来源:20160128181212_AddProfilePictureFieldToUserDetailsTable.php
示例2: down
/**
* Undo the migration
*/
public function down()
{
$this->schema->table('users_basic_info', function ($table) {
$table->dropForeign('users_basic_info_user_id_foreign');
});
//Drop table
$this->schema->dropIfExists('users_basic_info');
}
示例3: down
/**
* Undo the migration
*/
public function down()
{
//Drop foreign keys
$this->schema->table('friend_requests', function ($table) {
$table->dropForeign('friend_requests_sender_foreign');
$table->dropForeign('friend_requests_receiver_foreign');
});
//Drop table
$this->schema->dropIfExists('friend_requests');
}
示例4: down
/**
* Undo the migration
*/
public function down()
{
//Drop foreign keys
$this->schema->table('lecturers_courses_faculties', function ($table) {
$table->dropForeign('lecturer_courses_faculties_uom_id_foreign');
$table->dropForeign('lecturer_courses_faculties_faculty_id_foreign');
$table->dropForeign('lecturer_courses_faculties_course_id_foreign');
});
//Drop table
$this->schema->dropIfExists('lecturers_courses_faculties');
}
开发者ID:AshniSukhoo,项目名称:UOM_connect,代码行数:14,代码来源:20160302175103_CreateLecturerFacultyCoursesTable.php
示例5: dropColumn
/**
* Drop a column.
*
* @param $table
* @param FieldType $type
*/
public function dropColumn($table, FieldType $type)
{
$schema = $type->getSchema();
if (!$this->schema->hasTable($table)) {
return;
}
$this->schema->table($table, function (Blueprint $table) use($schema) {
$schema->dropColumn($table);
});
}
示例6: table
/**
* Create table if not exist.
* @param string table
* @param \Closure $callback
*/
public function table($table, \Closure $callback)
{
try {
parent::create($table, $callback);
} catch (\Exception $e) {
try {
parent::table($table, $callback);
} catch (\Exception $e) {
echo $e->getMessage();
}
}
}
示例7: table
/**
* Modify a table on the schema.
*
* @param string $table
* @param \Closure $callback
*
* @return \Illuminate\Database\Schema\Blueprint
*/
public static function table($table, Closure $callback)
{
static::$instance = static::$instance ?: new static();
return static::$schema->table($table, $callback);
}
示例8: up
public function up()
{
$this->schema->table($this->table, function ($table) {
$this->create($table);
});
}
示例9: table
/**
* Modify a table on the schema.
*
* @param string $table
* @param \Closure $callback
* @return \Illuminate\Database\Schema\Blueprint
* @static
*/
public static function table($table, $callback)
{
return \Illuminate\Database\Schema\Builder::table($table, $callback);
}
示例10: down
/**
* Undo the migration
*/
public function down()
{
$this->schema->table('ci_sessions', function ($table) {
$table->dropPrimary('ci_sessions_session_id_primary');
});
}