I'm making a application with laravel 5. I change the field 'vote ' that I have defined as
$ table-> enum ('vote', [ '- 1 ', '0 ', '1 ']);
and should be as follows
$ table-> enum ('vote', [' 1', ' 2', ' 3', ' 4', ' 5'] ) ;
To change a table name, you can do this: Schema::rename($currentTableName, $newTableName); You can use the drop or dropIfExists methods to remove an existing table: Schema::drop('users'); Schema::dropIfExists('users');
To do this you should follow these steps:
create a new migration file
php artisan make:migration update_votes_table
open the newly created migration file (app_folder\database\migrations{date_migrationfile_was_created}-update_votes_tables.php)
change the columns you want to change
For more details see the documentation on database migrations
Note: If you add your migrations file to the question we could provide more detailed help
this how i do it:
php artisan make:migration Alter_votes_to_tableName --table=tableName
open the file and change it then
php artisan migrate
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With