您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

2023_09_12_014413_create_appearances_table.php 1.5KB

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