本文整理匯總了PHP中Illuminate\Support\Facades\Schema::table方法的典型用法代碼示例。如果您正苦於以下問題:PHP Schema::table方法的具體用法?PHP Schema::table怎麽用?PHP Schema::table使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Illuminate\Support\Facades\Schema
的用法示例。
在下文中一共展示了Schema::table方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: up
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('users', function ($table) {
$table->string('password', 60)->change();
$table->rememberToken();
});
}
示例2: up
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('tasks', function ($table) {
$table->string('title', 100)->after('id')->nullable();
$table->text('description')->after('title')->nullable();
});
}
示例3: down
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('oauth_auth_codes', function (Blueprint $t) {
$t->dropForeign('oauth_auth_codes_session_id_foreign');
});
Schema::drop('oauth_auth_codes');
}
開發者ID:nicklaw5,項目名稱:ticketing-system-api,代碼行數:12,代碼來源:2015_10_19_000010_create_oauth_auth_codes_table.php
示例4: down
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('users', function (Blueprint $table) {
$table->dropColumn('first_name');
$table->dropColumn('last_name');
});
}
開發者ID:mcculley1108,項目名稱:faithpromise.org,代碼行數:12,代碼來源:2015_12_10_133859_add_first_last_name_to_users.php
示例5: down
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('third_party_logins', function (Blueprint $table) {
$table->dropForeign('third_party_logins_user_id_foreign');
});
Schema::drop('third_party_logins');
}
開發者ID:alfoalfr,項目名稱:laravel-dev-env,代碼行數:12,代碼來源:2015_11_16_202926_create_third_party_logins_table.php
示例6: down
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('users', function (Blueprint $table) {
//
$table->string('password')->nullable(false)->change();
});
}
示例7: down
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('media', function (Blueprint $table) {
$table->dropColumn('deleted_at');
});
Schema::drop('sample_mediables');
}
示例8: down
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
//
Schema::table('pets', function ($table) {
$table->integer('pet_age');
});
}
示例9: up
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('oauth_identities', function (Blueprint $table) {
$table->dropForeign('oauth_identities_user_id_foreign');
$table->foreign('user_id')->references('id')->on('users')->onDelete('cascade');
});
}
示例10: createDataField
/**
*
* Generate field on custom table and log field generation
*
* @param string $tableName
* @param string $fieldType
* @param string $fieldName
* @return bool
\ */
static function createDataField($tableName, $fieldType, $fieldName)
{
Schema::table($tableName, function (Blueprint $table) use($fieldName, $fieldType) {
$table->{$fieldType}($fieldName);
});
return true;
}
示例11: down
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table("partnerships_arms", function (Blueprint $table) {
$table->dropForeign("partnerships_arms_partnership_id_foreign");
$table->dropForeign("partnerships_arms_arms_id_foreign");
});
}
開發者ID:foodring,項目名稱:partnership,代碼行數:12,代碼來源:2016_02_06_190235_create_partnership_arms_foreignkey.php
示例12: up
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
// Oh my word! Cant rename any columns in a table that has an
// enum. o_0
//
// Apply the hacky workaround seen here:
// https://github.com/laravel/framework/issues/1186#issuecomment-248853309
Schema::getConnection()->getDoctrineSchemaManager()->getDatabasePlatform()->registerDoctrineTypeMapping('enum', 'string');
// Define the tables and columns that need to be changed
$integer_tables_and_columns = ['character_bookmarks' => ['itemID'], 'eve_conquerable_station_lists' => ['stationID'], 'character_character_sheets' => ['homeStationID'], 'character_contact_lists' => ['labelMask'], 'character_contact_list_labels' => ['labelID'], 'character_contact_list_alliances' => ['labelMask'], 'character_contact_list_alliance_labels' => ['labelID'], 'character_contact_list_corporates' => ['labelMask'], 'character_contact_list_corporate_labels' => ['labelID'], 'character_contracts' => ['startStationID', 'endStationID'], 'character_industry_jobs' => ['stationID', 'blueprintLocationID', 'outputLocationID'], 'character_market_orders' => ['stationID'], 'character_wallet_journals' => ['argID1'], 'character_wallet_transactions' => ['stationID'], 'corporation_bookmarks' => ['itemID'], 'corporation_contact_list_labels' => ['labelID'], 'corporation_contact_lists' => ['labelMask'], 'corporation_contact_list_alliances' => ['labelMask'], 'corporation_contact_list_alliance_labels' => ['labelID'], 'corporation_contracts' => ['startStationID', 'endStationID'], 'corporation_member_securities' => ['roleID'], 'corporation_sheets' => ['stationID'], 'corporation_industry_jobs' => ['stationID', 'blueprintLocationID', 'outputLocationID'], 'corporation_market_orders' => ['stationID'], 'corporation_wallet_journals' => ['argID1'], 'corporation_wallet_transactions' => ['stationID']];
// Loop over the changes defined in the above array.
foreach ($integer_tables_and_columns as $table => $columns) {
Schema::table($table, function (Blueprint $table) use($columns) {
// Loop over the columns that are passed in and change them
foreach ($columns as $column) {
$table->bigInteger($column)->change();
}
});
}
// Fix some Wallet values for the industry jobs tables.
Schema::table('character_industry_jobs', function (Blueprint $table) {
$table->decimal('cost', 30, 2)->change();
});
Schema::table('corporation_industry_jobs', function (Blueprint $table) {
$table->decimal('cost', 30, 2)->change();
});
}
示例13: down
public function down()
{
Schema::table('questions', function (Blueprint $table) {
$table->dropColumn('status_id');
$table->dropColumn('visibility_id');
});
}
開發者ID:raccoonsoftware,項目名稱:Blogify,代碼行數:7,代碼來源:2015_04_22_173900_add_status_and_visibility_id_to_posts_table.php
示例14: down
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('administrators', function ($table) {
$table->dropForeign('administrators_user_id_foreign');
});
Schema::drop('administrators');
}
開發者ID:franciscoBarrientos,項目名稱:laravel,代碼行數:12,代碼來源:2015_12_17_135502_create_administrators_table.php
示例15: down
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('eve_api_keys', function (Blueprint $table) {
$table->dropColumn('api_call_constraints');
$table->longText('disabled_calls')->after('last_error')->nullable();
});
}
開發者ID:eveseat,項目名稱:eveapi,代碼行數:12,代碼來源:2016_11_29_094850_rename_disabledcalls_to_apicallconstraint.php