my changes
This commit is contained in:
parent
28301e4312
commit
8dc1f1b048
263 changed files with 36882 additions and 4453 deletions
41
database/migrations/2017_06_01_104359_create_books_table.php
Normal file
41
database/migrations/2017_06_01_104359_create_books_table.php
Normal file
|
@ -0,0 +1,41 @@
|
|||
<?php
|
||||
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
class CreateBooksTable extends Migration {
|
||||
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('books', function(Blueprint $table)
|
||||
{
|
||||
$table->increments('id');
|
||||
$table->string('title');
|
||||
$table->string('author');
|
||||
$table->integer('year');
|
||||
$table->integer('stock');
|
||||
$table->integer('category_id')->unsigned();
|
||||
$table->foreign('category_id')->references('id')->on('categories');
|
||||
$table->integer('shelf_id')->unsigned();
|
||||
$table->foreign('shelf_id')->references('id')->on('shelves');
|
||||
$table->integer('year_id')->default('0');
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::drop('books');
|
||||
}
|
||||
|
||||
}
|
Loading…
Add table
editor.link_modal.header
Reference in a new issue