2024_01_17_134239_create_assets_table.php 1.3 KB

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. public function up(): void
  11. {
  12. Schema::create('assets', function (Blueprint $table) {
  13. $table->id();
  14. $table->string('name', 100);
  15. $table->string('code', 45);
  16. $table->integer('company_id');
  17. $table->enum('status', ['doing', 'done', 'closed'])->default('doing');
  18. $table->integer('owner');
  19. $table->integer('group_id')->unsigned();
  20. $table->string("address", 255)->nullable();
  21. $table->string("geo_address_code")->nullable();
  22. $table->decimal("latitude", 10, 6)->nullable();
  23. $table->decimal("longitude", 10, 6)->nullable();
  24. $table->text("description")->nullable();
  25. $table->enum("acl", ['private', 'custom'])->default('private');
  26. $table->string('whitelist', 255)->nullable();
  27. $table->integer("created_by")->nullable();
  28. $table->timestamps();
  29. });
  30. }
  31. /**
  32. * Reverse the migrations.
  33. */
  34. public function down(): void
  35. {
  36. Schema::dropIfExists('assets');
  37. }
  38. };