Update book table to cintain extra info
This commit is contained in:
@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class BookExtraInformation extends Migration {
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up() {
|
||||
Schema::table('books', function(Blueprint $table) {
|
||||
$table->text('description')->nullable();
|
||||
$table->date('published_date')->nullable();
|
||||
$table->integer('pages')->default(0);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down() {
|
||||
Schema::table('books', function(Blueprint $table) {
|
||||
$table->dropColumn([ 'description', 'published_date', 'pages' ]);
|
||||
});
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user