Change Laravel 5 table with migration
I am building an application with laravel 5. I am changing the "vote" field, which I defined as
$ table-> enum ('vote', [ '- 1 ', '0 ', '1 ']); and should be as follows:
$ table-> enum ('vote', [' 1', ' 2', ' 3', ' 4', ' 5'] ) ; To do this, you must follow these steps:
create a new migration file
php artisan make:migration update_votes_tableopen the newly created migration file (app_folder \ database \ migrations {date_migrationfile_was_created} -update_votes_tables.php)
change the columns you want to change
See the database migration documentation for more information .
Note. If you add your migration file to the question, we can provide more detailed help.
this is how i do it:
php artisan make:migration Alter_votes_to_tableName --table=tableName open the file and change it then
php artisan migrate first create a new migration using the command below
php artisan make:migration Alter_your_comment_yourTableName --table=yourTableName modify the file according to your requirements and after that run the command below in composer
php artisan migrate