lundi 23 mai 2016

Is there a way to keep the data when updating a database table using Laravel 5?

I have a working Laravel app, i needed to update a Model and add a new column to the database, in order to do this i added the following code to the database/migrations/table.php file:

Schema::table('client', function (Blueprint $table) {
        $table->string('newColumn');
});

When i try to update the database (with "php artisan migrate") i get the message "Nothing to migrate". I noticed that the only way to apply this changes is doing "php artisan migrate:refresh" or reset, but both commands drop every line on the database.

Is there anyway to update my database columns without droping everything?



from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/25bVY8g
via IFTTT

Aucun commentaire:

Enregistrer un commentaire