2022_06_16_091344_create_suppliers_table.php 855B

123456789101112131415161718192021222324252627282930313233343536373839
  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. * Run the migrations.
  8. *
  9. * @return void
  10. */
  11. public function up()
  12. {
  13. Schema::create("suppliers", function (Blueprint $table) {
  14. $table->id();
  15. $table->string("name");
  16. $table->string("address");
  17. $table->string("phone")->unique();
  18. $table
  19. ->string("email")
  20. ->unique()
  21. ->nullable();
  22. $table->string("npwp")->unique();
  23. $table->timestamps();
  24. });
  25. }
  26. /**
  27. * Reverse the migrations.
  28. *
  29. * @return void
  30. */
  31. public function down()
  32. {
  33. Schema::dropIfExists("suppliers");
  34. }
  35. };