Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

2024_11_14_230753_create_adjustments_table.php 1.4KB

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('adjustments', function (Blueprint $table) {
  13. $table->id();
  14. $table->foreignId('company_id')->constrained()->cascadeOnDelete();
  15. $table->foreignId('account_id')->nullable()->constrained('accounts')->nullOnDelete();
  16. $table->string('name')->nullable();
  17. $table->text('description')->nullable();
  18. $table->string('category')->default('tax');
  19. $table->string('type')->default('sales');
  20. $table->boolean('recoverable')->default(false);
  21. $table->integer('rate')->default(0);
  22. $table->string('computation')->default('percentage');
  23. $table->string('scope')->nullable();
  24. $table->dateTime('start_date')->nullable();
  25. $table->dateTime('end_date')->nullable();
  26. $table->foreignId('created_by')->nullable()->constrained('users')->nullOnDelete();
  27. $table->foreignId('updated_by')->nullable()->constrained('users')->nullOnDelete();
  28. $table->timestamps();
  29. });
  30. }
  31. /**
  32. * Reverse the migrations.
  33. */
  34. public function down(): void
  35. {
  36. Schema::dropIfExists('adjustments');
  37. }
  38. };