Answers for "add column in existing table in migration after one column"

PHP
34

git commit

git commit -a -m "The Commit message"
Posted by: Guest on June-12-2020
0

git commit - m command

git commit -m "My message"
Posted by: Guest on July-26-2021
2

how to commit changes in git command

git commit -a
Posted by: Guest on April-14-2020
3

add a new column to existing table in a migration

// for Laravel 5+
php artisan make:migration add_email_to_users_table --table=users

public function up()
{
    Schema::table('users', function($table) {
        $table->integer('email');
    });
}

public function down()
{
    Schema::table('users', function($table) {
        $table->dropColumn('email');
    });
}

php artisan migrate
Posted by: Guest on January-01-2021

Code answers related to "add column in existing table in migration after one column"

Browse Popular Code Answers by Language