/** * Run the migrations. * * @return void */ public function up() { Schema::table('users', function ($table) { $table->string('password', 60)->change(); $table->rememberToken(); }); }
/** * 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(); }); }
/** * 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'); }
/** * Reverse the migrations. * * @return void */ public function down() { Schema::table('users', function (Blueprint $table) { $table->dropColumn('first_name'); $table->dropColumn('last_name'); }); }
/** * 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'); }
/** * Reverse the migrations. * * @return void */ public function down() { Schema::table('users', function (Blueprint $table) { // $table->string('password')->nullable(false)->change(); }); }
/** * Reverse the migrations. * * @return void */ public function down() { Schema::table('finds', function (Blueprint $table) { $table->dropColumn('icon'); $table->dropColumn('color'); }); }
/** * Reverse the migrations. * * @return void */ public function down() { Schema::table('media', function (Blueprint $table) { $table->dropColumn('deleted_at'); }); Schema::drop('sample_mediables'); }
/** * Reverse the migrations. * * @return void */ public function down() { Schema::table("user_settings", function (Blueprint $table) { $table->dropForeign("user_settings_user_id_foreign"); }); Schema::drop("user_settings"); }
/** * Reverse the migrations. * * @return void */ public function down() { Schema::table('users', function (Blueprint $table) { $table->dropColumn('city2'); $table->dropColumn('birthday'); }); }
/** * Reverse the migrations. * * @return void */ public function down() { // Schema::table('pets', function ($table) { $table->integer('pet_age'); }); }
/** * Reverse the migrations. * * @return void */ public function down() { Schema::table('users', function (Blueprint $table) { $table->dropColumn('two_authenticate'); $table->dropColumn('two_authenticate_until'); }); }
/** * 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'); }); }
/** * * 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; }
/** * Reverse the migrations. * * @return void */ public function down() { Schema::table('artists', function (Blueprint $table) { $table->dropColumn('bandcamp'); $table->dropColumn('patreon'); }); }
/** * 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"); }); }
/** * 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(); }); }
/** * Reverse the migrations. * * @return void */ public function down() { Schema::table('sent_emails', function (Blueprint $table) { $table->dropColumn('message_id'); $table->dropColumn('meta'); }); }
/** * Reverse the migrations. * * @return void */ public function down() { Schema::table('user_meta', function (Blueprint $table) { $table->dropForeign('user_meta_user_id_foreign'); }); Schema::drop('user_meta'); }
/** * Run the migrations. * * @return void */ public function up() { // Heads up that this is a heavy migration. print 'Running migration to increase integer size constraints. ' . 'This may take some time to complete.' . PHP_EOL; // 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 = ['account_api_key_info_characters' => ['characterID', 'corporationID'], 'character_account_balances' => ['characterID'], 'character_asset_list_contents' => ['characterID'], 'character_asset_lists' => ['characterID'], 'character_bookmarks' => ['itemID', 'characterID', 'bookmarkID', 'creatorID', 'mapID'], 'character_character_sheet_corporation_titles' => ['characterID', 'titleID'], 'character_character_sheet_implants' => ['characterID'], 'character_character_sheet_jump_clone_implants' => ['jumpCloneID', 'characterID'], 'character_character_sheet_jump_clones' => ['jumpCloneID', 'characterID'], 'character_character_sheet_skills' => ['characterID'], 'character_character_sheets' => ['characterID', 'corporationID', 'allianceID', 'factionID', 'homeStationID'], 'character_chat_channel_infos' => ['channelID', 'ownerID'], 'character_chat_channel_members' => ['channelID', 'accessorID'], 'character_chat_channels' => ['characterID', 'channelID'], 'character_contact_list_alliance_labels' => ['characterID', 'labelID'], 'character_contact_list_alliances' => ['characterID', 'contactID', 'labelMask'], 'character_contact_list_corporate_labels' => ['characterID', 'corporationID', 'labelID'], 'character_contact_list_corporates' => ['characterID', 'corporationID', 'contactID', 'labelMask'], 'character_contact_list_labels' => ['characterID', 'labelID'], 'character_contact_lists' => ['characterID', 'contactID', 'labelMask'], 'character_contact_notifications' => ['characterID', 'notificationID', 'senderID'], 'character_contract_items' => ['characterID', 'contractID', 'recordID'], 'character_contracts' => ['characterID', 'contractID', 'issuerID', 'issuerCorpID', 'assigneeID', 'acceptorID', 'forCorp', 'startStationID', 'endStationID'], 'character_industry_jobs' => ['characterID', 'jobID', 'installerID', 'facilityID', 'activityID', 'completedCharacterID', 'stationID', 'blueprintLocationID', 'outputLocationID'], 'character_kill_mails' => ['characterID', 'killID'], 'character_mail_message_bodies' => ['messageID'], 'character_mail_messages' => ['characterID', 'messageID', 'senderID', 'toCorpOrAllianceID', 'toListID'], 'character_mailing_list_infos' => ['listID'], 'character_mailing_lists' => ['characterID', 'listID'], 'character_market_orders' => ['charID', 'bid', 'stationID'], 'character_notifications' => ['characterID', 'notificationID', 'senderID'], 'character_notifications_texts' => ['notificationID'], 'character_planetary_colonies' => ['ownerID'], 'character_planetary_links' => ['ownerID'], 'character_planetary_pins' => ['ownerID'], 'character_planetary_routes' => ['ownerID'], 'character_researches' => ['characterID'], 'character_skill_in_trainings' => ['characterID'], 'character_skill_queues' => ['characterID'], 'character_standings' => ['characterID'], 'character_upcoming_calendar_events' => ['characterID'], 'character_wallet_journals' => ['characterID', 'ownerID1', 'ownerID2', 'taxReceiverID', 'argID1'], 'character_wallet_transactions' => ['characterID', 'clientID', 'stationID'], 'corporation_asset_list_contents' => ['corporationID'], 'corporation_asset_lists' => ['corporationID'], 'corporation_bookmarks' => ['corporationID', 'itemID'], 'corporation_contact_list_labels' => ['corporationID', 'labelID'], 'corporation_contact_lists' => ['corporationID', 'contactID', 'labelMask'], 'corporation_contact_list_alliances' => ['corporationID', 'contactID', 'labelMask'], 'corporation_contact_list_alliance_labels' => ['corporationID', 'labelID'], 'corporation_contracts' => ['corporationID', 'issuerID', 'issuerCorpID', 'assigneeID', 'acceptorID', 'forCorp', 'startStationID', 'endStationID'], 'corporation_contract_items' => ['corporationID', 'contractID', 'recordID'], 'corporation_customs_office_locations' => ['corporationID'], 'corporation_customs_offices' => ['corporationID'], 'corporation_industry_jobs' => ['corporationID', 'jobID', 'installerID', 'facilityID', 'stationID', 'blueprintLocationID', 'outputLocationID'], 'corporation_kill_mails' => ['corporationID', 'killID'], 'corporation_locations' => ['corporationID', 'mapID'], 'corporation_market_orders' => ['corporationID', 'charID', 'stationID'], 'corporation_medals' => ['medalID', 'corporationID', 'creatorID'], 'corporation_member_medals' => ['corporationID', 'medalID', 'characterID', 'issuerID'], 'corporation_member_securities' => ['corporationID', 'characterID', 'roleID'], 'corporation_member_security_logs' => ['corporationID', 'characterID', 'issuerID'], 'corporation_member_security_titles' => ['corporationID', 'characterID'], 'corporation_member_trackings' => ['corporationID', 'characterID', 'locationID'], 'corporation_shareholders' => ['corporationID', 'shareholderID', 'shareholderCorporationID'], 'corporation_sheet_divisions' => ['corporationID'], 'corporation_sheet_wallet_divisions' => ['corporationID'], 'corporation_sheets' => ['corporationID', 'stationID', 'ceoID', 'allianceID', 'factionID'], 'corporation_standings' => ['corporationID'], 'corporation_starbase_details' => ['corporationID', 'useStandingsFrom'], 'corporation_starbases' => ['corporationID'], 'corporation_titles' => ['corporationID', 'titleID'], 'corporation_wallet_journals' => ['argID1', 'corporationID', 'ownerID1', 'ownerID2'], 'corporation_wallet_transactions' => ['stationID', 'corporationID', 'clientID', 'characterID'], 'eve_conquerable_station_lists' => ['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(); }); }
/** * Reverse the migrations. * * @return void */ public function down() { Schema::table('artist_tracks', function (Blueprint $table) { $table->dropColumn('display_order'); $table->dropColumn('title_romanized'); }); }
public function down() { Schema::table('questions', function (Blueprint $table) { $table->dropColumn('status_id'); $table->dropColumn('visibility_id'); }); }
/** * Reverse the migrations. * * @return void */ public function down() { Schema::table('administrators', function ($table) { $table->dropForeign('administrators_user_id_foreign'); }); Schema::drop('administrators'); }
/** * 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(); }); }
/** * Reverse the migrations. * * @return void */ public function down() { Schema::table('posts', function (Blueprint $table) { $table->dropForeign('posts_topic_id_foreign'); }); Schema::drop('topics'); }
/** * Run the migrations. * * @return void */ public function up() { Schema::create('listings', function (Blueprint $table) { $table->increments('id'); $table->string('address'); $table->string('address_2'); $table->integer('city_id')->unsigned(); $table->integer('zipcode')->unsigned(); $table->char('state', 2); $table->text('description'); $table->date('available_date')->nullable(); $table->tinyInteger('listing_type_id'); $table->string('contract_type'); $table->smallInteger('year_built')->unsigned(); $table->smallInteger('sqft')->unsigned(); $table->tinyInteger('beds')->unsigned(); $table->tinyInteger('baths')->unsigned(); $table->integer('price')->unsigned(); $table->string('price_suffix')->nullable(); $table->integer('user_id'); $table->timestamps(); }); Schema::table('listings', function ($table) { $table->foreign('city_id')->references('id')->on('cities'); $table->foreign('listing_type_id')->references('id')->on('property_types'); $table->foreign('user_id')->references('id')->on('users'); }); DB::statement('ALTER TABLE listings ADD searchable tsvector NULL'); DB::statement('CREATE INDEX listings_searchable_index ON listings USING GIN (searchable)'); }
/** * Reverse the migrations. * * @return void */ public function down() { Schema::table('oauth_client_endpoints', function (Blueprint $table) { $table->dropForeign('oauth_client_endpoints_client_id_foreign'); }); Schema::drop('oauth_client_endpoints'); }
/** * Reverse the migrations. * * @return void */ public function down() { Schema::table("contacts", function (Blueprint $table) { $table->dropForeign("contacts_partnership_id_foreign"); }); Schema::drop("contacts"); }
/** * Reverse the migrations. * * @return void */ public function down() { Schema::table('oauth_refresh_tokens', function (Blueprint $table) { $table->dropForeign('oauth_refresh_tokens_access_token_id_foreign'); }); Schema::drop('oauth_refresh_tokens'); }
/** * Reverse the migrations. * * @return void */ public function down() { Schema::table('components', function (Blueprint $table) { $table->dropColumn('tags'); $table->dropColumn('link'); }); }