本文整理汇总了PHP中Illuminate\Support\Facades\Schema::rename方法的典型用法代码示例。如果您正苦于以下问题:PHP Schema::rename方法的具体用法?PHP Schema::rename怎么用?PHP Schema::rename使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Illuminate\Support\Facades\Schema
的用法示例。
在下文中一共展示了Schema::rename方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: up
public function up()
{
// change country_041
DBLibrary::renameColumnWithForeignKey('005_041_contact', 'country_041', 'country_id_041', 'VARCHAR', 2, false, false, 'fk01_005_041_contact', '001_002_country', 'id_002');
// change group_042
DBLibrary::renameColumnWithForeignKey('005_042_contacts_groups', 'group_042', 'group_id_042', 'INT', 10, true, false, 'fk01_005_042_contacts_groups', '005_040_group', 'id_040', 'cascade', 'cascade');
// change contact_042
DBLibrary::renameColumnWithForeignKey('005_042_contacts_groups', 'contact_042', 'contact_id_042', 'INT', 10, true, false, 'fk02_005_042_contacts_groups', '005_041_contact', 'id_041', 'cascade', 'cascade');
// change email_account_044
DBLibrary::renameColumnWithForeignKey('005_044_email_campaign', 'email_account_044', 'email_account_id_044', 'INT', 10, true, false, 'fk01_005_044_email_campaign', '001_013_email_account', 'id_013');
// change template_044
DBLibrary::renameColumnWithForeignKey('005_044_email_campaign', 'template_044', 'template_id_044', 'INT', 10, true, true, 'fk02_005_044_email_campaign', '005_043_email_template', 'id_043');
// change campaign_045
DBLibrary::renameColumnWithForeignKey('005_045_email_campaigns_countries', 'campaign_045', 'campaign_id_045', 'INT', 10, true, false, 'fk01_005_045_email_campaigns_countries', '005_044_email_campaign', 'id_044', 'cascade', 'cascade');
// change country_045
DBLibrary::renameColumnWithForeignKey('005_045_email_campaigns_countries', 'country_045', 'country_id_045', 'VARCHAR', 2, false, false, 'fk02_005_045_email_campaigns_countries', '001_002_country', 'id_002', 'cascade', 'cascade');
// change campaign_046
DBLibrary::renameColumnWithForeignKey('005_046_email_campaigns_groups', 'campaign_046', 'campaign_id_046', 'INT', 10, true, false, 'fk01_005_046_email_campaigns_groups', '005_044_email_campaign', 'id_044', 'cascade', 'cascade');
// change group_046
DBLibrary::renameColumnWithForeignKey('005_046_email_campaigns_groups', 'group_046', 'group_id_046', 'INT', 10, true, false, 'fk02_005_046_email_campaigns_groups', '005_040_group', 'id_040', 'cascade', 'cascade');
// change campaign_047
DBLibrary::renameColumnWithForeignKey('005_047_email_send_queue', 'campaign_047', 'campaign_id_047', 'INT', 10, true, false, 'fk01_005_047_email_send_queue', '005_044_email_campaign', 'id_044', 'cascade', 'cascade');
// change contact_047
DBLibrary::renameColumnWithForeignKey('005_047_email_send_queue', 'contact_047', 'contact_id_047', 'INT', 10, true, false, 'fk02_005_047_email_send_queue', '005_041_contact', 'id_041', 'cascade', 'cascade');
// rename columns
// status_047
DBLibrary::renameColumn('005_047_email_send_queue', 'status_047', 'status_id_047', 'TINYINT', 3, true, false, 0);
// rename table
if (Schema::hasTable('005_048_email_send_historical')) {
Schema::rename('005_048_email_send_historical', '005_048_email_send_history');
}
// change send_queue_048
DBLibrary::renameColumnWithForeignKey('005_048_email_send_history', 'send_queue_048', 'send_queue_id_048', 'BIGINT', 20, true, true, 'fk01_005_048_email_send_history', '005_047_email_send_queue', 'id_047', 'set null', 'cascade');
// change campaign_048
DBLibrary::renameColumnWithForeignKey('005_048_email_send_history', 'campaign_048', 'campaign_id_048', 'INT', 10, true, false, 'fk02_005_048_email_send_history', '005_044_email_campaign', 'id_044', 'cascade', 'cascade');
// change contact_048
DBLibrary::renameColumnWithForeignKey('005_048_email_send_history', 'contact_048', 'contact_id_048', 'INT', 10, true, false, 'fk03_005_048_email_send_history', '005_041_contact', 'id_041', 'cascade', 'cascade');
}
示例2: correctNameForPiggyBankEvents
public function correctNameForPiggyBankEvents()
{
Schema::rename('piggybank_events', 'piggy_bank_events');
}
示例3: down
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
if (Schema::hasTable('districts')) {
Schema::rename('districts', 'ward_districts');
}
}
开发者ID:joshdavis11,项目名称:hometeachme,代码行数:11,代码来源:2016_02_11_025551_change_ward_districts_to_districts.php
示例4: renamePiggyBankEvents
private function renamePiggyBankEvents()
{
Schema::rename('piggy_bank_events', 'piggybank_events');
}