2022_04_20_031728_create_transactions_table.php 1.0KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. <?php
  2. use Illuminate\Database\Migrations\Migration;
  3. use Illuminate\Database\Schema\Blueprint;
  4. use Illuminate\Support\Facades\Schema;
  5. return new class extends Migration
  6. {
  7. /**
  8. * Run the migrations.
  9. *
  10. * @return void
  11. */
  12. public function up()
  13. {
  14. Schema::create('transactions', function (Blueprint $table) {
  15. $table->id();
  16. $table->timestamp('login_time');
  17. $table->dateTime('time_out');
  18. $table->unsignedInteger('price');
  19. $table->string('plat_number')->unique();
  20. $table->string('input_by');
  21. $table->string('capture_vehicle');
  22. $table->foreignId('type_vehicle_id')->constrained();
  23. $table->foreignId('user_id')->constrained();
  24. $table->foreignId('member_id')->nullable()->default(null)->constrained();
  25. $table->timestamps();
  26. });
  27. }
  28. /**
  29. * Reverse the migrations.
  30. *
  31. * @return void
  32. */
  33. public function down()
  34. {
  35. Schema::dropIfExists('tansactions');
  36. }
  37. };