my changes
This commit is contained in:
parent
28301e4312
commit
8dc1f1b048
263 changed files with 36882 additions and 4453 deletions
|
@ -0,0 +1,46 @@
|
|||
<?php
|
||||
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
class CreateTransactionsTable extends Migration {
|
||||
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('transactions', function(Blueprint $table)
|
||||
{
|
||||
$table->increments('id');
|
||||
$table->integer('student_id')->unsigned();
|
||||
$table->foreign('student_id')->references('id')->on('students');
|
||||
$table->integer('book_id')->unsigned();
|
||||
$table->foreign('book_id')->references('id')->on('books');
|
||||
$table->integer('borrowed_at');
|
||||
$table->integer('returned_at')->default('0');
|
||||
$table->integer('fines')->default('0');
|
||||
$table->boolean('status')->default('0');
|
||||
$table->timestamps();
|
||||
});
|
||||
// Schema::table('transactions', function($table) {
|
||||
// $table->foreign('student_id')->references('id')->on('students');
|
||||
// });
|
||||
// Schema::table('transactions', function($table) {
|
||||
// $table->foreign('book_id')->references('id')->on('books');
|
||||
// });
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::drop('transactions');
|
||||
}
|
||||
|
||||
}
|
Loading…
Add table
editor.link_modal.header
Reference in a new issue