2024_01_21_031515_create_projects_table.php 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  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('projects', function (Blueprint $table) {
  13. $table->id();
  14. $table->string('name', 150);
  15. $table->integer("company_id");
  16. $table->string('code', 50);
  17. $table->decimal('const', 10, 2)->nullable();
  18. $table->integer('available_days')->default(0);
  19. $table->string("status", 20)->default("undone")->comment("undone, pending_review, suspended, closed");
  20. $table->timestamp("begin")->nullable();
  21. $table->timestamp("end")->nullable();
  22. $table->decimal('latitude', 10, 6)->nullable();
  23. $table->decimal('longitude', 10, 6)->nullable();
  24. $table->string("type", 20)->nullable();
  25. $table->enum('acl', ['private', 'custom'])->default('private');
  26. $table->string("whitelist")->nullable();
  27. $table->text("description")->nullable();
  28. $table->integer("created_by");
  29. $table->softDeletes();
  30. $table->timestamps();
  31. });
  32. }
  33. /**
  34. * Reverse the migrations.
  35. */
  36. public function down(): void
  37. {
  38. Schema::dropIfExists('projects');
  39. }
  40. };