41 lines
1.1 KiB
PHP
41 lines
1.1 KiB
PHP
<?php
|
|
|
|
use Illuminate\Database\Migrations\Migration;
|
|
use Illuminate\Database\Schema\Blueprint;
|
|
use Illuminate\Support\Facades\Schema;
|
|
|
|
class CreateTransactionsTable extends Migration
|
|
{
|
|
/**
|
|
* Run the migrations.
|
|
*
|
|
* @return void
|
|
*/
|
|
public function up()
|
|
{
|
|
Schema::create('transactions', function (Blueprint $table) {
|
|
$table->id();
|
|
$table->bigInteger('user_id')->unsigned();
|
|
$table->bigInteger('user_sa_id')->unsigned();
|
|
$table->bigInteger('work_id')->unsigned();
|
|
$table->foreign('user_id')->references('id')->on('users')->onDelete('cascade');
|
|
$table->foreign('user_sa_id')->references('id')->on('users');
|
|
$table->string('spk');
|
|
$table->string('police_number');
|
|
$table->tinyInteger('warranty');
|
|
$table->dateTime('tanggal');
|
|
$table->timestamps();
|
|
});
|
|
}
|
|
|
|
/**
|
|
* Reverse the migrations.
|
|
*
|
|
* @return void
|
|
*/
|
|
public function down()
|
|
{
|
|
Schema::dropIfExists('transactions');
|
|
}
|
|
}
|