laravel-migrations

Add a new column to existing table in a migration

坚强是说给别人听的谎言 提交于 2019-11-26 10:05:30
问题 I can\'t figure out how to add a new column to my existing database table using the Laravel framework. I tried to edit the migration file using... <?php public function up() { Schema::create(\'users\', function ($table) { $table->integer(\"paid\"); }); } In terminal, I execute php artisan migrate:install and migrate . How do I add new columns? 回答1: To create a migration, you may use the migrate:make command on the Artisan CLI. Use a specific name to avoid clashing with existing models for