You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

2023_09_12_014413_create_appearances_table.php 1.2KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. <?php
  2. use App\Enums\Setting\Font;
  3. use App\Enums\Setting\PrimaryColor;
  4. use App\Enums\Setting\RecordsPerPage;
  5. use App\Enums\Setting\TableSortDirection;
  6. use Illuminate\Database\Migrations\Migration;
  7. use Illuminate\Database\Schema\Blueprint;
  8. use Illuminate\Support\Facades\Schema;
  9. return new class extends Migration
  10. {
  11. /**
  12. * Run the migrations.
  13. */
  14. public function up(): void
  15. {
  16. Schema::create('appearances', function (Blueprint $table) {
  17. $table->id();
  18. $table->foreignId('company_id')->constrained()->onDelete('cascade');
  19. $table->string('primary_color')->default(PrimaryColor::DEFAULT);
  20. $table->string('font')->default(Font::DEFAULT);
  21. $table->string('table_sort_direction')->default(TableSortDirection::DEFAULT);
  22. $table->unsignedTinyInteger('records_per_page')->default(RecordsPerPage::DEFAULT);
  23. $table->foreignId('created_by')->nullable()->constrained('users')->nullOnDelete();
  24. $table->foreignId('updated_by')->nullable()->constrained('users')->nullOnDelete();
  25. $table->timestamps();
  26. });
  27. }
  28. /**
  29. * Reverse the migrations.
  30. */
  31. public function down(): void
  32. {
  33. Schema::dropIfExists('appearances');
  34. }
  35. };