Search
 
SCRIPT & CODE EXAMPLE
 

PHP

laravel migration remove column

public function up()
{
  Schema::table('table', function($table) {
    $table->dropColumn('column_name');
  });
}
Comment

laravel drop column

// To drop a column, use the dropColumn method on the schema builder.
// Before dropping columns from a SQLite database, you will need to add
// the doctrine/dbal dependency to your composer.json file and run the
// composer update command in your terminal to install the library:

Schema::table('users', function (Blueprint $table) {
    $table->dropColumn('votes');
});
Comment

laravel drop table column

Update Table

migrate:fresh          Drop all tables and re-run all migrations
migrate:install        Create the migration repository
migrate:refresh        Reset and re-run all migrations
migrate:reset          Rollback all database migrations
migrate:rollback       Rollback the last database migration
migrate:status         Show the status of each migration

for specific table
php artisan migrate:refresh --path=/database/migrations/table_name.php
Comment

drop column migration laravel

 Class RemoveCommentViewCount extends Migration
  {
      public function up()
      {
          Schema::table('articles', function($table) {
             $table->dropColumn('comment_count');
             $table->dropColumn('view_count');
          });
      }

      public function down()
      {
          Schema::table('articles', function($table) {
             $table->integer('comment_count');
             $table->integer('view_count');
          });
      }
  }
Comment

laravel migration delete column

Class RemoveCommentViewCount extends Migration
  {
      public function up()
      {
          Schema::table('table', function($table) {
             $table->dropColumn('coulmn_name');
          });
      }

      public function down()
      {
          Schema::table('table', function($table) {
             $table->integer('column_name');
          });
      }
  }
Comment

laravel drop column softdeletes

public function down()
{
  Schema::table('users', function (Blueprint $table) {
    $table->dropSoftDeletes();
  });
}
Comment

how remove column in migration laravel

          Schema::table('articles', function($table) {
             $table->dropColumn('comment_count');
             $table->dropColumn('view_count');
          });
Comment

drop column laravel migration

Schema::table('clients', function (Blueprint $table) {
    $table->string('UserDomainName');
});
Comment

remove column laravel migration

$table->dropColumn('column_name');
Comment

PREVIOUS NEXT
Code Example
Php :: laravel Filesystem chmod(): Operation not permitted 
Php :: strpos in php 
Php :: where_in codeigniter 
Php :: count number of rows laravel controller 
Php :: php empty 
Php :: get header respnse code php curl 
Php :: linux set default php 
Php :: string to int php 
Php :: how to check if there is an authenticated user laravel 
Php :: Fatal error: Cannot redeclare 
Php :: page expire in laravel 
Php :: laravel link active class 
Php :: eloquent get distinct 
Php :: php convert mb to bytes 
Php :: append to collection laravel 
Php :: php random string 
Php :: php round() function 
Php :: php append to csv 
Php :: php str to int 
Php :: php trim string if longer than 
Php :: wordpress thumbnail 
Php :: check value falls between in two range in php 
Php :: ubuntu install lamp and phpmyadmin 
Php :: codeigniter redirect 
Php :: column of csv to array php 
Php :: PHP time limit (max_execution_time): 
Php :: cron run 1 time 
Php :: blade if 
Php :: laravel cron job on shared hosting 
Php :: get all category custom post type wordpress dev 
ADD CONTENT
Topic
Content
Source link
Name
9+1 =